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 ----------------------------------------------------------------------------*/
41 #ifndef vtkConvertSelection_h
42 #define vtkConvertSelection_h
43 
44 #include "vtkFiltersExtractionModule.h" // For export macro
45 #include "vtkSelectionAlgorithm.h"
46 
48 class vtkGraph;
49 class vtkIdTypeArray;
50 class vtkSelection;
51 class vtkSelectionNode;
52 class vtkStringArray;
53 class vtkTable;
55 
57 {
58 public:
59  static vtkConvertSelection *New();
61  void PrintSelf(ostream& os, vtkIndent indent);
62 
65  void SetDataObjectConnection(vtkAlgorithmOutput* in);
66 
68 
72  vtkSetMacro(InputFieldType, int);
73  vtkGetMacro(InputFieldType, int);
75 
77 
79  vtkSetMacro(OutputType, int);
80  vtkGetMacro(OutputType, int);
82 
84 
85  virtual void SetArrayName(const char*);
86  virtual const char* GetArrayName();
88 
90 
91  virtual void SetArrayNames(vtkStringArray*);
92  vtkGetObjectMacro(ArrayNames, vtkStringArray);
94 
96 
97  void AddArrayName(const char*);
98  void ClearArrayNames();
100 
102 
104  vtkSetMacro(MatchAnyValues, bool);
105  vtkGetMacro(MatchAnyValues, bool);
106  vtkBooleanMacro(MatchAnyValues, bool);
108 
110 
111  virtual void SetSelectionExtractor(vtkExtractSelection*);
112  vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
114 
116 
119  static vtkSelection* ToIndexSelection(
120  vtkSelection* input,
122  static vtkSelection* ToGlobalIdSelection(
123  vtkSelection* input,
125  static vtkSelection* ToPedigreeIdSelection(
126  vtkSelection* input,
128  static vtkSelection* ToValueSelection(
129  vtkSelection* input,
131  const char* arrayName);
132  static vtkSelection* ToValueSelection(
133  vtkSelection* input,
135  vtkStringArray* arrayNames);
137 
139 
142  static void GetSelectedItems(
143  vtkSelection* input,
145  int fieldType,
146  vtkIdTypeArray* indices);
148 
150 
152  static void GetSelectedVertices(
153  vtkSelection* input,
154  vtkGraph* data,
155  vtkIdTypeArray* indices);
156  static void GetSelectedEdges(
157  vtkSelection* input,
158  vtkGraph* data,
159  vtkIdTypeArray* indices);
160  static void GetSelectedPoints(
161  vtkSelection* input,
162  vtkDataSet* data,
163  vtkIdTypeArray* indices);
164  static void GetSelectedCells(
165  vtkSelection* input,
166  vtkDataSet* data,
167  vtkIdTypeArray* indices);
168  static void GetSelectedRows(
169  vtkSelection* input,
170  vtkTable* data,
171  vtkIdTypeArray* indices);
173 
175 
177  static vtkSelection* ToSelectionType(
178  vtkSelection* input,
180  int type,
181  vtkStringArray* arrayNames = 0,
182  int inputFieldType = -1);
184 
185 protected:
188 
189  virtual int RequestData(
190  vtkInformation *,
193 
194  int Convert(
195  vtkSelection* input,
197  vtkSelection* output);
198 
199  int ConvertCompositeDataSet(
200  vtkSelection* input,
202  vtkSelection* output);
203 
204  int ConvertToIndexSelection(
205  vtkSelectionNode* input,
206  vtkDataSet* data,
207  vtkSelectionNode* output);
208 
209  int SelectTableFromTable(
210  vtkTable* selTable,
211  vtkTable* dataTable,
212  vtkIdTypeArray* indices);
213 
214  int ConvertToBlockSelection(
216 
217  virtual int FillInputPortInformation(
218  int port, vtkInformation* info);
219 
225 
226 private:
227  vtkConvertSelection(const vtkConvertSelection&); // Not implemented.
228  void operator=(const vtkConvertSelection&); // Not implemented.
229 };
230 
231 #endif
A node in a selection tree. Used to store selection results.
Store vtkAlgorithm input/output information.
virtual int FillInputPortInformation(int port, vtkInformation *info)
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
vtkExtractSelection * SelectionExtractor
a vtkAbstractArray subclass for strings
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:44
dynamic, self-adjusting array of vtkIdType
Proxy object to connect input/output ports.
Base class for graph data types.
Definition: vtkGraph.h:288
abstract superclass for composite (multi-block or AMR) datasets
static vtkSelectionAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKFILTERSEXTRACTION_EXPORT
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:67
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store zero or more vtkInformation instances.
Convert a selection from one type to another.
general representation of visualization data
Definition: vtkDataObject.h:64
void PrintSelf(ostream &os, vtkIndent indent)