API Documentation
Loading...
Searching...
No Matches
GeometryBoolean.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/SoftwareService.h>
4#include <NDEVR/GeometryVertices.h>
5#include <NDEVR/Model.h>
6#include <NDEVR/Buffer.h>
7#include <NDEVR/GenericOption.h>
8namespace NDEVR
9{
10 class DesignSelection;
11 /**--------------------------------------------------------------------------------------------------
12 \brief Types of GeometryBoolean operations supported natively by the NDEVR engine
13 **/
20 class DesignObjectLookup;
21 /**--------------------------------------------------------------------------------------------------
22 \brief Describes custom options for a particular GeometryBoolean operation
23 **/
25 {
26 BooleanDescription(const TranslatedString& filter_name, const String& filter_id);
27 };
28 /**--------------------------------------------------------------------------------------------------
29 \brief Stores a groups of options for performing GeometryBoolean operations.
30 **/
43
44 /**--------------------------------------------------------------------------------------------------
45 \brief Class for calculating geometry Boolean operations (AND, OR, NOT, XOR, ...) in 3D space. See
46 https://en.wikipedia.org/wiki/Boolean_operations_on_polygons
47 **/
49 {
50 protected:
51 explicit GeometryBoolean(const TranslatedString& name, const String& id);
52 public:
53 static void SetupDefaultSurfaceObject(Model& target_surface_location, const void* lock);
56
57 static void ExecuteBoolean(const JSONNode& active_filters, const DesignSelection& selection_to_surface, Model& target_surface_location, DesignObjectLookup* lookup, ProgressInfo* log, const void* lock);
58 static void ExecuteBoolean(const JSONNode& active_filters, const Buffer<Model>& models_to_surface, Model& target_surface_location, ProgressInfo* log, const void* lock);
59 static void ExecuteBoolean(const JSONNode& active_filters, GeometryBooleanParameters& params, Model& target_surface_location);
63 public:
64 GeometryBoolean(const GeometryBoolean& filter) = delete;
65 GeometryBoolean(const GeometryBoolean&& filter) = delete;
66 virtual ~GeometryBoolean() = default;
67 virtual bool runBoolean(GeometryBooleanParameters& parameters) = 0;
68 //Returns whether or not the filter can be applied given the target parameters. Default true
69 virtual bool canRunBoolean(const GeometryBooleanParameters&) { return true; }
71 [[nodiscard]] const TranslatedString& BooleanName() const { return m_name; }
72 [[nodiscard]] const String& BooleanID() const { return m_id; }
73 protected:
76 protected:
77 static void PrepareForBoolean(const Matrix<fltp08>& transform, const Geometry& geo, GeometryBooleanParameters& params);
78 static void ClearAllBoolean(Geometry& geo, ProgressInfo* log, const void* lock);
79 static void FinishBoolean(const Matrix<fltp08>& transform, Geometry& geo, const GeometryBooleanParameters& params);
80 protected:
82 };
83}
#define NDEVR_DESIGN_API
Definition DLLInfo.h:55
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
A simple structure for storing a collection of data.
Definition DesignSelection.h:26
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Stores a groups of GenericOptions that can be used to group them.
Definition GenericOptions.h:151
Class for calculating geometry Boolean operations (AND, OR, NOT, XOR, ...) in 3D space....
Definition GeometryBoolean.h:49
static uint04 AvailableBooleanDescriptionCount()
static const Dictionary< String, GeometryBoolean * > & AvailableBoolean()
static void PrepareForBoolean(const Matrix< fltp08 > &transform, const Geometry &geo, GeometryBooleanParameters &params)
static Buffer< BooleanDescription > GetAvailableDescriptions()
String m_id
Definition GeometryBoolean.h:75
virtual bool canRunBoolean(const GeometryBooleanParameters &)
Definition GeometryBoolean.h:69
static Dictionary< String, GeometryBoolean * > s_global_available_boolean_engines
Definition GeometryBoolean.h:81
virtual ~GeometryBoolean()=default
static void ExecuteBoolean(const JSONNode &active_filters, GeometryBooleanParameters &params, Model &target_surface_location)
GeometryBoolean(const TranslatedString &name, const String &id)
GeometryBoolean(const GeometryBoolean &&filter)=delete
const TranslatedString & BooleanName() const
Definition GeometryBoolean.h:71
static void AddAvailableBooleanEngine(GeometryBoolean *filter)
static void ExecuteBoolean(const JSONNode &active_filters, const Buffer< Model > &models_to_surface, Model &target_surface_location, ProgressInfo *log, const void *lock)
TranslatedString m_name
Definition GeometryBoolean.h:74
static void ClearAllBoolean(Geometry &geo, ProgressInfo *log, const void *lock)
static void ExecuteBoolean(const JSONNode &active_filters, const DesignSelection &selection_to_surface, Model &target_surface_location, DesignObjectLookup *lookup, ProgressInfo *log, const void *lock)
virtual bool runBoolean(GeometryBooleanParameters &parameters)=0
static String ToCommandString(const Buffer< BooleanDescription > &descriptions)
static void SetupDefaultSurfaceObject(Model &target_surface_location, const void *lock)
static void FinishBoolean(const Matrix< fltp08 > &transform, Geometry &geo, const GeometryBooleanParameters &params)
virtual Buffer< BooleanDescription > defaultBooleanArguments()
const String & BooleanID() const
Definition GeometryBoolean.h:72
GeometryBoolean(const GeometryBoolean &filter)=delete
A core class within the model heirarchy containing vertex-based data (Usually 3D data) within a set c...
Definition Geometry.h:64
JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text ...
Definition JSONParser.h:60
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
Software Services provide an interface for adding to or changing the software behavior via functional...
Definition SoftwareService.h:9
Software Service Managers take a Software service to modify the behavior of the software.
Definition SoftwareService.h:15
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
GeometryBooleanOperation
Types of GeometryBoolean operations supported natively by the NDEVR engine.
Definition GeometryBoolean.h:15
@ e_subtract
Definition GeometryBoolean.h:17
@ e_cut
Definition GeometryBoolean.h:18
@ e_concatinate
Definition GeometryBoolean.h:16
Describes custom options for a particular GeometryBoolean operation.
Definition GeometryBoolean.h:25
BooleanDescription(const TranslatedString &filter_name, const String &filter_id)
Stores a groups of options for performing GeometryBoolean operations.
Definition GeometryBoolean.h:32
Buffer< Vertex< 3, fltp04 > > surface_positions
Definition GeometryBoolean.h:36
Buffer< RGBColor > surface_colors
Definition GeometryBoolean.h:38
Buffer< Buffer< uint04 > > surface_polygons
Definition GeometryBoolean.h:40
Buffer< Ray< 3, fltp04 > > surface_normals
Definition GeometryBoolean.h:37
Buffer< Vector< 3, uint04 > > surface_triangles
Definition GeometryBoolean.h:39
An container for storing some number of vertices for editing.
Definition GeometryVertices.h:18