NDEVR
API Documentation
GeometryFilterabstract

A service that contains registered algorithms for removing vertices or shapes from a group of vertices or shapes. More...

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

Public Member Functions

 GeometryFilter (const GeometryFilter &&filter)=delete
 Move constructor is deleted; filters are non-movable.
 GeometryFilter (const GeometryFilter &filter)=delete
 Copy constructor is deleted; filters are non-copyable.
virtual ~GeometryFilter ()=default
 Virtual destructor defaulted for proper polymorphic cleanup.
virtual bool canRunFilter (const GeometryFilterParameters &)
 Returns whether this filter can be applied given the target parameters.
virtual Buffer< FilterDescriptiondefaultFilterArguments ()
 Returns the default set of FilterDescription arguments for this filter.
const StringfilterID () const
 Returns the internal string identifier of this filter.
const TranslatedStringfilterName () const
 Returns the user-facing translated name of this filter.
virtual bool runFilter (GeometryFilterParameters &parameters)=0
 Executes this filter on the given parameters, modifying the filtered flags.

Static Public Member Functions

static void AddAvailableFilter (GeometryFilter *filter)
 Registers a GeometryFilter instance in the global available filters dictionary.
static DynamicPointer< ManagedDesignCommandAddFilterCommand (const FilterDescription &filter)
 Creates a design command that adds a single filter to the active filter set.
static const Dictionary< String, GeometryFilter * > & AvailableFilters ()
 Returns the global dictionary of all registered GeometryFilter instances keyed by their ID.
static void ExecuteFiltering (const JSONNode &active_filters, const Matrix< fltp08 > &transform, Geometry &geo, LogPtr log, const void *lock)
 Executes filtering on a single Geometry object using the filters described in the JSON node.
static void ExecuteFiltering (const JSONNode &active_filters, Model &model, LogPtr log, const void *lock)
 Executes filtering on all geometry within a Model using the filters described in the JSON node.
static Buffer< FilterDescriptionGetAvailableDescriptions ()
 Retrieves the default FilterDescription entries for all registered filters.
static DynamicPointer< ManagedDesignCommandSetFiltersCommand (const Buffer< FilterDescription > &filter)
 Creates a design command that replaces the entire active filter set with the given filters.
static String ToCommandString (const Buffer< FilterDescription > &descriptions)
 Serializes a set of filter descriptions into a command string representation.

Protected Member Functions

 GeometryFilter (const TranslatedString &name, const StringView &id)
 Constructs a GeometryFilter with the given display name and identifier.

Static Protected Member Functions

static void ClearAllFiltering (Geometry &geo, LogPtr log, const void *lock)
 Clears all filtering results from the given geometry, restoring it to unfiltered state.
static void FinishFiltering (const Matrix< fltp08 > &transform, Geometry &geo, const GeometryFilterParameters &params)
 Applies the filtering results back to the geometry after filter execution.
static void PrepareForFiltering (const Matrix< fltp08 > &transform, Geometry &geo, GeometryFilterParameters &params)
 Prepares geometry data for filtering by populating the parameters with vertex data.

Protected Attributes

String m_id
 The internal unique string identifier for this filter.
TranslatedString m_name
 The user-facing translated display name for this filter.

Static Protected Attributes

static Dictionary< String, GeometryFilter * > s_global_available_filters
 Global registry of all available filter instances, keyed by their string ID.

Detailed Description

A service that contains registered algorithms for removing vertices or shapes from a group of vertices or shapes.


See also
Geometry, GeometryBoolean, GeometryRegistration

Definition at line 51 of file GeometryFilter.h.

Constructor & Destructor Documentation

◆ GeometryFilter()

GeometryFilter::GeometryFilter ( const TranslatedString & name,
const StringView & id )
explicitprotected

Constructs a GeometryFilter with the given display name and identifier.


Parameters
[in]nameThe user-facing translated name for this filter.
[in]idThe internal string identifier for this filter.

Referenced by GeometryFilter(), GeometryFilter(), and AddAvailableFilter().

Member Function Documentation

◆ AddAvailableFilter()

void GeometryFilter::AddAvailableFilter ( GeometryFilter * filter)
static

Registers a GeometryFilter instance in the global available filters dictionary.


Parameters
[in]filterThe filter to register. Ownership is not transferred.

References GeometryFilter().

◆ AddFilterCommand()

DynamicPointer< ManagedDesignCommand > GeometryFilter::AddFilterCommand ( const FilterDescription & filter)
static

Creates a design command that adds a single filter to the active filter set.


Parameters
[in]filterThe filter description to add.
Returns
A DynamicPointer to the created ManagedDesignCommand for undo/redo support.

◆ AvailableFilters()

const Dictionary< String, GeometryFilter * > & GeometryFilter::AvailableFilters ( )
static

Returns the global dictionary of all registered GeometryFilter instances keyed by their ID.


Returns
A const reference to the dictionary mapping filter IDs to filter pointers.

◆ canRunFilter()

virtual bool GeometryFilter::canRunFilter ( const GeometryFilterParameters & )
inlinevirtual

Returns whether this filter can be applied given the target parameters.


Parameters
[in]parametersThe filter parameters to check compatibility against.
Returns
True if the filter can run with the given parameters, false otherwise. Default is true.

Reimplemented in PropertyChannelFilter.

Definition at line 138 of file GeometryFilter.h.

◆ ClearAllFiltering()

void GeometryFilter::ClearAllFiltering ( Geometry & geo,
LogPtr log,
const void * lock )
staticprotected

Clears all filtering results from the given geometry, restoring it to unfiltered state.


Parameters
[in]geoThe geometry to clear filtering from.
[in]logAn optional log for reporting progress.
[in]lockAn optional lock pointer for thread synchronization.

◆ defaultFilterArguments()

virtual Buffer< FilterDescription > GeometryFilter::defaultFilterArguments ( )
virtual

Returns the default set of FilterDescription arguments for this filter.


Returns
A buffer of FilterDescription objects representing the default configuration.

Reimplemented in PropertyChannelFilter.

◆ ExecuteFiltering() [1/2]

void GeometryFilter::ExecuteFiltering ( const JSONNode & active_filters,
const Matrix< fltp08 > & transform,
Geometry & geo,
LogPtr log,
const void * lock )
static

Executes filtering on a single Geometry object using the filters described in the JSON node.


Parameters
[in]active_filtersA JSON node describing which filters to apply and their parameters.
[in]transformThe transformation matrix to apply to the geometry.
[in]geoThe geometry to filter.
[in]logAn optional log for reporting progress or errors.
[in]lockAn optional lock pointer for thread synchronization.

◆ ExecuteFiltering() [2/2]

void GeometryFilter::ExecuteFiltering ( const JSONNode & active_filters,
Model & model,
LogPtr log,
const void * lock )
static

Executes filtering on all geometry within a Model using the filters described in the JSON node.


Parameters
[in]active_filtersA JSON node describing which filters to apply and their parameters.
[in]modelThe model whose geometry will be filtered.
[in]logAn optional log for reporting progress or errors.
[in]lockAn optional lock pointer for thread synchronization.

◆ filterID()

const String & GeometryFilter::filterID ( ) const
inlinenodiscard

Returns the internal string identifier of this filter.


Returns
A const reference to the filter's ID string.

Definition at line 156 of file GeometryFilter.h.

References m_id.

◆ filterName()

const TranslatedString & GeometryFilter::filterName ( ) const
inlinenodiscard

Returns the user-facing translated name of this filter.


Returns
A const reference to the filter's translated name.

Definition at line 150 of file GeometryFilter.h.

References m_name.

◆ FinishFiltering()

void GeometryFilter::FinishFiltering ( const Matrix< fltp08 > & transform,
Geometry & geo,
const GeometryFilterParameters & params )
staticprotected

Applies the filtering results back to the geometry after filter execution.


Parameters
[in]transformThe transformation matrix that was used during filtering.
[in]geoThe geometry to apply filtered results to.
[in]paramsThe parameters containing the filtering results.

◆ GetAvailableDescriptions()

Buffer< FilterDescription > GeometryFilter::GetAvailableDescriptions ( )
static

Retrieves the default FilterDescription entries for all registered filters.


Returns
A buffer of FilterDescription objects representing all available filter configurations.

◆ PrepareForFiltering()

void GeometryFilter::PrepareForFiltering ( const Matrix< fltp08 > & transform,
Geometry & geo,
GeometryFilterParameters & params )
staticprotected

Prepares geometry data for filtering by populating the parameters with vertex data.


Parameters
[in]transformThe transformation matrix to apply.
[in]geoThe geometry to prepare.
[in]paramsThe parameters struct to populate with geometry data.

◆ runFilter()

virtual bool GeometryFilter::runFilter ( GeometryFilterParameters & parameters)
pure virtual

Executes this filter on the given parameters, modifying the filtered flags.


Parameters
[in]parametersThe filter parameters including vertices, transform, and output filtered flags.
Returns
True if the filter was successfully applied and produced changes, false otherwise.

Implemented in PropertyChannelFilter.

◆ SetFiltersCommand()

DynamicPointer< ManagedDesignCommand > GeometryFilter::SetFiltersCommand ( const Buffer< FilterDescription > & filter)
static

Creates a design command that replaces the entire active filter set with the given filters.


Parameters
[in]filterThe complete set of filter descriptions to apply.
Returns
A DynamicPointer to the created ManagedDesignCommand for undo/redo support.

◆ ToCommandString()

String GeometryFilter::ToCommandString ( const Buffer< FilterDescription > & descriptions)
static

Serializes a set of filter descriptions into a command string representation.


Parameters
[in]descriptionsThe filter descriptions to serialize.
Returns
A String containing the serialized command representation.
Note
The exact format and purpose of this command string is unclear; it may be used for undo/redo command serialization or for persisting filter configurations.

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