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 "vtkSelectionAlgorithm.h"
45 
47 class vtkGraph;
48 class vtkIdTypeArray;
49 class vtkSelection;
50 class vtkSelectionNode;
51 class vtkStringArray;
52 class vtkTable;
53 
55 {
56 public:
57  static vtkConvertSelection *New();
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
63  void SetDataObjectConnection(vtkAlgorithmOutput* in);
64 
66 
70  vtkSetMacro(InputFieldType, int);
71  vtkGetMacro(InputFieldType, int);
73 
75 
77  vtkSetMacro(OutputType, int);
78  vtkGetMacro(OutputType, int);
80 
82 
83  virtual void SetArrayName(const char*);
84  virtual const char* GetArrayName();
86 
88 
89  virtual void SetArrayNames(vtkStringArray*);
90  vtkGetObjectMacro(ArrayNames, vtkStringArray);
92 
94 
95  void AddArrayName(const char*);
96  void ClearArrayNames();
98 
100 
102  vtkSetMacro(MatchAnyValues, bool);
103  vtkGetMacro(MatchAnyValues, bool);
104  vtkBooleanMacro(MatchAnyValues, bool);
106 
108 
111  static vtkSelection* ToIndexSelection(
112  vtkSelection* input,
114  static vtkSelection* ToGlobalIdSelection(
115  vtkSelection* input,
117  static vtkSelection* ToPedigreeIdSelection(
118  vtkSelection* input,
120  static vtkSelection* ToValueSelection(
121  vtkSelection* input,
123  const char* arrayName);
124  static vtkSelection* ToValueSelection(
125  vtkSelection* input,
127  vtkStringArray* arrayNames);
129 
131 
134  static void GetSelectedItems(
135  vtkSelection* input,
137  int fieldType,
138  vtkIdTypeArray* indices);
140 
142 
144  static void GetSelectedVertices(
145  vtkSelection* input,
146  vtkGraph* data,
147  vtkIdTypeArray* indices);
148  static void GetSelectedEdges(
149  vtkSelection* input,
150  vtkGraph* data,
151  vtkIdTypeArray* indices);
152  static void GetSelectedPoints(
153  vtkSelection* input,
154  vtkDataSet* data,
155  vtkIdTypeArray* indices);
156  static void GetSelectedCells(
157  vtkSelection* input,
158  vtkDataSet* data,
159  vtkIdTypeArray* indices);
160  static void GetSelectedRows(
161  vtkSelection* input,
162  vtkTable* data,
163  vtkIdTypeArray* indices);
165 
167 
169  static vtkSelection* ToSelectionType(
170  vtkSelection* input,
172  int type,
173  vtkStringArray* arrayNames = 0,
174  int inputFieldType = -1);
176 
177 protected:
180 
181  virtual int RequestData(
182  vtkInformation *,
185 
186  int Convert(
187  vtkSelection* input,
189  vtkSelection* output);
190 
191  int ConvertCompositeDataSet(
192  vtkSelection* input,
194  vtkSelection* output);
195 
196  int ConvertToIndexSelection(
197  vtkSelectionNode* input,
198  vtkDataSet* data,
199  vtkSelectionNode* output);
200 
201  int SelectTableFromTable(
202  vtkTable* selTable,
203  vtkTable* dataTable,
204  vtkIdTypeArray* indices);
205 
206  int ConvertToBlockSelection(
208 
209  virtual int FillInputPortInformation(
210  int port, vtkInformation* info);
211 
216 
217 private:
218  vtkConvertSelection(const vtkConvertSelection&); // Not implemented.
219  void operator=(const vtkConvertSelection&); // Not implemented.
220 };
221 
222 #endif