VTK  9.2.6
vtkSelector.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSelector.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
22
23#ifndef vtkSelector_h
24#define vtkSelector_h
25
26#include "vtkFiltersExtractionModule.h" // For export macro
27#include "vtkObject.h"
28#include "vtkSmartPointer.h" // For vtkSmartPointer
29
30#include <set> // for std::set
31
33class vtkDataObject;
36class vtkTable;
39
40class VTKFILTERSEXTRACTION_EXPORT vtkSelector : public vtkObject
41{
42public:
43 vtkTypeMacro(vtkSelector, vtkObject);
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
55 virtual void Initialize(vtkSelectionNode* node);
56
60 virtual void Finalize() {}
61
71 virtual void Execute(vtkDataObject* input, vtkDataObject* output);
72
74
78 vtkSetMacro(InsidednessArrayName, std::string);
79 vtkGetMacro(InsidednessArrayName, std::string);
81protected:
83 ~vtkSelector() override;
84
85 // Contains the selection criteria.
87
88 // Name of the insidedness array added to the output when the selection criteria is
89 // evaluated by this operator.
91
108 vtkDataObject* input, vtkSignedCharArray* insidednessArray) = 0;
109
116
124 virtual SelectionMode GetAMRBlockSelection(unsigned int level, unsigned int index);
125
137 unsigned int compositeIndex, bool isDataObjectTree = true);
138
144
150 vtkDataObject* data, vtkSignedCharArray* selectedPoints);
151
160
161private:
162 vtkSelector(const vtkSelector&) = delete;
163 void operator=(const vtkSelector&) = delete;
164
165 void ProcessBlock(vtkDataObject* inputBlock, vtkDataObject* outputBlock, bool forceFalse);
166 void ProcessAMR(vtkUniformGridAMR* input, vtkCompositeDataSet* output);
167 void ProcessDataObjectTree(vtkDataObjectTree* input, vtkDataObjectTree* output,
168 SelectionMode inheritedSelectionMode, unsigned int compositeIndex = 0);
169 void ProcessSelectors(vtkCompositeDataSet* input);
170
171 std::set<unsigned int> SubsetCompositeIds;
172};
173
174#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:34
a node in a vtkSelection the defines the selection criteria.
virtual SelectionMode GetAMRBlockSelection(unsigned int level, unsigned int index)
Returns whether the AMR block is to be processed.
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.
vtkSelectionNode * Node
Definition vtkSelector.h:86
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:60
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:90
~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:68
a concrete implementation of vtkCompositeDataSet
int vtkIdType
Definition vtkType.h:332