VTK
vtkExtractSelection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractSelection.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 =========================================================================*/
35 #ifndef vtkExtractSelection_h
36 #define vtkExtractSelection_h
37 
38 #include "vtkFiltersExtractionModule.h" // For export macro
39 #include "vtkDataObjectAlgorithm.h"
40 
41 #include "vtkSelectionNode.h" // for vtkSelectionNode::SelectionContent
42 #include "vtkSmartPointer.h" // for smart pointer
43 
44 class vtkSignedCharArray;
45 class vtkSelection;
46 class vtkSelectionNode;
47 class vtkSelector;
49 class vtkTable;
50 
51 class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelection : public vtkDataObjectAlgorithm
52 {
53 public:
54  static vtkExtractSelection *New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
63  {
64  this->SetInputConnection(1, algOutput);
65  }
66 
68 
73  vtkSetMacro(PreserveTopology, bool);
74  vtkGetMacro(PreserveTopology, bool);
75  vtkBooleanMacro(PreserveTopology, bool);
77 
78 
80 
85  VTK_LEGACY(void SetShowBounds(bool));
86  VTK_LEGACY(bool GetShowBounds());
87  VTK_LEGACY(void ShowBoundsOn());
88  VTK_LEGACY(void ShowBoundsOff());
90 
92 
97  VTK_LEGACY(void SetUseProbeForLocations(bool));
98  VTK_LEGACY(bool GetUseProbeForLocations());
99  VTK_LEGACY(void UseProbeForLocationsOn());
100  VTK_LEGACY(void UseProbeForLocationsOff());
102 
103 protected:
105  ~vtkExtractSelection() override;
106 
110  int RequestDataObject(vtkInformation* request,
111  vtkInformationVector** inputVector,
112  vtkInformationVector* outputVector) override;
116  int RequestData(vtkInformation* request,
117  vtkInformationVector** inputVector,
118  vtkInformationVector* outputVector) override;
119 
120  // Gets the attribute association of the selection. Currently we support ROW, POINT, and CELL.
121  // If the selection types are mismatched the boolean parameter will be set to false, otherwise
122  // it will be true after the function returns.
123  vtkDataObject::AttributeTypes GetAttributeTypeOfSelection(vtkSelection* sel, bool& sane);
124 
129  virtual vtkSmartPointer<vtkSelector> NewSelectionOperator(
131 
139  vtkSmartPointer<vtkDataObject> ExtractElements(vtkDataObject* block,
140  vtkDataObject::AttributeTypes elementType, vtkSignedCharArray* insidednessArray);
141 
142  int FillInputPortInformation(int port, vtkInformation* info) override;
143 
148  void ExtractSelectedCells(vtkDataSet* input,
149  vtkUnstructuredGrid* output,
150  vtkSignedCharArray* cellInside);
156  void ExtractSelectedPoints(vtkDataSet* input,
157  vtkUnstructuredGrid* output,
158  vtkSignedCharArray* pointInside);
163  void ExtractSelectedRows(vtkTable* input,
164  vtkTable* output,
165  vtkSignedCharArray* rowsInside);
166 
168 
169 private:
170  vtkExtractSelection(const vtkExtractSelection&) = delete;
171  void operator=(const vtkExtractSelection&) = delete;
172 
173 };
174 
175 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
A node in a selection tree.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
static vtkDataObjectAlgorithm * New()
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:57
Hold a reference to a vtkObjectBase instance.
void SetSelectionConnection(vtkAlgorithmOutput *algOutput)
Convenience method to specify the selection connection (2nd input port)
Proxy object to connect input/output ports.
SelectionContent
Indicate the means by which data is selected.
a simple class to control print indentation
Definition: vtkIndent.h:33
dataset represents arbitrary combinations of all possible cell types
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
dynamic, self-adjusting array of signed char
extract a subset from a vtkDataSet.
Superclass for algorithms that produce only data object as output.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Store zero or more vtkInformation instances.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
general representation of visualization data
Definition: vtkDataObject.h:58
AttributeTypes
Possible attribute types.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.