VTK  9.1.0
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 =========================================================================*/
144 #ifndef vtkExtractSelection_h
145 #define vtkExtractSelection_h
146 
147 #include "vtkDataObjectAlgorithm.h"
148 #include "vtkFiltersExtractionModule.h" // For export macro
149 
150 #include "vtkSelectionNode.h" // for vtkSelectionNode::SelectionContent
151 #include "vtkSmartPointer.h" // for smart pointer
152 
153 class vtkSignedCharArray;
154 class vtkSelection;
155 class vtkSelectionNode;
156 class vtkSelector;
157 class vtkUnstructuredGrid;
158 class vtkTable;
159 
160 class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelection : public vtkDataObjectAlgorithm
161 {
162 public:
165  void PrintSelf(ostream& os, vtkIndent indent) override;
166 
172  {
173  this->SetInputConnection(1, algOutput);
174  }
175 
177 
182  vtkSetMacro(PreserveTopology, bool);
183  vtkGetMacro(PreserveTopology, bool);
184  vtkBooleanMacro(PreserveTopology, bool);
186 
187 protected:
190 
195  vtkInformationVector* outputVector) override;
199  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
200  vtkInformationVector* outputVector) override;
201 
202  // Gets the attribute association of the selection. Currently we support ROW, POINT, and CELL.
203  // If the selection types are mismatched the boolean parameter will be set to false, otherwise
204  // it will be true after the function returns.
206 
213 
222  vtkDataObject::AttributeTypes elementType, vtkSignedCharArray* insidednessArray);
223 
225 
231  vtkDataSet* input, vtkUnstructuredGrid* output, vtkSignedCharArray* cellInside);
238  vtkDataSet* input, vtkUnstructuredGrid* output, vtkSignedCharArray* pointInside);
243  void ExtractSelectedRows(vtkTable* input, vtkTable* output, vtkSignedCharArray* rowsInside);
244 
245  bool PreserveTopology = false;
246 
247 private:
248  vtkExtractSelection(const vtkExtractSelection&) = delete;
249  void operator=(const vtkExtractSelection&) = delete;
250 };
251 
252 #endif
vtkExtractSelection::RequestDataObject
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Sets up empty output dataset.
vtkExtractSelection::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 vtkSelection the defines the selection criteria.
Definition: vtkSelectionNode.h:341
vtkExtractSelection::ExtractElements
vtkSmartPointer< vtkDataObject > ExtractElements(vtkDataObject *block, vtkDataObject::AttributeTypes elementType, vtkSignedCharArray *insidednessArray)
Given a non-composite input data object (either a block of a larger composite or the whole input),...
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtkExtractSelection::vtkExtractSelection
vtkExtractSelection()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
vtkExtractSelection::ExtractSelectedRows
void ExtractSelectedRows(vtkTable *input, vtkTable *output, vtkSignedCharArray *rowsInside)
Given an input vtkTable and an array of which rows to extract, this populates the output table with t...
vtkDataObjectAlgorithm
Superclass for algorithms that produce only data object as output.
Definition: vtkDataObjectAlgorithm.h:63
vtkExtractSelection
extract a subset from a vtkDataSet.
Definition: vtkExtractSelection.h:161
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:145
vtkExtractSelection::ExtractSelectedCells
void ExtractSelectedCells(vtkDataSet *input, vtkUnstructuredGrid *output, vtkSignedCharArray *cellInside)
Given a vtkDataSet and an array of which cells to extract, this populates the given vtkUnstructuredGr...
vtkExtractSelection::~vtkExtractSelection
~vtkExtractSelection() override
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:36
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:163
vtkSelectionNode::SelectionContent
SelectionContent
Indicate the means by which data is selected.
Definition: vtkSelectionNode.h:410
vtkSelector
Definition: vtkSelector.h:41
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkSelectionNode.h
vtkExtractSelection::RequestData
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Sets up empty output dataset.
vtkExtractSelection::New
static vtkExtractSelection * New()
vtkExtractSelection::ExtractSelectedPoints
void ExtractSelectedPoints(vtkDataSet *input, vtkUnstructuredGrid *output, vtkSignedCharArray *pointInside)
Given a vtkDataSet and an array of which points to extract, the populates the given vtkUnstructuredGr...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkSmartPointer.h
vtkExtractSelection::SetSelectionConnection
void SetSelectionConnection(vtkAlgorithmOutput *algOutput)
Convenience method to specify the selection connection (2nd input port)
Definition: vtkExtractSelection.h:171
vtkExtractSelection::GetAttributeTypeOfSelection
vtkDataObject::AttributeTypes GetAttributeTypeOfSelection(vtkSelection *sel, bool &sane)
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkAlgorithm::SetInputConnection
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkExtractSelection::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:66
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:204
vtkDataObjectAlgorithm.h
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:169
vtkDataObject::AttributeTypes
AttributeTypes
Possible attribute types.
Definition: vtkDataObject.h:373
vtkExtractSelection::NewSelectionOperator
virtual vtkSmartPointer< vtkSelector > NewSelectionOperator(vtkSelectionNode::SelectionContent type)
Creates a new vtkSelector for the given content type.