VTK
vtkConvertSelection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkConvertSelection.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 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
39 #ifndef vtkConvertSelection_h
40 #define vtkConvertSelection_h
41 
42 #include "vtkFiltersExtractionModule.h" // For export macro
43 #include "vtkSelectionAlgorithm.h"
44 
46 class vtkGraph;
47 class vtkIdTypeArray;
48 class vtkSelection;
49 class vtkSelectionNode;
50 class vtkStringArray;
51 class vtkTable;
53 
54 class VTKFILTERSEXTRACTION_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
55 {
56 public:
57  static vtkConvertSelection *New();
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
64  void SetDataObjectConnection(vtkAlgorithmOutput* in);
65 
67 
75  vtkSetMacro(InputFieldType, int);
76  vtkGetMacro(InputFieldType, int);
78 
80 
84  vtkSetMacro(OutputType, int);
85  vtkGetMacro(OutputType, int);
87 
89 
92  virtual void SetArrayName(const char*);
93  virtual const char* GetArrayName();
95 
97 
100  virtual void SetArrayNames(vtkStringArray*);
101  vtkGetObjectMacro(ArrayNames, vtkStringArray);
103 
105 
108  void AddArrayName(const char*);
109  void ClearArrayNames();
111 
113 
117  vtkSetMacro(MatchAnyValues, bool);
118  vtkGetMacro(MatchAnyValues, bool);
119  vtkBooleanMacro(MatchAnyValues, bool);
121 
123 
127  virtual void SetSelectionExtractor(vtkExtractSelection*);
128  vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
130 
132 
137  static vtkSelection* ToIndexSelection(
138  vtkSelection* input,
140  static vtkSelection* ToGlobalIdSelection(
141  vtkSelection* input,
143  static vtkSelection* ToPedigreeIdSelection(
144  vtkSelection* input,
146  static vtkSelection* ToValueSelection(
147  vtkSelection* input,
149  const char* arrayName);
150  static vtkSelection* ToValueSelection(
151  vtkSelection* input,
153  vtkStringArray* arrayNames);
155 
160  static void GetSelectedItems(
161  vtkSelection* input,
163  int fieldType,
164  vtkIdTypeArray* indices);
165 
167 
171  static void GetSelectedVertices(
172  vtkSelection* input,
173  vtkGraph* data,
174  vtkIdTypeArray* indices);
175  static void GetSelectedEdges(
176  vtkSelection* input,
177  vtkGraph* data,
178  vtkIdTypeArray* indices);
179  static void GetSelectedPoints(
180  vtkSelection* input,
181  vtkDataSet* data,
182  vtkIdTypeArray* indices);
183  static void GetSelectedCells(
184  vtkSelection* input,
185  vtkDataSet* data,
186  vtkIdTypeArray* indices);
187  static void GetSelectedRows(
188  vtkSelection* input,
189  vtkTable* data,
190  vtkIdTypeArray* indices);
192 
197  static vtkSelection* ToSelectionType(
198  vtkSelection* input,
200  int type,
201  vtkStringArray* arrayNames = 0,
202  int inputFieldType = -1);
203 
204 protected:
207 
208  virtual int RequestData(
209  vtkInformation *,
212 
213  int Convert(
214  vtkSelection* input,
216  vtkSelection* output);
217 
218  int ConvertCompositeDataSet(
219  vtkSelection* input,
221  vtkSelection* output);
222 
223  int ConvertToIndexSelection(
224  vtkSelectionNode* input,
225  vtkDataSet* data,
226  vtkSelectionNode* output);
227 
228  int SelectTableFromTable(
229  vtkTable* selTable,
230  vtkTable* dataTable,
231  vtkIdTypeArray* indices);
232 
233  int ConvertToBlockSelection(
235 
236  virtual int FillInputPortInformation(
237  int port, vtkInformation* info);
238 
244 
245 private:
246  vtkConvertSelection(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
247  void operator=(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
248 };
249 
250 #endif
A node in a selection tree.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkExtractSelection * SelectionExtractor
a vtkAbstractArray subclass for strings
A node in a selection tree.
Definition: vtkSelection.h:43
dynamic, self-adjusting array of vtkIdType
Proxy object to connect input/output ports.
Base class for graph data types.
Definition: vtkGraph.h:287
abstract superclass for composite (multi-block or AMR) datasets
static vtkSelectionAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:39
Superclass for algorithms that produce only Selection as output.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkStringArray * ArrayNames
extract a subset from a vtkDataSet.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store zero or more vtkInformation instances.
Convert a selection from one type to another.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
general representation of visualization data
Definition: vtkDataObject.h:64