VTK  9.3.20241007
vtkConvertSelection.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3// SPDX-License-Identifier: BSD-3-Clause
24#ifndef vtkConvertSelection_h
25#define vtkConvertSelection_h
26
27#include "vtkFiltersExtractionModule.h" // For export macro
29
30VTK_ABI_NAMESPACE_BEGIN
32class vtkGraph;
33class vtkIdTypeArray;
34class vtkSelection;
36class vtkStringArray;
37class vtkTable;
39
40class VTKFILTERSEXTRACTION_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
51
53
61 vtkSetMacro(InputFieldType, int);
62 vtkGetMacro(InputFieldType, int);
64
66
70 vtkSetMacro(OutputType, int);
71 vtkGetMacro(OutputType, int);
73
75
78 virtual void SetArrayName(const char*);
79 virtual const char* GetArrayName();
81
83
87 vtkGetObjectMacro(ArrayNames, vtkStringArray);
89
91
94 void AddArrayName(const char*);
97
99
103 vtkSetMacro(MatchAnyValues, bool);
104 vtkGetMacro(MatchAnyValues, bool);
105 vtkBooleanMacro(MatchAnyValues, bool);
107
109
113 vtkSetMacro(AllowMissingArray, bool);
114 vtkGetMacro(AllowMissingArray, bool);
115 vtkBooleanMacro(AllowMissingArray, bool);
117
119
124 vtkGetObjectMacro(SelectionExtractor, vtkExtractSelection);
126
128
137 vtkSelection* input, vtkDataObject* data, const char* arrayName);
139 vtkSelection* input, vtkDataObject* data, vtkStringArray* arrayNames);
141
146 static void GetSelectedItems(
147 vtkSelection* input, vtkDataObject* data, int fieldType, vtkIdTypeArray* indices);
148
150
154 static void GetSelectedVertices(vtkSelection* input, vtkGraph* data, vtkIdTypeArray* indices);
155 static void GetSelectedEdges(vtkSelection* input, vtkGraph* data, vtkIdTypeArray* indices);
156 static void GetSelectedPoints(vtkSelection* input, vtkDataSet* data, vtkIdTypeArray* indices);
157 static void GetSelectedCells(vtkSelection* input, vtkDataSet* data, vtkIdTypeArray* indices);
158 static void GetSelectedRows(vtkSelection* input, vtkTable* data, vtkIdTypeArray* indices);
160
166 vtkStringArray* arrayNames = nullptr, int inputFieldType = -1, bool allowMissingArray = false);
167
168protected:
171
173
174 int Convert(vtkSelection* input, vtkDataObject* data, vtkSelection* output);
175
177
179 vtkSelectionNode* input, vtkCompositeDataSet* data, vtkSelection* output);
180
182
183 int SelectTableFromTable(vtkTable* selTable, vtkTable* dataTable, vtkIdTypeArray* indices);
184
186
187 int FillInputPortInformation(int port, vtkInformation* info) override;
188
195
196private:
198 void operator=(const vtkConvertSelection&) = delete;
199};
200
201VTK_ABI_NAMESPACE_END
202#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.
static vtkSelection * ToValueSelection(vtkSelection *input, vtkDataObject *data, vtkStringArray *arrayNames)
Static methods for easily converting between selection types.
static vtkConvertSelection * New()
int ConvertFromQueryAndBlockSelectionNodeCompositeDataSet(vtkSelectionNode *input, vtkCompositeDataSet *data, vtkSelection *output)
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:340
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:108
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.
a vtkAbstractArray subclass for strings
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169