VTK  9.2.5
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 =========================================================================*/
147 #ifndef vtkExtractSelection_h
148 #define vtkExtractSelection_h
149 
150 #include "vtkDataObjectAlgorithm.h"
151 #include "vtkFiltersExtractionModule.h" // For export macro
152 
153 #include "vtkSelectionNode.h" // for vtkSelectionNode::SelectionContent
154 #include "vtkSmartPointer.h" // for smart pointer
155 
156 class vtkSignedCharArray;
157 class vtkSelection;
158 class vtkSelectionNode;
159 class vtkSelector;
160 class vtkUnstructuredGrid;
161 class vtkTable;
162 
163 class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelection : public vtkDataObjectAlgorithm
164 {
165 public:
168  void PrintSelf(ostream& os, vtkIndent indent) override;
169 
175  {
176  this->SetInputConnection(1, algOutput);
177  }
178 
180 
185  vtkSetMacro(PreserveTopology, bool);
186  vtkGetMacro(PreserveTopology, bool);
187  vtkBooleanMacro(PreserveTopology, bool);
189 
190 protected:
193 
198  vtkInformationVector* outputVector) override;
200  vtkInformationVector* outputVector) override;
204  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
205  vtkInformationVector* outputVector) override;
206 
207  // Gets the attribute association of the selection. Currently we support ROW, POINT, and CELL.
208  // If the selection types are mismatched the boolean parameter will be set to false, otherwise
209  // it will be true after the function returns.
211 
218 
227  vtkDataObject::AttributeTypes elementType, vtkSignedCharArray* insidednessArray);
228 
230 
236  vtkDataSet* input, vtkUnstructuredGrid* output, vtkSignedCharArray* cellInside);
243  vtkDataSet* input, vtkUnstructuredGrid* output, vtkSignedCharArray* pointInside);
248  void ExtractSelectedRows(vtkTable* input, vtkTable* output, vtkSignedCharArray* rowsInside);
249 
250  bool PreserveTopology = false;
251 
252 private:
253  vtkExtractSelection(const vtkExtractSelection&) = delete;
254  void operator=(const vtkExtractSelection&) = delete;
255 };
256 
257 #endif
Proxy object to connect input/output ports.
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
Superclass for algorithms that produce only data object as output.
general representation of visualization data
AttributeTypes
Possible attribute types.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
extract a subset from a vtkDataSet.
vtkDataObject::AttributeTypes GetAttributeTypeOfSelection(vtkSelection *sel, bool &sane)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkExtractSelection() override
void SetSelectionConnection(vtkAlgorithmOutput *algOutput)
Convenience method to specify the selection connection (2nd input port)
void ExtractSelectedCells(vtkDataSet *input, vtkUnstructuredGrid *output, vtkSignedCharArray *cellInside)
Given a vtkDataSet and an array of which cells to extract, this populates the given vtkUnstructuredGr...
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
static vtkExtractSelection * New()
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),...
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Sets up empty output dataset.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual vtkSmartPointer< vtkSelector > NewSelectionOperator(vtkSelectionNode::SelectionContent type)
Creates a new vtkSelector for the given content type.
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Sets up empty output dataset.
void ExtractSelectedPoints(vtkDataSet *input, vtkUnstructuredGrid *output, vtkSignedCharArray *pointInside)
Given a vtkDataSet and an array of which points to extract, the populates the given vtkUnstructuredGr...
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...
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
a node in a vtkSelection the defines the selection criteria.
SelectionContent
Indicate the means by which data is selected.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:169
dynamic, self-adjusting array of signed char
Hold a reference to a vtkObjectBase instance.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:183
dataset represents arbitrary combinations of all possible cell types
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
@ type
Definition: vtkX3D.h:522