VTK
dox/Graphics/vtkAppendPolyData.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkAppendPolyData.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00036 #ifndef __vtkAppendPolyData_h
00037 #define __vtkAppendPolyData_h
00038 
00039 #include "vtkPolyDataAlgorithm.h"
00040 
00041 class vtkCellArray;
00042 class vtkDataArray;
00043 class vtkPoints;
00044 class vtkPolyData;
00045 
00046 class VTK_GRAPHICS_EXPORT vtkAppendPolyData : public vtkPolyDataAlgorithm
00047 {
00048 public:
00049   static vtkAppendPolyData *New();
00050 
00051   vtkTypeMacro(vtkAppendPolyData,vtkPolyDataAlgorithm);
00052   void PrintSelf(ostream& os, vtkIndent indent);
00053 
00055 
00059   vtkSetMacro(UserManagedInputs,int);
00060   vtkGetMacro(UserManagedInputs,int);
00061   vtkBooleanMacro(UserManagedInputs,int);
00063 
00066   void AddInput(vtkPolyData *);
00067 
00070   void RemoveInput(vtkPolyData *);
00071 
00073 
00074   vtkPolyData *GetInput(int idx);
00075   vtkPolyData *GetInput() { return this->GetInput( 0 ); };
00077 //ETX
00078 
00081   void SetNumberOfInputs(int num);
00082 
00083   // Set Nth input, should only be used when UserManagedInputs is true.
00084   void SetInputByNumber(int num, vtkPolyData *input);
00085 
00087 
00094   vtkSetMacro(ParallelStreaming, int); 
00095   vtkGetMacro(ParallelStreaming, int); 
00096   vtkBooleanMacro(ParallelStreaming, int); 
00098 
00099 //BTX
00100   int ExecuteAppend(vtkPolyData* output,
00101     vtkPolyData* inputs[], int numInputs);
00102 //ETX
00103 protected:
00104   vtkAppendPolyData();
00105   ~vtkAppendPolyData();
00106 
00107   // Flag for selecting parallel streaming behavior
00108   int ParallelStreaming;
00109 
00110   // Usual data generation method
00111   virtual int RequestData(vtkInformation *, 
00112                           vtkInformationVector **, vtkInformationVector *);
00113   virtual int RequestUpdateExtent(vtkInformation *, 
00114                                   vtkInformationVector **, vtkInformationVector *);
00115   virtual int FillInputPortInformation(int, vtkInformation *);
00116 
00117   // An efficient way to append data/cells.
00118   void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset);
00119   void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src,
00120                              vtkIdType offset);
00121   vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src,
00122                          vtkIdType offset);
00123 
00124  private:
00125   // hide the superclass' AddInput() from the user and the compiler
00126   void AddInput(vtkDataObject *)
00127     { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); };
00128 
00129   int UserManagedInputs;
00130 
00131 private:
00132   vtkAppendPolyData(const vtkAppendPolyData&);  // Not implemented.
00133   void operator=(const vtkAppendPolyData&);  // Not implemented.
00134 };
00135 
00136 #endif
00137 
00138