All data in MeshLib are stored in objects. Each object can have it own type derived from Object:
Object (Simple object can be selected or hidden)
|
VisualObject (Object with common visualize properties, which are used in ObjectMesh and ObjectPoints)
/ \
ObjectMesh ObjectPoints
/
JawScan, Tooth, ...
Scene in MeshLib consists of a tree of object with one root, and all others objects are children or some grandchildren of scene root. Each object has its own name (e.g. Upper Jaw), transform, visibility, selected and ancillary flags. Ancillary objects are not shown in UI list but rendered in 3D and cannot be selected. For example, a scene can look like:
Root
|
Case
|
Mouth
/ \
Upper Jaw Lower Jaw
/ \
Jaw Scan Tooth UL1 ...
Objects inherit parameters from scene parent, for example transform and visibility. So all children are hidden if their parent is hidden irrespective of their own visibility field. And each object transform is the transform from local object space into parent's space. So if parent is moved, all objects are moved with it.
To serialize object tree one needs to call
And to deserialize object tree:
To create your own object type you need to make class derived from one of base class:
To be able to use serialization and deserialization you have to do: