VTK
|
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 "vtkFiltersCoreModule.h" // For export macro 00040 #include "vtkPolyDataAlgorithm.h" 00041 00042 class vtkCellArray; 00043 class vtkDataArray; 00044 class vtkPoints; 00045 class vtkPolyData; 00046 00047 class VTKFILTERSCORE_EXPORT vtkAppendPolyData : public vtkPolyDataAlgorithm 00048 { 00049 public: 00050 static vtkAppendPolyData *New(); 00051 00052 vtkTypeMacro(vtkAppendPolyData,vtkPolyDataAlgorithm); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00056 00061 vtkSetMacro(UserManagedInputs,int); 00062 vtkGetMacro(UserManagedInputs,int); 00063 vtkBooleanMacro(UserManagedInputs,int); 00065 00068 void AddInputData(vtkPolyData *); 00069 00072 void RemoveInputData(vtkPolyData *); 00073 00074 //BTX 00076 00077 vtkPolyData *GetInput(int idx); 00078 vtkPolyData *GetInput() { return this->GetInput( 0 ); }; 00079 //ETX 00081 00084 void SetNumberOfInputs(int num); 00085 00086 // Set Nth input, should only be used when UserManagedInputs is true. 00087 void SetInputConnectionByNumber(int num, vtkAlgorithmOutput *input); 00088 void SetInputDataByNumber(int num, vtkPolyData *ds); 00089 00091 00098 vtkSetMacro(ParallelStreaming, int); 00099 vtkGetMacro(ParallelStreaming, int); 00100 vtkBooleanMacro(ParallelStreaming, int); 00102 00104 00107 vtkSetMacro(OutputPointsPrecision,int); 00108 vtkGetMacro(OutputPointsPrecision,int); 00110 00111 //BTX 00112 int ExecuteAppend(vtkPolyData* output, 00113 vtkPolyData* inputs[], int numInputs); 00114 //ETX 00115 protected: 00116 vtkAppendPolyData(); 00117 ~vtkAppendPolyData(); 00118 00119 // Flag for selecting parallel streaming behavior 00120 int ParallelStreaming; 00121 int OutputPointsPrecision; 00122 00123 // Usual data generation method 00124 virtual int RequestData(vtkInformation *, 00125 vtkInformationVector **, vtkInformationVector *); 00126 virtual int RequestUpdateExtent(vtkInformation *, 00127 vtkInformationVector **, vtkInformationVector *); 00128 virtual int FillInputPortInformation(int, vtkInformation *); 00129 00130 // An efficient way to append data/cells. 00131 void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset); 00132 void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src, 00133 vtkIdType offset); 00134 vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src, 00135 vtkIdType offset); 00136 00137 private: 00138 // hide the superclass' AddInput() from the user and the compiler 00139 void AddInputData(vtkDataObject *) 00140 { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); }; 00141 00142 int UserManagedInputs; 00143 00144 private: 00145 vtkAppendPolyData(const vtkAppendPolyData&); // Not implemented. 00146 void operator=(const vtkAppendPolyData&); // Not implemented. 00147 }; 00148 00149 #endif 00150 00151