00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00087 #ifndef __vtkDataObjectToDataSetFilter_h
00088 #define __vtkDataObjectToDataSetFilter_h
00089
00090 #include "vtkSource.h"
00091
00092 class vtkCellArray;
00093 class vtkDataArray;
00094 class vtkDataSet;
00095 class vtkPointSet;
00096 class vtkPolyData;
00097 class vtkRectilinearGrid;
00098 class vtkStructuredGrid;
00099 class vtkStructuredPoints;
00100 class vtkUnstructuredGrid;
00101
00102 class VTK_GRAPHICS_EXPORT vtkDataObjectToDataSetFilter : public vtkSource
00103 {
00104 public:
00105 static vtkDataObjectToDataSetFilter *New();
00106 vtkTypeRevisionMacro(vtkDataObjectToDataSetFilter,vtkSource);
00107 void PrintSelf(ostream& os, vtkIndent indent);
00108
00110
00111 void SetInput(vtkDataObject *input);
00112 vtkDataObject *GetInput();
00114
00116
00117 void SetDataSetType(int);
00118 vtkGetMacro(DataSetType,int);
00119 void SetDataSetTypeToPolyData() {
00120 this->SetDataSetType(VTK_POLY_DATA);};
00121 void SetDataSetTypeToStructuredPoints() {
00122 this->SetDataSetType(VTK_STRUCTURED_POINTS);};
00123 void SetDataSetTypeToStructuredGrid() {
00124 this->SetDataSetType(VTK_STRUCTURED_GRID);};
00125 void SetDataSetTypeToRectilinearGrid() {
00126 this->SetDataSetType(VTK_RECTILINEAR_GRID);};
00127 void SetDataSetTypeToUnstructuredGrid() {
00128 this->SetDataSetType(VTK_UNSTRUCTURED_GRID);};
00130
00132
00137 vtkDataSet *GetOutput();
00138 vtkDataSet *GetOutput(int idx);
00139 vtkPolyData *GetPolyDataOutput();
00140 vtkStructuredPoints *GetStructuredPointsOutput();
00141 vtkStructuredGrid *GetStructuredGridOutput();
00142 vtkUnstructuredGrid *GetUnstructuredGridOutput();
00143 vtkRectilinearGrid *GetRectilinearGridOutput();
00145
00147
00158 void SetPointComponent(int comp, char *arrayName, int arrayComp,
00159 int min, int max, int normalize);
00160 void SetPointComponent(int comp, char *arrayName, int arrayComp)
00161 {this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
00162 const char *GetPointComponentArrayName(int comp);
00163 int GetPointComponentArrayComponent(int comp);
00164 int GetPointComponentMinRange(int comp);
00165 int GetPointComponentMaxRange(int comp);
00166 int GetPointComponentNormailzeFlag(int comp);
00168
00170
00177 void SetVertsComponent(char *arrayName, int arrayComp, int min, int max);
00178 void SetVertsComponent(char *arrayName, int arrayComp)
00179 {this->SetVertsComponent(arrayName, arrayComp, -1, -1);};
00180 const char *GetVertsComponentArrayName();
00181 int GetVertsComponentArrayComponent();
00182 int GetVertsComponentMinRange();
00183 int GetVertsComponentMaxRange();
00184 void SetLinesComponent(char *arrayName, int arrayComp, int min, int max);
00185 void SetLinesComponent(char *arrayName, int arrayComp)
00186 {this->SetLinesComponent(arrayName, arrayComp, -1, -1);};
00187 const char *GetLinesComponentArrayName();
00188 int GetLinesComponentArrayComponent();
00189 int GetLinesComponentMinRange();
00190 int GetLinesComponentMaxRange();
00191 void SetPolysComponent(char *arrayName, int arrayComp, int min, int max);
00192 void SetPolysComponent(char *arrayName, int arrayComp)
00193 {this->SetPolysComponent(arrayName, arrayComp, -1, -1);};
00194 const char *GetPolysComponentArrayName();
00195 int GetPolysComponentArrayComponent();
00196 int GetPolysComponentMinRange();
00197 int GetPolysComponentMaxRange();
00198 void SetStripsComponent(char *arrayName, int arrayComp, int min, int max);
00199 void SetStripsComponent(char *arrayName, int arrayComp)
00200 {this->SetStripsComponent(arrayName, arrayComp, -1, -1);};
00201 const char *GetStripsComponentArrayName();
00202 int GetStripsComponentArrayComponent();
00203 int GetStripsComponentMinRange();
00204 int GetStripsComponentMaxRange();
00206
00208
00215 void SetCellTypeComponent(char *arrayName, int arrayComp,
00216 int min, int max);
00217 void SetCellTypeComponent(char *arrayName, int arrayComp)
00218 {this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);};
00219 const char *GetCellTypeComponentArrayName();
00220 int GetCellTypeComponentArrayComponent();
00221 int GetCellTypeComponentMinRange();
00222 int GetCellTypeComponentMaxRange();
00223 void SetCellConnectivityComponent(char *arrayName, int arrayComp,
00224 int min, int max);
00225 void SetCellConnectivityComponent(char *arrayName, int arrayComp)
00226 {this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);};
00227 const char *GetCellConnectivityComponentArrayName();
00228 int GetCellConnectivityComponentArrayComponent();
00229 int GetCellConnectivityComponentMinRange();
00230 int GetCellConnectivityComponentMaxRange();
00232
00234
00236 vtkSetMacro(DefaultNormalize,int);
00237 vtkGetMacro(DefaultNormalize,int);
00238 vtkBooleanMacro(DefaultNormalize,int);
00240
00242
00245 vtkSetVector3Macro(Dimensions,int);
00246 vtkGetVectorMacro(Dimensions,int,3);
00248
00250
00252 vtkSetVector3Macro(Origin,float);
00253 vtkGetVectorMacro(Origin,float,3);
00255
00257
00259 vtkSetVector3Macro(Spacing,float);
00260 vtkGetVectorMacro(Spacing,float,3);
00262
00264
00269 void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max);
00270 void SetDimensionsComponent(char *arrayName, int arrayComp)
00271 {this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);};
00272 void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max);
00273 void SetSpacingComponent(char *arrayName, int arrayComp)
00274 {this->SetSpacingComponent(arrayName, arrayComp, -1, -1);};
00275 void SetOriginComponent(char *arrayName, int arrayComp, int min, int max);
00276 void SetOriginComponent(char *arrayName, int arrayComp)
00277 {this->SetOriginComponent(arrayName, arrayComp, -1, -1);};
00279
00280 protected:
00281 vtkDataObjectToDataSetFilter();
00282 ~vtkDataObjectToDataSetFilter();
00283
00284 void Execute();
00285 void ExecuteInformation();
00286 void ComputeInputUpdateExtents(vtkDataObject *output);
00287
00288 char Updating;
00289
00290
00291 int DataSetType;
00292
00293
00294 char *PointArrays[3];
00295 int PointArrayComponents[3];
00296 vtkIdType PointComponentRange[3][2];
00297 int PointNormalize[3];
00298
00299
00300 char *VertsArray;
00301 int VertsArrayComponent;
00302 vtkIdType VertsComponentRange[2];
00303
00304 char *LinesArray;
00305 int LinesArrayComponent;
00306 vtkIdType LinesComponentRange[2];
00307
00308 char *PolysArray;
00309 int PolysArrayComponent;
00310 vtkIdType PolysComponentRange[2];
00311
00312 char *StripsArray;
00313 int StripsArrayComponent;
00314 vtkIdType StripsComponentRange[2];
00315
00316
00317 char *CellTypeArray;
00318 int CellTypeArrayComponent;
00319 vtkIdType CellTypeComponentRange[2];
00320
00321 char *CellConnectivityArray;
00322 int CellConnectivityArrayComponent;
00323 vtkIdType CellConnectivityComponentRange[2];
00324
00325
00326 void SetArrayName(char* &name, char *newName);
00327 vtkIdType ConstructPoints(vtkPointSet *ps);
00328 vtkIdType ConstructPoints(vtkRectilinearGrid *rg);
00329 int ConstructCells(vtkPolyData *pd);
00330 int ConstructCells(vtkUnstructuredGrid *ug);
00331 vtkCellArray *ConstructCellArray(vtkDataArray *da, int comp,
00332 vtkIdType compRange[2]);
00333
00334
00335 int DefaultNormalize;
00336
00337
00338 int Dimensions[3];
00339 float Origin[3];
00340 float Spacing[3];
00341
00342 char *DimensionsArray;
00343 int DimensionsArrayComponent;
00344 vtkIdType DimensionsComponentRange[2];
00345
00346 char *OriginArray;
00347 int OriginArrayComponent;
00348 vtkIdType OriginComponentRange[2];
00349
00350 char *SpacingArray;
00351 int SpacingArrayComponent;
00352 vtkIdType SpacingComponentRange[2];
00353
00354 void ConstructDimensions();
00355 void ConstructSpacing();
00356 void ConstructOrigin();
00357
00358 private:
00359 vtkDataObjectToDataSetFilter(const vtkDataObjectToDataSetFilter&);
00360 void operator=(const vtkDataObjectToDataSetFilter&);
00361 };
00362
00363 #endif