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/SoftwareService.h>
4#include <NDEVR/GeometryVertices.h>
5#include <NDEVR/DesignCommand.h>
6#include <NDEVR/Buffer.h>
7#include <NDEVR/UUID.h>
8#include <NDEVR/GenericOption.h>
9#include <NDEVR/Pointer.h>
10
11namespace NDEVR
12{
13 class Model;
14 class Geometry;
15
16 /**--------------------------------------------------------------------------------------------------
17 \brief Describes special options/parameters for a GeometryFilter engine
18 **/
20 {
21 FilterDescription(const TranslatedString& filter_name, const String& filter_id);
22 };
23 /**--------------------------------------------------------------------------------------------------
24 \brief Stores a groups of options for performing GeometryFilter operations.
25 **/
35
36 /**--------------------------------------------------------------------------------------------------
37 \brief A service that contains registered algorithms for removing vertices or shapes from a group of
38 vertices or shapes
39 **/
41 {
42 protected:
43 explicit GeometryFilter(const TranslatedString& name, const String& id);
44 public:
46 static void AddAvailableFilter(GeometryFilter* filter);
47 static void ExecuteFiltering(const JSONNode& active_filters, Model& model, ProgressInfo* log, const void* lock);
48 static void ExecuteFiltering(const JSONNode& active_filters, const Matrix<fltp08>& transform, Geometry& geo, ProgressInfo* log, const void* lock);
53 public:
54 GeometryFilter(const GeometryFilter& filter) = delete;
55 GeometryFilter(const GeometryFilter&& filter) = delete;
56 virtual ~GeometryFilter() = default;
57 virtual bool runFilter(GeometryFilterParameters& parameters) = 0;
58 //Returns whether or not the filter can be applied given the target parameters. Default true
59 virtual bool canRunFilter(const GeometryFilterParameters&) { return true; }
61 [[nodiscard]] const TranslatedString& filterName() const { return m_name; }
62 [[nodiscard]] const String& filterID() const { return m_id; }
63 protected:
66 protected:
67 static void PrepareForFiltering(const Matrix<fltp08>& transform, Geometry& geo, GeometryFilterParameters& params);
68 static void ClearAllFiltering(Geometry& geo, ProgressInfo* log, const void* lock);
69 static void FinishFiltering(const Matrix<fltp08>& transform, Geometry& geo, const GeometryFilterParameters& params);
70 protected:
72 };
73}
#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 hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Stores a groups of GenericOptions that can be used to group them.
Definition GenericOptions.h:151
A service that contains registered algorithms for removing vertices or shapes from a group of vertice...
Definition GeometryFilter.h:41
const TranslatedString & filterName() const
Definition GeometryFilter.h:61
const String & filterID() const
Definition GeometryFilter.h:62
static DynamicPointer< DesignCommand > SetFiltersCommand(const Buffer< FilterDescription > &filter)
String m_id
Definition GeometryFilter.h:65
static DynamicPointer< DesignCommand > AddFilterCommand(const FilterDescription &filter)
static const Dictionary< String, GeometryFilter * > & AvailableFilters()
static void ExecuteFiltering(const JSONNode &active_filters, Model &model, ProgressInfo *log, const void *lock)
static Dictionary< String, GeometryFilter * > s_global_available_filters
Definition GeometryFilter.h:71
GeometryFilter(const GeometryFilter &filter)=delete
static void ExecuteFiltering(const JSONNode &active_filters, const Matrix< fltp08 > &transform, Geometry &geo, ProgressInfo *log, const void *lock)
virtual ~GeometryFilter()=default
virtual bool runFilter(GeometryFilterParameters &parameters)=0
GeometryFilter(const GeometryFilter &&filter)=delete
static void ClearAllFiltering(Geometry &geo, ProgressInfo *log, const void *lock)
static Buffer< FilterDescription > GetAvailableDescriptions()
virtual bool canRunFilter(const GeometryFilterParameters &)
Definition GeometryFilter.h:59
static void PrepareForFiltering(const Matrix< fltp08 > &transform, Geometry &geo, GeometryFilterParameters &params)
static String ToCommandString(const Buffer< FilterDescription > &descriptions)
TranslatedString m_name
Definition GeometryFilter.h:64
static void FinishFiltering(const Matrix< fltp08 > &transform, Geometry &geo, const GeometryFilterParameters &params)
GeometryFilter(const TranslatedString &name, const String &id)
static void AddAvailableFilter(GeometryFilter *filter)
virtual Buffer< FilterDescription > defaultFilterArguments()
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
Describes special options/parameters for a GeometryFilter engine.
Definition GeometryFilter.h:20
FilterDescription(const TranslatedString &filter_name, const String &filter_id)
Stores a groups of options for performing GeometryFilter operations.
Definition GeometryFilter.h:27
Matrix< fltp08 > transform
Definition GeometryFilter.h:29
Buffer< bool > filtered
Definition GeometryFilter.h:32
Dictionary< UUID, Bounds< 1, uint04 > > vertex_bounds
Definition GeometryFilter.h:33
An container for storing some number of vertices for editing.
Definition GeometryVertices.h:18