NDEVR
API Documentation

A core class that represents a node on model hierarchy. More...

Inheritance diagram for Model:
[legend]
Collaboration diagram for Model:
[legend]

Public Types

enum  DescendedFlags { e_descendent_selected = 0 , e_descendent_focussed = 1 , e_descendent_deletion_blocked = 2 }
 Flags that propagate upward from descendant models to ancestors, indicating aggregate states of the subtree below this model. More...
enum  InheritedFlags : uint01 {
  e_inherited_is_visible = 0 , e_inherited_has_no_focus = 1 , e_inherited_is_tree_visible = 2 , e_inherited_not_selected = 3 ,
  e_placholder = 4 , e_inherited_can_delete = 5 , e_inherited_does_not_follow_camera = 6 , e_inherited_does_not_orient_to_camera = 7 ,
  e_inherited_does_not_scale_to_camera = 8 , e_inherited_not_deleted = 9 , e_inherited_not_application_owned = 10 , e_inherited_exportable = 11
}
 Flags that are recursively inherited from ancestor models down through the hierarchy. More...
enum class  MaterialMode { e_by_parent , e_by_layer , e_custom , e_hidden }
 Determines how a model resolves its material for rendering. More...
enum class  ModelColorMode { e_direct , e_by_selectable_children , e_by_material_root , e_by_layer }
 Determines how the model color is resolved for display purposes. More...
enum  ParentMatrixFlags : uint01 {
  e_ignore_offset = 0 , e_ignore_scale = 1 , e_ignore_rotation = 2 , e_ignore_scale_distortion = 3 ,
  e_use_only_for_offset = 4 , e_orient_to_camera = 5 , e_follow_camera = 6 , e_scale_to_camera = 7
}
 Flags controlling which components of the parent's transformation matrix are applied to this model. More...
Public Types inherited from DesignInfo
enum  DesignObjectType : uint01

Public Member Functions

 Model ()
 Default constructor. Creates an uninitialized Model.
 Model (const DesignInfo &obj)
 Constructs a Model from an existing DesignInfo descriptor.
 Model (DesignObjectBase *base)
 Constructs a Model from a design object base, using the next available index.
 Model (uint04 index, DesignObjectBase *base)
 Constructs a Model at a specific index within the design object base.
void addChild (Model &child)
 Adds an existing model as a child of this model.
void addChild (uint04 child_idx, Model &child)
 Adds an existing model as a child at a specific index.
void addChild (uint04 child_index)
 Adds a child by its database index.
void addPerVertexColorFromMaterialConstant (UVType constant_index)
 Adds per-vertex color data derived from a material constant UV channel.
Matrix< fltp08applyTransformToParent (Matrix< fltp08 > mat, const Matrix< fltp08 > &parent_mat) const
 Applies a transformation matrix to the parent transform, respecting parent matrix flags.
Vector< 3, fltp08calculateAverageDirection (const Matrix< fltp08 > &parent_transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the average direction vector of descendant linear geometries.
Vector< 2, fltp08calculateHVLength (const Matrix< fltp08 > &parent_transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates horizontal and vertical length components of descendant linear geometries.
void calculateIndexNeighborList ()
 Calculates the index neighbor list for geometry processing.
fltp08 calculateLength (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the total length of all descendant linear geometries.
void calculateNormals (NormalMode mode, Angle< fltp08 > smoothing_angle)
 Recalculates normals for all descendant geometries.
void calculateSmoothTextures (Vector< 3, fltp08 > origin, fltp08 scale)
 Calculates smooth texture coordinates based on a projection origin and scale.
fltp08 calculateSurfaceArea (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the surface area of all descendant mesh geometries.
void calculateTangentSpace (bool calc_tan, bool calc_bitan)
 Calculates tangent and/or bitangent vectors for all descendant geometries.
fltp08 calculateVolume (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid) const
 Calculates the volume of all descendant mesh geometries.
Vector< 2, fltp08calculateVolumeAndSurfaceArea (const Matrix< fltp08 > &transform=Constant< Matrix< fltp08 > >::Invalid, const void *lock=nullptr) const
 Calculates both volume and surface area in a single pass for efficiency.
bool canExplode () const
 Checks whether this model can be exploded into its constituent children.
bool canInteract () const
 Checks whether this model can be interacted with (visible, not locked, etc.).
Vertex< 3, fltp08centerAlignModel ()
 Centers the model geometry at the origin and returns the offset applied.
void checkBounds ()
 Validates and recalculates cached bounding boxes if needed.
uint04 childCount () const
 Returns the number of direct children this model has.
void clearChildren ()
 Removes all children from this model without deleting them.
void clearLayer ()
 Removes the layer assignment from this model.
void clearMaterial ()
 Removes the material assignment from this model.
void clearMaterialDescendants ()
 Removes all descendant material assignments without deleting the materials.
void colorByChannel (Material &mat, const StringView &channel, fltp08 avg=Constant< fltp08 >::Invalid) const
 Colors geometry vertices by a data channel value from a material.
void copyFrom (const Model &model, bool deep_copy, bool copy_ids=false, bool recursive=true, bool keep_root_properties=false)
 Copies data from another model into this model.
void copyMaterialProperties (const Model &model)
 Copies material properties from another model to this model.
Model createChild ()
 Creates a new child model and appends it to this model's child list.
Model createChild (uint04 child_slot)
 Creates a new child model at a specific child slot index.
Effect createChildEffect ()
 Creates a new child effect attached to this model.
Geometry createChildGeometry ()
 Creates a new child geometry for this model.
Material createChildMaterial (bool copy_child=false)
 Creates a new child material for this model.
void createChildren (uint04 child_size)
 Creates multiple children at once.
Effect createSceneEffect () const
 Creates a new effect in the scene database.
Geometry createSceneGeometry () const
 Creates a new geometry in the scene database.
Model createSceneLayer () const
 Creates a new layer model in the scene database.
Material createSceneMaterial () const
 Creates a new material in the scene database.
Model createSceneModel () const
 Creates a new model in the scene database associated with this model.
RGBColor customModelColor (ModelColorMode mode) const
 Returns the resolved model color based on the specified color mode.
void deleteChildren ()
 Deletes all children of this model.
void deleteModel (bool deletchildren, bool removfrom_parent=true)
 Deletes this model from the scene.
BitFlag descendedFlagsNoCache (bool complete_cache_ignore) const
 Computes descended flags without using the cache.
BitFlag descendedPersonalFlagsNoCache () const
 Computes descended personal flags without using the cache.
void descendentGeometryTypes (Set< GeometryType > &buffer) const
 Collects all unique geometry types from descendants into the provided set.
Model directLayer () const
 Returns the directly assigned layer model.
TranslatedString displayName () const
 Returns the translated display name for this model.
TranslatedString displayNamePath (const StringView &seperator=":") const
 Returns the full display name path from root to this model.
bool doesModelPropertyContain (NDPN property, const char *value, bool ignorcase) const
 Checks whether a model property contains a given C-string substring.
template<class t_type>
bool doesModelPropertyContain (NDPN property, const StringView &value, bool ignorcase) const
 Checks whether a model property contains a given substring.
void ensureTangentSpace (bool ensure_tan, bool ensure_bitan)
 Ensures that tangent and/or bitangent data exists, calculating if needed.
void ensureVisibleChildren (uint04 count)
 Hides children whos child index is greater than size, or creates/shows children if needed such that there is exactly a given number of visible children for this model.
void eraseModel ()
 Erases this model from the database without removing children.
ModelBuffer explodeModel ()
 Explodes this model, promoting its children to siblings in the parent.
bool exportIgnored () const
 Checks whether this model is excluded from export operations.
Model findDescendentByName (const StringView &name) const
 Recursively searches descendants for a model with the given name.
Model findDescendentByType (const StringView &type) const
 Recursively searches descendants for a model with the given type.
Time getAscModifiedTime (bool include_self, bool include_layer=true) const
 Returns the greatest modified time of this model and all ancestors.
Bounds< 3, fltp08getBounds () const
 Returns the local bounding box of this model.
Bounds< 3, fltp08getBoundsOfVisible () const
 Returns the bounding box of all visible descendants.
Model getChild (uint04 child) const
 Returns the child model at the given child slot index.
Model getChild (UUID id) const
 Returns the child model with the specified UUID.
uint04 getChildIndex () const
 Returns this model's index within its parent's child list.
uint04 getChildIndex (uint04 child) const
 Returns the database index of the child at the given slot.
Buffer< uint04getChildIndices () const
 Returns the database indices of all direct children.
uint04 getChildLayerIndex () const
 Returns this model's index within its parent's layer child list.
ModelBuffer getChildren () const
 Returns a buffer containing all direct children of this model.
void getChildren (ModelBuffer &children) const
 Appends all direct children of this model to the provided buffer.
ModelBuffer getChildrenByName (const StringView &name) const
 Returns all direct children whose name matches the given string.
ModelBuffer getChildrenByType (const Buffer< String > &type) const
 Returns all direct children whose type matches any of the given strings.
ModelBuffer getChildrenByType (const StringView &type) const
 Returns all direct children whose type matches the given string.
Buffer< UUIDgetChildrenIDs () const
 Returns the UUIDs of all direct children.
PrimitiveAlignedBuffer< std::pair< Model, Geometry >, 32 > getClippingGeometry () const
 Returns model-geometry pairs used for clipping operations.
Matrix< fltp08getCompleteTransform () const
 Returns the fully composed local-to-global transform matrix for this model.
ModelBuffer getDescendants (bool include_deleted=false, bool local_only=false) const
 Returns all descendant models recursively.
void getDescendants (ModelBuffer &buffer, bool include_deleted=false, bool local_only=false) const
 Appends all descendant models recursively to the provided buffer.
ModelBuffer getDescendantsByName (const StringView &name, uint04 max_count=Constant< uint04 >::Max) const
 Recursively searches all descendants for models matching the given name.
ModelBuffer getDescendantsByNameAndType (const StringView &name, const StringView &type, uint04 max_count=Constant< uint04 >::Max) const
 Recursively searches all descendants for models matching both name and type.
ModelBuffer getDescendantsByType (const StringView &type, uint04 max_count=Constant< uint04 >::Max) const
 Recursively searches all descendants for models matching the given type.
Time getDescModifiedTime (bool includself) const
 Returns the greatest modified time of this model and all descendants.
uint04 getDirectLayerIndex () const
 Returns the database index of the directly assigned layer.
Effect getEffect (uint04 index=0) const
 Returns the effect at the specified child index.
EffectBuffer getEffectChildren () const
 Returns all direct child effects of this model.
EffectBuffer getEffectDescendants () const
 Returns all descendant effects recursively.
uint04 getEffectIndex (uint04 child_index=0) const
 Returns the database index of the effect at the given child slot.
Model getFamilyMember (uint04 index) const
 Returns a model from the family tree (ancestors + descendants) by flat index.
Geometry getGeometry () const
 Returns the geometry attached to this model.
GeometryBuffer getGeometryDescendants (bool remove_redundant=true, uint04 max_count=Constant< uint04 >::Max) const
 Recursively collects all descendant geometries.
uint04 getGeometryIndex () const
 Returns the database index of the geometry associated with this model.
Model getLayer () const
 Returns the layer model assigned to this model (direct or inherited).
Material getMaterial () const
 Returns the material assigned to this model.
MaterialBuffer getMaterialDescendants (bool local_only=false) const
 Recursively collects all descendant materials.
void getMaterialDescendants (MaterialBuffer &materials, bool local_only=false) const
 Appends all descendant materials to the provided buffer.
void getMaterialDescendants (Set< Material > &materials, bool local_only=false) const
 Appends all descendant materials to the provided set (deduplicating).
MaterialBuffer getMaterialDescendantsByName (const StringView &name, uint04 max_count=Constant< uint04 >::Max) const
 Returns descendant materials filtered by name.
uint04 getMaterialIdx () const
 Returns the database index of the material assigned to this model.
MaterialMode getMaterialMode () const
 Returns the material mode determining how materials are resolved for this model.
StringView getModelIcon () const
 Returns the icon identifier string for this model's type.
uint04 getNumOfEffects () const
 Returns the number of effects attached to this model.
Model getParent () const
 Returns the parent model of this model.
uint04 getParentIndex () const
 Returns the database index of this model's parent.
Matrix< fltp08getParentTransform () const
 Returns the parent's transformation matrix as seen by this model.
Model getRoot () const
 Returns the root ancestor of this model's hierarchy.
Material getRootMaterial () const
 Returns the root material resolved through the hierarchy.
Model getRootMaterialModel ()
 Returns the ancestor model that determines the root material for this model.
Effect getSceneEffect (UUID id) const
 Returns a scene effect by its UUID.
EffectBuffer getSceneEffects () const
 Returns all effects in the scene database.
GeometryBuffer getSceneGeometries () const
 Returns all geometries in the scene database.
Geometry getSceneGeometry (uint04 index) const
 Returns a scene geometry by database index.
Geometry getSceneGeometry (UUID id) const
 Returns a scene geometry by UUID.
Model getSceneLayer (UUID id) const
 Returns a scene layer by its UUID.
ModelBuffer getSceneLayers (bool include_deleted=false) const
 Returns all layer models in the scene.
Material getSceneMaterial (uint04 index) const
 Returns a scene material by database index.
Material getSceneMaterial (UUID id) const
 Returns a scene material by UUID.
MaterialBuffer getSceneMaterials () const
 Returns all materials in the scene database.
Model getSceneModel (UUID id) const
 Retrieves a scene model by its UUID.
ModelBuffer getSceneModels (bool include_deleted=false, bool local_only=false) const
 Returns all models in the scene database.
ModelBuffer getSceneModelsByName (const StringView &name, uint04 max_count=Constant< uint04 >::Max, bool includdeleted=false) const
 Returns scene models filtered by name.
ModelBuffer getSceneModelsByType (const StringView &type, uint04 max_count=Constant< uint04 >::Max, bool includdeleted=false) const
 Returns scene models filtered by type.
Bounds< 3, fltp08getSelectionBounds () const
 Returns the selection-specific bounding box in local space.
template<class t_type>
Buffer< t_type > getTypeChildren (const StringView &type) const
 Returns children of a specific type, cast to the requested derived type.
template<class t_type>
Buffer< t_type > getTypeDescendants (const StringView &type) const
 Recursively searches descendants for models of a specific type, cast to a derived type.
Bounds< 3, fltp08globalBounds () const
 Returns the global bounding box of this model (including transform).
Vertex< 3, fltp08globalCenterOfRotation () const
 Returns the center of rotation in global coordinates.
Bounds< 3, fltp08globalSelectionBounds () const
 Returns the global selection bounding box.
bool hasChild (uint04 child_index=0U) const
 Checks whether this model has a child at the given slot.
void hasDescendants (bool &has_point, bool &has_line, bool &has_mesh, bool only_user_objects) const
 Checks which types of geometry primitives exist among descendants.
bool hasDescendent (const Model &model) const
 Checks whether a given model is a descendant of this model.
bool hasDescendent (const UUID &id) const
 Checks whether a model with the given UUID is a descendant of this model.
bool hasDirectLayer () const
 Checks whether this model has a directly assigned layer (not inherited).
bool hasEffect (uint04 index=0) const
 Checks whether an effect exists at the given child index.
bool hasFocus () const
 Checks whether this model currently has focus.
bool hasGeometryDescendent () const
 Checks whether any descendant has geometry data.
bool hasHoles (PrimitiveProperty property) const
 Checks whether the geometry has holes (missing primitives) for a given property.
bool hasLayer () const
 Checks whether this model has a layer (directly or inherited).
bool hasLayerRootMaterial () const
 Checks whether a root material exists through the layer hierarchy.
bool hasLinearDescendent () const
 Checks whether any descendant has linear (line/polyline) geometry.
bool hasMaterial () const
 Checks whether this model has a material assigned.
bool hasMeshDescendent () const
 Checks whether any descendant has mesh (triangle) geometry.
bool hasPointsDescendent () const
 Checks whether any descendant has point geometry.
bool hasRootMaterial () const
 Checks whether a root material can be resolved through the hierarchy.
bool hasSelectedDescendent () const
 Checks whether any descendant of this model is selected.
Vector< 32, bool > inheritedFlags () const
 Returns the cached inherited flags vector for this model.
Vector< 32, bool > inheritedFlagsNoCache (bool complete_cache_ignore) const
 Computes inherited flags without using the cache.
Vector< 32, bool > inheritedPersonalFlagsNoCache () const
 Computes inherited personal flags without using the cache.
void invalidateBounds ()
 Invalidates all cached bounding boxes, forcing recalculation on next access.
void invalidateGlobalBoundsDesc ()
 Invalidates global bounding boxes for this model and all descendants.
void invalidateSelectionBounds ()
 Invalidates the cached selection bounding box.
void invalidateTransformCache ()
 Invalidates the cached transformation matrix, forcing recomputation.
void invalidateVisibleBounds ()
 Invalidates the cached visible bounding box.
bool isApplicationOwned () const
 Checks whether this model is owned by the application (not user-created).
bool isDeleted () const
 Checks whether this model has been deleted.
bool isLayer () const
 Checks whether this model is a layer definition.
bool isLocked () const
 Checks whether this model is locked against editing.
bool isScene () const
 Checks whether this model represents a scene root node.
bool isSelected () const
 Checks whether this model is currently selected.
bool isTreeVisible () const
 Checks whether this model is visible in the model tree view.
template<class t_buffer_type>
bool isType (const Buffer< t_buffer_type > &types) const
 Checks whether the model's type matches any type in the given buffer.
bool isVisible () const
 Checks whether this model is visible (accounting for inherited visibility).
 operator bool () const
 Boolean conversion operator. Returns true if this Model references a valid entry.
void overrideMaterialDescendants (MaterialMode override_desc)
 Overrides material mode for all descendants.
BitFlag parentMatrixFlags () const
 Returns the parent matrix flags for this model.
BitFlag personalDescendedFlags () const
 Returns the cached personal descended flags.
Vector< 32, bool > personalInheritedFlags () const
 Returns the personal inherited flags from the cache.
void removeChild (const Model &model)
 Removes a specific child model from this model's child list.
void removeDuplicateVertices (fltp08 epsilon, void *lock, InfoPipe *log=nullptr)
 Removes duplicate vertices from all descendant geometries.
void removeGeometry ()
 Removes the geometry reference from this model (does not delete the geometry).
void removeMaterial ()
 Removes the material from this model.
void restoreModel ()
 Restores a previously deleted model, re-adding it to the scene.
void restoreModel (Model &parent, uint04 index=Constant< uint04 >::Invalid)
 Restores a previously deleted model under a specific parent.
void setChildApplicationConstructed (const StringView &database_name=StringView())
 Sets the child database to an application-constructed database by name.
void setChildApplicationConstructed (DesignObjectBase *base)
 Sets the child database to use an application-constructed DesignObjectBase.
void setChildEffectSize (uint04 child_size)
 Sets the number of child effect slots for this model.
void setChildIndex (uint04 child, uint04 id)
 Sets the database index for a specific child slot.
void setEffectIndex (uint04 material_index, uint04 sub_index=0)
 Sets the effect database index at a given sub-index.
void setGeometryApplicationConstructed (const StringView &database_name=StringView())
 Sets the geometry database to an application-constructed database by name.
void setGeometryChild (Geometry &geo)
 Sets the geometry child of this model to an existing Geometry object.
void setGeometryIndex (uint04 geo_index)
 Sets the geometry database index for this model.
void setIsLayer (bool is_layer)
 Marks or unmarks this model as a layer definition.
void setLayer (Model layer)
 Assigns this model to a specific layer.
void setMaterial (const Material &material)
 Assigns a material to this model.
void setMaterialApplicationConstructed (const StringView &database_name=StringView())
 Sets the material database to an application-constructed database by name.
void setMaterialMode (MaterialMode option)
 Sets the material mode for this model.
void setModelTransform (const Matrix< fltp08 > &transform)
 Sets the model's local transformation matrix, replacing the current one.
bool setModelVisible (bool is_visible)
 Sets the visibility of this model.
void setNormalMode (NormalMode mode, Angle< fltp08 > smoothing_angle, InfoPipe *log)
 Sets the normal mode and recalculates normals with progress logging.
void setOrientation (const Vector< 3, Angle< fltp08 > > &new_orientation, const void *lock=nullptr)
 Sets the orientation of this model using floating-point angles.
void setOrientation (const Vector< 3, Angle< sint04 > > &new_orientation, const void *lock=nullptr)
 Sets the orientation of this model using integer-precision angles.
void setParentMatrixFlag (ParentMatrixFlags flag, bool value)
 Sets or clears a specific parent matrix flag.
void setParentMatrixFlags (BitFlag flags)
 Sets the parent matrix flags controlling which parent transform components to inherit.
void setSize (const Vector< 3, fltp08 > &size)
 Sets the model size by scaling its transform to match the desired dimensions.
void setWindingMode (WindingMode mode)
 Sets the winding mode for all descendant geometries.
Vector< 3, fltp08size () const
 Returns the size (extents) of the model's bounding box.
void swapChildren (uint04 a, uint04 b)
 Swaps the positions of two children in the child list.
void updateAscGeometryTime (const Time &time, bool include_self)
 Updates the geometry-modified timestamp for this model and all ancestors.
void updateAscTime (const Time &time, bool includself)
 Updates the modified timestamp for this model and all ancestors.
void updateDescGeometryTime (const Time &time, bool include_self)
 Updates the geometry-modified timestamp for this model and all descendants.
void updateDescTime (const Time &time, bool include_self)
 Updates the modified timestamp for this model and all descendants.
void updateFrom (const Model &model, bool check_resources)
 Updates this model's properties from another model, optionally checking resources.
void updateGeometryTime (Time time=Time::SystemTime())
 Updates the geometry-modified timestamp for this model.
void updateInheritedFlagsCache (bool force_update_all=false, bool update_personal_flags=false)
 Recalculates and caches the inherited flags for this model.
void updateModelTransform (const Matrix< fltp08 > &transform, const void *lock=nullptr)
 Applies a delta transform to the current model transform.
void updateModifiedTime (Time time=Time::SystemTime())
 Updates the modified timestamp for this model.
void updateVisibleRecursive (bool is_visible)
 Recursively updates visibility for this model and all descendants.
void validate (bool validate_children=true) const
 Validates this model's internal state for consistency.
uint04 vertexCount () const
 Returns the total number of vertices across all descendant geometries.
uint04 visibleVertexCount () const
 Returns the total number of visible vertices across all descendant geometries.
Public Member Functions inherited from DesignObject
 DesignObject ()=default
 Creates an "invalid" design object.
 DesignObject (const DesignInfo &info)
 Constructs a DesignObject from an existing DesignInfo, sharing the same base and indices.
 DesignObject (DesignObjectBase *base)
 Creates an new design object within the given DesignObjectBase.
 DesignObject (uint04 index, DesignObjectBase *base)
 Sets a DesignObject up to be a pointer to an existing object in the database.
JSONNode activeFilters () const
 Retrieves the active filters applied to this design object as a JSON structure.
void appendData (const StringView &data, bool compressed)
 Appends data to this design object's data storage.
DesignObjectBasebase () const
 Returns a reference to the underlying DesignObjectBase database.
void clearAllMetaData ()
 Removes all metadata entries from this design object.
void clearMetaData (const StringView &index)
 Removes a specific metadata entry by key.
void copyFrom (const DesignObject &object)
 Copies all properties from the given design object into this one.
uint04 designIndex () const
 Returns the design-specific index used to access type-specific properties (e.g., model, geometry, material properties).
bool doesPropertyBeginWith (NDPO property, const StringView &value, bool ignore_case) const
 Checks whether a string property's value begins with the given substring.
bool doesPropertyContain (NDPO property, const StringView &value, bool ignore_case) const
 Checks whether a string property's value contains the given substring.
File file () const
 Returns the file path associated with this design object as a File object.
template<auto t_property>
constexpr decltype(auto) get () const
 Retrieves a property value using a compile-time property constant, with the type deduced from PropertySpec.
template<auto t_property, class t_type>
constexpr decltype(auto) get () const
 Retrieves a property value using a compile-time property constant, cast to the requested type.
template<class t_type, class t_property_type>
constexpr decltype(auto) get (t_property_type property) const
 Retrieves a property value from the database, cast to the requested type.
DesignObject getDesignParent () const
 Retrieves the parent design object of this object in the model hierarchy.
StringView getIcon () const
 Retrieves the icon identifier string associated with this design object.
template<class t_type>
decltype(auto) getInheritedProperty (NDPO property) const
 Retrieves a property value, walking up the parent hierarchy if the property is not set on this object.
Scene getScene () const
 Retrieves the Scene that this design object belongs to.
bool hasMetaData (const StringView &index) const
 Checks whether a metadata entry exists for the given key.
template<class t_type, class t_design_type>
bool hasProperty (t_design_type property) const
 Checks whether a property has a valid (non-default) value.
uint04 index () const
 Returns the primary row index of this object within the DesignObjectBase property table.
template<auto t_property>
bool is (const char *value) const
 Checks whether a compile-time property matches the given C-string value.
template<auto t_property>
bool is (const String &value) const
 Checks whether a compile-time property matches the given String value.
template<auto t_property>
bool is (const StringView &value) const
 Checks whether a compile-time property matches the given StringView value.
template<auto t_property, class t_type>
std::enable_if<!ObjectInfo< t_type >::String, bool >::type is (const t_type &value) const
 Checks whether a compile-time property matches a non-string value using equality comparison.
template<class t_property_type>
bool is (t_property_type property, const char *value) const
 Checks whether a string property matches the given C-string value.
template<class t_property_type>
bool is (t_property_type property, const String &value) const
 Checks whether a string property matches the given String value.
template<class t_property_type>
bool is (t_property_type property, const StringView &value) const
 Checks whether a string property matches the given StringView value.
template<class t_property_type, class t_type>
std::enable_if<!ObjectInfo< t_type >::String, bool >::type is (t_property_type property, const t_type &value) const
 Checks whether a non-string property matches the given value using equality comparison.
bool isDesignType (DesignObjectType mode) const
 Checks whether this object has the specified design type flag set.
bool isDesignType (uint04 mode) const
 Checks whether this object has the specified design type flag set, using a raw integer value.
bool isValid () const
 Checks whether this design object has a valid index into the database.
const JSONNodemetaData () const
 Retrieves the entire metadata tree for this design object.
const JSONNodemetaData (const StringView &index) const
 Retrieves a specific metadata entry by key.
void offsetDesign (const Vector< 3, fltp08 > &offset)
 Translates this design object by the given offset vector.
 operator bool () const
 Bool conversion operator.
bool operator!= (const DesignObject &object) const
 Checks inequality with another DesignObject.
bool operator< (const DesignObject &object) const
 Less-than comparison for ordering DesignObjects (e.g., for sorted containers).
bool operator== (const DesignObject &object) const
 Checks equality with another DesignObject by comparing base pointers and indices.
bool operator> (const DesignObject &object) const
 Greater-than comparison for ordering DesignObjects (e.g., for sorted containers).
Table & propertyTable ()
 Returns a mutable reference to the property table that stores this object's properties.
const Table & propertyTable () const
 Returns a const reference to the property table that stores this object's properties.
void removeMetaData (const StringView &index, const void *lock_ptr=nullptr)
 Removes a metadata entry by key, with optional write lock support.
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale, const Matrix< fltp08 > &transform)
 Scales this design object's geometry by the given scale factors around a center point, applying an additional transform.
void scale (Vector< 3, fltp08 > scale, Vertex< 3, fltp08 > center_of_scale=Constant< Vertex< 3, fltp08 > >::Invalid)
 Scales this design object's geometry and transform by the given scale factors around a center point.
template<auto t_property, class t_type>
void set (const t_type &value)
 Sets a property value in the database using a compile-time property constant.
template<class t_type, class t_property_type>
void set (t_property_type property, const t_type &value)
 Sets a property value in the database.
void setActiveFilters (const JSONNode &node)
 Sets the active filters on this design object from a JSON structure.
void setDesignType (DesignObjectType mode, bool is_type)
 Sets or clears a design type flag on this object.
void setMetaData (const JSONNode &node)
 Replaces the entire metadata tree with the given JSON node.
void setMetaData (const StringView &index, const bool &data)
 Sets a metadata entry at the given key to a boolean value.
void setMetaData (const StringView &index, const fltp08 &data)
 Sets a metadata entry at the given key to a 64-bit floating point value.
void setMetaData (const StringView &index, const JSONNode &node)
 Sets a metadata entry at the given key to the specified JSON node value.
void setMetaData (const StringView &index, const String &data)
 Sets a metadata entry at the given key to a String value.
void setMetaData (const StringView &index, const StringView &data)
 Sets a metadata entry at the given key to a StringView value.
void setMetaData (const StringView &index, const uint01 &data)
 Sets a metadata entry at the given key to a uint01 value.
void setMetaData (const StringView &index, const uint04 &data)
 Sets a metadata entry at the given key to a uint04 value.
template<auto t_property, class t_type>
bool update (const t_type &value, const void *lock=nullptr)
 Updates a property using a compile-time property constant, only if the new value differs.
template<class t_type, class t_property_type>
bool update (t_property_type property, const t_type &value, const void *lock=nullptr)
 Updates a property only if the new value differs from the current value.
void updateCreatedTime ()
 Sets the creation time stamp for this design object to the current system time.
void updateDesignModifiedTime (Time time=Time::SystemTime())
 Updates the modified time stamp for this design object.
void updateDesignTransform (const Matrix< fltp08 > &transform, const void *lock=nullptr)
 Updates the transform of this design object if it differs from the current value.
bool updateDesignVisible (bool is_visible, const void *lock=nullptr)
 Updates the spatial visibility of this design object if it differs from the current value.
void updateMetaData (const StringView &index, const bool &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const fltp08 &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const String &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
void updateMetaData (const StringView &index, const StringView &data, const void *lock_ptr=nullptr)
 Updates a metadata entry only if the new value differs from the current value.
bool validateDesignObject () const
 Validates the internal state of this design object, ensuring indices and base pointer are consistent.

Static Public Member Functions

static ModelBuffer ReduceToRoots (const ModelBuffer &children, const std::function< bool(const Model &, const Set< Model > &)> &filter)
 Reduces a collection of models to only root-level models (removing any that are descendants of others in the set), filtered by a user-provided predicate.
Static Public Member Functions inherited from DesignObject
static constexpr StringView FilePathDesignNameVariable ()
 Returns the placeholder variable string used in file paths to represent the design name.

Protected Member Functions

DesignObjectBasechildBase () const
 Returns the DesignObjectBase used for child model storage.
ColumnT< uint04 > & childToParentReference () const
 Returns the column mapping child indices to parent indices.
DesignObjectBasegeometryBase () const
 Returns the DesignObjectBase used for geometry storage.
DesignObjectBasematerialBase () const
 Returns the DesignObjectBase used for material storage.
DesignObjectBaseparentBase () const
 Returns the DesignObjectBase used for parent model storage.
ColumnT< Buffer< uint04 > > & parentToChildReference () const
 Returns the column mapping parent indices to child index lists.
Protected Member Functions inherited from DesignObject
template<class t_type>
void _setProperty (NDPO property, const t_type &value)
 Low-level property setter that directly writes to the design properties table without triggering side effects such as transform or visibility updates.
void initDesignObject ()
 Initializes default property values for this design object after construction.
Protected Member Functions inherited from DesignInfo
 DesignInfo (DesignObjectBase *base)
 Creates an new design object within the given DesignObjectBase.
 DesignInfo (uint04 index, DesignObjectBase *base)
 Sets a DesignObject up to be a pointer to an existing object in the database.
void _setDesignVisible (bool is_visible)
 Sets the spatial visibility of this design object and propagates the change through the design hierarchy.
void _setTransform (const Matrix< fltp08 > &transform)
 Sets the 4x4 transform matrix for this design object and propagates the change through the design hierarchy.

Additional Inherited Members

Protected Attributes inherited from DesignInfo
DesignObjectBasem_base = nullptr
 Pointer to the owning DesignObjectBase property database.
uint04 m_design_index = Constant<uint04>::Invalid
 Index of the parent design that owns this object.
uint04 m_index = Constant<uint04>::Invalid
 Row index of this object within the property database.

Detailed Description

A core class that represents a node on model hierarchy.


This node may contain a Geometry or one or more child Models as well as 3 different materials for rendering the Geometry parts.

See also
DesignObject, Geometry, Material, Effect, Scene, DesignObjectLookup

Definition at line 291 of file Model.h.

Member Enumeration Documentation

◆ DescendedFlags

Flags that propagate upward from descendant models to ancestors, indicating aggregate states of the subtree below this model.


Enumerator
e_descendent_selected 

At least one descendant is selected.

e_descendent_focussed 

At least one descendant has focus.

e_descendent_deletion_blocked 

At least one descendant blocks deletion.

Definition at line 346 of file Model.h.

◆ InheritedFlags

Flags that are recursively inherited from ancestor models down through the hierarchy.


These represent visibility, selection, deletion, and other aggregate states.

Enumerator
e_inherited_is_visible 

Whether this model is visible (inherited from ancestors).

e_inherited_has_no_focus 

Whether this model lacks focus (inherited).

e_inherited_is_tree_visible 

Whether this model is visible in the tree view (inherited).

e_inherited_not_selected 

Whether this model is not selected (inherited).

e_placholder 

Reserved placeholder flag.

e_inherited_can_delete 

Whether this model can be deleted (inherited).

e_inherited_does_not_follow_camera 

Whether this model does not follow the camera (inherited).

e_inherited_does_not_orient_to_camera 

Whether this model does not orient to camera (inherited).

e_inherited_does_not_scale_to_camera 

Whether this model does not scale to camera (inherited).

e_inherited_not_deleted 

Whether this model is not deleted (inherited).

e_inherited_not_application_owned 

Whether this model is not application-owned (inherited).

e_inherited_exportable 

Whether this model is exportable (inherited).

Definition at line 326 of file Model.h.

◆ MaterialMode

enum class Model::MaterialMode
strong

Determines how a model resolves its material for rendering.


Enumerator
e_by_parent 

Inherit material from the parent model.

e_by_layer 

Use the material assigned to this model's layer.

e_custom 

Use a custom material assigned directly to this model.

e_hidden 

Model is hidden and not rendered.

Definition at line 297 of file Model.h.

◆ ModelColorMode

enum class Model::ModelColorMode
strong

Determines how the model color is resolved for display purposes.


Enumerator
e_direct 

Use the color set directly on this model.

e_by_selectable_children 

Derive color from selectable children.

e_by_material_root 

Derive color from the root material.

e_by_layer 

Derive color from the assigned layer.

Definition at line 356 of file Model.h.

◆ ParentMatrixFlags

Flags controlling which components of the parent's transformation matrix are applied to this model.


Each flag, when set, causes the corresponding transform component to be ignored or overridden.

Enumerator
e_ignore_offset 

Ignore parent translation.

e_ignore_scale 

Ignore parent scale.

e_ignore_rotation 

Ignore parent rotation.

e_ignore_scale_distortion 

Ignore non-uniform scale distortion from parent.

e_use_only_for_offset 

Use parent transform only for translation (ignore scale and rotation).

e_orient_to_camera 

Orient this model to always face the camera (billboard).

e_follow_camera 

Follow the camera position.

e_scale_to_camera 

Scale relative to camera distance for constant apparent size.

Definition at line 310 of file Model.h.

Constructor & Destructor Documentation

◆ Model() [1/3]

Model::Model ( DesignObjectBase * base)

Constructs a Model from a design object base, using the next available index.


Parameters
[in]baseThe design object base that stores model data.

References DesignObject::base().

◆ Model() [2/3]

Model::Model ( uint04 index,
DesignObjectBase * base )

Constructs a Model at a specific index within the design object base.


Parameters
[in]indexThe row index in the model database.
[in]baseThe design object base that stores model data.

References DesignObject::base(), and DesignObject::index().

◆ Model() [3/3]

Model::Model ( const DesignInfo & obj)
explicit

Constructs a Model from an existing DesignInfo descriptor.


Parameters
[in]objThe design info to reference.

Member Function Documentation

◆ addChild() [1/3]

void Model::addChild ( Model & child)

Adds an existing model as a child of this model.


Parameters
[in]childThe model to add as a child.

References Model().

Referenced by DesignObjectResourceCache::createModel().

◆ addChild() [2/3]

void Model::addChild ( uint04 child_idx,
Model & child )

Adds an existing model as a child at a specific index.


Parameters
[in]child_idxThe child slot index.
[in]childThe model to add.

References Model().

◆ addChild() [3/3]

void Model::addChild ( uint04 child_index)

Adds a child by its database index.


Parameters
[in]child_indexThe database index of the child to add.

◆ addPerVertexColorFromMaterialConstant()

void Model::addPerVertexColorFromMaterialConstant ( UVType constant_index)

Adds per-vertex color data derived from a material constant UV channel.


Parameters
[in]constant_indexThe UV type index to use as color source.

◆ applyTransformToParent()

Matrix< fltp08 > Model::applyTransformToParent ( Matrix< fltp08 > mat,
const Matrix< fltp08 > & parent_mat ) const
nodiscard

Applies a transformation matrix to the parent transform, respecting parent matrix flags.


Parameters
[in]matThe transform matrix to apply.
[in]parent_matThe current parent transform.
Returns
The resulting composed transform matrix.

◆ calculateAverageDirection()

Vector< 3, fltp08 > Model::calculateAverageDirection ( const Matrix< fltp08 > & parent_transform = ConstantMatrixfltp08 > >::Invalid) const
nodiscard

Calculates the average direction vector of descendant linear geometries.


Parameters
[in]parent_transformOptional parent transform (Invalid = use model transform).
Returns
The average direction as a 3D vector.

◆ calculateHVLength()

Vector< 2, fltp08 > Model::calculateHVLength ( const Matrix< fltp08 > & parent_transform = ConstantMatrixfltp08 > >::Invalid) const
nodiscard

Calculates horizontal and vertical length components of descendant linear geometries.


Parameters
[in]parent_transformOptional parent transform (Invalid = use model transform).
Returns
A 2D vector where X is horizontal length and Y is vertical length.

◆ calculateLength()

fltp08 Model::calculateLength ( const Matrix< fltp08 > & transform = ConstantMatrixfltp08 > >::Invalid) const
nodiscard

Calculates the total length of all descendant linear geometries.


Parameters
[in]transformOptional transform to apply before calculation (Invalid = use model transform).
Returns
The calculated total length.

◆ calculateNormals()

void Model::calculateNormals ( NormalMode mode,
Angle< fltp08 > smoothing_angle )

Recalculates normals for all descendant geometries.


Parameters
[in]modeThe normal calculation mode (flat, smooth, etc.).
[in]smoothing_angleThe angle threshold for smooth normal blending.

◆ calculateSmoothTextures()

void Model::calculateSmoothTextures ( Vector< 3, fltp08 > origin,
fltp08 scale )

Calculates smooth texture coordinates based on a projection origin and scale.


Parameters
[in]originThe projection origin.
[in]scaleThe UV scale factor.

References DesignObject::scale().

◆ calculateSurfaceArea()

fltp08 Model::calculateSurfaceArea ( const Matrix< fltp08 > & transform = ConstantMatrixfltp08 > >::Invalid) const
nodiscard

Calculates the surface area of all descendant mesh geometries.


Parameters
[in]transformOptional transform to apply before calculation (Invalid = use model transform).
Returns
The calculated surface area.

◆ calculateTangentSpace()

void Model::calculateTangentSpace ( bool calc_tan,
bool calc_bitan )

Calculates tangent and/or bitangent vectors for all descendant geometries.


Parameters
[in]calc_tanWhether to calculate tangents.
[in]calc_bitanWhether to calculate bitangents.

◆ calculateVolume()

fltp08 Model::calculateVolume ( const Matrix< fltp08 > & transform = ConstantMatrixfltp08 > >::Invalid) const
nodiscard

Calculates the volume of all descendant mesh geometries.


Parameters
[in]transformOptional transform to apply before calculation (Invalid = use model transform).
Returns
The calculated volume.

◆ calculateVolumeAndSurfaceArea()

Vector< 2, fltp08 > Model::calculateVolumeAndSurfaceArea ( const Matrix< fltp08 > & transform = ConstantMatrixfltp08 > >::Invalid,
const void * lock = nullptr ) const
nodiscard

Calculates both volume and surface area in a single pass for efficiency.


Parameters
[in]transformOptional transform to apply before calculation (Invalid = use model transform).
[in]lockOptional lock pointer for thread safety.
Returns
A 2D vector where X is volume and Y is surface area.

◆ canExplode()

bool Model::canExplode ( ) const
nodiscard

Checks whether this model can be exploded into its constituent children.

Returns
True if the model can be exploded.

◆ canInteract()

bool Model::canInteract ( ) const
nodiscard

Checks whether this model can be interacted with (visible, not locked, etc.).

Returns
True if the model is interactable.

◆ centerAlignModel()

Vertex< 3, fltp08 > Model::centerAlignModel ( )

Centers the model geometry at the origin and returns the offset applied.

Returns
The translation offset that was applied.

◆ childBase()

DesignObjectBase * Model::childBase ( ) const
protected

Returns the DesignObjectBase used for child model storage.

Returns
Pointer to the child DesignObjectBase.

◆ childCount()

uint04 Model::childCount ( ) const
nodiscard

Returns the number of direct children this model has.

Returns
The child count.

◆ childToParentReference()

ColumnT< uint04 > & Model::childToParentReference ( ) const
protected

Returns the column mapping child indices to parent indices.

Returns
Reference to the child-to-parent index column.

◆ colorByChannel()

void Model::colorByChannel ( Material & mat,
const StringView & channel,
fltp08 avg = Constantfltp08 >::Invalid ) const

Colors geometry vertices by a data channel value from a material.


Parameters
[in]matThe material containing the color map.
[in]channelThe channel name to read values from.
[in]avgOptional average value for normalization (Invalid = auto-compute).

◆ copyFrom()

void Model::copyFrom ( const Model & model,
bool deep_copy,
bool copy_ids = false,
bool recursive = true,
bool keep_root_properties = false )

Copies data from another model into this model.


Parameters
[in]modelThe source model to copy from.
[in]deep_copyWhether to deep-copy children and associated data.
[in]copy_idsWhether to preserve UUIDs from the source.
[in]recursiveWhether to recursively copy child models.
[in]keep_root_propertiesWhether to preserve this model's own root-level properties.

References Model().

Referenced by TransitIncidentManager::setActiveBus().

◆ copyMaterialProperties()

void Model::copyMaterialProperties ( const Model & model)

Copies material properties from another model to this model.


Parameters
[in]modelThe source model whose material properties to copy.

References Model(), and DesignObject::index().

◆ createChild() [1/2]

◆ createChild() [2/2]

Model Model::createChild ( uint04 child_slot)

Creates a new child model at a specific child slot index.


Parameters
[in]child_slotThe slot index for the new child.
Returns
The newly created child Model.

References Model().

◆ createChildEffect()

Effect Model::createChildEffect ( )

Creates a new child effect attached to this model.

Returns
The newly created Effect.

◆ createChildGeometry()

Geometry Model::createChildGeometry ( )
nodiscard

Creates a new child geometry for this model.

Returns
The newly created Geometry.

Referenced by DesignObjectResourceCache::createGeometry().

◆ createChildMaterial()

Material Model::createChildMaterial ( bool copy_child = false)
nodiscard

Creates a new child material for this model.


Parameters
[in]copy_childWhether to copy existing material properties to the new material.
Returns
The newly created Material.

◆ createChildren()

void Model::createChildren ( uint04 child_size)

Creates multiple children at once.


Parameters
[in]child_sizeThe number of children to create.

Referenced by StreetInfo::StreetInfo(), and DesignObjectResourceCache::createChildren().

◆ createSceneEffect()

Effect Model::createSceneEffect ( ) const
nodiscard

Creates a new effect in the scene database.

Returns
The newly created Effect.

◆ createSceneGeometry()

Geometry Model::createSceneGeometry ( ) const
nodiscard

Creates a new geometry in the scene database.

Returns
The newly created Geometry.

◆ createSceneLayer()

Model Model::createSceneLayer ( ) const
nodiscard

Creates a new layer model in the scene database.

Returns
The newly created layer Model.

References Model().

◆ createSceneMaterial()

Material Model::createSceneMaterial ( ) const
nodiscard

Creates a new material in the scene database.

Returns
The newly created Material.

◆ createSceneModel()

Model Model::createSceneModel ( ) const

Creates a new model in the scene database associated with this model.

Returns
The newly created scene Model.

References Model().

◆ customModelColor()

RGBColor Model::customModelColor ( ModelColorMode mode) const
nodiscard

Returns the resolved model color based on the specified color mode.


Parameters
[in]modeThe color resolution strategy to use.
Returns
The resolved RGB color.

◆ deleteModel()

void Model::deleteModel ( bool deletchildren,
bool removfrom_parent = true )

Deletes this model from the scene.


Parameters
[in]deletchildrenWhether to also delete all child models.
[in]removfrom_parentWhether to remove this model from its parent's child list.

◆ descendedFlagsNoCache()

BitFlag Model::descendedFlagsNoCache ( bool complete_cache_ignore) const
nodiscard

Computes descended flags without using the cache.


Parameters
[in]complete_cache_ignoreIf true, ignores all cached values in the entire hierarchy.
Returns
A BitFlag of descended flags (uncached).

◆ descendedPersonalFlagsNoCache()

BitFlag Model::descendedPersonalFlagsNoCache ( ) const
nodiscard

Computes descended personal flags without using the cache.

Returns
A BitFlag of personal descended flags (uncached).

◆ descendentGeometryTypes()

void Model::descendentGeometryTypes ( Set< GeometryType > & buffer) const

Collects all unique geometry types from descendants into the provided set.


Parameters
[in]bufferThe set to populate with geometry types.

◆ directLayer()

Model Model::directLayer ( ) const
nodiscard

Returns the directly assigned layer model.

Returns
The direct layer Model.

References Model().

Referenced by SetLayerCommand::execute().

◆ displayName()

TranslatedString Model::displayName ( ) const
nodiscard

Returns the translated display name for this model.

Returns
The display name as a TranslatedString.

Referenced by BuildActionProgramLogic::createButton().

◆ displayNamePath()

TranslatedString Model::displayNamePath ( const StringView & seperator = ":") const
nodiscard

Returns the full display name path from root to this model.


Parameters
[in]seperatorThe separator string between path segments (default ":").
Returns
The full path as a TranslatedString.

◆ doesModelPropertyContain() [1/2]

bool Model::doesModelPropertyContain ( NDPN property,
const char * value,
bool ignorcase ) const
inlinenodiscard

Checks whether a model property contains a given C-string substring.


Parameters
[in]propertyThe NDPN property to search within.
[in]valueThe C-string substring to search for.
[in]ignorcaseWhether the search should be case-insensitive.
Returns
True if the property value contains the substring.

Definition at line 493 of file Model.h.

References DesignInfo::m_base, and DesignInfo::m_design_index.

◆ doesModelPropertyContain() [2/2]

template<class t_type>
bool Model::doesModelPropertyContain ( NDPN property,
const StringView & value,
bool ignorcase ) const
inlinenodiscard

Checks whether a model property contains a given substring.


Parameters
[in]propertyThe NDPN property to search within.
[in]valueThe substring to search for.
[in]ignorcaseWhether the search should be case-insensitive.
Returns
True if the property value contains the substring.

Definition at line 481 of file Model.h.

References DesignInfo::m_base, and DesignInfo::m_design_index.

◆ ensureTangentSpace()

void Model::ensureTangentSpace ( bool ensure_tan,
bool ensure_bitan )

Ensures that tangent and/or bitangent data exists, calculating if needed.


Parameters
[in]ensure_tanWhether to ensure tangent data exists.
[in]ensure_bitanWhether to ensure bitangent data exists.

◆ ensureVisibleChildren()

void Model::ensureVisibleChildren ( uint04 count)

Hides children whos child index is greater than size, or creates/shows children if needed such that there is exactly a given number of visible children for this model.


This method is optimized for visuals where the number of children is constantly changing.

Parameters
countThe number of visible children this model should have.

◆ explodeModel()

ModelBuffer Model::explodeModel ( )

Explodes this model, promoting its children to siblings in the parent.


Returns
A buffer of the resulting models after explosion.

◆ exportIgnored()

bool Model::exportIgnored ( ) const
nodiscard

Checks whether this model is excluded from export operations.

Returns
True if export is ignored for this model.

Referenced by FactoryModelFilters::FilterGeometryModels(), FactoryModelFilters::FilterGeometryModels(), FactoryModelFilters::FilterTypeModels(), FactoryModelFilters::FilterTypeModels(), and FactoryModelFilters::FilterTypeModels().

◆ findDescendentByName()

Model Model::findDescendentByName ( const StringView & name) const
nodiscard

Recursively searches descendants for a model with the given name.


Parameters
[in]nameThe name to search for.
Returns
The first matching descendant Model, or an invalid Model if not found.

References Model().

◆ findDescendentByType()

Model Model::findDescendentByType ( const StringView & type) const
nodiscard

Recursively searches descendants for a model with the given type.


Parameters
[in]typeThe type identifier to search for.
Returns
The first matching descendant Model, or an invalid Model if not found.

References Model().

◆ geometryBase()

DesignObjectBase * Model::geometryBase ( ) const
protected

Returns the DesignObjectBase used for geometry storage.

Returns
Pointer to the geometry DesignObjectBase.

◆ getAscModifiedTime()

Time Model::getAscModifiedTime ( bool include_self,
bool include_layer = true ) const
nodiscard

Returns the greatest modified time of this model and all ancestors.


Parameters
[in]include_selfWhether to include this model's own modified time.
[in]include_layerWhether to include the layer's modified time.
Returns
The most recent modified Time.

◆ getBounds()

Bounds< 3, fltp08 > Model::getBounds ( ) const
nodiscard

Returns the local bounding box of this model.

Returns
The local-space axis-aligned bounding box.

◆ getBoundsOfVisible()

Bounds< 3, fltp08 > Model::getBoundsOfVisible ( ) const
nodiscard

Returns the bounding box of all visible descendants.

Returns
The axis-aligned bounding box of visible content.

Referenced by GravityIntersection::FindGravityPoints().

◆ getChild() [1/2]

Model Model::getChild ( uint04 child) const
nodiscard

Returns the child model at the given child slot index.


Parameters
[in]childThe child slot index.
Returns
The child Model at that index.

References Model().

Referenced by MadgwickSimulator::referenceModel(), MadgwickSimulator::referenceTransformModel(), StreetInfo::speedLimit(), StreetInfo::streetName(), StreetInfo::surfaceCondition(), and StreetInfo::surfaceType().

◆ getChild() [2/2]

Model Model::getChild ( UUID id) const
nodiscard

Returns the child model with the specified UUID.


Parameters
[in]idThe UUID to search for among children.
Returns
The matching child Model.

References Model().

◆ getChildIndex() [1/2]

uint04 Model::getChildIndex ( ) const
nodiscard

Returns this model's index within its parent's child list.

Returns
The child index.

◆ getChildIndex() [2/2]

uint04 Model::getChildIndex ( uint04 child) const
nodiscard

Returns the database index of the child at the given slot.


Parameters
[in]childThe child slot index.
Returns
The database index of the child.

Referenced by BuildActionProgramLogic::executeMenuItems().

◆ getChildIndices()

Buffer< uint04 > Model::getChildIndices ( ) const
nodiscard

Returns the database indices of all direct children.

Returns
A buffer of child indices.

◆ getChildLayerIndex()

uint04 Model::getChildLayerIndex ( ) const
nodiscard

Returns this model's index within its parent's layer child list.

Returns
The child layer index.

◆ getChildren() [1/2]

ModelBuffer Model::getChildren ( ) const
nodiscard

Returns a buffer containing all direct children of this model.

Returns
A ModelBuffer of direct children.

Referenced by FactoryModelFilters::FilterGeometryModels(), and FactoryModelFilters::FilterGeometryModels().

◆ getChildren() [2/2]

void Model::getChildren ( ModelBuffer & children) const

Appends all direct children of this model to the provided buffer.


Parameters
[in]childrenThe buffer to populate with children.

◆ getChildrenByName()

ModelBuffer Model::getChildrenByName ( const StringView & name) const
nodiscard

Returns all direct children whose name matches the given string.


Parameters
[in]nameThe name to filter by.
Returns
A ModelBuffer of matching children.

◆ getChildrenByType() [1/2]

ModelBuffer Model::getChildrenByType ( const Buffer< String > & type) const
nodiscard

Returns all direct children whose type matches any of the given strings.


Parameters
[in]typeA buffer of type identifiers to filter by.
Returns
A ModelBuffer of matching children.

◆ getChildrenByType() [2/2]

ModelBuffer Model::getChildrenByType ( const StringView & type) const
nodiscard

Returns all direct children whose type matches the given string.


Parameters
[in]typeThe type identifier to filter by.
Returns
A ModelBuffer of matching children.

Referenced by getTypeChildren(), and CustomerDevice::passwords().

◆ getChildrenIDs()

Buffer< UUID > Model::getChildrenIDs ( ) const
nodiscard

Returns the UUIDs of all direct children.

Returns
A buffer of child UUIDs.

◆ getClippingGeometry()

PrimitiveAlignedBuffer< std::pair< Model, Geometry >, 32 > Model::getClippingGeometry ( ) const
nodiscard

Returns model-geometry pairs used for clipping operations.

Returns
An aligned buffer of Model-Geometry pairs.

◆ getCompleteTransform()

Matrix< fltp08 > Model::getCompleteTransform ( ) const
nodiscard

Returns the fully composed local-to-global transform matrix for this model.

Returns
The complete transformation matrix.

Referenced by GravityIntersection::FindGravityPoints().

◆ getDescendants() [1/2]

ModelBuffer Model::getDescendants ( bool include_deleted = false,
bool local_only = false ) const
nodiscard

Returns all descendant models recursively.


Parameters
[in]include_deletedWhether to include deleted descendants.
[in]local_onlyWhether to restrict to the local database only.
Returns
A ModelBuffer of all descendants.

◆ getDescendants() [2/2]

void Model::getDescendants ( ModelBuffer & buffer,
bool include_deleted = false,
bool local_only = false ) const

Appends all descendant models recursively to the provided buffer.


Parameters
[in]bufferThe buffer to populate.
[in]include_deletedWhether to include deleted descendants.
[in]local_onlyWhether to restrict to the local database only.

◆ getDescendantsByName()

ModelBuffer Model::getDescendantsByName ( const StringView & name,
uint04 max_count = Constantuint04 >::Max ) const
nodiscard

Recursively searches all descendants for models matching the given name.


Parameters
[in]nameThe name to search for.
[in]max_countMaximum number of results to return.
Returns
A ModelBuffer of matching descendants.

◆ getDescendantsByNameAndType()

ModelBuffer Model::getDescendantsByNameAndType ( const StringView & name,
const StringView & type,
uint04 max_count = Constantuint04 >::Max ) const
nodiscard

Recursively searches all descendants for models matching both name and type.


Parameters
[in]nameThe name to search for.
[in]typeThe type identifier to filter by.
[in]max_countMaximum number of results to return.
Returns
A ModelBuffer of matching descendants.

◆ getDescendantsByType()

ModelBuffer Model::getDescendantsByType ( const StringView & type,
uint04 max_count = Constantuint04 >::Max ) const
nodiscard

Recursively searches all descendants for models matching the given type.


Parameters
[in]typeThe type identifier to filter by.
[in]max_countMaximum number of results to return.
Returns
A ModelBuffer of matching descendants.

Referenced by FactoryModelFilters::FilterTypeModels(), FactoryModelFilters::FilterTypeModels(), getTypeDescendants(), and ModelTileTable::setTarget().

◆ getDescModifiedTime()

Time Model::getDescModifiedTime ( bool includself) const
nodiscard

Returns the greatest modified time of this model and all descendants.


Parameters
[in]includselfWhether to include this model's own modified time.
Returns
The most recent modified Time.

◆ getDirectLayerIndex()

uint04 Model::getDirectLayerIndex ( ) const
nodiscard

Returns the database index of the directly assigned layer.

Returns
The layer's database index.

◆ getEffect()

Effect Model::getEffect ( uint04 index = 0) const
nodiscard

Returns the effect at the specified child index.


Parameters
[in]indexThe child effect index (default 0).
Returns
The Effect at that index.

References DesignObject::index().

◆ getEffectChildren()

EffectBuffer Model::getEffectChildren ( ) const
nodiscard

Returns all direct child effects of this model.

Returns
An EffectBuffer of child effects.

◆ getEffectDescendants()

EffectBuffer Model::getEffectDescendants ( ) const
nodiscard

Returns all descendant effects recursively.

Returns
An EffectBuffer of descendant effects.

◆ getEffectIndex()

uint04 Model::getEffectIndex ( uint04 child_index = 0) const
nodiscard

Returns the database index of the effect at the given child slot.


Parameters
[in]child_indexThe child slot index (default 0).
Returns
The database index of the effect.

◆ getFamilyMember()

Model Model::getFamilyMember ( uint04 index) const
nodiscard

Returns a model from the family tree (ancestors + descendants) by flat index.


Parameters
[in]indexThe flat index into the family tree.
Returns
The Model at that index. [NOTE: The exact indexing scheme for this function is unclear from the declaration alone.]

References Model(), and DesignObject::index().

◆ getGeometry()

Geometry Model::getGeometry ( ) const
nodiscard

Returns the geometry attached to this model.

Returns
The Geometry object.

◆ getGeometryDescendants()

GeometryBuffer Model::getGeometryDescendants ( bool remove_redundant = true,
uint04 max_count = Constantuint04 >::Max ) const
nodiscard

Recursively collects all descendant geometries.


Parameters
[in]remove_redundantWhether to remove duplicate geometry references.
[in]max_countMaximum number of geometries to collect.
Returns
A GeometryBuffer of descendant geometries.

◆ getGeometryIndex()

uint04 Model::getGeometryIndex ( ) const
nodiscard

Returns the database index of the geometry associated with this model.

Returns
The geometry database index.

◆ getLayer()

Model Model::getLayer ( ) const
nodiscard

Returns the layer model assigned to this model (direct or inherited).

Returns
The layer Model.

References Model().

Referenced by VisibleCommand::execute().

◆ getMaterial()

Material Model::getMaterial ( ) const
nodiscard

Returns the material assigned to this model.

Returns
The Material object.

◆ getMaterialDescendants() [1/3]

MaterialBuffer Model::getMaterialDescendants ( bool local_only = false) const
nodiscard

Recursively collects all descendant materials.


Parameters
[in]local_onlyWhether to restrict to the local database only.
Returns
A MaterialBuffer of descendant materials.

◆ getMaterialDescendants() [2/3]

void Model::getMaterialDescendants ( MaterialBuffer & materials,
bool local_only = false ) const

Appends all descendant materials to the provided buffer.


Parameters
[in]materialsThe buffer to populate.
[in]local_onlyWhether to restrict to the local database only.

◆ getMaterialDescendants() [3/3]

void Model::getMaterialDescendants ( Set< Material > & materials,
bool local_only = false ) const

Appends all descendant materials to the provided set (deduplicating).


Parameters
[in]materialsThe set to populate.
[in]local_onlyWhether to restrict to the local database only.

◆ getMaterialDescendantsByName()

MaterialBuffer Model::getMaterialDescendantsByName ( const StringView & name,
uint04 max_count = Constantuint04 >::Max ) const
nodiscard

Returns descendant materials filtered by name.


Parameters
[in]nameThe name to search for.
[in]max_countMaximum number of results.
Returns
A MaterialBuffer of matching materials.

◆ getMaterialIdx()

uint04 Model::getMaterialIdx ( ) const
nodiscard

Returns the database index of the material assigned to this model.

Returns
The material database index.

◆ getMaterialMode()

MaterialMode Model::getMaterialMode ( ) const
nodiscard

Returns the material mode determining how materials are resolved for this model.

Returns
The current MaterialMode.

◆ getModelIcon()

StringView Model::getModelIcon ( ) const
nodiscard

Returns the icon identifier string for this model's type.

Returns
A StringView of the icon name.

◆ getNumOfEffects()

uint04 Model::getNumOfEffects ( ) const
nodiscard

Returns the number of effects attached to this model.

Returns
The effect count.

◆ getParent()

Model Model::getParent ( ) const
nodiscard

Returns the parent model of this model.

Returns
The parent Model, or an invalid Model if this is a root.

References Model().

Referenced by BuildActionProgramLogic::addMenuItems(), VisibleCommand::execute(), BuildActionProgramLogic::executeMenuItems(), ModelTileTable::init(), and DesignObjectResourceCache::setModelToDefaults().

◆ getParentIndex()

uint04 Model::getParentIndex ( ) const
nodiscard

Returns the database index of this model's parent.

Returns
The parent's database index.

◆ getParentTransform()

Matrix< fltp08 > Model::getParentTransform ( ) const
nodiscard

Returns the parent's transformation matrix as seen by this model.

Returns
The parent transformation matrix.

◆ getRoot()

Model Model::getRoot ( ) const
nodiscard

Returns the root ancestor of this model's hierarchy.

Returns
The root Model.

References Model().

◆ getRootMaterial()

Material Model::getRootMaterial ( ) const
nodiscard

Returns the root material resolved through the hierarchy.

Returns
The root Material.

◆ getRootMaterialModel()

Model Model::getRootMaterialModel ( )
nodiscard

Returns the ancestor model that determines the root material for this model.

Returns
The root material Model.

References Model().

Referenced by parentBase().

◆ getSceneEffect()

Effect Model::getSceneEffect ( UUID id) const
nodiscard

Returns a scene effect by its UUID.


Parameters
[in]idThe UUID of the effect.
Returns
The matching Effect.

◆ getSceneEffects()

EffectBuffer Model::getSceneEffects ( ) const
nodiscard

Returns all effects in the scene database.

Returns
An EffectBuffer of scene effects.

◆ getSceneGeometries()

GeometryBuffer Model::getSceneGeometries ( ) const
nodiscard

Returns all geometries in the scene database.

Returns
A GeometryBuffer of scene geometries.

◆ getSceneGeometry() [1/2]

Geometry Model::getSceneGeometry ( uint04 index) const
nodiscard

Returns a scene geometry by database index.


Parameters
[in]indexThe database index of the geometry.
Returns
The Geometry object.

References DesignObject::index().

◆ getSceneGeometry() [2/2]

Geometry Model::getSceneGeometry ( UUID id) const
nodiscard

Returns a scene geometry by UUID.


Parameters
[in]idThe UUID of the geometry.
Returns
The Geometry object.

◆ getSceneLayer()

Model Model::getSceneLayer ( UUID id) const
nodiscard

Returns a scene layer by its UUID.


Parameters
[in]idThe UUID of the layer.
Returns
The matching layer Model.

References Model().

◆ getSceneLayers()

ModelBuffer Model::getSceneLayers ( bool include_deleted = false) const
nodiscard

Returns all layer models in the scene.


Parameters
[in]include_deletedWhether to include deleted layers.
Returns
A ModelBuffer of scene layers.

◆ getSceneMaterial() [1/2]

Material Model::getSceneMaterial ( uint04 index) const
nodiscard

Returns a scene material by database index.


Parameters
[in]indexThe database index of the material.
Returns
The Material object.

References DesignObject::index().

◆ getSceneMaterial() [2/2]

Material Model::getSceneMaterial ( UUID id) const
nodiscard

Returns a scene material by UUID.


Parameters
[in]idThe UUID of the material.
Returns
The Material object.

◆ getSceneMaterials()

MaterialBuffer Model::getSceneMaterials ( ) const
nodiscard

Returns all materials in the scene database.

Returns
A MaterialBuffer of scene materials.

◆ getSceneModel()

Model Model::getSceneModel ( UUID id) const

Retrieves a scene model by its UUID.


Parameters
[in]idThe UUID of the scene model to find.
Returns
The matching scene Model.

References Model().

◆ getSceneModels()

ModelBuffer Model::getSceneModels ( bool include_deleted = false,
bool local_only = false ) const
nodiscard

Returns all models in the scene database.


Parameters
[in]include_deletedWhether to include deleted models.
[in]local_onlyWhether to restrict to the local database only.
Returns
A ModelBuffer of scene models.

◆ getSceneModelsByName()

ModelBuffer Model::getSceneModelsByName ( const StringView & name,
uint04 max_count = Constantuint04 >::Max,
bool includdeleted = false ) const
nodiscard

Returns scene models filtered by name.


Parameters
[in]nameThe name to filter by.
[in]max_countMaximum number of results.
[in]includdeletedWhether to include deleted models.
Returns
A ModelBuffer of matching scene models.

◆ getSceneModelsByType()

ModelBuffer Model::getSceneModelsByType ( const StringView & type,
uint04 max_count = Constantuint04 >::Max,
bool includdeleted = false ) const
nodiscard

Returns scene models filtered by type.


Parameters
[in]typeThe type identifier to filter by.
[in]max_countMaximum number of results.
[in]includdeletedWhether to include deleted models.
Returns
A ModelBuffer of matching scene models.

◆ getSelectionBounds()

Bounds< 3, fltp08 > Model::getSelectionBounds ( ) const
nodiscard

Returns the selection-specific bounding box in local space.

Returns
The selection bounding box.

◆ getTypeChildren()

template<class t_type>
Buffer< t_type > Model::getTypeChildren ( const StringView & type) const
inlinenodiscard

Returns children of a specific type, cast to the requested derived type.


Parameters
[in]typeThe type identifier to filter by.
Returns
A typed buffer of matching children.

Definition at line 770 of file Model.h.

References Buffer< t_type, t_memory_manager >::add(), getChildrenByType(), and type.

Referenced by Customer::addresses(), Customer::jobs(), and Customer::phoneNumbers().

◆ getTypeDescendants()

template<class t_type>
Buffer< t_type > Model::getTypeDescendants ( const StringView & type) const
inlinenodiscard

Recursively searches descendants for models of a specific type, cast to a derived type.


Parameters
[in]typeThe type identifier to filter by.
Returns
A typed buffer of matching descendants.

Definition at line 802 of file Model.h.

References Buffer< t_type, t_memory_manager >::add(), getDescendantsByType(), and type.

Referenced by FactoryModelFilters::FilterTypeModels().

◆ globalBounds()

Bounds< 3, fltp08 > Model::globalBounds ( ) const
nodiscard

Returns the global bounding box of this model (including transform).

Returns
The world-space axis-aligned bounding box.

◆ globalCenterOfRotation()

Vertex< 3, fltp08 > Model::globalCenterOfRotation ( ) const
nodiscard

Returns the center of rotation in global coordinates.

Returns
The center of rotation as a 3D vertex.

◆ globalSelectionBounds()

Bounds< 3, fltp08 > Model::globalSelectionBounds ( ) const
nodiscard

Returns the global selection bounding box.

Returns
The world-space selection bounding box.

◆ hasChild()

bool Model::hasChild ( uint04 child_index = 0U) const
nodiscard

Checks whether this model has a child at the given slot.


Parameters
[in]child_indexThe child slot to check (default 0).
Returns
True if a valid child exists at that slot.

◆ hasDescendants()

void Model::hasDescendants ( bool & has_point,
bool & has_line,
bool & has_mesh,
bool only_user_objects ) const

Checks which types of geometry primitives exist among descendants.


Parameters
[out]has_pointSet to true if point geometry exists.
[out]has_lineSet to true if line geometry exists.
[out]has_meshSet to true if mesh geometry exists.
[in]only_user_objectsWhether to restrict to user-created objects only.

◆ hasDescendent() [1/2]

bool Model::hasDescendent ( const Model & model) const
nodiscard

Checks whether a given model is a descendant of this model.


Parameters
[in]modelThe model to search for.
Returns
True if the model is found in the descendant tree.

References Model().

◆ hasDescendent() [2/2]

bool Model::hasDescendent ( const UUID & id) const
nodiscard

Checks whether a model with the given UUID is a descendant of this model.


Parameters
[in]idThe UUID to search for.
Returns
True if a descendant with that UUID exists.

◆ hasDirectLayer()

bool Model::hasDirectLayer ( ) const
nodiscard

Checks whether this model has a directly assigned layer (not inherited).

Returns
True if a direct layer assignment exists.

Referenced by VisibleCommand::execute().

◆ hasEffect()

bool Model::hasEffect ( uint04 index = 0) const
nodiscard

Checks whether an effect exists at the given child index.


Parameters
[in]indexThe effect index to check (default 0).
Returns
True if an effect exists at that index.

References DesignObject::index().

◆ hasFocus()

bool Model::hasFocus ( ) const
nodiscard

Checks whether this model currently has focus.

Returns
True if the model has focus.

◆ hasGeometryDescendent()

bool Model::hasGeometryDescendent ( ) const
nodiscard

Checks whether any descendant has geometry data.

Returns
True if a geometry descendant exists.

◆ hasHoles()

bool Model::hasHoles ( PrimitiveProperty property) const
nodiscard

Checks whether the geometry has holes (missing primitives) for a given property.


Parameters
[in]propertyThe primitive property to check for holes.
Returns
True if holes exist.

◆ hasLayer()

bool Model::hasLayer ( ) const
nodiscard

Checks whether this model has a layer (directly or inherited).

Returns
True if a layer is assigned.

◆ hasLayerRootMaterial()

bool Model::hasLayerRootMaterial ( ) const
nodiscard

Checks whether a root material exists through the layer hierarchy.

Returns
True if a layer root material exists.

◆ hasLinearDescendent()

bool Model::hasLinearDescendent ( ) const
nodiscard

Checks whether any descendant has linear (line/polyline) geometry.

Returns
True if a linear descendant exists.

◆ hasMaterial()

bool Model::hasMaterial ( ) const
nodiscard

Checks whether this model has a material assigned.

Returns
True if a material is assigned.

◆ hasMeshDescendent()

bool Model::hasMeshDescendent ( ) const
nodiscard

Checks whether any descendant has mesh (triangle) geometry.

Returns
True if a mesh descendant exists.

◆ hasPointsDescendent()

bool Model::hasPointsDescendent ( ) const
nodiscard

Checks whether any descendant has point geometry.

Returns
True if a point descendant exists.

◆ hasRootMaterial()

bool Model::hasRootMaterial ( ) const
nodiscard

Checks whether a root material can be resolved through the hierarchy.

Returns
True if a root material exists.

◆ hasSelectedDescendent()

bool Model::hasSelectedDescendent ( ) const
nodiscard

Checks whether any descendant of this model is selected.

Returns
True if at least one descendant is selected.

◆ inheritedFlags()

Vector< 32, bool > Model::inheritedFlags ( ) const
nodiscard

Returns the cached inherited flags vector for this model.

Returns
A 32-bit boolean vector of inherited flags.

◆ inheritedFlagsNoCache()

Vector< 32, bool > Model::inheritedFlagsNoCache ( bool complete_cache_ignore) const
nodiscard

Computes inherited flags without using the cache.


Parameters
[in]complete_cache_ignoreIf true, ignores all cached values in the entire hierarchy.
Returns
A 32-bit boolean vector of inherited flags (uncached).

◆ inheritedPersonalFlagsNoCache()

Vector< 32, bool > Model::inheritedPersonalFlagsNoCache ( ) const
nodiscard

Computes inherited personal flags without using the cache.

Returns
A 32-bit boolean vector of personal inherited flags (uncached).

◆ isApplicationOwned()

bool Model::isApplicationOwned ( ) const
nodiscard

Checks whether this model is owned by the application (not user-created).

Returns
True if application-owned.

Referenced by FactoryModelFilters::FilterGeometryModels(), and FactoryModelFilters::FilterGeometryModels().

◆ isDeleted()

bool Model::isDeleted ( ) const
nodiscard

Checks whether this model has been deleted.

Returns
True if the model is deleted.

◆ isLayer()

bool Model::isLayer ( ) const
nodiscard

Checks whether this model is a layer definition.

Returns
True if this model is a layer.

◆ isLocked()

bool Model::isLocked ( ) const
nodiscard

Checks whether this model is locked against editing.

Returns
True if the model is locked.

◆ isScene()

bool Model::isScene ( ) const
nodiscard

Checks whether this model represents a scene root node.

Returns
True if this model is a scene.

◆ isSelected()

bool Model::isSelected ( ) const
nodiscard

Checks whether this model is currently selected.

Returns
True if the model is selected.

◆ isTreeVisible()

bool Model::isTreeVisible ( ) const
nodiscard

Checks whether this model is visible in the model tree view.

Returns
True if tree-visible.

◆ isType()

template<class t_buffer_type>
bool Model::isType ( const Buffer< t_buffer_type > & types) const
inlinenodiscard

Checks whether the model's type matches any type in the given buffer.


Parameters
[in]typesA buffer of type identifiers to check against.
Returns
True if this model's type matches any entry in the buffer.

Definition at line 510 of file Model.h.

References DesignObject::is().

◆ isVisible()

bool Model::isVisible ( ) const
nodiscard

Checks whether this model is visible (accounting for inherited visibility).

Returns
True if the model is visible.

Referenced by VulkanRenderObject::ModelProperties::ModelProperties(), and VisibleCommand::execute().

◆ materialBase()

DesignObjectBase * Model::materialBase ( ) const
protected

Returns the DesignObjectBase used for material storage.

Returns
Pointer to the material DesignObjectBase.

◆ overrideMaterialDescendants()

void Model::overrideMaterialDescendants ( MaterialMode override_desc)

Overrides material mode for all descendants.


Parameters
[in]override_descThe MaterialMode to apply to all descendants.

◆ parentBase()

DesignObjectBase * Model::parentBase ( ) const
protected

Returns the DesignObjectBase used for parent model storage.

Returns
Pointer to the parent DesignObjectBase.

References Model(), and getRootMaterialModel().

◆ parentMatrixFlags()

BitFlag Model::parentMatrixFlags ( ) const
nodiscard

Returns the parent matrix flags for this model.

Returns
The BitFlag containing all parent matrix flags.

◆ parentToChildReference()

ColumnT< Buffer< uint04 > > & Model::parentToChildReference ( ) const
protected

Returns the column mapping parent indices to child index lists.

Returns
Reference to the parent-to-child index buffer column.

◆ personalDescendedFlags()

BitFlag Model::personalDescendedFlags ( ) const
nodiscard

Returns the cached personal descended flags.

Returns
A BitFlag of personal descended flags.

◆ personalInheritedFlags()

Vector< 32, bool > Model::personalInheritedFlags ( ) const
nodiscard

Returns the personal inherited flags from the cache.

Returns
A 32-bit boolean vector of personal inherited flags.

◆ ReduceToRoots()

ModelBuffer Model::ReduceToRoots ( const ModelBuffer & children,
const std::function< bool(const Model &, const Set< Model > &)> & filter )
static

Reduces a collection of models to only root-level models (removing any that are descendants of others in the set), filtered by a user-provided predicate.


Parameters
[in]childrenThe full set of models to reduce.
[in]filterA predicate function that returns true if a model should be kept, given the model and the full set.
Returns
A ModelBuffer containing only root-level models that pass the filter.

References Model().

Referenced by FactoryModelFilters::FilterGeometryModels(), and FactoryModelFilters::FilterGeometryModels().

◆ removeChild()

void Model::removeChild ( const Model & model)

Removes a specific child model from this model's child list.


Parameters
[in]modelThe child model to remove.

References Model().

Referenced by DesignObjectResourceCache::setModelToDefaults().

◆ removeDuplicateVertices()

void Model::removeDuplicateVertices ( fltp08 epsilon,
void * lock,
InfoPipe * log = nullptr )

Removes duplicate vertices from all descendant geometries.


Parameters
[in]epsilonThe distance threshold for considering vertices as duplicates.
[in]lockLock pointer for thread safety.
[in]logOptional info pipe for progress logging.

◆ restoreModel()

void Model::restoreModel ( Model & parent,
uint04 index = Constantuint04 >::Invalid )

Restores a previously deleted model under a specific parent.


Parameters
[in]parentThe parent model to restore under.
[in]indexThe child slot index to restore into (Invalid for append).

References Model(), and DesignObject::index().

◆ setChildApplicationConstructed() [1/2]

void Model::setChildApplicationConstructed ( const StringView & database_name = StringView())

Sets the child database to an application-constructed database by name.


Parameters
[in]database_nameThe name of the database to use.

◆ setChildApplicationConstructed() [2/2]

void Model::setChildApplicationConstructed ( DesignObjectBase * base)

Sets the child database to use an application-constructed DesignObjectBase.


Parameters
[in]baseThe DesignObjectBase to use for child storage.

References DesignObject::base().

◆ setChildEffectSize()

void Model::setChildEffectSize ( uint04 child_size)

Sets the number of child effect slots for this model.


Parameters
[in]child_sizeThe number of effect slots.

◆ setChildIndex()

void Model::setChildIndex ( uint04 child,
uint04 id )

Sets the database index for a specific child slot.


Parameters
[in]childThe child slot position.
[in]idThe database index to assign to that slot.

◆ setEffectIndex()

void Model::setEffectIndex ( uint04 material_index,
uint04 sub_index = 0 )

Sets the effect database index at a given sub-index.


Parameters
[in]material_indexThe effect database index to assign.
[in]sub_indexThe effect slot (default 0).

◆ setGeometryApplicationConstructed()

void Model::setGeometryApplicationConstructed ( const StringView & database_name = StringView())

Sets the geometry database to an application-constructed database by name.


Parameters
[in]database_nameThe name of the database to use.

◆ setGeometryChild()

void Model::setGeometryChild ( Geometry & geo)

Sets the geometry child of this model to an existing Geometry object.


Parameters
[in]geoThe geometry to attach.

Referenced by DesignObjectResourceCache::createGeometry().

◆ setGeometryIndex()

void Model::setGeometryIndex ( uint04 geo_index)

Sets the geometry database index for this model.


Parameters
[in]geo_indexThe geometry database index.

◆ setIsLayer()

void Model::setIsLayer ( bool is_layer)

Marks or unmarks this model as a layer definition.


Parameters
[in]is_layerWhether this model should be a layer.

◆ setLayer()

void Model::setLayer ( Model layer)

Assigns this model to a specific layer.


Parameters
[in]layerThe layer model to assign.

References Model().

Referenced by SetLayerCommand::execute().

◆ setMaterial()

void Model::setMaterial ( const Material & material)

Assigns a material to this model.


Parameters
[in]materialThe material to assign.

◆ setMaterialApplicationConstructed()

void Model::setMaterialApplicationConstructed ( const StringView & database_name = StringView())

Sets the material database to an application-constructed database by name.


Parameters
[in]database_nameThe name of the database to use.

◆ setMaterialMode()

void Model::setMaterialMode ( MaterialMode option)

Sets the material mode for this model.


Parameters
[in]optionThe MaterialMode to set.

◆ setModelTransform()

void Model::setModelTransform ( const Matrix< fltp08 > & transform)

Sets the model's local transformation matrix, replacing the current one.


Parameters
[in]transformThe new transformation matrix.

◆ setModelVisible()

bool Model::setModelVisible ( bool is_visible)

Sets the visibility of this model.


Parameters
[in]is_visibleWhether the model should be visible.
Returns
True if the visibility state actually changed.

◆ setNormalMode()

void Model::setNormalMode ( NormalMode mode,
Angle< fltp08 > smoothing_angle,
InfoPipe * log )

Sets the normal mode and recalculates normals with progress logging.


Parameters
[in]modeThe normal calculation mode.
[in]smoothing_angleThe angle threshold for smooth normal blending.
[in]logInfo pipe for progress output.

◆ setOrientation() [1/2]

void Model::setOrientation ( const Vector< 3, Angle< fltp08 > > & new_orientation,
const void * lock = nullptr )

Sets the orientation of this model using floating-point angles.


Parameters
[in]new_orientationThe new orientation as Euler angles (X, Y, Z).
[in]lockOptional lock pointer for thread safety.

◆ setOrientation() [2/2]

void Model::setOrientation ( const Vector< 3, Angle< sint04 > > & new_orientation,
const void * lock = nullptr )

Sets the orientation of this model using integer-precision angles.


Parameters
[in]new_orientationThe new orientation as Euler angles (X, Y, Z).
[in]lockOptional lock pointer for thread safety.

◆ setParentMatrixFlag()

void Model::setParentMatrixFlag ( ParentMatrixFlags flag,
bool value )

Sets or clears a specific parent matrix flag.


Parameters
[in]flagThe flag to modify.
[in]valueWhether to set (true) or clear (false) the flag.

◆ setParentMatrixFlags()

void Model::setParentMatrixFlags ( BitFlag flags)

Sets the parent matrix flags controlling which parent transform components to inherit.


Parameters
[in]flagsThe BitFlag value to set.

◆ setSize()

void Model::setSize ( const Vector< 3, fltp08 > & size)

Sets the model size by scaling its transform to match the desired dimensions.


Parameters
[in]sizeThe desired width, height, and depth.

References size().

◆ setWindingMode()

void Model::setWindingMode ( WindingMode mode)

Sets the winding mode for all descendant geometries.


Parameters
[in]modeThe winding mode (clockwise, counter-clockwise, etc.).

◆ size()

◆ swapChildren()

void Model::swapChildren ( uint04 a,
uint04 b )

Swaps the positions of two children in the child list.


Parameters
[in]aIndex of the first child to swap.
[in]bIndex of the second child to swap.

◆ updateAscGeometryTime()

void Model::updateAscGeometryTime ( const Time & time,
bool include_self )

Updates the geometry-modified timestamp for this model and all ancestors.


Parameters
[in]timeThe timestamp to propagate.
[in]include_selfWhether to include this model in the update.

◆ updateAscTime()

void Model::updateAscTime ( const Time & time,
bool includself )

Updates the modified timestamp for this model and all ancestors.


Parameters
[in]timeThe timestamp to propagate.
[in]includselfWhether to include this model in the update.

◆ updateDescGeometryTime()

void Model::updateDescGeometryTime ( const Time & time,
bool include_self )

Updates the geometry-modified timestamp for this model and all descendants.


Parameters
[in]timeThe timestamp to propagate.
[in]include_selfWhether to include this model in the update.

◆ updateDescTime()

void Model::updateDescTime ( const Time & time,
bool include_self )

Updates the modified timestamp for this model and all descendants.


Parameters
[in]timeThe timestamp to propagate.
[in]include_selfWhether to include this model in the update.

◆ updateFrom()

void Model::updateFrom ( const Model & model,
bool check_resources )

Updates this model's properties from another model, optionally checking resources.


Parameters
[in]modelThe source model to update from.
[in]check_resourcesWhether to verify and update associated resources.

References Model().

◆ updateGeometryTime()

void Model::updateGeometryTime ( Time time = Time::SystemTime())

Updates the geometry-modified timestamp for this model.


Parameters
[in]timeThe timestamp to set (defaults to current system time).

References Time::SystemTime().

◆ updateInheritedFlagsCache()

void Model::updateInheritedFlagsCache ( bool force_update_all = false,
bool update_personal_flags = false )

Recalculates and caches the inherited flags for this model.


Parameters
[in]force_update_allWhether to force recalculation even if cache appears valid.
[in]update_personal_flagsWhether to also update personal inherited flags.

◆ updateModelTransform()

void Model::updateModelTransform ( const Matrix< fltp08 > & transform,
const void * lock = nullptr )

Applies a delta transform to the current model transform.


Parameters
[in]transformThe transform matrix to compose with the current transform.
[in]lockOptional lock pointer for thread safety.

◆ updateModifiedTime()

void Model::updateModifiedTime ( Time time = Time::SystemTime())

Updates the modified timestamp for this model.


Parameters
[in]timeThe timestamp to set (defaults to current system time).

References Time::SystemTime().

Referenced by NewModelCommand::execute(), SetLayerCommand::execute(), and BuildActionProgramLogic::executeMenuItems().

◆ updateVisibleRecursive()

void Model::updateVisibleRecursive ( bool is_visible)

Recursively updates visibility for this model and all descendants.


Parameters
[in]is_visibleThe visibility state to propagate.

◆ validate()

void Model::validate ( bool validate_children = true) const

Validates this model's internal state for consistency.


Parameters
[in]validate_childrenWhether to also validate all child models.

◆ vertexCount()

uint04 Model::vertexCount ( ) const
nodiscard

Returns the total number of vertices across all descendant geometries.

Returns
The total vertex count.

◆ visibleVertexCount()

uint04 Model::visibleVertexCount ( ) const
nodiscard

Returns the total number of visible vertices across all descendant geometries.

Returns
The visible vertex count.

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