VTK
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 "vtkPolyDataAlgorithm.h"
40 
41 class vtkCellArray;
42 class vtkDataArray;
43 class vtkPoints;
44 class vtkPolyData;
45 
47 {
48 public:
49  static vtkAppendPolyData *New();
50 
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
55 
59  vtkSetMacro(UserManagedInputs,int);
60  vtkGetMacro(UserManagedInputs,int);
61  vtkBooleanMacro(UserManagedInputs,int);
63 
66  void AddInput(vtkPolyData *);
67 
70  void RemoveInput(vtkPolyData *);
71 
72 //BTX
74 
75  vtkPolyData *GetInput(int idx);
76  vtkPolyData *GetInput() { return this->GetInput( 0 ); };
77 //ETX
79 
82  void SetNumberOfInputs(int num);
83 
84  // Set Nth input, should only be used when UserManagedInputs is true.
85  void SetInputByNumber(int num, vtkPolyData *input);
86 
88 
95  vtkSetMacro(ParallelStreaming, int);
96  vtkGetMacro(ParallelStreaming, int);
97  vtkBooleanMacro(ParallelStreaming, int);
99 
100 //BTX
101  int ExecuteAppend(vtkPolyData* output,
102  vtkPolyData* inputs[], int numInputs);
103 //ETX
104 protected:
107 
108  // Flag for selecting parallel streaming behavior
110 
111  // Usual data generation method
112  virtual int RequestData(vtkInformation *,
114  virtual int RequestUpdateExtent(vtkInformation *,
116  virtual int FillInputPortInformation(int, vtkInformation *);
117 
118  // An efficient way to append data/cells.
119  void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset);
120  void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src,
121  vtkIdType offset);
122  vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src,
123  vtkIdType offset);
124 
125  private:
126  // hide the superclass' AddInput() from the user and the compiler
127  void AddInput(vtkDataObject *)
128  { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); };
129 
130  int UserManagedInputs;
131 
132 private:
133  vtkAppendPolyData(const vtkAppendPolyData&); // Not implemented.
134  void operator=(const vtkAppendPolyData&); // Not implemented.
135 };
136 
137 #endif
138 
139