VTK  9.1.0
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
44
46class vtkGraph;
47class vtkIdTypeArray;
48class vtkSelection;
50class vtkStringArray;
51class vtkTable;
53
54class VTKFILTERSEXTRACTION_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
55{
56public:
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
151 vtkSelection* input, vtkDataObject* data, const char* arrayName);
153 vtkSelection* input, vtkDataObject* data, vtkStringArray* arrayNames);
155
160 static void GetSelectedItems(
161 vtkSelection* input, vtkDataObject* data, int fieldType, vtkIdTypeArray* indices);
162
164
168 static void GetSelectedVertices(vtkSelection* input, vtkGraph* data, vtkIdTypeArray* indices);
169 static void GetSelectedEdges(vtkSelection* input, vtkGraph* data, vtkIdTypeArray* indices);
170 static void GetSelectedPoints(vtkSelection* input, vtkDataSet* data, vtkIdTypeArray* indices);
171 static void GetSelectedCells(vtkSelection* input, vtkDataSet* data, vtkIdTypeArray* indices);
172 static void GetSelectedRows(vtkSelection* input, vtkTable* data, vtkIdTypeArray* indices);
174
180 vtkStringArray* arrayNames = nullptr, int inputFieldType = -1, bool allowMissingArray = false);
181
182protected:
185
187
188 int Convert(vtkSelection* input, vtkDataObject* data, vtkSelection* output);
189
191
193 vtkSelectionNode* input, vtkCompositeDataSet* data, vtkSelection* output);
194
196
197 int SelectTableFromTable(vtkTable* selTable, vtkTable* dataTable, vtkIdTypeArray* indices);
198
200
201 int FillInputPortInformation(int port, vtkInformation* info) override;
202
209
210private:
212 void operator=(const vtkConvertSelection&) = delete;
213};
214
215#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 void GetSelectedRows(vtkSelection *input, vtkTable *data, vtkIdTypeArray *indices)
Static methods for easily obtaining selected items from a data object.
int ConvertCompositeDataSet(vtkSelection *input, vtkCompositeDataSet *data, vtkSelection *output)
void AddArrayName(const char *)
Convenience methods used by UI.
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.
static void GetSelectedItems(vtkSelection *input, vtkDataObject *data, int fieldType, vtkIdTypeArray *indices)
Static generic method for obtaining selected items from a data object.
static vtkSelection * ToGlobalIdSelection(vtkSelection *input, vtkDataObject *data)
Static methods for easily converting between selection types.
static void GetSelectedEdges(vtkSelection *input, vtkGraph *data, vtkIdTypeArray *indices)
Static methods for easily obtaining selected items from a data object.
vtkExtractSelection * SelectionExtractor
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)
Static methods for easily obtaining selected items from a data object.
static vtkSelection * ToIndexSelection(vtkSelection *input, vtkDataObject *data)
Static methods for easily converting between selection types.
static vtkSelection * ToPedigreeIdSelection(vtkSelection *input, vtkDataObject *data)
Static methods for easily converting between selection types.
virtual const char * GetArrayName()
The output array name for value or threshold selections.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ClearArrayNames()
Convenience methods used by UI.
void SetDataObjectConnection(vtkAlgorithmOutput *in)
A convenience method for setting the second input (i.e.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
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 vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, const char *arrayName)
Static methods for easily converting between selection types.
static void GetSelectedPoints(vtkSelection *input, vtkDataSet *data, vtkIdTypeArray *indices)
Static methods for easily obtaining selected items from a data object.
int Convert(vtkSelection *input, vtkDataObject *data, vtkSelection *output)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int ConvertFromQueryNodeCompositeDataSet(vtkSelectionNode *input, vtkCompositeDataSet *data, vtkSelection *output)
static vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, vtkStringArray *arrayNames)
Static methods for easily converting between selection types.
static vtkConvertSelection * New()
vtkStringArray * ArrayNames
virtual void SetArrayNames(vtkStringArray *)
The output array names for value selection.
~vtkConvertSelection() override
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
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
extract a subset from a vtkDataSet.
Base class for graph data types.
Definition: vtkGraph.h:339
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only Selection as output.
a node in a vtkSelection the defines the selection criteria.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:163
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172