VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
36 #ifndef __vtkAppendPolyData_h
37 #define __vtkAppendPolyData_h
38 
39 #include "vtkFiltersCoreModule.h" // For export macro
40 #include "vtkPolyDataAlgorithm.h"
41 
42 class vtkCellArray;
43 class vtkDataArray;
44 class vtkPoints;
45 class vtkPolyData;
46 
47 class VTKFILTERSCORE_EXPORT vtkAppendPolyData : public vtkPolyDataAlgorithm
48 {
49 public:
50  static vtkAppendPolyData *New();
51 
52  vtkTypeMacro(vtkAppendPolyData,vtkPolyDataAlgorithm);
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
56 
61  vtkSetMacro(UserManagedInputs,int);
62  vtkGetMacro(UserManagedInputs,int);
63  vtkBooleanMacro(UserManagedInputs,int);
65 
68  void AddInputData(vtkPolyData *);
69 
72  void RemoveInputData(vtkPolyData *);
73 
74 //BTX
76 
77  vtkPolyData *GetInput(int idx);
78  vtkPolyData *GetInput() { return this->GetInput( 0 ); };
79 //ETX
81 
84  void SetNumberOfInputs(int num);
85 
86  // Set Nth input, should only be used when UserManagedInputs is true.
87  void SetInputConnectionByNumber(int num, vtkAlgorithmOutput *input);
88  void SetInputDataByNumber(int num, vtkPolyData *ds);
89 
91 
98  vtkSetMacro(ParallelStreaming, int);
99  vtkGetMacro(ParallelStreaming, int);
100  vtkBooleanMacro(ParallelStreaming, int);
102 
103 //BTX
104  int ExecuteAppend(vtkPolyData* output,
105  vtkPolyData* inputs[], int numInputs);
106 //ETX
107 protected:
110 
111  // Flag for selecting parallel streaming behavior
113 
114  // Usual data generation method
115  virtual int RequestData(vtkInformation *,
116  vtkInformationVector **, vtkInformationVector *);
117  virtual int RequestUpdateExtent(vtkInformation *,
118  vtkInformationVector **, vtkInformationVector *);
119  virtual int FillInputPortInformation(int, vtkInformation *);
120 
121  // An efficient way to append data/cells.
122  void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset);
123  void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src,
124  vtkIdType offset);
125  vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src,
126  vtkIdType offset);
127 
128  private:
129  // hide the superclass' AddInput() from the user and the compiler
130  void AddInputData(vtkDataObject *)
131  { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); };
132 
133  int UserManagedInputs;
134 
135 private:
136  vtkAppendPolyData(const vtkAppendPolyData&); // Not implemented.
137  void operator=(const vtkAppendPolyData&); // Not implemented.
138 };
139 
140 #endif
141 
142 
vtkPolyData * GetInput()
appends one or more polygonal datasets together