VTK  9.3.20240416
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:
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 
177 protected:
180 
181  // Usual data generation method
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
Proxy object to connect input/output ports.
appends one or more selections together
static vtkAppendSelection * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
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.
double * GetInputColor(int index) const
Set/Get colors for inputs selections.
void SetInputName(int index, const char *name)
Set/Get names for inputs selections.
vtkSelection * GetInput(int idx)
Get any input of this filter.
void SetNumberOfInputs(int num)
Directly set(allocate) number of inputs, should only be used when UserManagedInputs is true.
vtkSelection * GetInput()
Get any input of this filter.
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.
static const char * GetColorArrayName()
Return the specific name used for the selection color array.
void RemoveAllInputNames()
Remove all assigned input selection names.
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.
void RemoveInputData(vtkSelection *)
Remove a dataset from the list of data to append.
void RemoveAllInputColors()
Remove all assigned input selection colors.
~vtkAppendSelection() override
void AddInputData(vtkSelection *)
Add a dataset to the list of data to append.
const char * GetInputName(int index) const
Set/Get names for inputs selections.
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.
Definition: vtkSelection.h:159
@ color
Definition: vtkX3D.h:221
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
@ string
Definition: vtkX3D.h:490
int vtkTypeBool
Definition: vtkABI.h:64