API Documentation
Loading...
Searching...
No Matches
GeometryFilter.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/GeometryVertices.h>
4#include <NDEVR/DesignCommand.h>
5#include <NDEVR/Buffer.h>
6#include <NDEVR/UUID.h>
7#include <NDEVR/GenericOption.h>
8#include <NDEVR/Pointer.h>
9
10namespace NDEVR
11{
12 class Model;
13 class Geometry;
15 {
16 FilterDescription(const TranslatedString& filter_name, const String& filter_id);
17 };
27
29 {
30 protected:
31 explicit GeometryFilter(const TranslatedString& name, const String& id);
32
33 public:
34
35 static const Dictionary<String, GeometryFilter*>& AvailableFilters();
36 static void AddAvailableFilter(GeometryFilter* filter);
37
38 static void ExecuteFiltering(const JSONNode& active_filters, Model& model, ProgressInfo* log, const void* lock);
39 static void ExecuteFiltering(const JSONNode& active_filters, const Matrix<fltp08>& transform, Geometry& geo, ProgressInfo* log, const void* lock);
40 static Buffer<FilterDescription> GetAvailableDescriptions();
41 static String ToCommandString(const Buffer<FilterDescription>& descriptions);
42 static DynamicPointer<DesignCommand> AddFilterCommand(const FilterDescription& filter);
43 static DynamicPointer<DesignCommand> SetFiltersCommand(const Buffer<FilterDescription>& filter);
44 public:
45 GeometryFilter(const GeometryFilter& filter) = delete;
46 GeometryFilter(const GeometryFilter&& filter) = delete;
47 virtual ~GeometryFilter() = default;
48 virtual bool runFilter(GeometryFilterParameters& parameters) = 0;
49 //Returns whether or not the filter can be applied given the target parameters. Default true
50 virtual bool canRunFilter(const GeometryFilterParameters&) { return true; }
51 virtual Buffer<FilterDescription> defaultFilterArguments();
52 [[nodiscard]] const TranslatedString& filterName() const { return m_name; }
53 [[nodiscard]] const String& filterID() const { return m_id; }
54 protected:
57 protected:
58 static void PrepareForFiltering(const Matrix<fltp08>& transform, Geometry& geo, GeometryFilterParameters& params);
59 static void ClearAllFiltering(Geometry& geo, ProgressInfo* log, const void* lock);
60 static void FinishFiltering(const Matrix<fltp08>& transform, Geometry& geo, const GeometryFilterParameters& params);
61 protected:
63 };
64}
#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 Dictionary.h:48
Definition Pointer.hpp:303
Definition GenericOptions.h:145
Definition GeometryFilter.h:29
const TranslatedString & filterName() const
Definition GeometryFilter.h:52
const String & filterID() const
Definition GeometryFilter.h:53
String m_id
Definition GeometryFilter.h:56
GeometryFilter(const GeometryFilter &filter)=delete
virtual ~GeometryFilter()=default
virtual bool runFilter(GeometryFilterParameters &parameters)=0
GeometryFilter(const GeometryFilter &&filter)=delete
virtual bool canRunFilter(const GeometryFilterParameters &)
Definition GeometryFilter.h:50
TranslatedString m_name
Definition GeometryFilter.h:55
static Dictionary< String, GeometryFilter * > s_global_available_filters
Definition GeometryFilter.h:62
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
Definition GeometryFilter.h:15
Definition GeometryFilter.h:19
Matrix< fltp08 > transform
Definition GeometryFilter.h:21
Buffer< bool > filtered
Definition GeometryFilter.h:24
Dictionary< UUID, Bounds< 1, uint04 > > vertex_bounds
Definition GeometryFilter.h:25
Definition GeometryVertices.h:14