NDEVR
API Documentation

A core class that provides a dynamic effect to an object in a model hierarchy. More...

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

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< DesignObjectgetTargets () 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.
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.

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
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 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.

See also
Model, Material, DesignObject

Definition at line 157 of file Effect.h.

Member Enumeration Documentation

◆ EffectType

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).

Definition at line 163 of file Effect.h.

Constructor & Destructor Documentation

◆ Effect() [1/4]

Effect::Effect ( )

Default constructor.


Creates an invalid Effect object.

Referenced by copyFrom(), operator!=(), and operator==().

◆ Effect() [2/4]

Effect::Effect ( uint04 index,
DesignObjectBase * property_table )

Constructs an Effect referencing an existing entry in the property table.


Parameters
[in]indexThe index of the effect in the design database.
[in]property_tableThe property table that stores effect data.

References DesignObject::index().

◆ Effect() [3/4]

Effect::Effect ( DesignObjectBase * property_table)

Constructs a new Effect and appends it to the given property table.


Parameters
[in]property_tableThe property table to add the new effect to.

◆ Effect() [4/4]

Effect::Effect ( const DesignObject & object)
explicit

Constructs an Effect from an existing DesignObject.


Parameters
[in]objectThe design object to interpret as an Effect.

References DesignObject::DesignObject().

Member Function Documentation

◆ activate()

void Effect::activate ( )

Activates this effect so it applies during updates.


◆ addTarget() [1/2]

void Effect::addTarget ( const DesignObject & target)

Appends a target to the end of the target list.


Parameters
[in]targetThe design object to add.

References DesignObject::DesignObject().

◆ addTarget() [2/2]

void Effect::addTarget ( uint04 index,
const DesignObject & target )

Inserts a target at a specific index.


Parameters
[in]indexThe zero-based index at which to insert.
[in]targetThe design object to insert.

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

◆ cleanup()

void Effect::cleanup ( )

Cleans up resources and state associated with this effect.


◆ clearTargets()

void Effect::clearTargets ( )

Removes all targets from this effect.


◆ copyFrom()

void Effect::copyFrom ( const Effect & effect)

Copies all effect properties from another Effect into this one.


Parameters
[in]effectThe source effect to copy from.

References Effect().

◆ deactivate()

void Effect::deactivate ( )

Deactivates this effect so it no longer applies during updates.


◆ deleteEffect()

void Effect::deleteEffect ( )

Deletes this effect from the design database.


◆ effectType()

EffectType Effect::effectType ( ) const

Returns the type of this effect.


Returns
The EffectType enum value.

◆ getBoundsRotation()

bool Effect::getBoundsRotation ( ) const

Gets whether the bounding box is allowed to rotate with its target.


Returns
True if the bounding box can rotate, false if axis-aligned.

◆ getTarget()

DesignObject Effect::getTarget ( uint04 target) const

Retrieves a specific target design object by index.


Parameters
[in]targetThe zero-based index of the target.
Returns
The DesignObject at the given target index.

References DesignObject::DesignObject().

◆ getTargets()

Buffer< DesignObject > Effect::getTargets ( ) const

Retrieves all targets of this effect.


Returns
A buffer containing all target DesignObjects.

◆ operator!=()

bool Effect::operator!= ( const Effect & effect) const
inline

Checks inequality by comparing effect indices.


Parameters
[in]effectThe other Effect to compare against.
Returns
True if the effects have different indices.

Definition at line 412 of file Effect.h.

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

◆ operator==()

bool Effect::operator== ( const Effect & mat) const
inline

Checks equality by comparing effect indices.


Parameters
[in]matThe other Effect to compare against.
Returns
True if both effects share the same index.

Definition at line 403 of file Effect.h.

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

◆ removeTarget()

void Effect::removeTarget ( uint04 index)

Removes a target at the given index.


Parameters
[in]indexThe zero-based index of the target to remove.

References DesignObject::index().

◆ setBoundsRotation()

void Effect::setBoundsRotation ( bool bounds_can_rotate)

Sets whether the bounding box is allowed to rotate with its target.


Parameters
[in]bounds_can_rotateTrue to allow rotation, false for axis-aligned.

◆ setEffectType()

void Effect::setEffectType ( EffectType type)

Sets the type of this effect.


Parameters
[in]typeThe EffectType to assign.

◆ setTarget()

void Effect::setTarget ( uint04 index,
const DesignObject & target )

Sets a specific target at the given index.


Parameters
[in]indexThe zero-based index to set.
[in]targetThe design object to assign at that index.

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

◆ setTargetProperty() [1/2]

template<class t_type>
void Effect::setTargetProperty ( uint04 property_name,
t_type value )
inline

Sets a single target property value on this effect.


Parameters
[in]property_nameThe property index to modify on the target.
[in]valueThe value to assign to the target property.

Definition at line 322 of file Effect.h.

References DesignObject::set(), target_property, and target_value_a.

◆ setTargetProperty() [2/2]

template<class t_type>
void Effect::setTargetProperty ( uint04 property_name,
t_type value_a,
t_type value_b )
inline

Sets a target property with two values (e.g., for interpolation between value_a and value_b).


Parameters
[in]property_nameThe property index to modify on the target.
[in]value_aThe first value (start or primary).
[in]value_bThe 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.

◆ setTargets()

void Effect::setTargets ( const Buffer< DesignObject > & targets)

Replaces the entire target list with the given buffer of design objects.


Parameters
[in]targetsThe new set of target design objects.

◆ setupAsBlinking()

void Effect::setupAsBlinking ( fltp04 frequency)

Configures this effect as a blinking effect.


Parameters
[in]frequencyThe blink frequency in Hz.

◆ setupAsBoundingBox() [1/3]

void Effect::setupAsBoundingBox ( const Model & bounds)

Configures this effect to draw a bounding box around the given model.


Parameters
[in]boundsThe model whose bounds define the bounding box.

◆ setupAsBoundingBox() [2/3]

void Effect::setupAsBoundingBox ( const Model & bounds,
const Model & target )

Configures this effect to draw a bounding box with a specific target model.


Parameters
[in]boundsThe model whose bounds define the bounding box.
[in]targetThe model to apply the bounding box to.

◆ setupAsBoundingBox() [3/3]

void Effect::setupAsBoundingBox ( const Model & bounds,
const ModelBuffer & targets )

Configures this effect to draw a bounding box with multiple targets.


Parameters
[in]boundsThe model whose bounds define the bounding box.
[in]targetsThe buffer of models to apply the bounding box to.

◆ setupAsLight()

void Effect::setupAsLight ( fltp04 intensity = 1.0)

Configures this effect as a light source.


Parameters
[in]intensityThe light intensity value (default 1.0).

◆ setupAsLocationOperations()

void Effect::setupAsLocationOperations ( const Model & reference)

Configures this effect to perform location-based operations.


Parameters
[in]referenceThe reference model for location operations.

◆ setupAsModelTile()

void Effect::setupAsModelTile ( const Model & model_tile)

Configures this effect to tile a model to fit an object.


Parameters
[in]model_tileThe model to use as the tile source.

◆ setupAsMotion()

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.


Parameters
[in]speedThe linear velocity vector (units per second).
[in]accelerationThe linear acceleration vector (units per second squared).
[in]rotation_speedThe angular velocity vector (angle per second).
[in]rotation_accThe angular acceleration vector (angle per second squared).

◆ setupAsTransformAnimation()

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.


Parameters
[in]targetThe model to animate.
[in]transformThe target transformation matrix to animate toward.
[in]spanThe duration of the animation (default 1.0 second).
[in]hide_at_endWhether to hide the target when the animation finishes.

◆ targetCount()

uint04 Effect::targetCount ( ) const

Returns the number of targets this effect operates on.


Returns
The target count.

◆ update()

void Effect::update ( Time current_time,
DesignObjectLookup * lock_ptr )

Updates this effect based on the current time, applying changes to all targets.


Parameters
[in]current_timeThe current simulation/application time.
[in]lock_ptrThe design object lookup used for resolving references.

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