VTK  9.5.20250805
vtkSelector.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
11#ifndef vtkSelector_h
12#define vtkSelector_h
13
14#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_6_0
15#include "vtkFiltersExtractionModule.h" // For export macro
16#include "vtkObject.h"
17#include "vtkSmartPointer.h" // For vtkSmartPointer
18
19#include <set> // for std::set
20
21VTK_ABI_NAMESPACE_BEGIN
23class vtkDataObject;
26class vtkTable;
29
30class VTKFILTERSEXTRACTION_EXPORT vtkSelector : public vtkObject
31{
32public:
33 vtkTypeMacro(vtkSelector, vtkObject);
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
45 virtual void Initialize(vtkSelectionNode* node);
46
50 virtual void Finalize() {}
51
61 virtual void Execute(vtkDataObject* input, vtkDataObject* output);
62
64
68 vtkSetMacro(InsidednessArrayName, std::string);
69 vtkGetMacro(InsidednessArrayName, std::string);
71protected:
73 ~vtkSelector() override;
74
75 // Contains the selection criteria.
76 vtkSelectionNode* Node = nullptr;
77
78 // Name of the insidedness array added to the output when the selection criteria is
79 // evaluated by this operator.
81
98 vtkDataObject* input, vtkSignedCharArray* insidednessArray) = 0;
99
101 {
104 INHERIT
105 };
106
112 "Deprecated method without effect, use GetBlockSelection(idx, false) instead.")
113 virtual SelectionMode GetAMRBlockSelection(
114 unsigned int vtkNotUsed(level), unsigned int vtkNotUsed(index))
115 {
116 return EXCLUDE;
117 };
118
130 unsigned int compositeIndex, bool isDataObjectTree = true);
131
137
143 vtkDataObject* data, vtkSignedCharArray* selectedPoints);
144
153
154private:
155 vtkSelector(const vtkSelector&) = delete;
156 void operator=(const vtkSelector&) = delete;
157
158 void ProcessBlock(vtkDataObject* inputBlock, vtkDataObject* outputBlock, bool forceFalse);
159 void ProcessAMR(vtkUniformGridAMR* input, vtkDataObjectTree* output);
160 void ProcessDataObjectTree(vtkDataObjectTree* input, vtkDataObjectTree* output,
161 SelectionMode inheritedSelectionMode, unsigned int compositeIndex = 0);
162 void ProcessSelectors(vtkCompositeDataSet* input);
163
164 std::set<unsigned int> SubsetCompositeIds;
165};
166
167VTK_ABI_NAMESPACE_END
168#endif
abstract superclass for composite (multi-block or AMR) datasets
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
a node in a vtkSelection the defines the selection criteria.
virtual bool ComputeSelectedElements(vtkDataObject *input, vtkSignedCharArray *insidednessArray)=0
This method computes whether or not each element in the dataset is inside the selection and populates...
vtkSmartPointer< vtkSignedCharArray > CreateInsidednessArray(vtkIdType numElems)
Creates an array suitable for storing insideness.
virtual SelectionMode GetBlockSelection(unsigned int compositeIndex, bool isDataObjectTree=true)
Returns whether the block is to be processed.
vtkSmartPointer< vtkSignedCharArray > ComputeCellsContainingSelectedPoints(vtkDataObject *data, vtkSignedCharArray *selectedPoints)
Given a data object and selected points, return an array indicating the insidedness of cells that con...
virtual void Finalize()
Does any cleanup of objects created in Initialize.
Definition vtkSelector.h:50
virtual void Execute(vtkDataObject *input, vtkDataObject *output)
Given an input and the vtkSelectionNode passed into the Initialize() method, add to the output a vtkS...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::string InsidednessArrayName
Definition vtkSelector.h:80
~vtkSelector() override
virtual void Initialize(vtkSelectionNode *node)
Sets the vtkSelectionNode used by this selection operator and initializes the data structures in the ...
void ExpandToConnectedElements(vtkDataObject *output)
Handle expanding to connected cells or point, if requested.
dynamic, self-adjusting array of signed char
Hold a reference to a vtkObjectBase instance.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
a multi-resolution dataset based on vtkUniformGrid
#define VTK_DEPRECATED_IN_9_6_0(reason)
int vtkIdType
Definition vtkType.h:332