![]() |
NDEVR
API Documentation
|
A core class that provides a dynamic effect to an object in a model hierarchy. More...
Public Types | |
| enum | EffectType : uint01 { e_none , e_placeholder , e_3D_fade_in , e_3D_fade_out , e_draw_bounding_box , e_station , e_set_transform , e_scan , e_light , e_design_property , e_model_property , e_material_property , e_geometry_property , e_material_uv_color , e_location_operations , e_azimuth_operations , e_tile_model_to_object , e_motion } |
| Enumerates the available effect types. More... | |
| Public Types inherited from DesignInfo | |
| enum | DesignObjectType : uint01 |
Public Member Functions | |
| Effect () | |
| Default constructor. | |
| Effect (const DesignObject &object) | |
| Constructs an Effect from an existing DesignObject. | |
| Effect (DesignObjectBase *property_table) | |
| Constructs a new Effect and appends it to the given property table. | |
| Effect (uint04 index, DesignObjectBase *property_table) | |
| Constructs an Effect referencing an existing entry in the property table. | |
| void | activate () |
| Activates this effect so it applies during updates. | |
| void | addTarget (const DesignObject &target) |
| Appends a target to the end of the target list. | |
| void | addTarget (uint04 index, const DesignObject &target) |
| Inserts a target at a specific index. | |
| void | cleanup () |
| Cleans up resources and state associated with this effect. | |
| void | clearTargets () |
| Removes all targets from this effect. | |
| void | copyFrom (const Effect &effect) |
| Copies all effect properties from another Effect into this one. | |
| void | deactivate () |
| Deactivates this effect so it no longer applies during updates. | |
| void | deleteEffect () |
| Deletes this effect from the design database. | |
| EffectType | effectType () const |
| Returns the type of this effect. | |
| bool | getBoundsRotation () const |
| Gets whether the bounding box is allowed to rotate with its target. | |
| DesignObject | getTarget (uint04 target) const |
| Retrieves a specific target design object by index. | |
| Buffer< DesignObject > | getTargets () const |
| Retrieves all targets of this effect. | |
| bool | operator!= (const Effect &effect) const |
| Checks inequality by comparing effect indices. | |
| bool | operator== (const Effect &mat) const |
| Checks equality by comparing effect indices. | |
| void | removeTarget (uint04 index) |
| Removes a target at the given index. | |
| void | setBoundsRotation (bool bounds_can_rotate) |
| Sets whether the bounding box is allowed to rotate with its target. | |
| void | setEffectType (EffectType type) |
| Sets the type of this effect. | |
| void | setTarget (uint04 index, const DesignObject &target) |
| Sets a specific target at the given index. | |
| template<class t_type> | |
| void | setTargetProperty (uint04 property_name, t_type value) |
| Sets a single target property value on this effect. | |
| template<class t_type> | |
| void | setTargetProperty (uint04 property_name, t_type value_a, t_type value_b) |
| Sets a target property with two values (e.g., for interpolation between value_a and value_b). | |
| void | setTargets (const Buffer< DesignObject > &targets) |
| Replaces the entire target list with the given buffer of design objects. | |
| void | setupAsBlinking (fltp04 frequency) |
| Configures this effect as a blinking effect. | |
| void | setupAsBoundingBox (const Model &bounds) |
| Configures this effect to draw a bounding box around the given model. | |
| void | setupAsBoundingBox (const Model &bounds, const Model &target) |
| Configures this effect to draw a bounding box with a specific target model. | |
| void | setupAsBoundingBox (const Model &bounds, const ModelBuffer &targets) |
| Configures this effect to draw a bounding box with multiple targets. | |
| void | setupAsLight (fltp04 intensity=1.0) |
| Configures this effect as a light source. | |
| void | setupAsLocationOperations (const Model &reference) |
| Configures this effect to perform location-based operations. | |
| void | setupAsModelTile (const Model &model_tile) |
| Configures this effect to tile a model to fit an object. | |
| void | setupAsMotion (const Vector< 3, fltp08 > &speed, const Vector< 3, fltp08 > &acceleration, const Vector< 3, Angle< fltp08 > > &rotation_speed, const Vector< 3, Angle< fltp08 > > &rotation_acc) |
| Configures this effect as a motion effect with velocity and acceleration. | |
| void | setupAsTransformAnimation (const Model &target, const Matrix< fltp08 > &transform, const TimeSpan &span=TimeSpan(1.0), bool hide_at_end=false) |
| Configures this effect as a transform animation over a time span. | |
| uint04 | targetCount () const |
| Returns the number of targets this effect operates on. | |
| void | update (Time current_time, DesignObjectLookup *lock_ptr) |
| Updates this effect based on the current time, applying changes to all targets. | |
| 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. | |
| DesignObjectBase & | base () 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 JSONNode & | metaData () const |
| Retrieves the entire metadata tree for this design object. | |
| const JSONNode & | metaData (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. | |
Additional Inherited Members | |
| 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 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. | |
| Protected Attributes inherited from DesignInfo | |
| DesignObjectBase * | m_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. | |
A core class that provides a dynamic effect to an object in a model hierarchy.
Effects are time-based or persistent modifications applied to one or more target DesignObjects. They can represent visual effects (fading, blinking, bounding boxes), property animations, spatial operations (location, azimuth, motion), and more. Each Effect has a type, optional time bounds, and a list of targets it operates upon.
| enum Effect::EffectType : uint01 |
Enumerates the available effect types.
| Enumerator | |
|---|---|
| e_none | No effect. |
| e_placeholder | Placeholder effect. |
| e_3D_fade_in | Gradually fades a 3D object in. |
| e_3D_fade_out | Gradually fades a 3D object out. |
| e_draw_bounding_box | Draws a bounding box around target objects. |
| e_station | Station-based effect for survey/positioning. |
| e_set_transform | Applies a transformation matrix to the target. |
| e_scan | Scan-related effect (e.g., point cloud processing). |
| e_light | Light source effect with configurable intensity. |
| e_design_property | Modifies a design-level property on the target. |
| e_model_property | Modifies a model-level property on the target. |
| e_material_property | Modifies a material-level property on the target. |
| e_geometry_property | Modifies a geometry-level property on the target. |
| e_material_uv_color | Modifies material UV color on the target. |
| e_location_operations | Performs location-based operations on the target. |
| e_azimuth_operations | Performs azimuth-based operations on the target. |
| e_tile_model_to_object | Tiles a model to fit an object. |
| e_motion | Applies continuous motion (velocity and acceleration). |
| Effect::Effect | ( | ) |
Default constructor.
Creates an invalid Effect object.
Referenced by copyFrom(), operator!=(), and operator==().
| Effect::Effect | ( | uint04 | index, |
| DesignObjectBase * | property_table ) |
Constructs an Effect referencing an existing entry in the property table.
| [in] | index | The index of the effect in the design database. |
| [in] | property_table | The property table that stores effect data. |
References DesignObject::index().
| Effect::Effect | ( | DesignObjectBase * | property_table | ) |
Constructs a new Effect and appends it to the given property table.
| [in] | property_table | The property table to add the new effect to. |
|
explicit |
Constructs an Effect from an existing DesignObject.
| [in] | object | The design object to interpret as an Effect. |
References DesignObject::DesignObject().
| void Effect::activate | ( | ) |
Activates this effect so it applies during updates.
| void Effect::addTarget | ( | const DesignObject & | target | ) |
Appends a target to the end of the target list.
| [in] | target | The design object to add. |
References DesignObject::DesignObject().
| void Effect::addTarget | ( | uint04 | index, |
| const DesignObject & | target ) |
Inserts a target at a specific index.
| [in] | index | The zero-based index at which to insert. |
| [in] | target | The design object to insert. |
References DesignObject::DesignObject(), and DesignObject::index().
| void Effect::cleanup | ( | ) |
Cleans up resources and state associated with this effect.
| void Effect::clearTargets | ( | ) |
Removes all targets from this effect.
| void Effect::copyFrom | ( | const Effect & | effect | ) |
| void Effect::deactivate | ( | ) |
Deactivates this effect so it no longer applies during updates.
| void Effect::deleteEffect | ( | ) |
Deletes this effect from the design database.
| EffectType Effect::effectType | ( | ) | const |
| bool Effect::getBoundsRotation | ( | ) | const |
Gets whether the bounding box is allowed to rotate with its target.
| DesignObject Effect::getTarget | ( | uint04 | target | ) | const |
Retrieves a specific target design object by index.
| [in] | target | The zero-based index of the target. |
References DesignObject::DesignObject().
| Buffer< DesignObject > Effect::getTargets | ( | ) | const |
Retrieves all targets of this effect.
|
inline |
Checks inequality by comparing effect indices.
| [in] | effect | The other Effect to compare against. |
Definition at line 412 of file Effect.h.
References Effect(), and DesignObject::index().
|
inline |
Checks equality by comparing effect indices.
| [in] | mat | The other Effect to compare against. |
Definition at line 403 of file Effect.h.
References Effect(), and DesignObject::index().
| void Effect::removeTarget | ( | uint04 | index | ) |
Removes a target at the given index.
| [in] | index | The zero-based index of the target to remove. |
References DesignObject::index().
| void Effect::setBoundsRotation | ( | bool | bounds_can_rotate | ) |
Sets whether the bounding box is allowed to rotate with its target.
| [in] | bounds_can_rotate | True to allow rotation, false for axis-aligned. |
| void Effect::setEffectType | ( | EffectType | type | ) |
| void Effect::setTarget | ( | uint04 | index, |
| const DesignObject & | target ) |
Sets a specific target at the given index.
| [in] | index | The zero-based index to set. |
| [in] | target | The design object to assign at that index. |
References DesignObject::DesignObject(), and DesignObject::index().
|
inline |
Sets a single target property value on this effect.
| [in] | property_name | The property index to modify on the target. |
| [in] | value | The value to assign to the target property. |
Definition at line 322 of file Effect.h.
References DesignObject::set(), target_property, and target_value_a.
|
inline |
Sets a target property with two values (e.g., for interpolation between value_a and value_b).
| [in] | property_name | The property index to modify on the target. |
| [in] | value_a | The first value (start or primary). |
| [in] | value_b | The second value (end or secondary). |
Definition at line 334 of file Effect.h.
References DesignObject::set(), target_property, target_value_a, and target_value_b.
| void Effect::setTargets | ( | const Buffer< DesignObject > & | targets | ) |
Replaces the entire target list with the given buffer of design objects.
| [in] | targets | The new set of target design objects. |
| void Effect::setupAsBlinking | ( | fltp04 | frequency | ) |
Configures this effect as a blinking effect.
| [in] | frequency | The blink frequency in Hz. |
| void Effect::setupAsBoundingBox | ( | const Model & | bounds | ) |
Configures this effect to draw a bounding box around the given model.
| [in] | bounds | The model whose bounds define the bounding box. |
| void Effect::setupAsBoundingBox | ( | const Model & | bounds, |
| const Model & | target ) |
Configures this effect to draw a bounding box with a specific target model.
| [in] | bounds | The model whose bounds define the bounding box. |
| [in] | target | The model to apply the bounding box to. |
| void Effect::setupAsBoundingBox | ( | const Model & | bounds, |
| const ModelBuffer & | targets ) |
Configures this effect to draw a bounding box with multiple targets.
| [in] | bounds | The model whose bounds define the bounding box. |
| [in] | targets | The buffer of models to apply the bounding box to. |
| void Effect::setupAsLight | ( | fltp04 | intensity = 1.0 | ) |
Configures this effect as a light source.
| [in] | intensity | The light intensity value (default 1.0). |
| void Effect::setupAsLocationOperations | ( | const Model & | reference | ) |
Configures this effect to perform location-based operations.
| [in] | reference | The reference model for location operations. |
| void Effect::setupAsModelTile | ( | const Model & | model_tile | ) |
Configures this effect to tile a model to fit an object.
| [in] | model_tile | The model to use as the tile source. |
| void Effect::setupAsMotion | ( | const Vector< 3, fltp08 > & | speed, |
| const Vector< 3, fltp08 > & | acceleration, | ||
| const Vector< 3, Angle< fltp08 > > & | rotation_speed, | ||
| const Vector< 3, Angle< fltp08 > > & | rotation_acc ) |
Configures this effect as a motion effect with velocity and acceleration.
| [in] | speed | The linear velocity vector (units per second). |
| [in] | acceleration | The linear acceleration vector (units per second squared). |
| [in] | rotation_speed | The angular velocity vector (angle per second). |
| [in] | rotation_acc | The angular acceleration vector (angle per second squared). |
| void Effect::setupAsTransformAnimation | ( | const Model & | target, |
| const Matrix< fltp08 > & | transform, | ||
| const TimeSpan & | span = TimeSpan(1.0), | ||
| bool | hide_at_end = false ) |
Configures this effect as a transform animation over a time span.
| [in] | target | The model to animate. |
| [in] | transform | The target transformation matrix to animate toward. |
| [in] | span | The duration of the animation (default 1.0 second). |
| [in] | hide_at_end | Whether to hide the target when the animation finishes. |
| uint04 Effect::targetCount | ( | ) | const |
Returns the number of targets this effect operates on.
| void Effect::update | ( | Time | current_time, |
| DesignObjectLookup * | lock_ptr ) |
Updates this effect based on the current time, applying changes to all targets.
| [in] | current_time | The current simulation/application time. |
| [in] | lock_ptr | The design object lookup used for resolving references. |