VTK  9.7.0
vtkAppendPolyData.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
29
30#ifndef vtkAppendPolyData_h
31#define vtkAppendPolyData_h
32
33#include "vtkFiltersCoreModule.h" // For export macro
35#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36
37VTK_ABI_NAMESPACE_BEGIN
38class vtkCellArray;
39class vtkDataArray;
40class vtkPoints;
41class vtkPolyData;
42
43class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkAppendPolyData : public vtkPolyDataAlgorithm
44{
45public:
47
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
58 vtkSetMacro(UserManagedInputs, vtkTypeBool);
59 vtkGetMacro(UserManagedInputs, vtkTypeBool);
60 vtkBooleanMacro(UserManagedInputs, vtkTypeBool);
62
64
70 vtkGetMacro(UseImplicitArray, bool);
71 vtkSetMacro(UseImplicitArray, bool);
72 vtkBooleanMacro(UseImplicitArray, bool);
74
80
86
88
92 vtkPolyData* GetInput() { return this->GetInput(0); }
94
99 void SetNumberOfInputs(int num);
100
101 // Set Nth input, should only be used when UserManagedInputs is true.
104
106
120
122
127 vtkSetMacro(OutputPointsPrecision, int);
128 vtkGetMacro(OutputPointsPrecision, int);
130
131 int ExecuteAppend(vtkPolyData* output, vtkPolyData* inputs[], int numInputs)
132 VTK_SIZEHINT(inputs, numInputs);
133
146 {
147 PolyDataOffsets(const std::vector<vtkPolyData*>& datasets);
148
159 std::vector<vtkIdType> PointOffsets;
160 std::vector<vtkIdType> VertOffsets;
161 std::vector<vtkIdType> VertConnectivityOffsets;
162 std::vector<vtkIdType> LineOffsets;
163 std::vector<vtkIdType> LineConnectivityOffsets;
164 std::vector<vtkIdType> PolyOffsets;
165 std::vector<vtkIdType> PolyConnectivityOffsets;
166 std::vector<vtkIdType> StripOffsets;
167 std::vector<vtkIdType> StripConnectivityOffsets;
168 };
169
170 static void AppendCellData(const PolyDataOffsets& stats, const std::vector<vtkPolyData*>& inputs,
171 vtkPolyData* output, bool useImplicit);
172
173protected:
176
177 // Flag for selecting parallel streaming behavior
180
181 // Usual data generation method
185
186private:
187 // hide the superclass' AddInput() from the user and the compiler
189 {
190 vtkErrorMacro(<< "AddInput() must be called with a vtkPolyData not a vtkDataObject.");
191 }
192
196 void AppendPoints(
197 const PolyDataOffsets& stats, const std::vector<vtkPolyData*>& inputs, vtkPolyData* output);
198
203 void AppendCells(
204 const PolyDataOffsets& stats, const std::vector<vtkPolyData*>& inputs, vtkPolyData* output);
205
206 vtkTypeBool UserManagedInputs;
207
208 bool UseImplicitArray = false;
209
210 vtkAppendPolyData(const vtkAppendPolyData&) = delete;
211 void operator=(const vtkAppendPolyData&) = delete;
212};
213
214VTK_ABI_NAMESPACE_END
215#endif
Proxy object to connect input/output ports.
appends one or more polygonal datasets together
int FillInputPortInformation(int, vtkInformation *) override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void AddInputData(vtkPolyData *)
Add a dataset to the list of data to append.
void RemoveInputData(vtkPolyData *)
Remove a dataset from the list of data to append.
~vtkAppendPolyData() override
vtkTypeBool ParallelStreaming
int ExecuteAppend(vtkPolyData *output, vtkPolyData *inputs[], int numInputs)
vtkPolyData * GetInput(int idx)
Get any input of this filter.
static void AppendCellData(const PolyDataOffsets &stats, const std::vector< vtkPolyData * > &inputs, vtkPolyData *output, bool useImplicit)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static vtkAppendPolyData * New()
void SetInputConnectionByNumber(int num, vtkAlgorithmOutput *input)
vtkPolyData * GetInput()
Get any input of this filter.
void SetNumberOfInputs(int num)
Directly set(allocate) number of inputs, should only be used when UserManagedInputs is true.
void SetInputDataByNumber(int num, vtkPolyData *ds)
object to represent cell connectivity
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:31
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
PolyDataOffsets agregates cell array information from the input polydata list.
std::vector< vtkIdType > StripConnectivityOffsets
std::vector< vtkIdType > LineOffsets
std::vector< vtkIdType > StripOffsets
std::vector< vtkIdType > PointOffsets
std::vector< vtkIdType > VertOffsets
std::vector< vtkIdType > PolyOffsets
PolyDataOffsets(const std::vector< vtkPolyData * > &datasets)
std::vector< vtkIdType > LineConnectivityOffsets
std::vector< vtkIdType > VertConnectivityOffsets
std::vector< vtkIdType > PolyConnectivityOffsets
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO