NDEVR
API Documentation
DesignParameterAccumulatorfinal

Searches a model hierarchy and pulls all parameter data based on the AccumationMode settings. More...

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

Public Types

enum  AccumulateMode {
  e_get_max_min , e_get_average , e_get_variance , e_get_std_dev ,
  e_get_strings , e_get_total , e_get_indices , e_get_floats
}
 Defines which statistical or data-collection operations to perform during accumulation. More...
Public Types inherited from ModelIterator
enum  ParseResult { e_continue_parsing , e_do_not_parse_children , e_finish_parsing }
 The result returned by process functions to control iteration flow. More...

Public Member Functions

 DesignParameterAccumulator (const DesignParameter &design_parameter, BitFlag mode=BitFlag(0))
 Constructs a DesignParameterAccumulator for a specific parameter.
void accumulate (const DesignObject &object, fltp08 known_avg=Constant< fltp08 >::Invalid)
 Accumulates parameter data from a design object.
void accumulate (fltp08 value, const uint01 &dim=X, bool to_unit=true)
 Accumulates a single floating-point value into the running statistics.
void addToTotal (fltp08 value)
 Adds a value directly to the running total without updating other statistics.
void clear ()
 Resets all accumulated statistics and collected data to their initial state.
void setCollectVerticesByPrimitive (PrimitiveProperty vertex_collection_primitive)
 Configures vertex collection to gather vertices by the specified primitive property.
void setToDefaults (const DesignObject &object)
 Initialises accumulator defaults from the given design object's properties.
DesignObject::DesignObjectType type ()
 Returns the DesignObjectType that this accumulator is targeting.
Public Member Functions inherited from ModelIterator
 ModelIterator ()
 Default constructor.
 ModelIterator (Buffer< Model > models)
 Constructs an iterator initialized with multiple root models.
 ModelIterator (const Model &model)
 Constructs an iterator initialized with a single root model.
void addToStack (const Model &model)
 Adds a model to the internal traversal stack without starting iteration.
Model currentModel () const
 Returns the model currently at the top of the traversal stack.
void parseAll ()
 Parses all models currently on the internal stack and their descendants.
void parseAll (const Model &model)
 Parses the given model and all of its descendants.
void parseAllChildren (const Model &parent)
 Parses all children of the given parent model, but not the parent itself.
void parseAllModels (const Buffer< Model > &models)
 Parses all models in the given buffer and their descendants.
ParseResult parseNext ()
 Parses the next model on the stack, processing it and optionally its geometry and material.

Public Attributes

BitFlag accumulate_mode
 Bitmask of AccumulateMode flags controlling which statistics to collect.
bool add_commas = false
 Whether to insert commas as thousands separators in formatted output.
fltp08 average = Constant<fltp08>::Invalid
 The computed average value, or Invalid if not yet calculated.
String default_value
 Default value string used when a parameter is missing.
Buffer< fltp08float_values
 Collected raw floating-point values (when e_get_floats is set).
bool include_unit_symbols = true
 Whether to append unit symbols (e.g., "m", "ft") in formatted string output.
Buffer< uint04indices
 Collected row or object indices (when e_get_indices is set).
bool is_normal_prop = false
 Whether the parameter is a standard built-in property.
fltp08 lower_std_dev = 0.0
 Standard deviation for values less than the average.
fltp08 lower_variance = 0.0
 Variance for values less than the average.
fltp08 max = Constant<fltp08>::Min
 The maximum value encountered during accumulation.
uint04 max_num_of_decimals = Constant<uint04>::Max
 Maximum number of decimal places for string formatting.
uint04 max_num_of_values = Constant<uint04>::Max
 Maximum number of values to collect before stopping.
fltp08 min = Constant<fltp08>::Max
 The minimum value encountered during accumulation.
uint04 min_digits = 0
 Minimum number of digits for string formatting.
uint04 min_num_of_decimals = 0
 Minimum number of decimal places for string formatting.
ConstPointer< Unitoverride_unit
 Optional unit override for value conversion. Null uses the parameter's default unit.
DesignParameter parameter
 The design parameter being accumulated.
bool recursive_matrix = false
 Whether to recursively compose parent transform matrices.
StringAllocatingView string_cache
 Temporary string buffer used during value formatting.
Buffer< StringAllocatingViewstring_values
 Collected string representations of parameter values (when e_get_strings is set).
uint04 total_count = 0
 Total number of values accumulated.
uint04 total_lower = 0
 Count of values less than the average.
uint04 total_upper = 0
 Count of values greater than the average.
fltp08 total_value = 0.0
 The running sum of all accumulated values.
Matrix< fltp08transform = Matrix<fltp08>(1.0)
 The current transformation matrix applied during accumulation.
fltp08 upper_std_dev = 0.0
 Standard deviation for values greater than the average.
fltp08 upper_variance = 0.0
 Variance for values greater than the average.
bool use_defaults = false
 Whether to use default_value when the parameter is absent from an object.
Public Attributes inherited from ModelIterator
bool depth_first = true
 Whether to traverse depth-first (true) or breadth-first (false).
std::function< bool(const Model &, const Geometry &)> geo_filter
 Optional filter predicate for geometry processing. Returns true to include.
bool is_recursive = true
 Whether to recurse into child models.
std::function< bool(const Model &, const Material &)> material_filter
 Optional filter predicate for material processing. Returns true to include.
std::function< bool(const Model &)> model_filter
 Optional filter predicate for model processing. Returns true to include.
bool post_process_model = false
 Whether to invoke postProcess() after a model's children have been parsed.
bool process_geometry = true
 Whether to invoke process() for each Geometry on a model.
bool process_material = false
 Whether to invoke process() for each Material on a model.
bool process_model = true
 Whether to invoke process() for the model itself.
bool use_unit = false
 Whether to apply unit conversions during processing.

Protected Attributes

bool is_design_index = false
 Whether the parameter represents a design-level index property.
bool is_matrix_prop = false
 Whether the parameter represents a matrix-type property.
bool is_special_field = false
 Whether the parameter requires special handling (e.g., computed fields).
bool is_vertex_index = false
 Whether the parameter represents a vertex-level index property.
DesignObject::DesignObjectType m_design_type = DesignObject::DesignObjectType::e_model
 The type of design object this accumulator targets.
PrimitiveProperty m_vertex_collection_primitive = PrimitiveProperty::Vertices
 The primitive property used to group vertices during collection.
uint04 property_index = Constant<uint04>::Invalid
 Cached column/property index for the current parameter lookup.
fltp08 total_value_c = 0.0
 Kahan summation compensation term for maintaining precision during accumulation.
Protected Attributes inherited from ModelIterator
uint04 m_forward_position = 0U
 Current forward index position used in breadth-first traversal.
Buffer< std::pair< Model, uint04 > > m_model_parent_stack
 Stack tracking parent models and their child indices for post-processing.
Buffer< Modelm_model_stack
 The stack of models pending traversal.

Private Member Functions

void _parseAllModels () final override
 Internal entry point that begins parsing all models in the hierarchy.
ParseResult postProcess (Model &m) final override
 Post-processes a Model after its children have been visited, finalising statistics.
ParseResult process (Model &model) final override
 Processes a single Model node during accumulation.
ParseResult process (Model &model, Geometry &geo) final override
 Processes a Geometry node associated with a Model during accumulation.
ParseResult process (Model &model, Material &mat) final override
 Processes a Material node associated with a Model during accumulation.

Additional Inherited Members

Protected Member Functions inherited from ModelIterator
Model popNextModel ()
 Pops and returns the next model from the traversal stack.
void removeFromPostProcessStack ()
 Removes the current model from the post-process stack.

Detailed Description

Searches a model hierarchy and pulls all parameter data based on the AccumationMode settings.


Definition at line 85 of file DesignParameterAccumulator.h.

Member Enumeration Documentation

◆ AccumulateMode

Defines which statistical or data-collection operations to perform during accumulation.

Enumerator
e_get_max_min 

Collect the maximum and minimum values.

e_get_average 

Compute the average value.

e_get_variance 

Compute upper and lower variance relative to the average.

e_get_std_dev 

Compute upper and lower standard deviation relative to the average.

e_get_strings 

Collect parameter values as strings.

e_get_total 

Compute the total (sum) of all values.

e_get_indices 

Collect the row/object indices of matched parameters.

e_get_floats 

Collect raw floating-point parameter values.

Definition at line 89 of file DesignParameterAccumulator.h.

Constructor & Destructor Documentation

◆ DesignParameterAccumulator()

DesignParameterAccumulator::DesignParameterAccumulator ( const DesignParameter & design_parameter,
BitFlag mode = BitFlag(0) )
explicit

Constructs a DesignParameterAccumulator for a specific parameter.

Parameters
[in]design_parameterThe parameter definition to accumulate.
[in]modeA BitFlag combination of AccumulateMode values controlling what data to collect.

Member Function Documentation

◆ accumulate() [1/2]

void DesignParameterAccumulator::accumulate ( const DesignObject & object,
fltp08 known_avg = Constantfltp08 >::Invalid )

Accumulates parameter data from a design object.

Parameters
[in]objectThe design object whose parameter value is accumulated.
[in]known_avgA pre-computed average, used when computing variance or std deviation. Invalid if not provided.

◆ accumulate() [2/2]

void DesignParameterAccumulator::accumulate ( fltp08 value,
const uint01 & dim = X,
bool to_unit = true )

Accumulates a single floating-point value into the running statistics.

Parameters
[in]valueThe value to accumulate.
[in]dimThe dimension index (e.g., X, Y, Z) for multi-dimensional parameters.
[in]to_unitWhether to convert the value to the display unit before accumulating.

◆ addToTotal()

void DesignParameterAccumulator::addToTotal ( fltp08 value)

Adds a value directly to the running total without updating other statistics.

Parameters
[in]valueThe value to add to the total.

◆ postProcess()

ParseResult DesignParameterAccumulator::postProcess ( Model & m)
finaloverrideprivatevirtual

Post-processes a Model after its children have been visited, finalising statistics.

Parameters
[in]mThe model being post-processed.
Returns
ParseResult indicating whether to continue or stop iteration.

Reimplemented from ModelIterator.

◆ process() [1/3]

ParseResult DesignParameterAccumulator::process ( Model & model)
finaloverrideprivatevirtual

Processes a single Model node during accumulation.

Parameters
[in]modelThe model to process.
Returns
ParseResult indicating whether to continue or stop iteration.

Reimplemented from ModelIterator.

◆ process() [2/3]

ParseResult DesignParameterAccumulator::process ( Model & model,
Geometry & geo )
finaloverrideprivatevirtual

Processes a Geometry node associated with a Model during accumulation.

Parameters
[in]modelThe parent model of the geometry.
[in]geoThe geometry to process.
Returns
ParseResult indicating whether to continue or stop iteration.

Reimplemented from ModelIterator.

◆ process() [3/3]

ParseResult DesignParameterAccumulator::process ( Model & model,
Material & mat )
finaloverrideprivatevirtual

Processes a Material node associated with a Model during accumulation.

Parameters
[in]modelThe parent model of the material.
[in]matThe material to process.
Returns
ParseResult indicating whether to continue or stop iteration.

Reimplemented from ModelIterator.

◆ setCollectVerticesByPrimitive()

void DesignParameterAccumulator::setCollectVerticesByPrimitive ( PrimitiveProperty vertex_collection_primitive)

Configures vertex collection to gather vertices by the specified primitive property.

Parameters
[in]vertex_collection_primitiveThe primitive property that determines how vertices are grouped.

◆ setToDefaults()

void DesignParameterAccumulator::setToDefaults ( const DesignObject & object)

Initialises accumulator defaults from the given design object's properties.

Parameters
[in]objectThe design object to derive defaults from.

◆ type()

DesignObject::DesignObjectType DesignParameterAccumulator::type ( )
inline

Returns the DesignObjectType that this accumulator is targeting.

Returns
The design object type (e.g., model, geometry, material).

Definition at line 127 of file DesignParameterAccumulator.h.

References m_design_type.


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