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 =========================================================================*/
38 #ifndef vtkExtractSelection_h
39 #define vtkExtractSelection_h
40 
41 #include "vtkFiltersExtractionModule.h" // For export macro
42 #include "vtkDataObjectAlgorithm.h"
43 
44 #include "vtkSelectionNode.h" // for vtkSelectionNode::SelectionContent
45 #include "vtkSmartPointer.h" // for smart pointer
46 
47 class vtkSignedCharArray;
48 class vtkSelection;
49 class vtkSelectionNode;
50 class vtkSelector;
52 class vtkTable;
53 
54 class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelection : public vtkDataObjectAlgorithm
55 {
56 public:
59  void PrintSelf(ostream& os, vtkIndent indent) override;
60 
66  {
67  this->SetInputConnection(1, algOutput);
68  }
69 
71 
76  vtkSetMacro(PreserveTopology, bool);
77  vtkGetMacro(PreserveTopology, bool);
78  vtkBooleanMacro(PreserveTopology, bool);
80 
81 
83 
88  VTK_LEGACY(void SetShowBounds(bool));
89  VTK_LEGACY(bool GetShowBounds());
90  VTK_LEGACY(void ShowBoundsOn());
91  VTK_LEGACY(void ShowBoundsOff());
93 
95 
100  VTK_LEGACY(void SetUseProbeForLocations(bool));
101  VTK_LEGACY(bool GetUseProbeForLocations());
102  VTK_LEGACY(void UseProbeForLocationsOn());
103  VTK_LEGACY(void UseProbeForLocationsOff());
105 
106 protected:
109 
114  vtkInformationVector** inputVector,
115  vtkInformationVector* outputVector) override;
120  vtkInformationVector** inputVector,
121  vtkInformationVector* outputVector) override;
122 
123  // Gets the attribute association of the selection. Currently we support ROW, POINT, and CELL.
124  // If the selection types are mismatched the boolean parameter will be set to false, otherwise
125  // it will be true after the function returns.
127 
134 
143  vtkDataObject::AttributeTypes elementType, vtkSignedCharArray* insidednessArray);
144 
146 
152  vtkUnstructuredGrid* output,
153  vtkSignedCharArray* cellInside);
160  vtkUnstructuredGrid* output,
161  vtkSignedCharArray* pointInside);
167  vtkTable* output,
168  vtkSignedCharArray* rowsInside);
169 
171 
172 private:
173  vtkExtractSelection(const vtkExtractSelection&) = delete;
174  void operator=(const vtkExtractSelection&) = delete;
175 
176 };
177 
178 #endif
vtkExtractSelection::RequestDataObject
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Sets up empty output dataset.
vtkExtractSelection::GetShowBounds
bool GetShowBounds()
vtkExtractSelection::UseProbeForLocationsOff
void UseProbeForLocationsOff()
vtkExtractSelection::SetShowBounds
void SetShowBounds(bool)
These functions is provided for compile-time compatibility with the old vtkExtractSelection which is ...
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 selection tree.
Definition: vtkSelectionNode.h:68
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:516
vtkExtractSelection::vtkExtractSelection
vtkExtractSelection()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
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:44
vtkExtractSelection
extract a subset from a vtkDataSet.
Definition: vtkExtractSelection.h:55
vtkExtractSelection::UseProbeForLocationsOn
void UseProbeForLocationsOn()
vtkSmartPointer
Hold a reference to a vtkObjectBase instance.
Definition: vtkSmartPointer.h:37
vtkExtractSelection::PreserveTopology
bool PreserveTopology
Definition: vtkExtractSelection.h:170
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 vtkUnstruturedGri...
vtkExtractSelection::~vtkExtractSelection
~vtkExtractSelection() override
vtkSignedCharArray
dynamic, self-adjusting array of signed char
Definition: vtkSignedCharArray.h:39
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:64
vtkSelectionNode::SelectionContent
SelectionContent
Indicate the means by which data is selected.
Definition: vtkSelectionNode.h:134
vtkSelector
Definition: vtkSelector.h:36
vtkX3D::port
@ port
Definition: vtkX3D.h:447
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...
vtkExtractSelection::ShowBoundsOff
void ShowBoundsOff()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSmartPointer.h
vtkExtractSelection::GetUseProbeForLocations
bool GetUseProbeForLocations()
vtkExtractSelection::SetSelectionConnection
void SetSelectionConnection(vtkAlgorithmOutput *algOutput)
Convenience method to specify the selection connection (2nd input port)
Definition: vtkExtractSelection.h:65
vtkExtractSelection::GetAttributeTypeOfSelection
vtkDataObject::AttributeTypes GetAttributeTypeOfSelection(vtkSelection *sel, bool &sane)
vtkExtractSelection::SetUseProbeForLocations
void SetUseProbeForLocations(bool)
These functions is provided for compile-time compatibility with the old vtkExtractSelection which is ...
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
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:87
vtkExtractSelection::ShowBoundsOn
void ShowBoundsOn()
vtkExtractSelection::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:40
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:89
vtkDataObjectAlgorithm.h
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkDataObject::AttributeTypes
AttributeTypes
Possible attribute types.
Definition: vtkDataObject.h:274
vtkExtractSelection::NewSelectionOperator
virtual vtkSmartPointer< vtkSelector > NewSelectionOperator(vtkSelectionNode::SelectionContent type)
Creates a new vtkSelector for the given content type.