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 "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 00072 //BTX 00074 00075 vtkPolyData *GetInput(int idx); 00076 vtkPolyData *GetInput() { return this->GetInput( 0 ); }; 00077 //ETX 00079 00082 void SetNumberOfInputs(int num); 00083 00084 // Set Nth input, should only be used when UserManagedInputs is true. 00085 void SetInputByNumber(int num, vtkPolyData *input); 00086 00088 00095 vtkSetMacro(ParallelStreaming, int); 00096 vtkGetMacro(ParallelStreaming, int); 00097 vtkBooleanMacro(ParallelStreaming, int); 00099 00100 //BTX 00101 int ExecuteAppend(vtkPolyData* output, 00102 vtkPolyData* inputs[], int numInputs); 00103 //ETX 00104 protected: 00105 vtkAppendPolyData(); 00106 ~vtkAppendPolyData(); 00107 00108 // Flag for selecting parallel streaming behavior 00109 int ParallelStreaming; 00110 00111 // Usual data generation method 00112 virtual int RequestData(vtkInformation *, 00113 vtkInformationVector **, vtkInformationVector *); 00114 virtual int RequestUpdateExtent(vtkInformation *, 00115 vtkInformationVector **, vtkInformationVector *); 00116 virtual int FillInputPortInformation(int, vtkInformation *); 00117 00118 // An efficient way to append data/cells. 00119 void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset); 00120 void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src, 00121 vtkIdType offset); 00122 vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src, 00123 vtkIdType offset); 00124 00125 private: 00126 // hide the superclass' AddInput() from the user and the compiler 00127 void AddInput(vtkDataObject *) 00128 { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); }; 00129 00130 int UserManagedInputs; 00131 00132 private: 00133 vtkAppendPolyData(const vtkAppendPolyData&); // Not implemented. 00134 void operator=(const vtkAppendPolyData&); // Not implemented. 00135 }; 00136 00137 #endif 00138 00139