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 00103 //BTX 00104 int ExecuteAppend(vtkPolyData* output, 00105 vtkPolyData* inputs[], int numInputs); 00106 //ETX 00107 protected: 00108 vtkAppendPolyData(); 00109 ~vtkAppendPolyData(); 00110 00111 // Flag for selecting parallel streaming behavior 00112 int ParallelStreaming; 00113 00114 // Usual data generation method 00115 virtual int RequestData(vtkInformation *, 00116 vtkInformationVector **, vtkInformationVector *); 00117 virtual int RequestUpdateExtent(vtkInformation *, 00118 vtkInformationVector **, vtkInformationVector *); 00119 virtual int FillInputPortInformation(int, vtkInformation *); 00120 00121 // An efficient way to append data/cells. 00122 void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset); 00123 void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src, 00124 vtkIdType offset); 00125 vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src, 00126 vtkIdType offset); 00127 00128 private: 00129 // hide the superclass' AddInput() from the user and the compiler 00130 void AddInputData(vtkDataObject *) 00131 { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); }; 00132 00133 int UserManagedInputs; 00134 00135 private: 00136 vtkAppendPolyData(const vtkAppendPolyData&); // Not implemented. 00137 void operator=(const vtkAppendPolyData&); // Not implemented. 00138 }; 00139 00140 #endif 00141 00142