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:
70  vtkSelector();
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 
95  virtual bool ComputeSelectedElementsForBlock(vtkDataObject* input,
96  vtkSignedCharArray* insidednessArray, unsigned int compositeIndex,
97  unsigned int amrLevel, unsigned int amrIndex) = 0;
98 
113  virtual bool ComputeSelectedElementsForCompositeDataSet(
114  vtkCompositeDataSet* input, vtkCompositeDataSet* output);
115 
119  bool SkipBlock(unsigned int compositeIndex, unsigned int amrLevel, unsigned int amrIndex);
120 
124  vtkSmartPointer<vtkSignedCharArray> CreateInsidednessArray(vtkIdType numElems);
125 
129  vtkSmartPointer<vtkSignedCharArray> ComputeCellsContainingSelectedPoints(
130  vtkDataObject* data, vtkSignedCharArray* selectedPoints);
131 
132 private:
133  vtkSelector(const vtkSelector&) = delete;
134  void operator=(const vtkSelector&) = delete;
135 };
136 
137 #endif
A node in a selection tree.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:78
Hold a reference to a vtkObjectBase instance.
int vtkIdType
Definition: vtkType.h:347
abstract superclass for composite (multi-block or AMR) datasets
a simple class to control print indentation
Definition: vtkIndent.h:39
dynamic, self-adjusting array of signed char
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
virtual void Finalize()
Does any cleanup of objects created in Initialize.
Definition: vtkSelector.h:57
general representation of visualization data
Definition: vtkDataObject.h:64