NDEVR
API Documentation
GeometryBooleanabstract

Class for calculating geometry Boolean operations (AND, OR, NOT, XOR, ...) in 3D space. More...

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

Public Member Functions

 GeometryBoolean (const GeometryBoolean &&filter)=delete
 Move constructor is deleted; boolean engines are not movable.
 GeometryBoolean (const GeometryBoolean &filter)=delete
 Copy constructor is deleted; boolean engines are not copyable.
virtual ~GeometryBoolean ()=default
 Virtual destructor for proper cleanup of derived classes.
const StringBooleanID () const
 Returns the internal string identifier of this boolean engine.
const TranslatedStringBooleanName () const
 Returns the user-facing translated name of this boolean engine.
virtual bool canRunBoolean (const GeometryBooleanParameters &)
 Returns whether or not the boolean operation can be applied given the target parameters.
virtual Buffer< BooleanDescriptiondefaultBooleanArguments ()
 Returns the default set of BooleanDescription arguments for this engine.
virtual bool runBoolean (GeometryBooleanParameters &parameters)=0
 Executes the boolean operation defined by this engine on the given parameters.

Static Public Member Functions

static void AddAvailableBooleanEngine (GeometryBoolean *filter)
 Registers a GeometryBoolean engine so it becomes available for boolean operations.
static const Dictionary< String, GeometryBoolean * > & AvailableBoolean ()
 Returns the dictionary of all registered GeometryBoolean engines keyed by their string ID.
static uint04 AvailableBooleanDescriptionCount ()
 Returns the number of available boolean description entries across all registered engines.
static void ExecuteBoolean (const JSONNode &active_filters, const Buffer< Model > &models_to_surface, Model &target_surface_location, InfoPipe *log, const void *lock)
 Executes boolean operations on a buffer of Models, writing results into the target model.
static void ExecuteBoolean (const JSONNode &active_filters, const DesignSelection &selection_to_surface, Model &target_surface_location, DesignObjectLookup *lookup, InfoPipe *log, const void *lock)
 Executes boolean operations on a DesignSelection, writing results into the target model.
static void ExecuteBoolean (const JSONNode &active_filters, GeometryBooleanParameters &params, Model &target_surface_location)
 Executes boolean operations using pre-populated parameters, writing results into the target model.
static Buffer< BooleanDescriptionGetAvailableDescriptions ()
 Retrieves the list of all available BooleanDescription options from registered engines.
static void SetupDefaultSurfaceObject (Model &target_surface_location, const void *lock)
 Configures a Model as a default surface object suitable for receiving boolean operation results.
static String ToCommandString (const Buffer< BooleanDescription > &descriptions)
 Serializes a buffer of BooleanDescription objects into a command string representation.

Protected Member Functions

 GeometryBoolean (const TranslatedString &name, const String &id)
 Constructs a GeometryBoolean engine with the given display name and identifier.

Static Protected Member Functions

static void ClearAllBoolean (Geometry &geo, InfoPipe *log, const void *lock)
 Clears all boolean-related data from the given geometry.
static void FinishBoolean (const Matrix< fltp08 > &transform, Geometry &geo, const GeometryBooleanParameters &params)
 Writes boolean operation results back into the geometry, applying the inverse transform.
static void PrepareForBoolean (const Matrix< fltp08 > &transform, const Geometry &geo, GeometryBooleanParameters &params)
 Prepares geometry data for a boolean operation by transforming and extracting mesh data.

Protected Attributes

String m_id
 The internal string identifier of this boolean engine.
TranslatedString m_name
 The user-facing translated display name of this boolean engine.

Static Protected Attributes

static Dictionary< String, GeometryBoolean * > s_global_available_boolean_engines
 Global registry of all available boolean engines keyed by string ID.

Detailed Description

Class for calculating geometry Boolean operations (AND, OR, NOT, XOR, ...) in 3D space.


See https://en.wikipedia.org/wiki/Boolean_operations_on_polygons

See also
Geometry, GeometryFilter

Definition at line 58 of file GeometryBoolean.h.

Constructor & Destructor Documentation

◆ GeometryBoolean()

GeometryBoolean::GeometryBoolean ( const TranslatedString & name,
const String & id )
explicitprotected

Constructs a GeometryBoolean engine with the given display name and identifier.


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

Referenced by GeometryBoolean(), GeometryBoolean(), and AddAvailableBooleanEngine().

Member Function Documentation

◆ AddAvailableBooleanEngine()

void GeometryBoolean::AddAvailableBooleanEngine ( GeometryBoolean * filter)
static

Registers a GeometryBoolean engine so it becomes available for boolean operations.


Parameters
[in]filterThe GeometryBoolean engine to register. Caller retains ownership.

References GeometryBoolean().

◆ AvailableBoolean()

const Dictionary< String, GeometryBoolean * > & GeometryBoolean::AvailableBoolean ( )
static

Returns the dictionary of all registered GeometryBoolean engines keyed by their string ID.


Returns
A const reference to the dictionary mapping engine IDs to GeometryBoolean pointers

◆ AvailableBooleanDescriptionCount()

uint04 GeometryBoolean::AvailableBooleanDescriptionCount ( )
static

Returns the number of available boolean description entries across all registered engines.


Returns
The count of available boolean descriptions

◆ BooleanID()

const String & GeometryBoolean::BooleanID ( ) const
inlinenodiscard

Returns the internal string identifier of this boolean engine.


Returns
A const reference to the engine ID string

Definition at line 159 of file GeometryBoolean.h.

References m_id.

◆ BooleanName()

const TranslatedString & GeometryBoolean::BooleanName ( ) const
inlinenodiscard

Returns the user-facing translated name of this boolean engine.


Returns
A const reference to the translated display name

Definition at line 154 of file GeometryBoolean.h.

References m_name.

◆ canRunBoolean()

virtual bool GeometryBoolean::canRunBoolean ( const GeometryBooleanParameters & )
inlinevirtual

Returns whether or not the boolean operation can be applied given the target parameters.


Parameters
[in]parametersThe geometry boolean parameters to check (unnamed in base implementation)
Returns
True if this engine can process the given parameters, false otherwise. Default returns true.

Definition at line 144 of file GeometryBoolean.h.

◆ ClearAllBoolean()

void GeometryBoolean::ClearAllBoolean ( Geometry & geo,
InfoPipe * log,
const void * lock )
staticprotected

Clears all boolean-related data from the given geometry.


Parameters
[in]geoThe geometry to clear
[in]logOptional info pipe for progress reporting
[in]lockOptional lock pointer for thread synchronization

◆ defaultBooleanArguments()

virtual Buffer< BooleanDescription > GeometryBoolean::defaultBooleanArguments ( )
virtual

Returns the default set of BooleanDescription arguments for this engine.


Returns
A buffer of BooleanDescription objects representing the default options

◆ ExecuteBoolean() [1/3]

void GeometryBoolean::ExecuteBoolean ( const JSONNode & active_filters,
const Buffer< Model > & models_to_surface,
Model & target_surface_location,
InfoPipe * log,
const void * lock )
static

Executes boolean operations on a buffer of Models, writing results into the target model.


Parameters
[in]active_filtersJSON configuration specifying which boolean engines and options to use
[in]models_to_surfaceThe buffer of source models to process
[in]target_surface_locationThe model to receive the boolean operation result
[in]logOptional info pipe for progress and error reporting
[in]lockOptional lock pointer for thread synchronization

◆ ExecuteBoolean() [2/3]

void GeometryBoolean::ExecuteBoolean ( const JSONNode & active_filters,
const DesignSelection & selection_to_surface,
Model & target_surface_location,
DesignObjectLookup * lookup,
InfoPipe * log,
const void * lock )
static

Executes boolean operations on a DesignSelection, writing results into the target model.


Parameters
[in]active_filtersJSON configuration specifying which boolean engines and options to use
[in]selection_to_surfaceThe design selection containing source geometry
[in]target_surface_locationThe model to receive the boolean operation result
[in]lookupLookup object for resolving design object references
[in]logOptional info pipe for progress and error reporting
[in]lockOptional lock pointer for thread synchronization

◆ ExecuteBoolean() [3/3]

void GeometryBoolean::ExecuteBoolean ( const JSONNode & active_filters,
GeometryBooleanParameters & params,
Model & target_surface_location )
static

Executes boolean operations using pre-populated parameters, writing results into the target model.


Parameters
[in]active_filtersJSON configuration specifying which boolean engines and options to use
[in]paramsThe pre-populated boolean parameters containing source geometry data
[in]target_surface_locationThe model to receive the boolean operation result

◆ FinishBoolean()

void GeometryBoolean::FinishBoolean ( const Matrix< fltp08 > & transform,
Geometry & geo,
const GeometryBooleanParameters & params )
staticprotected

Writes boolean operation results back into the geometry, applying the inverse transform.


Parameters
[in]transformThe transformation matrix (inverse will be applied to results)
[in]geoThe target geometry to receive the results
[in]paramsThe parameters containing the boolean operation results

◆ GetAvailableDescriptions()

Buffer< BooleanDescription > GeometryBoolean::GetAvailableDescriptions ( )
static

Retrieves the list of all available BooleanDescription options from registered engines.


Returns
A buffer containing all available BooleanDescription objects

◆ PrepareForBoolean()

void GeometryBoolean::PrepareForBoolean ( const Matrix< fltp08 > & transform,
const Geometry & geo,
GeometryBooleanParameters & params )
staticprotected

Prepares geometry data for a boolean operation by transforming and extracting mesh data.


Parameters
[in]transformThe transformation matrix to apply to the geometry
[in]geoThe source geometry to prepare
[in]paramsThe parameters object to populate with the prepared geometry data

◆ runBoolean()

virtual bool GeometryBoolean::runBoolean ( GeometryBooleanParameters & parameters)
pure virtual

Executes the boolean operation defined by this engine on the given parameters.


Parameters
[in]parametersThe geometry boolean parameters containing input data and receiving output
Returns
True if the boolean operation succeeded, false otherwise

◆ SetupDefaultSurfaceObject()

void GeometryBoolean::SetupDefaultSurfaceObject ( Model & target_surface_location,
const void * lock )
static

Configures a Model as a default surface object suitable for receiving boolean operation results.


Parameters
[in]target_surface_locationThe model to configure as a surface container
[in]lockOptional lock pointer for thread synchronization

◆ ToCommandString()

String GeometryBoolean::ToCommandString ( const Buffer< BooleanDescription > & descriptions)
static

Serializes a buffer of BooleanDescription objects into a command string representation.


Parameters
[in]descriptionsThe buffer of boolean descriptions to serialize

\returns A string representation suitable for command-line or JSON usage

Note
The exact format of the returned string is unclear from the header alone.

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