Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkAppendPolyData.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkAppendPolyData.h,v $
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 =========================================================================*/
00050 #ifndef __vtkAppendPolyData_h
00051 #define __vtkAppendPolyData_h
00052 
00053 #include "vtkPolyDataToPolyDataFilter.h"
00054 
00055 class vtkCellArray;
00056 class vtkDataArray;
00057 class vtkPoints;
00058 class vtkPolyData;
00059 
00060 class VTK_GRAPHICS_EXPORT vtkAppendPolyData : public vtkPolyDataToPolyDataFilter
00061 {
00062 public:
00063   static vtkAppendPolyData *New();
00064 
00065   vtkTypeRevisionMacro(vtkAppendPolyData,vtkPolyDataToPolyDataFilter);
00066   void PrintSelf(ostream& os, vtkIndent indent);
00067 
00069 
00073   vtkSetMacro(UserManagedInputs,int);
00074   vtkGetMacro(UserManagedInputs,int);
00075   vtkBooleanMacro(UserManagedInputs,int);
00077 
00080   void AddInput(vtkPolyData *);
00081 
00084   void RemoveInput(vtkPolyData *);
00085 
00087 
00088   vtkPolyData *GetInput(int idx);
00089   vtkPolyData *GetInput() { return this->GetInput( 0 ); };
00091 
00094   void SetNumberOfInputs(int num);
00095 
00096   // Set Nth input, should only be used when UserManagedInputs is true.
00097   void SetInputByNumber(int num, vtkPolyData *input);
00098 
00100 
00107   vtkSetMacro(ParallelStreaming, int); 
00108   vtkGetMacro(ParallelStreaming, int); 
00109   vtkBooleanMacro(ParallelStreaming, int); 
00111 
00112 protected:
00113   vtkAppendPolyData();
00114   ~vtkAppendPolyData();
00115 
00116   // Flag for selecting parallel streaming behavior
00117   int ParallelStreaming;
00118 
00119   // Usual data generation method
00120   void Execute();
00121 
00122   void ComputeInputUpdateExtents(vtkDataObject *output);
00123 
00124   // An efficient way to append data/cells.
00125   void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset);
00126   void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src,
00127                              vtkIdType offset);
00128   vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src,
00129                          vtkIdType offset);
00130 
00131  private:
00132   // hide the superclass' AddInput() from the user and the compiler
00133   void AddInput(vtkDataObject *)
00134     { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); };
00135   void RemoveInput(vtkDataObject *input)
00136     { this->vtkProcessObject::RemoveInput(input);
00137     this->vtkProcessObject::SqueezeInputArray();};
00138   int UserManagedInputs;
00139 private:
00140   vtkAppendPolyData(const vtkAppendPolyData&);  // Not implemented.
00141   void operator=(const vtkAppendPolyData&);  // Not implemented.
00142 };
00143 
00144 #endif
00145 
00146