NDEVR
API Documentation
DesignObjectBase

Provides the underlying data storage for the NDEVR Scene Model hierarchy. More...

Public Member Functions

 DesignObjectBase (bool is_app_owned)
 Constructs a DesignObjectBase and initializes all internal tables and columns.
 ~DesignObjectBase ()
 Destroys the DesignObjectBase and releases all owned resources.
void addReference (DesignObjectBase *base)
 Adds an external reference to another DesignObjectBase.
void addTable (Table *table)
 Adds a custom table to this base, making it accessible by its label.
DesignObjectBasebase (const StringView &base)
 Retrieves an owned or referenced DesignObjectBase by its string key.
void fetchDataColumns (Buffer< TableColumn * > &columns)
 Populates the given buffer with pointers to all active data columns across all tables.
void finishMapFromFile (BinaryFileTableInfo &info)
 Completes the mapping process after reading table data from a binary file.
DynamicPointer< RTree< 3, fltp04 > > getRTree (UUID id)
 Retrieves a mutable pointer to the R-tree associated with the given UUID.
ConstPointer< RTree< 3, fltp04 > > getRTree (UUID id) const
 Retrieves a read-only pointer to the R-tree associated with the given UUID.
bool hasRTree (UUID id) const
 Checks whether an R-tree exists for the given UUID.
bool isApplicationOwned () const
 Checks whether this base is owned by the application.
WLock lockRTrees ()
 Acquires a write lock on all R-trees in this base.
void mapFromFile (BinaryFileTableInfo &file)
 Deserializes all table data from a binary file.
void mapToFile (BinaryFileTableInfo &file) const
 Serializes all table data to a binary file.
void mapTreesFromFile (BinaryFileTableInfo &file)
 Deserializes R-tree spatial index data from a binary file.
void mapTreeToFile (BinaryFileTableInfo &file, int mode) const
 Serializes R-tree spatial index data to a binary file.
Dictionary< String, DesignObjectBase * > & ownedBases ()
 Returns a reference to the dictionary of DesignObjectBase instances owned by this base.
const RandomColorGeneratorrandomColorGenerator () const
 Returns a const reference to the random color generator used for assigning colors.
void readMetaDataFromColumn ()
 Reads JSON metadata from the metadata column into the cached_meta_data buffer.
Set< DesignObjectBase * > & referencedBases ()
 Returns a reference to the set of externally referenced DesignObjectBase instances.
void removeRTree (UUID id)
 Removes the R-tree associated with the given UUID.
void removeTable (const StringView &label)
 Removes a custom table identified by its label.
void setRTree (UUID id, const DynamicPointer< RTree< 3, fltp04 > > &tree)
 Sets or replaces the R-tree for the given UUID.
Table * table (const StringView &label)
 Retrieves a custom table by its label.
const Dictionary< UUID, Table * > & tables ()
 Returns a reference to the dictionary of all custom tables keyed by UUID.
const Dictionary< UUID, DynamicPointer< RTree< 3, fltp04 > > > & trees () const
 Returns a const reference to the dictionary of all R-trees keyed by UUID.
void writeMetaDataToColumn ()
 Writes cached JSON metadata from the cached_meta_data buffer back to the metadata column.

Public Attributes

ColumnT< Timeasc_modified_time
 Column storing the ascending-order modification timestamp.
TableVectorType< 6, fltp08bounding_box
 Column storing the axis-aligned bounding box (min XYZ, max XYZ).
JSONBuffer cached_meta_data
 Buffer storing cached JSON metadata for design objects.
ColumnT< uint08child_base_ptr
 Column storing a pointer or handle to the child DesignObjectBase.
ColumnT< Matrix< fltp08 > > complete_transform
 Column storing the fully composed world-space transform matrix.
ColumnT< Timedesc_modified_time
 Column storing the descending-order modification timestamp.
Vector< 38, TableColumn * > design_properties = Vector<38, TableColumn*>(nullptr)
 Array of pointers to all design property columns, indexed by property enum.
ColumnT< uint01design_type
 Column storing the design object type identifier.
ColumnT< Buffer< uint04 > > * edge_to_face_column = nullptr
 Optional column mapping edges to their adjacent face indices.
ColumnT< Buffer< uint04 > > effect_child_index
 Column storing child effect indices for each model.
ColumnT< Buffer< uint08 > > effect_extern_targets
 Column storing external target references for each effect.
ColumnT< uint04effect_index
 Column storing the effect table index for each design object.
Vector< 11, TableColumn * > effect_properties = Vector<11, TableColumn*>(nullptr)
 Array of pointers to all effect property columns.
Table effect_table
 Table storing effect definitions (animations, constraints, etc.).
ColumnT< Buffer< uint04 > > effect_targets
 Column storing target design object indices for each effect.
ColumnT< Buffer< uint04 > > external_child_location
 Column storing external child model references.
ColumnT< Buffer< uint04 > > * face_to_edge_column = nullptr
 Optional column mapping faces to their edge indices.
ColumnT< uint08geometry_base_ptr
 Column storing a pointer or handle to the geometry DesignObjectBase.
ColumnT< uint04geometry_index
 Column storing the geometry table index for each design object.
ColumnT< Buffer< uint04 > > geometry_parent
 Column storing parent geometry indices for geometry grouping.
Vector< 21, TableColumn * > geometry_properties
 Array of pointers to all geometry property columns.
Table geometry_table
 Table storing geometry metadata (vertex ranges, primitive modes).
ColumnT< Bounds< 3, fltp08 > > global_bounds
 Column storing the world-space axis-aligned bounding box.
ColumnT< Bounds< 3, fltp08 > > global_selection_bounds
 Column storing the world-space selection bounding box.
ColumnT< UUIDguid
 Column storing the globally unique identifier for each design object.
ColumnT< uint04index_fan_offset_column
 Column storing the offset into the fan index buffer.
ColumnT< uint04index_fan_size_column
 Column storing the size of the fan index buffer region.
ColumnT< uint04index_mode_offset_column
 Column storing the offset into the index mode buffer.
ColumnT< uint04index_mode_size_column
 Column storing the size of the index mode buffer region.
ColumnT< uint04inherited_flags
 Column storing flags inherited from ancestors (visibility, lock, etc.).
ColumnT< bool > is_deleted
 Column indicating whether the object has been soft-deleted.
ColumnT< uint04layer_location
 Column storing the layer index that this model belongs to.
ColumnT< Buffer< uint04 > > local_child_location
 Column storing local child model indices in the hierarchy.
ColumnT< uint08material_base_ptr
 Column storing a pointer or handle to the material DesignObjectBase.
ColumnT< uint04material_child_index
 Column storing the material index assigned to child models.
ColumnT< uint04material_index
 Column storing the material table index for each design object.
Vector< 28, TableColumn * > material_properties = Vector<28, TableColumn*>(nullptr)
 Array of pointers to all material property columns.
Table material_table
 Table storing material definitions (textures, colors, shading).
ColumnT< uint04model_geometry_index
 Column storing the geometry index associated with each model.
ColumnT< uint04model_index
 Column storing the model table index for each design object.
Vector< 18, TableColumn * > model_properties
 Array of pointers to all model property columns.
Table model_table
 Table storing model hierarchy data (parent/child, bounds, transforms).
ColumnT< Stringmodel_type
 Column storing the model type string identifier.
ColumnT< Timemodified_time
 Column storing the last modification timestamp.
ColumnT< Stringname
 Column storing the display name for each design object.
ColumnT< Buffer< uint04 > > * neighbor_index_location = nullptr
 Optional column storing neighbor vertex indices for adjacency queries.
ColumnT< uint08parent_base_ptr
 Column storing a pointer or handle to the parent DesignObjectBase.
ColumnT< uint04parent_location
 Column storing the parent model index in the hierarchy.
ColumnT< uint04personal_inherited_flags
 Column storing flags set on this model that propagate to children.
ColumnT< uint04primitive_fan_column
 Column storing the triangle fan index offset.
ColumnT< uint01primitive_flag_column
 Column storing per-primitive bit flags.
ColumnT< uint04primitive_index_column
 Column storing the primitive index buffer offset.
Table primitive_index_table
 Table storing primitive index buffers (triangles, lines, etc.).
Vector< 8, TableColumn * > primitive_property_mode_column
 Primitive property mode columns, one per PrimitiveProperty.
Vector< 8, ColumnT< uint04 > * > primitive_property_offset_column
 Primitive property offset columns into the index table.
Vector< 8, ColumnT< uint04 > * > primitive_property_size_column
 Primitive property size columns (number of indices).
Table property_table
 Table storing design object properties (name, transform, type, etc.).
ColumnT< uint04solid_vertex_count_column
 Column storing the number of active solid-fill vertices.
ColumnT< uint04solid_vertex_offset_column
 Column storing the starting offset for solid-fill vertices.
ColumnT< uint04solid_vertex_reserved_count_column
 Column storing the number of reserved solid-fill vertices.
ColumnT< bool > spacial_visible
 Column indicating whether the object is visible in the 3D viewport.
ColumnT< Matrix< fltp08 > > transform
 Column storing the local transformation matrix.
ColumnT< bool > tree_visible
 Column indicating whether the object is visible in the scene tree.
Vector< 10, TableColumn * > uv_color = Vector<10, TableColumn*>(nullptr)
 UV color columns, one per UVType.
Vector< 10, TableColumn * > uv_image_file = Vector<10, TableColumn*>(nullptr)
 UV image file path columns, one per UVType.
Vector< 10, TableColumn * > uv_intensity = Vector<10, TableColumn*>(nullptr)
 UV intensity value columns, one per UVType.
Vector< 10, TableColumn * > uv_layer = Vector<10, TableColumn*>(nullptr)
 UV layer index columns, one per UVType.
Vector< 10, TableColumn * > uv_mode = Vector<10, TableColumn*>(nullptr)
 UV mapping mode columns, one per UVType.
ColumnT< uint04vertex_count_column
 Column storing the number of active vertices.
Vector< 16, TableColumn * > vertex_mode_column = Vector<16, TableColumn*>(nullptr)
 Vertex mode columns describing how each vertex property is stored per geometry.
ColumnT< uint04vertex_offset_column
 Column storing the starting vertex offset in the vertex table.
Vector< 16, TableColumn * > vertex_property_column = Vector<16, TableColumn*>(nullptr)
 Array of pointers to vertex property columns, indexed by VertexProperty.
ColumnT< uint04vertex_reserved_count_column
 Column storing the number of reserved (allocated) vertices.
Table vertex_table
 Table storing per-vertex data (position, normal, color, etc.).
ColumnT< Bounds< 3, fltp08 > > visible_box
 Column storing the visible bounding box for culling.

Protected Member Functions

void createEffectTable ()
 Creates and configures the effect table and its columns.
void createGeometryTable ()
 Creates and configures the geometry table and its columns.
void createMaterialTable ()
 Creates and configures the material table and its columns.
void createModelTable ()
 Creates and configures the model hierarchy table and its columns.
void createPropertyTable ()
 Creates and configures the design object property table and its columns.
void createTables ()
 Creates and initializes all internal tables (property, material, geometry, model, effect).
void linkTables ()
 Links all tables together by establishing cross-table column references.
void setDefaultValues ()
 Sets default values for all columns across all tables.
void setupStaticTables ()
 Configures static (non-row-dependent) table properties and metadata.

Detailed Description

Provides the underlying data storage for the NDEVR Scene Model hierarchy.


See also
DesignObject, Table, TableColumn

Definition at line 177 of file DesignObjectBase.h.

Constructor & Destructor Documentation

◆ DesignObjectBase()

DesignObjectBase::DesignObjectBase ( bool is_app_owned)

Constructs a DesignObjectBase and initializes all internal tables and columns.


Parameters
[in]is_app_ownedWhether this base is owned by the application (true) or by an external source such as a file import (false).

Referenced by addReference(), and base().

◆ ~DesignObjectBase()

DesignObjectBase::~DesignObjectBase ( )

Destroys the DesignObjectBase and releases all owned resources.


Member Function Documentation

◆ addReference()

void DesignObjectBase::addReference ( DesignObjectBase * base)

Adds an external reference to another DesignObjectBase.


Parameters
[in]basePointer to the DesignObjectBase to reference.

References DesignObjectBase(), and base().

◆ addTable()

void DesignObjectBase::addTable ( Table * table)

Adds a custom table to this base, making it accessible by its label.


Parameters
[in]tablePointer to the table to add. Ownership is not transferred.

References table().

◆ base()

DesignObjectBase * DesignObjectBase::base ( const StringView & base)

Retrieves an owned or referenced DesignObjectBase by its string key.


Parameters
[in]baseThe string key identifying the base.
Returns
Pointer to the DesignObjectBase, or nullptr if not found.

References DesignObjectBase(), and base().

Referenced by addReference(), and base().

◆ createEffectTable()

void DesignObjectBase::createEffectTable ( )
protected

Creates and configures the effect table and its columns.


◆ createGeometryTable()

void DesignObjectBase::createGeometryTable ( )
protected

Creates and configures the geometry table and its columns.


◆ createMaterialTable()

void DesignObjectBase::createMaterialTable ( )
protected

Creates and configures the material table and its columns.


◆ createModelTable()

void DesignObjectBase::createModelTable ( )
protected

Creates and configures the model hierarchy table and its columns.


◆ createPropertyTable()

void DesignObjectBase::createPropertyTable ( )
protected

Creates and configures the design object property table and its columns.


◆ createTables()

void DesignObjectBase::createTables ( )
protected

Creates and initializes all internal tables (property, material, geometry, model, effect).


◆ fetchDataColumns()

void DesignObjectBase::fetchDataColumns ( Buffer< TableColumn * > & columns)

Populates the given buffer with pointers to all active data columns across all tables.


Parameters
[in]columnsBuffer to fill with column pointers.

◆ finishMapFromFile()

void DesignObjectBase::finishMapFromFile ( BinaryFileTableInfo & info)

Completes the mapping process after reading table data from a binary file.


Parameters
[in]infoThe binary file table info used during the mapping process.

◆ getRTree() [1/2]

DynamicPointer< RTree< 3, fltp04 > > DesignObjectBase::getRTree ( UUID id)

Retrieves a mutable pointer to the R-tree associated with the given UUID.


Parameters
[in]idThe UUID identifying the R-tree.
Returns
A dynamic pointer to the R-tree, or nullptr if not found.

◆ getRTree() [2/2]

ConstPointer< RTree< 3, fltp04 > > DesignObjectBase::getRTree ( UUID id) const

Retrieves a read-only pointer to the R-tree associated with the given UUID.


Parameters
[in]idThe UUID identifying the R-tree.
Returns
A const pointer to the R-tree, or nullptr if not found.

◆ hasRTree()

bool DesignObjectBase::hasRTree ( UUID id) const

Checks whether an R-tree exists for the given UUID.


Parameters
[in]idThe UUID to check.
Returns
True if an R-tree is associated with the given UUID, false otherwise.

◆ isApplicationOwned()

bool DesignObjectBase::isApplicationOwned ( ) const

Checks whether this base is owned by the application.


Returns
True if the base is application-owned, false otherwise.

◆ linkTables()

void DesignObjectBase::linkTables ( )
protected

Links all tables together by establishing cross-table column references.


◆ lockRTrees()

WLock DesignObjectBase::lockRTrees ( )

Acquires a write lock on all R-trees in this base.


Returns
A WLock that releases on destruction.

◆ mapFromFile()

void DesignObjectBase::mapFromFile ( BinaryFileTableInfo & file)

Deserializes all table data from a binary file.


Parameters
[in]fileThe binary file table info to read from.

◆ mapToFile()

void DesignObjectBase::mapToFile ( BinaryFileTableInfo & file) const

Serializes all table data to a binary file.


Parameters
[in]fileThe binary file table info to write to.

◆ mapTreesFromFile()

void DesignObjectBase::mapTreesFromFile ( BinaryFileTableInfo & file)

Deserializes R-tree spatial index data from a binary file.


Parameters
[in]fileThe binary file table info to read from.

◆ mapTreeToFile()

void DesignObjectBase::mapTreeToFile ( BinaryFileTableInfo & file,
int mode ) const

Serializes R-tree spatial index data to a binary file.


Parameters
[in]fileThe binary file table info to write to.
[in]modeThe serialization mode controlling which trees to write.

◆ ownedBases()

Dictionary< String, DesignObjectBase * > & DesignObjectBase::ownedBases ( )
inline

Returns a reference to the dictionary of DesignObjectBase instances owned by this base.


Returns
A reference to the owned bases dictionary.

Definition at line 369 of file DesignObjectBase.h.

◆ randomColorGenerator()

const RandomColorGenerator & DesignObjectBase::randomColorGenerator ( ) const
inline

Returns a const reference to the random color generator used for assigning colors.


Returns
A const reference to the RandomColorGenerator.

Definition at line 421 of file DesignObjectBase.h.

◆ readMetaDataFromColumn()

void DesignObjectBase::readMetaDataFromColumn ( )

Reads JSON metadata from the metadata column into the cached_meta_data buffer.


◆ referencedBases()

Set< DesignObjectBase * > & DesignObjectBase::referencedBases ( )
inline

Returns a reference to the set of externally referenced DesignObjectBase instances.


Returns
A reference to the set of referenced bases.

Definition at line 364 of file DesignObjectBase.h.

◆ removeRTree()

void DesignObjectBase::removeRTree ( UUID id)

Removes the R-tree associated with the given UUID.


Parameters
[in]idThe UUID identifying the R-tree to remove.

◆ removeTable()

void DesignObjectBase::removeTable ( const StringView & label)

Removes a custom table identified by its label.


Parameters
[in]labelThe string label of the table to remove.

◆ setDefaultValues()

void DesignObjectBase::setDefaultValues ( )
protected

Sets default values for all columns across all tables.


◆ setRTree()

void DesignObjectBase::setRTree ( UUID id,
const DynamicPointer< RTree< 3, fltp04 > > & tree )

Sets or replaces the R-tree for the given UUID.


Parameters
[in]idThe UUID identifying the R-tree.
[in]treeThe R-tree to associate with the UUID.

◆ setupStaticTables()

void DesignObjectBase::setupStaticTables ( )
protected

Configures static (non-row-dependent) table properties and metadata.


◆ table()

Table * DesignObjectBase::table ( const StringView & label)

Retrieves a custom table by its label.


Parameters
[in]labelThe string label of the table.
Returns
Pointer to the table, or nullptr if not found.

Referenced by addTable().

◆ tables()

const Dictionary< UUID, Table * > & DesignObjectBase::tables ( )
inline

Returns a reference to the dictionary of all custom tables keyed by UUID.


Returns
A const reference to the tables dictionary.

Definition at line 358 of file DesignObjectBase.h.

◆ trees()

const Dictionary< UUID, DynamicPointer< RTree< 3, fltp04 > > > & DesignObjectBase::trees ( ) const
inline

Returns a const reference to the dictionary of all R-trees keyed by UUID.


Returns
A const reference to the R-tree dictionary.

Definition at line 320 of file DesignObjectBase.h.

◆ writeMetaDataToColumn()

void DesignObjectBase::writeMetaDataToColumn ( )

Writes cached JSON metadata from the cached_meta_data buffer back to the metadata column.



The documentation for this class was generated from the following file: