VTK  9.4.20241217
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
34
35#include <memory> // For std::unique_ptr
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkSelection;
39
40class VTKFILTERSCORE_EXPORT vtkAppendSelection : public vtkSelectionAlgorithm
41{
42public:
44
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
49
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
97
99
105 void SetInputColor(int index, double r, double g, double b);
106 double* GetInputColor(int index) const;
108
113
115
123 vtkSetMacro(UserManagedInputs, vtkTypeBool);
124 vtkGetMacro(UserManagedInputs, vtkTypeBool);
125 vtkBooleanMacro(UserManagedInputs, vtkTypeBool);
127
133
139
141
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.
156
158
167 vtkSetMacro(AppendByUnion, vtkTypeBool);
168 vtkGetMacro(AppendByUnion, vtkTypeBool);
169 vtkBooleanMacro(AppendByUnion, vtkTypeBool);
171
175 static const char* GetColorArrayName() { return "vtkSelectionColor"; }
176
177protected:
180
181 // Usual data generation method
184
185private:
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
208VTK_ABI_NAMESPACE_END
209#endif
Proxy object to connect input/output ports.
appends one or more selections together
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static const char * GetColorArrayName()
Return the specific name used for the selection color array.
vtkSetStdStringFromCharMacro(Expression)
Set/Get the expression that defines the boolean expression to combine the selections.
vtkGetCharFromStdStringMacro(Expression)
Set/Get the expression that defines the boolean expression to combine the selections.
void SetInputName(int index, const char *name)
Set/Get names for inputs selections.
static vtkAppendSelection * New()
void SetNumberOfInputs(int num)
Directly set(allocate) number of inputs, should only be used when UserManagedInputs is true.
void SetInputConnectionByNumber(int num, vtkAlgorithmOutput *input)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetInputColor(int index) const
Set/Get colors for inputs selections.
void RemoveAllInputNames()
Remove all assigned input selection names.
const char * GetInputName(int index) const
Set/Get names for inputs selections.
void SetInputColor(int index, double r, double g, double b)
Set/Get colors for inputs selections.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkSelection * GetInput()
Get any input of this filter.
void RemoveInputData(vtkSelection *)
Remove a dataset from the list of data to append.
vtkSelection * GetInput(int idx)
Get any input of this filter.
void RemoveAllInputColors()
Remove all assigned input selection colors.
~vtkAppendSelection() override
void AddInputData(vtkSelection *)
Add a dataset to the list of data to append.
general representation of visualization data
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.
int vtkTypeBool
Definition vtkABI.h:64