VTK  9.0.1
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 =========================================================================*/
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 
31 class vtkDataObject;
32 class vtkSelectionNode;
33 class vtkSignedCharArray;
34 class vtkTable;
35 class vtkDataObjectTree;
36 class vtkUniformGridAMR;
37 
38 class VTKFILTERSEXTRACTION_EXPORT vtkSelector : public vtkObject
39 {
40 public:
41  vtkTypeMacro(vtkSelector, vtkObject);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
53  virtual void Initialize(vtkSelectionNode* node);
54 
58  virtual void Finalize() {}
59 
69  virtual void Execute(vtkDataObject* input, vtkDataObject* output);
70 
72 
76  vtkSetMacro(InsidednessArrayName, std::string);
77  vtkGetMacro(InsidednessArrayName, std::string);
79 protected:
81  virtual ~vtkSelector() override;
82 
83  // Contains the selection criteria.
84  vtkSelectionNode* Node = nullptr;
85 
86  // Name of the insidedness array added to the output when the selection criteria is
87  // evaluated by this operator.
89 
106  vtkDataObject* input, vtkSignedCharArray* insidednessArray) = 0;
107 
109  {
112  INHERIT
113  };
114 
122  virtual SelectionMode GetAMRBlockSelection(unsigned int level, unsigned int index);
123 
132  virtual SelectionMode GetBlockSelection(unsigned int compositeIndex);
133 
139 
145  vtkDataObject* data, vtkSignedCharArray* selectedPoints);
146 
155 
156 private:
157  vtkSelector(const vtkSelector&) = delete;
158  void operator=(const vtkSelector&) = delete;
159 
160  void ProcessBlock(vtkDataObject* inputBlock, vtkDataObject* outputBlock, bool forceFalse);
161  void ProcessAMR(vtkUniformGridAMR* input, vtkCompositeDataSet* output);
162  void ProcessDataObjectTree(vtkDataObjectTree* input, vtkDataObjectTree* output,
163  SelectionMode inheritedSelectionMode, unsigned int compositeIndex = 0);
164 };
165 
166 #endif
vtkSelector::vtkSelector
vtkSelector()
vtkSelector::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSelector::GetAMRBlockSelection
virtual SelectionMode GetAMRBlockSelection(unsigned int level, unsigned int index)
Returns whether the AMR block is to be processed.
vtkDataObjectTree
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
Definition: vtkDataObjectTree.h:47
vtkSelectionNode
A node in a selection tree.
Definition: vtkSelectionNode.h:62
vtkSelector::Execute
virtual void Execute(vtkDataObject *input, vtkDataObject *output)
Given an input and the vtkSelectionNode passed into the Initialize() method, add to the output a vtkS...
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:63
vtkSelector::ComputeSelectedElements
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
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:36
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:36
vtkSelector::InsidednessArrayName
std::string InsidednessArrayName
Definition: vtkSelector.h:88
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:46
vtkSelector
Definition: vtkSelector.h:39
vtkSelector::INCLUDE
@ INCLUDE
Definition: vtkSelector.h:110
vtkSelector::GetBlockSelection
virtual SelectionMode GetBlockSelection(unsigned int compositeIndex)
Returns whether the block is to be processed.
vtkX3D::level
@ level
Definition: vtkX3D.h:401
vtkSelector::ComputeCellsContainingSelectedPoints
vtkSmartPointer< vtkSignedCharArray > ComputeCellsContainingSelectedPoints(vtkDataObject *data, vtkSignedCharArray *selectedPoints)
Given a data object and selected points, return an array indicating the insidedness of cells that con...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkSelector::SelectionMode
SelectionMode
Definition: vtkSelector.h:109
vtkSelector::EXCLUDE
@ EXCLUDE
Definition: vtkSelector.h:111
vtkSmartPointer.h
vtkSelector::Initialize
virtual void Initialize(vtkSelectionNode *node)
Sets the vtkSelectionNode used by this selection operator and initializes the data structures in the ...
vtkSelector::ExpandToConnectedElements
void ExpandToConnectedElements(vtkDataObject *output)
Handle expanding to connected cells or point, if requested.
vtkObject.h
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkSelector::~vtkSelector
virtual ~vtkSelector() override
vtkSelector::Finalize
virtual void Finalize()
Does any cleanup of objects created in Initialize.
Definition: vtkSelector.h:58
vtkUniformGridAMR
Definition: vtkUniformGridAMR.h:33
vtkSelector::CreateInsidednessArray
vtkSmartPointer< vtkSignedCharArray > CreateInsidednessArray(vtkIdType numElems)
Creates an array suitable for storing insideness.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:60
vtkX3D::index
@ index
Definition: vtkX3D.h:252