VTK  9.0.20200706
vtkAppendPolyData.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAppendPolyData.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 =========================================================================*/
31 #ifndef vtkAppendPolyData_h
32 #define vtkAppendPolyData_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 
37 class vtkCellArray;
38 class vtkDataArray;
39 class vtkPoints;
40 class vtkPolyData;
41 
42 class VTKFILTERSCORE_EXPORT vtkAppendPolyData : public vtkPolyDataAlgorithm
43 {
44 public:
45  static vtkAppendPolyData* New();
46 
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
57  vtkSetMacro(UserManagedInputs, vtkTypeBool);
58  vtkGetMacro(UserManagedInputs, vtkTypeBool);
59  vtkBooleanMacro(UserManagedInputs, vtkTypeBool);
61 
67 
72  void RemoveInputData(vtkPolyData*);
73 
75 
78  vtkPolyData* GetInput(int idx);
79  vtkPolyData* GetInput() { return this->GetInput(0); }
81 
86  void SetNumberOfInputs(int num);
87 
88  // Set Nth input, should only be used when UserManagedInputs is true.
89  void SetInputConnectionByNumber(int num, vtkAlgorithmOutput* input);
90  void SetInputDataByNumber(int num, vtkPolyData* ds);
91 
93 
103  vtkSetMacro(ParallelStreaming, vtkTypeBool);
104  vtkGetMacro(ParallelStreaming, vtkTypeBool);
105  vtkBooleanMacro(ParallelStreaming, vtkTypeBool);
107 
109 
114  vtkSetMacro(OutputPointsPrecision, int);
115  vtkGetMacro(OutputPointsPrecision, int);
117 
118  int ExecuteAppend(vtkPolyData* output, vtkPolyData* inputs[], int numInputs)
119  VTK_SIZEHINT(inputs, numInputs);
120 
121 protected:
123  ~vtkAppendPolyData() override;
124 
125  // Flag for selecting parallel streaming behavior
128 
129  // Usual data generation method
132  int FillInputPortInformation(int, vtkInformation*) override;
133 
134  // An efficient templated way to append data.
135  void AppendData(vtkDataArray* dest, vtkDataArray* src, vtkIdType offset);
136 
137  // An efficient way to append cells.
138  void AppendCells(vtkCellArray* dst, vtkCellArray* src, vtkIdType offset);
139 
140 private:
141  // hide the superclass' AddInput() from the user and the compiler
143  {
144  vtkErrorMacro(<< "AddInput() must be called with a vtkPolyData not a vtkDataObject.");
145  }
146 
147  vtkTypeBool UserManagedInputs;
148 
149 private:
150  vtkAppendPolyData(const vtkAppendPolyData&) = delete;
151  void operator=(const vtkAppendPolyData&) = delete;
152 };
153 
154 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkAppendPolyData::ParallelStreaming
vtkTypeBool ParallelStreaming
Definition: vtkAppendPolyData.h:126
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkPolyDataAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataAlgorithm.h
vtkAppendPolyData
appends one or more polygonal datasets together
Definition: vtkAppendPolyData.h:42
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkX3D::offset
Definition: vtkX3D.h:444
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
vtkPolyDataAlgorithm::AddInputData
void AddInputData(vtkDataObject *)
Assign a data object as input.
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkAppendPolyData::GetInput
vtkPolyData * GetInput()
Definition: vtkAppendPolyData.h:79
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkPolyDataAlgorithm::GetInput
vtkDataObject * GetInput()
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkAppendPolyData::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkAppendPolyData.h:127
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41