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/GeometryVertices.h>
4#include <NDEVR/Model.h>
5#include <NDEVR/Buffer.h>
6#include <NDEVR/GenericOption.h>
7namespace NDEVR
8{
9 class DesignSelection;
16 class DesignObjectLookup;
18 {
19 BooleanDescription(const TranslatedString& filter_name, const String& filter_id);
20 };
34 {
35 protected:
36 explicit GeometryBoolean(const TranslatedString& name, const String& id);
37 public:
38 static void SetupDefaultSurfaceObject(Model& target_surface_location, const void* lock);
39 static const Dictionary<String, GeometryBoolean*>& AvailableBoolean();
40 static void AddAvailableBooleanEngine(GeometryBoolean* filter);
41
42 static void ExecuteBoolean(const JSONNode& active_filters, const DesignSelection& selection_to_surface, Model& target_surface_location, DesignObjectLookup* lookup, ProgressInfo* log, const void* lock);
43 static void ExecuteBoolean(const JSONNode& active_filters, const Buffer<Model>& models_to_surface, Model& target_surface_location, ProgressInfo* log, const void* lock);
44 static void ExecuteBoolean(const JSONNode& active_filters, GeometryBooleanParameters& params, Model& target_surface_location);
45 static Buffer<BooleanDescription> GetAvailableDescriptions();
46 static uint04 AvailableBooleanDescriptionCount();
47 static String ToCommandString(const Buffer<BooleanDescription>& descriptions);
48 public:
49 GeometryBoolean(const GeometryBoolean& filter) = delete;
50 GeometryBoolean(const GeometryBoolean&& filter) = delete;
51 virtual ~GeometryBoolean() = default;
52 virtual bool runBoolean(GeometryBooleanParameters& parameters) = 0;
53 //Returns whether or not the filter can be applied given the target parameters. Default true
54 virtual bool canRunBoolean(const GeometryBooleanParameters&) { return true; }
55 virtual Buffer<BooleanDescription> defaultBooleanArguments();
56 [[nodiscard]] const TranslatedString& BooleanName() const { return m_name; }
57 [[nodiscard]] const String& BooleanID() const { return m_id; }
58 protected:
61 protected:
62 static void PrepareForBoolean(const Matrix<fltp08>& transform, const Geometry& geo, GeometryBooleanParameters& params);
63 static void ClearAllBoolean(Geometry& geo, ProgressInfo* log, const void* lock);
64 static void FinishBoolean(const Matrix<fltp08>& transform, Geometry& geo, const GeometryBooleanParameters& params);
65 protected:
67 };
68}
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignObjectLookup.h:61
Definition DesignSelection.h:19
Definition Dictionary.h:48
Definition GenericOptions.h:145
Definition GeometryBoolean.h:34
String m_id
Definition GeometryBoolean.h:60
static Dictionary< String, GeometryBoolean * > s_global_available_boolean_engines
Definition GeometryBoolean.h:66
virtual bool canRunBoolean(const GeometryBooleanParameters &)
Definition GeometryBoolean.h:54
virtual ~GeometryBoolean()=default
GeometryBoolean(const GeometryBoolean &&filter)=delete
const TranslatedString & BooleanName() const
Definition GeometryBoolean.h:56
TranslatedString m_name
Definition GeometryBoolean.h:59
virtual bool runBoolean(GeometryBooleanParameters &parameters)=0
const String & BooleanID() const
Definition GeometryBoolean.h:57
GeometryBoolean(const GeometryBoolean &filter)=delete
Definition Geometry.h:64
JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text ...
Definition JSONParser.h:121
Definition Matrix.hpp:173
Definition Model.h:54
Definition ProgressInfo.hpp:43
Definition String.h:40
Definition TranslatedString.h:9
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:120
GeometryBooleanOperation
Definition GeometryBoolean.h:11
@ e_subtract
Definition GeometryBoolean.h:13
@ e_cut
Definition GeometryBoolean.h:14
@ e_concatinate
Definition GeometryBoolean.h:12
Definition GeometryBoolean.h:18
Definition GeometryBoolean.h:22
Buffer< Vertex< 3, fltp04 > > surface_positions
Definition GeometryBoolean.h:26
Buffer< RGBColor > surface_colors
Definition GeometryBoolean.h:28
Buffer< Buffer< uint04 > > surface_polygons
Definition GeometryBoolean.h:30
Buffer< Ray< 3, fltp04 > > surface_normals
Definition GeometryBoolean.h:27
Buffer< Vector< 3, uint04 > > surface_triangles
Definition GeometryBoolean.h:29
Definition GeometryVertices.h:14