VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
35 
36 #include <memory> // For std::unique_ptr
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkSelection;
40 
41 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkAppendSelection : public vtkSelectionAlgorithm
42 {
43 public:
44  static vtkAppendSelection* New();
45 
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
65  vtkSetStdStringFromCharMacro(Expression);
66  vtkGetCharFromStdStringMacro(Expression);
68 
70 
78  vtkSetMacro(Inverse, bool);
79  vtkBooleanMacro(Inverse, bool);
80  vtkGetMacro(Inverse, bool);
82 
84 
90  void SetInputName(int index, const char* name);
91  const char* GetInputName(int index) const;
93 
97  void RemoveAllInputNames();
98 
100 
106  void SetInputColor(int index, double r, double g, double b);
107  double* GetInputColor(int index) const;
109 
113  void RemoveAllInputColors();
114 
116 
124  vtkSetMacro(UserManagedInputs, vtkTypeBool);
125  vtkGetMacro(UserManagedInputs, vtkTypeBool);
126  vtkBooleanMacro(UserManagedInputs, vtkTypeBool);
128 
133  void AddInputData(vtkSelection*);
134 
139  void RemoveInputData(vtkSelection*);
140 
142 
145  vtkSelection* GetInput(int idx);
146  vtkSelection* GetInput() { return this->GetInput(0); }
148 
153  void SetNumberOfInputs(int num);
154 
155  // Set Nth input, should only be used when UserManagedInputs is true.
156  void SetInputConnectionByNumber(int num, vtkAlgorithmOutput* input);
157 
159 
168  vtkSetMacro(AppendByUnion, vtkTypeBool);
169  vtkGetMacro(AppendByUnion, vtkTypeBool);
170  vtkBooleanMacro(AppendByUnion, vtkTypeBool);
172 
176  static const char* GetColorArrayName() { return "vtkSelectionColor"; }
177 
178 protected:
180  ~vtkAppendSelection() override;
181 
182  // Usual data generation method
184  int FillInputPortInformation(int, vtkInformation*) override;
185 
186 private:
187  // hide the superclass' AddInput() from the user and the compiler
188  void AddInputData(vtkDataObject*)
189  {
190  vtkErrorMacro(<< "AddInput() must be called with a vtkSelection not a vtkDataObject.");
191  }
192 
196  void SetColorArray(vtkSelectionNode* node, double* color);
197 
198  vtkTypeBool UserManagedInputs;
199  vtkTypeBool AppendByUnion;
200  std::string Expression;
201  bool Inverse;
202  class vtkInternals;
203  std::unique_ptr<vtkInternals> Internals;
204 
205  vtkAppendSelection(const vtkAppendSelection&) = delete;
206  void operator=(const vtkAppendSelection&) = delete;
207 };
208 
209 VTK_ABI_NAMESPACE_END
210 #endif
a node in a vtkSelection the defines the selection criteria.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store vtkAlgorithm input/output information.
static const char * GetColorArrayName()
Return the specific name used for the selection color array.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:49
Proxy object to connect input/output ports.
appends one or more selections together
int vtkTypeBool
Definition: vtkABI.h:64
static vtkSelectionAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkSelection * GetInput()
Get any input of this filter.
Superclass for algorithms that produce only Selection as output.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
general representation of visualization data
Definition: vtkDataObject.h:55