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) override;
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 
127  vtkSetMacro(AllowMissingArray, bool);
128  vtkGetMacro(AllowMissingArray, bool);
129  vtkBooleanMacro(AllowMissingArray, bool);
131 
133 
138  vtkGetObjectMacro(SelectionExtractor,vtkExtractSelection);
140 
142 
148  vtkSelection* input,
151  vtkSelection* input,
154  vtkSelection* input,
157  vtkSelection* input,
159  const char* arrayName);
161  vtkSelection* input,
163  vtkStringArray* arrayNames);
165 
170  static void GetSelectedItems(
171  vtkSelection* input,
173  int fieldType,
174  vtkIdTypeArray* indices);
175 
177 
181  static void GetSelectedVertices(
182  vtkSelection* input,
183  vtkGraph* data,
184  vtkIdTypeArray* indices);
185  static void GetSelectedEdges(
186  vtkSelection* input,
187  vtkGraph* data,
188  vtkIdTypeArray* indices);
189  static void GetSelectedPoints(
190  vtkSelection* input,
191  vtkDataSet* data,
192  vtkIdTypeArray* indices);
193  static void GetSelectedCells(
194  vtkSelection* input,
195  vtkDataSet* data,
196  vtkIdTypeArray* indices);
197  static void GetSelectedRows(
198  vtkSelection* input,
199  vtkTable* data,
200  vtkIdTypeArray* indices);
202 
208  vtkSelection* input,
210  int type,
211  vtkStringArray* arrayNames = nullptr,
212  int inputFieldType = -1,
213  bool allowMissingArray = false);
214 
215 protected:
218 
220  vtkInformation *,
222  vtkInformationVector *) override;
223 
224  int Convert(
225  vtkSelection* input,
227  vtkSelection* output);
228 
230  vtkSelection* input,
232  vtkSelection* output);
233 
235  vtkSelectionNode* input,
236  vtkDataSet* data,
237  vtkSelectionNode* output);
238 
240  vtkTable* selTable,
241  vtkTable* dataTable,
242  vtkIdTypeArray* indices);
243 
246 
248  int port, vtkInformation* info) override;
249 
256 
257 private:
258  vtkConvertSelection(const vtkConvertSelection&) = delete;
259  void operator=(const vtkConvertSelection&) = delete;
260 };
261 
262 #endif
vtkConvertSelection::GetSelectedRows
static void GetSelectedRows(vtkSelection *input, vtkTable *data, vtkIdTypeArray *indices)
vtkConvertSelection::ClearArrayNames
void ClearArrayNames()
vtkConvertSelection::GetSelectedEdges
static void GetSelectedEdges(vtkSelection *input, vtkGraph *data, vtkIdTypeArray *indices)
vtkConvertSelection::ArrayNames
vtkStringArray * ArrayNames
Definition: vtkConvertSelection.h:252
vtkSelectionNode
A node in a selection tree.
Definition: vtkSelectionNode.h:68
vtkConvertSelection::GetSelectedItems
static void GetSelectedItems(vtkSelection *input, vtkDataObject *data, int fieldType, vtkIdTypeArray *indices)
Static generic method for obtaining selected items from a data object.
vtkConvertSelection::SetArrayName
virtual void SetArrayName(const char *)
The output array name for value or threshold selections.
vtkConvertSelection::vtkConvertSelection
vtkConvertSelection()
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkConvertSelection::AddArrayName
void AddArrayName(const char *)
Convenience methods used by UI.
vtkConvertSelection::ConvertToBlockSelection
int ConvertToBlockSelection(vtkSelection *input, vtkCompositeDataSet *data, vtkSelection *output)
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkConvertSelection::SetSelectionExtractor
virtual void SetSelectionExtractor(vtkExtractSelection *)
Set/get a selection extractor used in some conversions to obtain IDs.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
vtkExtractSelection
extract a subset from a vtkDataSet.
Definition: vtkExtractSelection.h:55
vtkConvertSelection::SelectTableFromTable
int SelectTableFromTable(vtkTable *selTable, vtkTable *dataTable, vtkIdTypeArray *indices)
vtkConvertSelection::ToIndexSelection
static vtkSelection * ToIndexSelection(vtkSelection *input, vtkDataObject *data)
Static methods for easily converting between selection types.
vtkConvertSelection::OutputType
int OutputType
Definition: vtkConvertSelection.h:250
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:64
vtkConvertSelection::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkConvertSelection::ToSelectionType
static vtkSelection * ToSelectionType(vtkSelection *input, vtkDataObject *data, int type, vtkStringArray *arrayNames=nullptr, int inputFieldType=-1, bool allowMissingArray=false)
A generic static method for converting selection types.
vtkSelectionAlgorithm.h
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:52
vtkConvertSelection::ConvertCompositeDataSet
int ConvertCompositeDataSet(vtkSelection *input, vtkCompositeDataSet *data, vtkSelection *output)
vtkConvertSelection::New
static vtkConvertSelection * New()
vtkConvertSelection::~vtkConvertSelection
~vtkConvertSelection() override
vtkConvertSelection::GetSelectedCells
static void GetSelectedCells(vtkSelection *input, vtkDataSet *data, vtkIdTypeArray *indices)
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkConvertSelection::ToGlobalIdSelection
static vtkSelection * ToGlobalIdSelection(vtkSelection *input, vtkDataObject *data)
vtkConvertSelection::InputFieldType
int InputFieldType
Definition: vtkConvertSelection.h:251
vtkConvertSelection::ToPedigreeIdSelection
static vtkSelection * ToPedigreeIdSelection(vtkSelection *input, vtkDataObject *data)
vtkConvertSelection::ToValueSelection
static vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, const char *arrayName)
vtkConvertSelection::MatchAnyValues
bool MatchAnyValues
Definition: vtkConvertSelection.h:253
vtkConvertSelection::SelectionExtractor
vtkExtractSelection * SelectionExtractor
Definition: vtkConvertSelection.h:255
vtkConvertSelection::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkConvertSelection::GetSelectedPoints
static void GetSelectedPoints(vtkSelection *input, vtkDataSet *data, vtkIdTypeArray *indices)
vtkConvertSelection::AllowMissingArray
bool AllowMissingArray
Definition: vtkConvertSelection.h:254
vtkConvertSelection::Convert
int Convert(vtkSelection *input, vtkDataObject *data, vtkSelection *output)
vtkConvertSelection::SetDataObjectConnection
void SetDataObjectConnection(vtkAlgorithmOutput *in)
A convenience method for setting the second input (i.e.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:42
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:40
vtkConvertSelection::SetArrayNames
virtual void SetArrayNames(vtkStringArray *)
The output array names for value selection.
vtkConvertSelection::ConvertToIndexSelection
int ConvertToIndexSelection(vtkSelectionNode *input, vtkDataSet *data, vtkSelectionNode *output)
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:43
vtkSelectionAlgorithm
Superclass for algorithms that produce only Selection as output.
Definition: vtkSelectionAlgorithm.h:47
vtkConvertSelection::ToValueSelection
static vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, vtkStringArray *arrayNames)
vtkGraph
Base class for graph data types.
Definition: vtkGraph.h:288
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkConvertSelection::GetArrayName
virtual const char * GetArrayName()
vtkConvertSelection
Convert a selection from one type to another.
Definition: vtkConvertSelection.h:55
vtkConvertSelection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkConvertSelection::GetSelectedVertices
static void GetSelectedVertices(vtkSelection *input, vtkGraph *data, vtkIdTypeArray *indices)
Static methods for easily obtaining selected items from a data object.