VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkDataObjectGenerator.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 =========================================================================*/ 00039 #ifndef __vtkDataObjectGenerator_h 00040 #define __vtkDataObjectGenerator_h 00041 00042 #include "vtkFiltersCoreModule.h" // For export macro 00043 #include "vtkDataObjectAlgorithm.h" 00044 00045 class vtkInternalStructureCache; 00046 00047 class VTKFILTERSCORE_EXPORT vtkDataObjectGenerator 00048 : public vtkDataObjectAlgorithm 00049 { 00050 public: 00051 static vtkDataObjectGenerator *New(); 00052 vtkTypeMacro(vtkDataObjectGenerator,vtkDataObjectAlgorithm); 00053 void PrintSelf(ostream &os, vtkIndent indent); 00054 00056 00057 vtkSetStringMacro(Program); 00058 vtkGetStringMacro(Program); 00060 00061 protected: 00062 vtkDataObjectGenerator(); 00063 ~vtkDataObjectGenerator(); 00064 00065 virtual int RequestData(vtkInformation *req, 00066 vtkInformationVector **inV, 00067 vtkInformationVector *outV); 00068 virtual int RequestDataObject(vtkInformation *req, 00069 vtkInformationVector **inV, 00070 vtkInformationVector *outV); 00071 virtual int RequestInformation(vtkInformation *req, 00072 vtkInformationVector **inV, 00073 vtkInformationVector *outV); 00074 virtual int RequestUpdateExtent(vtkInformation *req, 00075 vtkInformationVector **inV, 00076 vtkInformationVector *outV); 00077 00078 //the string to parse to create a structure 00079 char *Program; 00080 //a record of the structure 00081 vtkInternalStructureCache *Structure; 00082 00083 //Helper for RequestDataObject 00084 vtkDataObject * 00085 CreateOutputDataObjects(vtkInternalStructureCache *structure); 00086 //Helper for RequestData 00087 vtkDataObject * 00088 FillOutputDataObjects(vtkInternalStructureCache *structure, 00089 int level, 00090 int stripe=0); 00091 00092 //to determine which composite data stripe to fill in 00093 vtkIdType Rank; 00094 vtkIdType Processors; 00095 00096 //create the templated atomic data sets 00097 void MakeImageData1(vtkDataSet *ds); 00098 void MakeImageData2(vtkDataSet *ds); 00099 void MakeUniformGrid1(vtkDataSet *ds); 00100 void MakeRectilinearGrid1(vtkDataSet *ds); 00101 void MakeStructuredGrid1(vtkDataSet *ds); 00102 void MakePolyData1(vtkDataSet *ds); 00103 void MakePolyData2(vtkDataSet *ds); 00104 void MakeUnstructuredGrid1(vtkDataSet *ds); 00105 void MakeUnstructuredGrid2(vtkDataSet *ds); 00106 void MakeUnstructuredGrid3(vtkDataSet *ds); 00107 void MakeUnstructuredGrid4(vtkDataSet *ds); 00108 00109 //used to spatially separate sub data sets within composites 00110 double XOffset; //increases for each dataset index 00111 double YOffset; //increases for each sub data set 00112 double ZOffset; //increases for each group index 00113 00114 //used to filling in point and cell values with unique Ids 00115 vtkIdType CellIdCounter; 00116 vtkIdType PointIdCounter; 00117 00118 //assign point and cell values to each point and cell 00119 void MakeValues(vtkDataSet *ds); 00120 00121 private: 00122 vtkDataObjectGenerator(const vtkDataObjectGenerator&); // Not implemented. 00123 void operator=(const vtkDataObjectGenerator&); // Not implemented. 00124 }; 00125 00126 #endif