VTK  9.2.6
vtkAppendSelection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAppendSelection.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
44 #ifndef vtkAppendSelection_h
45 #define vtkAppendSelection_h
46 
47 #include "vtkFiltersCoreModule.h" // For export macro
48 #include "vtkSelectionAlgorithm.h"
49 
50 #include <memory> // For std::unique_ptr
51 
52 class vtkSelection;
53 
54 class VTKFILTERSCORE_EXPORT vtkAppendSelection : public vtkSelectionAlgorithm
55 {
56 public:
57  static vtkAppendSelection* New();
58 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
78  vtkSetStdStringFromCharMacro(Expression);
79  vtkGetCharFromStdStringMacro(Expression);
81 
83 
91  vtkSetMacro(Inverse, bool);
92  vtkBooleanMacro(Inverse, bool);
93  vtkGetMacro(Inverse, bool);
95 
97 
103  void SetInputName(int index, const char* name);
104  const char* GetInputName(int index) const;
106 
110  void RemoveAllInputNames();
111 
113 
121  vtkSetMacro(UserManagedInputs, vtkTypeBool);
122  vtkGetMacro(UserManagedInputs, vtkTypeBool);
123  vtkBooleanMacro(UserManagedInputs, vtkTypeBool);
125 
130  void AddInputData(vtkSelection*);
131 
136  void RemoveInputData(vtkSelection*);
137 
139 
142  vtkSelection* GetInput(int idx);
143  vtkSelection* GetInput() { return this->GetInput(0); }
145 
150  void SetNumberOfInputs(int num);
151 
152  // Set Nth input, should only be used when UserManagedInputs is true.
153  void SetInputConnectionByNumber(int num, vtkAlgorithmOutput* input);
154 
156 
165  vtkSetMacro(AppendByUnion, vtkTypeBool);
166  vtkGetMacro(AppendByUnion, vtkTypeBool);
167  vtkBooleanMacro(AppendByUnion, vtkTypeBool);
169 
170 protected:
172  ~vtkAppendSelection() override;
173 
174  // Usual data generation method
176  int FillInputPortInformation(int, vtkInformation*) override;
177 
178 private:
179  // hide the superclass' AddInput() from the user and the compiler
180  void AddInputData(vtkDataObject*)
181  {
182  vtkErrorMacro(<< "AddInput() must be called with a vtkSelection not a vtkDataObject.");
183  }
184 
185  vtkTypeBool UserManagedInputs;
186  vtkTypeBool AppendByUnion;
187  std::string Expression;
188  bool Inverse;
189  class vtkInternals;
190  std::unique_ptr<vtkInternals> Internals;
191 
192 private:
193  vtkAppendSelection(const vtkAppendSelection&) = delete;
194  void operator=(const vtkAppendSelection&) = delete;
195 };
196 
197 #endif
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store vtkAlgorithm input/output information.
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:59
Proxy object to connect input/output ports.
appends one or more selections together
int vtkTypeBool
Definition: vtkABI.h:69
static vtkSelectionAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:39
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.
general representation of visualization data
Definition: vtkDataObject.h:65