NDEVR
API Documentation
FactoryModelFilters

Provides easy filtering tools for factories that are only able to export certain types of models or geometries. More...

Static Public Member Functions

static Buffer< ModelFilterGeometryModels (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const Buffer< GeometryType > &types)
 Filters models to find those containing geometry matching any of the specified types.
static Buffer< ModelFilterGeometryModels (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, GeometryType type)
 Filters models to find those containing geometry of a specific type.
template<class t_type>
static Buffer< t_type > FilterTypeModels (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup)
 Filters models by a compile-time type, returning only models (or their descendants) whose type name matches t_type::TypeName().
static Buffer< ModelFilterTypeModels (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const Buffer< String > &types)
 Filters models by one or more type name strings, returning only models (or their descendants) that match the specified types.
static Buffer< ModelFilterTypeModels (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const Buffer< StringView > &types)
 Filters models by one or more type name string views, returning only models (or their descendants) that match the specified types.
template<class t_type>
static void SortModelsByName (Buffer< t_type > &models)
 Sorts a buffer of models alphabetically by their display name path using alphanumeric comparison.

Detailed Description

Provides easy filtering tools for factories that are only able to export certain types of models or geometries.


This utility class contains static methods for filtering, sorting, and retrieving models from a DesignObjectLookup based on type names, geometry types, deployment status, or station associations. It is primarily used by IO factories to determine which models are eligible for export.

Definition at line 18 of file FactoryModelFilters.h.

Member Function Documentation

◆ FilterGeometryModels() [1/2]

Buffer< Model > FactoryModelFilters::FilterGeometryModels ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup,
const Buffer< GeometryType > & types )
inlinestatic

Filters models to find those containing geometry matching any of the specified types.


Iterates through model hierarchies, skipping export-ignored and application-owned models, then reduces the result to root-level models where all non-ignored children are also included.

Parameters
[in]models_to_checkThe UUIDs of models to examine.
[in]lookupThe design object lookup used to resolve model UUIDs.
[in]typesThe buffer of geometry types to filter by.
Returns
A buffer of root-level models containing geometry of any of the specified types.

Definition at line 264 of file FactoryModelFilters.h.

References Buffer< t_type, t_memory_manager >::add(), ModelIterator::e_continue_parsing, Model::exportIgnored(), Model::getChildren(), Geometry::getGeometryType(), Set< t_value >::hasValue(), Model::isApplicationOwned(), DesignObject::isValid(), DesignObjectLookup::model(), ModelIterator::model_filter, DesignObjectLookup::readLock(), and Model::ReduceToRoots().

◆ FilterGeometryModels() [2/2]

Buffer< Model > FactoryModelFilters::FilterGeometryModels ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup,
GeometryType type )
inlinestatic

Filters models to find those containing geometry of a specific type.


Iterates through model hierarchies, skipping export-ignored and application-owned models, then reduces the result to root-level models where all non-ignored children are also included.

Parameters
[in]models_to_checkThe UUIDs of models to examine.
[in]lookupThe design object lookup used to resolve model UUIDs.
[in]typeThe geometry type to filter by.
Returns
A buffer of root-level models containing geometry of the specified type.

Definition at line 220 of file FactoryModelFilters.h.

References Buffer< t_type, t_memory_manager >::add(), ModelIterator::e_continue_parsing, Model::exportIgnored(), Model::getChildren(), Geometry::getGeometryType(), Set< t_value >::hasValue(), Model::isApplicationOwned(), DesignObject::isValid(), DesignObjectLookup::model(), ModelIterator::model_filter, DesignObjectLookup::readLock(), Model::ReduceToRoots(), and type.

◆ FilterTypeModels() [1/3]

template<class t_type>
Buffer< t_type > FactoryModelFilters::FilterTypeModels ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup )
inlinestatic

Filters models by a compile-time type, returning only models (or their descendants) whose type name matches t_type::TypeName().


Models flagged as export-ignored are skipped.

Parameters
[in]models_to_checkThe UUIDs of models to examine.
[in]lookupThe design object lookup used to resolve model UUIDs.
Returns
A buffer of t_type objects matching the specified type.

Definition at line 127 of file FactoryModelFilters.h.

References Buffer< t_type, t_memory_manager >::add(), Model::exportIgnored(), Model::getTypeDescendants(), DesignObject::is(), DesignObject::isValid(), DesignObjectLookup::model(), DesignObjectLookup::readLock(), and type.

◆ FilterTypeModels() [2/3]

Buffer< Model > FactoryModelFilters::FilterTypeModels ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup,
const Buffer< String > & types )
inlinestatic

Filters models by one or more type name strings, returning only models (or their descendants) that match the specified types.


Models flagged as export-ignored are excluded.

Parameters
[in]models_to_checkThe UUIDs of models to examine.
[in]lookupThe design object lookup used to resolve model UUIDs.
[in]typesThe type name strings to filter by. If empty, all valid non-ignored models are returned.
Returns
A buffer of models matching the specified types with export-ignored models removed.

Definition at line 42 of file FactoryModelFilters.h.

References Buffer< t_type, t_memory_manager >::add(), Model::exportIgnored(), Model::getDescendantsByType(), DesignObject::is(), IsValid(), DesignObject::isValid(), DesignObjectLookup::model(), DesignObjectLookup::readLock(), and type.

◆ FilterTypeModels() [3/3]

Buffer< Model > FactoryModelFilters::FilterTypeModels ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup,
const Buffer< StringView > & types )
inlinestatic

Filters models by one or more type name string views, returning only models (or their descendants) that match the specified types.


Models flagged as export-ignored are excluded.

Parameters
[in]models_to_checkThe UUIDs of models to examine.
[in]lookupThe design object lookup used to resolve model UUIDs.
[in]typesThe type name string views to filter by. If empty, all valid non-ignored models are returned.
Returns
A buffer of models matching the specified types with export-ignored models removed.

Definition at line 85 of file FactoryModelFilters.h.

References Buffer< t_type, t_memory_manager >::add(), Model::exportIgnored(), Model::getDescendantsByType(), DesignObject::is(), IsValid(), DesignObject::isValid(), DesignObjectLookup::model(), DesignObjectLookup::readLock(), and type.

◆ SortModelsByName()

template<class t_type>
void FactoryModelFilters::SortModelsByName ( Buffer< t_type > & models)
inlinestatic

Sorts a buffer of models alphabetically by their display name path using alphanumeric comparison.


Parameters
[in]modelsThe buffer of models to sort in-place.

Definition at line 27 of file FactoryModelFilters.h.


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