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) override;
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  vtkSetMacro(AllowMissingArray, bool);
128  vtkGetMacro(AllowMissingArray, bool);
129  vtkBooleanMacro(AllowMissingArray, bool);
131 
133 
137  virtual void SetSelectionExtractor(vtkExtractSelection*);
138  vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
140 
142 
147  static vtkSelection* ToIndexSelection(
148  vtkSelection* input,
150  static vtkSelection* ToGlobalIdSelection(
151  vtkSelection* input,
153  static vtkSelection* ToPedigreeIdSelection(
154  vtkSelection* input,
156  static vtkSelection* ToValueSelection(
157  vtkSelection* input,
159  const char* arrayName);
160  static vtkSelection* ToValueSelection(
161  vtkSelection* input,
163  vtkStringArray* arrayNames);
165 
170  static void GetSelectedItems(
171  vtkSelection* input,
173  int fieldType,
174  vtkIdTypeArray* indices);
175 
177 
181  static void GetSelectedVertices(
182  vtkSelection* input,
183  vtkGraph* data,
184  vtkIdTypeArray* indices);
185  static void GetSelectedEdges(
186  vtkSelection* input,
187  vtkGraph* data,
188  vtkIdTypeArray* indices);
189  static void GetSelectedPoints(
190  vtkSelection* input,
191  vtkDataSet* data,
192  vtkIdTypeArray* indices);
193  static void GetSelectedCells(
194  vtkSelection* input,
195  vtkDataSet* data,
196  vtkIdTypeArray* indices);
197  static void GetSelectedRows(
198  vtkSelection* input,
199  vtkTable* data,
200  vtkIdTypeArray* indices);
202 
207  static vtkSelection* ToSelectionType(
208  vtkSelection* input,
210  int type,
211  vtkStringArray* arrayNames = nullptr,
212  int inputFieldType = -1,
213  bool allowMissingArray = false);
214 
215 protected:
217  ~vtkConvertSelection() override;
218 
219  int RequestData(
220  vtkInformation *,
222  vtkInformationVector *) override;
223 
224  int Convert(
225  vtkSelection* input,
227  vtkSelection* output);
228 
229  int ConvertCompositeDataSet(
230  vtkSelection* input,
232  vtkSelection* output);
233 
234  int ConvertFromQueryNodeCompositeDataSet(
235  vtkSelectionNode* input,
237  vtkSelection* output);
238 
239  int ConvertToIndexSelection(
240  vtkSelectionNode* input,
241  vtkDataSet* data,
242  vtkSelectionNode* output);
243 
244  int SelectTableFromTable(
245  vtkTable* selTable,
246  vtkTable* dataTable,
247  vtkIdTypeArray* indices);
248 
249  int ConvertToBlockSelection(
251 
253  int port, vtkInformation* info) override;
254 
261 
262 private:
263  vtkConvertSelection(const vtkConvertSelection&) = delete;
264  void operator=(const vtkConvertSelection&) = delete;
265 };
266 
267 #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
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:63
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.
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.
general representation of visualization data
Definition: vtkDataObject.h:64
VTKACCELERATORSVTKM_EXPORT vtkm::cont::Field Convert(vtkDataArray *input, int association)