VTK  9.2.6
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 "vtkDataObjectAlgorithm.h"
42 #include "vtkFiltersExtractionModule.h" // For export macro
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:
57  static vtkExtractSelection* New();
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 protected:
83  ~vtkExtractSelection() override;
84 
88  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
89  vtkInformationVector* outputVector) override;
90  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
91  vtkInformationVector* outputVector) override;
95  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
96  vtkInformationVector* outputVector) override;
97 
98  // Gets the attribute association of the selection. Currently we support ROW, POINT, and CELL.
99  // If the selection types are mismatched the boolean parameter will be set to false, otherwise
100  // it will be true after the function returns.
101  vtkDataObject::AttributeTypes GetAttributeTypeOfSelection(vtkSelection* sel, bool& sane);
102 
107  virtual vtkSmartPointer<vtkSelector> NewSelectionOperator(
109 
117  vtkSmartPointer<vtkDataObject> ExtractElements(vtkDataObject* block,
118  vtkDataObject::AttributeTypes elementType, vtkSignedCharArray* insidednessArray);
119 
120  int FillInputPortInformation(int port, vtkInformation* info) override;
121 
126  void ExtractSelectedCells(
127  vtkDataSet* input, vtkUnstructuredGrid* output, vtkSignedCharArray* cellInside);
133  void ExtractSelectedPoints(
134  vtkDataSet* input, vtkUnstructuredGrid* output, vtkSignedCharArray* pointInside);
139  void ExtractSelectedRows(vtkTable* input, vtkTable* output, vtkSignedCharArray* rowsInside);
140 
141  bool PreserveTopology = false;
142 
143 private:
144  vtkExtractSelection(const vtkExtractSelection&) = delete;
145  void operator=(const vtkExtractSelection&) = delete;
146 };
147 
148 #endif
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
a node in a vtkSelection the defines the selection criteria.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
static vtkDataObjectAlgorithm * New()
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:59
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:32
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:39
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:73
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
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:65
AttributeTypes
Possible attribute types.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.