VTK: Filters/Core/vtkAppendSelection.h Source File

| VTK 9.3.1

vtkAppendSelection.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
29 #ifndef vtkAppendSelection_h
30 #define vtkAppendSelection_h
31
32 #include "vtkFiltersCoreModule.h" // For export macro
33 #include "vtkSelectionAlgorithm.h"
34
35 #include <memory> // For std::unique_ptr
36
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkSelection;
39
40 class VTKFILTERSCORE_EXPORT vtkAppendSelection : public vtkSelectionAlgorithm
41 {
42 public:
43 static vtkAppendSelection* New();
44
45 vtkTypeMacro(vtkAppendSelection, vtkSelectionAlgorithm);
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
64 vtkSetStdStringFromCharMacro(Expression);
65 vtkGetCharFromStdStringMacro(Expression);
67
69
77 vtkSetMacro(Inverse, bool);
78 vtkBooleanMacro(Inverse, bool);
79 vtkGetMacro(Inverse, bool);
81
83
89 void SetInputName(int index, const char* name);
90 const char* GetInputName(int index) const;
92
96 void RemoveAllInputNames();
97
99
105 void SetInputColor(int index, double r, double g, double b);
106 double* GetInputColor(int index) const;
108
112 void RemoveAllInputColors();
113
115
123 vtkSetMacro(UserManagedInputs, vtkTypeBool);
124 vtkGetMacro(UserManagedInputs, vtkTypeBool);
125 vtkBooleanMacro(UserManagedInputs, vtkTypeBool);
127
132 void AddInputData(vtkSelection*);
133
138 void RemoveInputData(vtkSelection*);
139
141
144 vtkSelection* GetInput(int idx);
145 vtkSelection* GetInput() { return this->GetInput(0); }
147
152 void SetNumberOfInputs(int num);
153
154 // Set Nth input, should only be used when UserManagedInputs is true.
155 void SetInputConnectionByNumber(int num, vtkAlgorithmOutput* input);
156
158
167 vtkSetMacro(AppendByUnion, vtkTypeBool);
168 vtkGetMacro(AppendByUnion, vtkTypeBool);
169 vtkBooleanMacro(AppendByUnion, vtkTypeBool);
171
175 static const char* GetColorArrayName() { return "vtkSelectionColor"; }
176
177 protected:
178 vtkAppendSelection();
179 ~vtkAppendSelection() override;
180
181 // Usual data generation method
182 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
183 int FillInputPortInformation(int, vtkInformation*) override;
184
185 private:
186 // hide the superclass' AddInput() from the user and the compiler
187 void AddInputData(vtkDataObject*)
188 {
189 vtkErrorMacro(<< "AddInput() must be called with a vtkSelection not a vtkDataObject.");
190 }
191
195 void SetColorArray(vtkSelectionNode* node, double* color);
196
197 vtkTypeBool UserManagedInputs;
198 vtkTypeBool AppendByUnion;
199 std::string Expression;
200 bool Inverse;
201 class vtkInternals;
202 std::unique_ptr<vtkInternals> Internals;
203
204 vtkAppendSelection(const vtkAppendSelection&) = delete;
205 void operator=(const vtkAppendSelection&) = delete;
206 };
207
208 VTK_ABI_NAMESPACE_END
209 #endif
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:41
vtkAppendSelection
appends one or more selections together
Definition: vtkAppendSelection.h:41
vtkAppendSelection::New
static vtkAppendSelection * New()
vtkAppendSelection::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkAppendSelection::vtkSetStdStringFromCharMacro
vtkSetStdStringFromCharMacro(Expression)
Set/Get the expression that defines the boolean expression to combine the selections.
vtkAppendSelection::vtkGetCharFromStdStringMacro
vtkGetCharFromStdStringMacro(Expression)
Set/Get the expression that defines the boolean expression to combine the selections.
vtkAppendSelection::GetInputColor
double * GetInputColor(int index) const
Set/Get colors for inputs selections.
vtkAppendSelection::SetInputName
void SetInputName(int index, const char *name)
Set/Get names for inputs selections.
vtkAppendSelection::GetInput
vtkSelection * GetInput(int idx)
Get any input of this filter.
vtkAppendSelection::SetNumberOfInputs
void SetNumberOfInputs(int num)
Directly set(allocate) number of inputs, should only be used when UserManagedInputs is true.
vtkAppendSelection::GetInput
vtkSelection * GetInput()
Get any input of this filter.
Definition: vtkAppendSelection.h:145
vtkAppendSelection::SetInputConnectionByNumber
void SetInputConnectionByNumber(int num, vtkAlgorithmOutput *input)
vtkAppendSelection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAppendSelection::GetColorArrayName
static const char * GetColorArrayName()
Return the specific name used for the selection color array.
Definition: vtkAppendSelection.h:175
vtkAppendSelection::RemoveAllInputNames
void RemoveAllInputNames()
Remove all assigned input selection names.
vtkAppendSelection::SetInputColor
void SetInputColor(int index, double r, double g, double b)
Set/Get colors for inputs selections.
vtkAppendSelection::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkAppendSelection::RemoveInputData
void RemoveInputData(vtkSelection *)
Remove a dataset from the list of data to append.
vtkAppendSelection::vtkAppendSelection
vtkAppendSelection()
vtkAppendSelection::RemoveAllInputColors
void RemoveAllInputColors()
Remove all assigned input selection colors.
vtkAppendSelection::~vtkAppendSelection
~vtkAppendSelection() override
vtkAppendSelection::AddInputData
void AddInputData(vtkSelection *)
Add a dataset to the list of data to append.
vtkAppendSelection::GetInputName
const char * GetInputName(int index) const
Set/Get names for inputs selections.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkSelectionAlgorithm
Superclass for algorithms that produce only Selection as output.
Definition: vtkSelectionAlgorithm.h:36
vtkSelectionNode
a node in a vtkSelection the defines the selection criteria.
Definition: vtkSelectionNode.h:242
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:59
vtkX3D::color
@ color
Definition: vtkX3D.h:221
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkSelectionAlgorithm.h