VTK
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 #ifndef vtkSelector_h
23 #define vtkSelector_h
24 
25 #include "vtkFiltersExtractionModule.h" // For export macro
26 #include "vtkObject.h"
27 #include "vtkSmartPointer.h" // For vtkSmartPointer
28 
30 class vtkDataObject;
31 class vtkSelectionNode;
32 class vtkSignedCharArray;
33 class vtkTable;
34 
35 class VTKFILTERSEXTRACTION_EXPORT vtkSelector : public vtkObject
36 {
37  public:
38  vtkTypeMacro(vtkSelector, vtkObject);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
52  virtual void Initialize(vtkSelectionNode* node, const std::string& insidednessArrayName);
53 
57  virtual void Finalize() {}
58 
67  virtual bool ComputeSelectedElements(vtkDataObject* input, vtkDataObject* output);
68 
69 protected:
71  virtual ~vtkSelector() override;
72 
73  // Contains the selection criteria.
74  vtkSelectionNode* Node = nullptr;
75 
76  // Name of the insidedness array added to the output when the selection criteria is
77  // evaluated by this operator.
79 
96  vtkSignedCharArray* insidednessArray, unsigned int compositeIndex,
97  unsigned int amrLevel, unsigned int amrIndex) = 0;
98 
114  vtkCompositeDataSet* input, vtkCompositeDataSet* output);
115 
119  bool SkipBlock(unsigned int compositeIndex, unsigned int amrLevel, unsigned int amrIndex);
120 
125 
130  vtkDataObject* data, vtkSignedCharArray* selectedPoints);
131 
132 private:
133  vtkSelector(const vtkSelector&) = delete;
134  void operator=(const vtkSelector&) = delete;
135 };
136 
137 #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.
vtkSelectionNode
A node in a selection tree.
Definition: vtkSelectionNode.h:68
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:37
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:39
vtkSelector::InsidednessArrayName
std::string InsidednessArrayName
Definition: vtkSelector.h:78
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:52
vtkSelector
Definition: vtkSelector.h:36
vtkSelector::SkipBlock
bool SkipBlock(unsigned int compositeIndex, unsigned int amrLevel, unsigned int amrIndex)
Subclasses can call this to check if the block should be skipped.
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...
vtkSelector::ComputeSelectedElements
virtual bool ComputeSelectedElements(vtkDataObject *input, vtkDataObject *output)
Given an input and the vtkSelectionNode passed into the Initialize() method, add to the output a vtkS...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSmartPointer.h
vtkSelector::Initialize
virtual void Initialize(vtkSelectionNode *node, const std::string &insidednessArrayName)
Sets the vtkSelectionNode used by this selection operator and initializes the data structures in the ...
vtkSelector::ComputeSelectedElementsForBlock
virtual bool ComputeSelectedElementsForBlock(vtkDataObject *input, vtkSignedCharArray *insidednessArray, unsigned int compositeIndex, unsigned int amrLevel, unsigned int amrIndex)=0
This method computes whether or not each element in the dataset is inside the selection and populates...
vtkObject.h
vtkSelector::ComputeSelectedElementsForCompositeDataSet
virtual bool ComputeSelectedElementsForCompositeDataSet(vtkCompositeDataSet *input, vtkCompositeDataSet *output)
Computes whether each element in the dataset is inside the selection and populates the given array wi...
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkSelector::~vtkSelector
virtual ~vtkSelector() override
vtkSelector::Finalize
virtual void Finalize()
Does any cleanup of objects created in Initialize.
Definition: vtkSelector.h:57
vtkSelector::CreateInsidednessArray
vtkSmartPointer< vtkSignedCharArray > CreateInsidednessArray(vtkIdType numElems)
Creates an array suitable for storing insideness.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65