3#include <NDEVR/SoftwareService.h>
4#include <NDEVR/GeometryVertices.h>
5#include <NDEVR/DesignCommand.h>
6#include <NDEVR/Buffer.h>
8#include <NDEVR/GenericOption.h>
9#include <NDEVR/Pointer.h>
39 const void*
lock =
nullptr;
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
GenericOptionGroup()=default
Default constructor.
const String & filterID() const
Returns the internal string identifier of this filter.
String m_id
The internal unique string identifier for this filter.
virtual bool runFilter(GeometryFilterParameters ¶meters)=0
Executes this filter on the given parameters, modifying the filtered flags.
static DynamicPointer< ManagedDesignCommand > AddFilterCommand(const FilterDescription &filter)
Creates a design command that adds a single filter to the active filter set.
static Buffer< FilterDescription > GetAvailableDescriptions()
Retrieves the default FilterDescription entries for all registered filters.
static void AddAvailableFilter(GeometryFilter *filter)
Registers a GeometryFilter instance in the global available filters dictionary.
static const Dictionary< String, GeometryFilter * > & AvailableFilters()
Returns the global dictionary of all registered GeometryFilter instances keyed by their ID.
virtual bool canRunFilter(const GeometryFilterParameters &)
Returns whether this filter can be applied given the target parameters.
static DynamicPointer< ManagedDesignCommand > SetFiltersCommand(const Buffer< FilterDescription > &filter)
Creates a design command that replaces the entire active filter set with the given filters.
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.
GeometryFilter(const GeometryFilter &&filter)=delete
Move constructor is deleted; filters are non-movable.
GeometryFilter(const TranslatedString &name, const StringView &id)
Constructs a GeometryFilter with the given display name and identifier.
static Dictionary< String, GeometryFilter * > s_global_available_filters
Global registry of all available filter instances, keyed by their string ID.
static void PrepareForFiltering(const Matrix< fltp08 > &transform, Geometry &geo, GeometryFilterParameters ¶ms)
Prepares geometry data for filtering by populating the parameters with vertex data.
TranslatedString m_name
The user-facing translated display name for this filter.
virtual Buffer< FilterDescription > defaultFilterArguments()
Returns the default set of FilterDescription arguments for this filter.
static String ToCommandString(const Buffer< FilterDescription > &descriptions)
Serializes a set of filter descriptions into a command string representation.
virtual ~GeometryFilter()=default
Virtual destructor defaulted for proper polymorphic cleanup.
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.
GeometryFilter(const GeometryFilter &filter)=delete
Copy constructor is deleted; filters are non-copyable.
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 ¶ms)
Applies the filtering results back to the geometry after filter execution.
const TranslatedString & filterName() const
Returns the user-facing translated name of this filter.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text ...
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
A DesignCommand subclass that dispatches common design operations based on a ManagedCommandType enum ...
Templated logic for doing matrix multiplication.
A core class that represents a node on model hierarchy.
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
Describes special options/parameters for a GeometryFilter engine.
FilterDescription(const TranslatedString &filter_name, const String &filter_id)
Constructs a FilterDescription with the given display name and identifier.
Stores a groups of options for performing GeometryFilter operations.
const void * lock
An optional lock pointer used for thread synchronization during filtering.
Matrix< fltp08 > transform
The transformation matrix applied to geometry during filtering.
Dictionary< UUID, Bounds< 1, uint04 > > vertex_bounds
Maps geometry UUIDs to their vertex index ranges within the shared vertex buffer.
LogPtr log
An optional log for reporting filter progress or errors.
Buffer< bool > filtered
Per-vertex or per-element boolean flags indicating whether each element was filtered out.
GeometryFilterParameters()
Constructs default GeometryFilterParameters with identity transform and null lock/log.
A container for storing vertex data associated with geometry, including positions,...