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;
54 
55 class VTKFILTERSEXTRACTION_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
56 {
57 public:
58  static vtkConvertSelection *New();
60  void PrintSelf(ostream& os, vtkIndent indent);
61 
64  void SetDataObjectConnection(vtkAlgorithmOutput* in);
65 
67 
71  vtkSetMacro(InputFieldType, int);
72  vtkGetMacro(InputFieldType, int);
74 
76 
78  vtkSetMacro(OutputType, int);
79  vtkGetMacro(OutputType, int);
81 
83 
84  virtual void SetArrayName(const char*);
85  virtual const char* GetArrayName();
87 
89 
90  virtual void SetArrayNames(vtkStringArray*);
91  vtkGetObjectMacro(ArrayNames, vtkStringArray);
93 
95 
96  void AddArrayName(const char*);
97  void ClearArrayNames();
99 
101 
103  vtkSetMacro(MatchAnyValues, bool);
104  vtkGetMacro(MatchAnyValues, bool);
105  vtkBooleanMacro(MatchAnyValues, bool);
107 
109 
112  static vtkSelection* ToIndexSelection(
113  vtkSelection* input,
115  static vtkSelection* ToGlobalIdSelection(
116  vtkSelection* input,
118  static vtkSelection* ToPedigreeIdSelection(
119  vtkSelection* input,
121  static vtkSelection* ToValueSelection(
122  vtkSelection* input,
124  const char* arrayName);
125  static vtkSelection* ToValueSelection(
126  vtkSelection* input,
128  vtkStringArray* arrayNames);
130 
132 
135  static void GetSelectedItems(
136  vtkSelection* input,
138  int fieldType,
139  vtkIdTypeArray* indices);
141 
143 
145  static void GetSelectedVertices(
146  vtkSelection* input,
147  vtkGraph* data,
148  vtkIdTypeArray* indices);
149  static void GetSelectedEdges(
150  vtkSelection* input,
151  vtkGraph* data,
152  vtkIdTypeArray* indices);
153  static void GetSelectedPoints(
154  vtkSelection* input,
155  vtkDataSet* data,
156  vtkIdTypeArray* indices);
157  static void GetSelectedCells(
158  vtkSelection* input,
159  vtkDataSet* data,
160  vtkIdTypeArray* indices);
161  static void GetSelectedRows(
162  vtkSelection* input,
163  vtkTable* data,
164  vtkIdTypeArray* indices);
166 
168 
170  static vtkSelection* ToSelectionType(
171  vtkSelection* input,
173  int type,
174  vtkStringArray* arrayNames = 0,
175  int inputFieldType = -1);
177 
178 protected:
181 
182  virtual int RequestData(
183  vtkInformation *,
186 
187  int Convert(
188  vtkSelection* input,
190  vtkSelection* output);
191 
192  int ConvertCompositeDataSet(
193  vtkSelection* input,
195  vtkSelection* output);
196 
197  int ConvertToIndexSelection(
198  vtkSelectionNode* input,
199  vtkDataSet* data,
200  vtkSelectionNode* output);
201 
202  int SelectTableFromTable(
203  vtkTable* selTable,
204  vtkTable* dataTable,
205  vtkIdTypeArray* indices);
206 
207  int ConvertToBlockSelection(
209 
210  virtual int FillInputPortInformation(
211  int port, vtkInformation* info);
212 
217 
218 private:
219  vtkConvertSelection(const vtkConvertSelection&); // Not implemented.
220  void operator=(const vtkConvertSelection&); // Not implemented.
221 };
222 
223 #endif