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