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 ----------------------------------------------------------------------------*/
33 #ifndef vtkConvertSelection_h
34 #define vtkConvertSelection_h
35 
36 #include "vtkFiltersExtractionModule.h" // For export macro
37 #include "vtkSelectionAlgorithm.h"
38 
40 class vtkGraph;
41 class vtkIdTypeArray;
42 class vtkSelection;
43 class vtkSelectionNode;
44 class vtkStringArray;
45 class vtkTable;
47 
48 class VTKFILTERSEXTRACTION_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
49 {
50 public:
51  static vtkConvertSelection *New();
53  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
54 
58  void SetDataObjectConnection(vtkAlgorithmOutput* in);
59 
61 
69  vtkSetMacro(InputFieldType, int);
70  vtkGetMacro(InputFieldType, int);
72 
74 
78  vtkSetMacro(OutputType, int);
79  vtkGetMacro(OutputType, int);
81 
83 
86  virtual void SetArrayName(const char*);
87  virtual const char* GetArrayName();
89 
91 
94  virtual void SetArrayNames(vtkStringArray*);
95  vtkGetObjectMacro(ArrayNames, vtkStringArray);
97 
99 
102  void AddArrayName(const char*);
103  void ClearArrayNames();
105 
107 
111  vtkSetMacro(MatchAnyValues, bool);
112  vtkGetMacro(MatchAnyValues, bool);
113  vtkBooleanMacro(MatchAnyValues, bool);
115 
117 
121  vtkSetMacro(AllowMissingArray, bool);
122  vtkGetMacro(AllowMissingArray, bool);
123  vtkBooleanMacro(AllowMissingArray, bool);
125 
127 
131  virtual void SetSelectionExtractor(vtkExtractSelection*);
132  vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
134 
136 
141  static vtkSelection* ToIndexSelection(
142  vtkSelection* input,
144  static vtkSelection* ToGlobalIdSelection(
145  vtkSelection* input,
147  static vtkSelection* ToPedigreeIdSelection(
148  vtkSelection* input,
150  static vtkSelection* ToValueSelection(
151  vtkSelection* input,
153  const char* arrayName);
154  static vtkSelection* ToValueSelection(
155  vtkSelection* input,
157  vtkStringArray* arrayNames);
159 
164  static void GetSelectedItems(
165  vtkSelection* input,
167  int fieldType,
168  vtkIdTypeArray* indices);
169 
171 
175  static void GetSelectedVertices(
176  vtkSelection* input,
177  vtkGraph* data,
178  vtkIdTypeArray* indices);
179  static void GetSelectedEdges(
180  vtkSelection* input,
181  vtkGraph* data,
182  vtkIdTypeArray* indices);
183  static void GetSelectedPoints(
184  vtkSelection* input,
185  vtkDataSet* data,
186  vtkIdTypeArray* indices);
187  static void GetSelectedCells(
188  vtkSelection* input,
189  vtkDataSet* data,
190  vtkIdTypeArray* indices);
191  static void GetSelectedRows(
192  vtkSelection* input,
193  vtkTable* data,
194  vtkIdTypeArray* indices);
196 
201  static vtkSelection* ToSelectionType(
202  vtkSelection* input,
204  int type,
205  vtkStringArray* arrayNames = 0,
206  int inputFieldType = -1,
207  bool allowMissingArray = false);
208 
209 protected:
211  ~vtkConvertSelection() VTK_OVERRIDE;
212 
213  int RequestData(
214  vtkInformation *,
216  vtkInformationVector *) VTK_OVERRIDE;
217 
218  int Convert(
219  vtkSelection* input,
221  vtkSelection* output);
222 
223  int ConvertCompositeDataSet(
224  vtkSelection* input,
225  vtkCompositeDataSet* data,
226  vtkSelection* output);
227 
228  int ConvertToIndexSelection(
229  vtkSelectionNode* input,
230  vtkDataSet* data,
231  vtkSelectionNode* output);
232 
233  int SelectTableFromTable(
234  vtkTable* selTable,
235  vtkTable* dataTable,
236  vtkIdTypeArray* indices);
237 
238  int ConvertToBlockSelection(
239  vtkSelection* input, vtkCompositeDataSet* data, vtkSelection* output);
240 
241  int FillInputPortInformation(
242  int port, vtkInformation* info) VTK_OVERRIDE;
243 
244  int OutputType;
245  int InputFieldType;
246  vtkStringArray* ArrayNames;
247  bool MatchAnyValues;
248  bool AllowMissingArray;
249  vtkExtractSelection* SelectionExtractor;
250 
251 private:
252  vtkConvertSelection(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
253  void operator=(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
254 };
255 
256 #endif
A node in a selection tree.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a vtkAbstractArray subclass for strings
A node in a selection tree.
Definition: vtkSelection.h:37
dynamic, self-adjusting array of vtkIdType
Proxy object to connect input/output ports.
Base class for graph data types.
Definition: vtkGraph.h:281
abstract superclass for composite (multi-block or AMR) datasets
static vtkSelectionAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:33
Superclass for algorithms that produce only Selection as output.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
extract a subset from a vtkDataSet.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:62
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:58
VTKACCELERATORSVTKM_EXPORT vtkm::cont::Field Convert(vtkDataArray *input, int association)