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:
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
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 
101  vtkGetObjectMacro(ArrayNames, vtkStringArray);
103 
105 
108  void AddArrayName(const char*);
111 
113 
117  vtkSetMacro(MatchAnyValues, bool);
118  vtkGetMacro(MatchAnyValues, bool);
119  vtkBooleanMacro(MatchAnyValues, bool);
121 
123 
128  vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
130 
132 
138  vtkSelection* input,
141  vtkSelection* input,
144  vtkSelection* input,
147  vtkSelection* input,
149  const char* arrayName);
151  vtkSelection* input,
153  vtkStringArray* arrayNames);
155 
160  static void GetSelectedItems(
161  vtkSelection* input,
163  int fieldType,
164  vtkIdTypeArray* indices);
165 
167 
171  static void GetSelectedVertices(
172  vtkSelection* input,
173  vtkGraph* data,
174  vtkIdTypeArray* indices);
175  static void GetSelectedEdges(
176  vtkSelection* input,
177  vtkGraph* data,
178  vtkIdTypeArray* indices);
179  static void GetSelectedPoints(
180  vtkSelection* input,
181  vtkDataSet* data,
182  vtkIdTypeArray* indices);
183  static void GetSelectedCells(
184  vtkSelection* input,
185  vtkDataSet* data,
186  vtkIdTypeArray* indices);
187  static void GetSelectedRows(
188  vtkSelection* input,
189  vtkTable* data,
190  vtkIdTypeArray* indices);
192 
198  vtkSelection* input,
200  int type,
201  vtkStringArray* arrayNames = 0,
202  int inputFieldType = -1);
203 
204 protected:
207 
208  virtual int RequestData(
209  vtkInformation *,
212 
213  int Convert(
214  vtkSelection* input,
216  vtkSelection* output);
217 
219  vtkSelection* input,
221  vtkSelection* output);
222 
224  vtkSelectionNode* input,
225  vtkDataSet* data,
226  vtkSelectionNode* output);
227 
229  vtkTable* selTable,
230  vtkTable* dataTable,
231  vtkIdTypeArray* indices);
232 
235 
237  int port, vtkInformation* info);
238 
244 
245 private:
246  vtkConvertSelection(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
247  void operator=(const vtkConvertSelection&) VTK_DELETE_FUNCTION;
248 };
249 
250 #endif
Proxy object to connect input/output ports.
abstract superclass for composite (multi-block or AMR) datasets
Convert a selection from one type to another.
static vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, const char *arrayName)
static void GetSelectedRows(vtkSelection *input, vtkTable *data, vtkIdTypeArray *indices)
int ConvertCompositeDataSet(vtkSelection *input, vtkCompositeDataSet *data, vtkSelection *output)
static vtkSelection * ToSelectionType(vtkSelection *input, vtkDataObject *data, int type, vtkStringArray *arrayNames=0, int inputFieldType=-1)
A generic static method for converting selection types.
static vtkSelection * ToGlobalIdSelection(vtkSelection *input, vtkDataObject *data)
static vtkSelection * ToPedigreeIdSelection(vtkSelection *input, vtkDataObject *data)
void AddArrayName(const char *)
Convenience methods used by UI.
static vtkSelection * ToIndexSelection(vtkSelection *input, vtkDataObject *data)
Static methods for easily converting between selection types.
static void GetSelectedItems(vtkSelection *input, vtkDataObject *data, int fieldType, vtkIdTypeArray *indices)
Static generic method for obtaining selected items from a data object.
static vtkConvertSelection * New()
static void GetSelectedEdges(vtkSelection *input, vtkGraph *data, vtkIdTypeArray *indices)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkExtractSelection * SelectionExtractor
static vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, vtkStringArray *arrayNames)
int ConvertToIndexSelection(vtkSelectionNode *input, vtkDataSet *data, vtkSelectionNode *output)
int SelectTableFromTable(vtkTable *selTable, vtkTable *dataTable, vtkIdTypeArray *indices)
static void GetSelectedCells(vtkSelection *input, vtkDataSet *data, vtkIdTypeArray *indices)
void SetDataObjectConnection(vtkAlgorithmOutput *in)
A convenience method for setting the second input (i.e.
virtual void SetArrayName(const char *)
The output array name for value or threshold selections.
static void GetSelectedVertices(vtkSelection *input, vtkGraph *data, vtkIdTypeArray *indices)
Static methods for easily obtaining selected items from a data object.
static void GetSelectedPoints(vtkSelection *input, vtkDataSet *data, vtkIdTypeArray *indices)
int Convert(vtkSelection *input, vtkDataObject *data, vtkSelection *output)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkStringArray * ArrayNames
virtual const char * GetArrayName()
virtual void SetArrayNames(vtkStringArray *)
The output array names for value selection.
int ConvertToBlockSelection(vtkSelection *input, vtkCompositeDataSet *data, vtkSelection *output)
virtual void SetSelectionExtractor(vtkExtractSelection *)
Set/get a selection extractor used in some conversions to obtain IDs.
general representation of visualization data
Definition: vtkDataObject.h:65
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
extract a subset from a vtkDataSet.
Base class for graph data types.
Definition: vtkGraph.h:288
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only Selection as output.
A node in a selection tree.
A node in a selection tree.
Definition: vtkSelection.h:44
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ type
Definition: vtkX3D.h:516
@ data
Definition: vtkX3D.h:315
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.