00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00098 #ifndef __vtkDataObjectToDataSetFilter_h
00099 #define __vtkDataObjectToDataSetFilter_h
00100
00101 #include "vtkSource.h"
00102 #include "vtkFieldData.h"
00103 #include "vtkDataSet.h"
00104
00105 class vtkPointSet;
00106 class vtkPolyData;
00107 class vtkStructuredPoints;
00108 class vtkStructuredGrid;
00109 class vtkRectilinearGrid;
00110 class vtkUnstructuredGrid;
00111 class vtkCellArray;
00112
00113 class VTK_GRAPHICS_EXPORT vtkDataObjectToDataSetFilter : public vtkSource
00114 {
00115 public:
00116 static vtkDataObjectToDataSetFilter *New();
00117 vtkTypeMacro(vtkDataObjectToDataSetFilter,vtkSource);
00118 void PrintSelf(ostream& os, vtkIndent indent);
00119
00121
00122 void SetInput(vtkDataObject *input);
00123 vtkDataObject *GetInput();
00125
00127
00128 void SetDataSetType(int);
00129 vtkGetMacro(DataSetType,int);
00130 void SetDataSetTypeToPolyData() {
00131 this->SetDataSetType(VTK_POLY_DATA);};
00132 void SetDataSetTypeToStructuredPoints() {
00133 this->SetDataSetType(VTK_STRUCTURED_POINTS);};
00134 void SetDataSetTypeToStructuredGrid() {
00135 this->SetDataSetType(VTK_STRUCTURED_GRID);};
00136 void SetDataSetTypeToRectilinearGrid() {
00137 this->SetDataSetType(VTK_RECTILINEAR_GRID);};
00138 void SetDataSetTypeToUnstructuredGrid() {
00139 this->SetDataSetType(VTK_UNSTRUCTURED_GRID);};
00141
00143
00148 vtkDataSet *GetOutput();
00149 vtkDataSet *GetOutput(int idx)
00150 {return static_cast<vtkDataSet *>(this->vtkSource::GetOutput(idx)); };
00151 vtkPolyData *GetPolyDataOutput();
00152 vtkStructuredPoints *GetStructuredPointsOutput();
00153 vtkStructuredGrid *GetStructuredGridOutput();
00154 vtkUnstructuredGrid *GetUnstructuredGridOutput();
00155 vtkRectilinearGrid *GetRectilinearGridOutput();
00157
00159
00170 void SetPointComponent(int comp, char *arrayName, int arrayComp,
00171 int min, int max, int normalize);
00172 void SetPointComponent(int comp, char *arrayName, int arrayComp)
00173 {this->SetPointComponent(comp, arrayName, arrayComp, -1, -1, this->DefaultNormalize);};
00174 const char *GetPointComponentArrayName(int comp);
00175 int GetPointComponentArrayComponent(int comp);
00176 int GetPointComponentMinRange(int comp);
00177 int GetPointComponentMaxRange(int comp);
00178 int GetPointComponentNormailzeFlag(int comp);
00180
00182
00189 void SetVertsComponent(char *arrayName, int arrayComp, int min, int max);
00190 void SetVertsComponent(char *arrayName, int arrayComp)
00191 {this->SetVertsComponent(arrayName, arrayComp, -1, -1);};
00192 const char *GetVertsComponentArrayName();
00193 int GetVertsComponentArrayComponent();
00194 int GetVertsComponentMinRange();
00195 int GetVertsComponentMaxRange();
00196 void SetLinesComponent(char *arrayName, int arrayComp, int min, int max);
00197 void SetLinesComponent(char *arrayName, int arrayComp)
00198 {this->SetLinesComponent(arrayName, arrayComp, -1, -1);};
00199 const char *GetLinesComponentArrayName();
00200 int GetLinesComponentArrayComponent();
00201 int GetLinesComponentMinRange();
00202 int GetLinesComponentMaxRange();
00203 void SetPolysComponent(char *arrayName, int arrayComp, int min, int max);
00204 void SetPolysComponent(char *arrayName, int arrayComp)
00205 {this->SetPolysComponent(arrayName, arrayComp, -1, -1);};
00206 const char *GetPolysComponentArrayName();
00207 int GetPolysComponentArrayComponent();
00208 int GetPolysComponentMinRange();
00209 int GetPolysComponentMaxRange();
00210 void SetStripsComponent(char *arrayName, int arrayComp, int min, int max);
00211 void SetStripsComponent(char *arrayName, int arrayComp)
00212 {this->SetStripsComponent(arrayName, arrayComp, -1, -1);};
00213 const char *GetStripsComponentArrayName();
00214 int GetStripsComponentArrayComponent();
00215 int GetStripsComponentMinRange();
00216 int GetStripsComponentMaxRange();
00218
00220
00227 void SetCellTypeComponent(char *arrayName, int arrayComp,
00228 int min, int max);
00229 void SetCellTypeComponent(char *arrayName, int arrayComp)
00230 {this->SetCellTypeComponent(arrayName, arrayComp, -1, -1);};
00231 const char *GetCellTypeComponentArrayName();
00232 int GetCellTypeComponentArrayComponent();
00233 int GetCellTypeComponentMinRange();
00234 int GetCellTypeComponentMaxRange();
00235 void SetCellConnectivityComponent(char *arrayName, int arrayComp,
00236 int min, int max);
00237 void SetCellConnectivityComponent(char *arrayName, int arrayComp)
00238 {this->SetCellConnectivityComponent(arrayName, arrayComp, -1, -1);};
00239 const char *GetCellConnectivityComponentArrayName();
00240 int GetCellConnectivityComponentArrayComponent();
00241 int GetCellConnectivityComponentMinRange();
00242 int GetCellConnectivityComponentMaxRange();
00244
00246
00248 vtkSetMacro(DefaultNormalize,int);
00249 vtkGetMacro(DefaultNormalize,int);
00250 vtkBooleanMacro(DefaultNormalize,int);
00252
00254
00257 vtkSetVector3Macro(Dimensions,int);
00258 vtkGetVectorMacro(Dimensions,int,3);
00260
00262
00264 vtkSetVector3Macro(Origin,float);
00265 vtkGetVectorMacro(Origin,float,3);
00267
00269
00271 vtkSetVector3Macro(Spacing,float);
00272 vtkGetVectorMacro(Spacing,float,3);
00274
00276
00281 void SetDimensionsComponent(char *arrayName, int arrayComp, int min, int max);
00282 void SetDimensionsComponent(char *arrayName, int arrayComp)
00283 {this->SetDimensionsComponent(arrayName, arrayComp, -1, -1);};
00284 void SetSpacingComponent(char *arrayName, int arrayComp, int min, int max);
00285 void SetSpacingComponent(char *arrayName, int arrayComp)
00286 {this->SetSpacingComponent(arrayName, arrayComp, -1, -1);};
00287 void SetOriginComponent(char *arrayName, int arrayComp, int min, int max);
00288 void SetOriginComponent(char *arrayName, int arrayComp)
00289 {this->SetOriginComponent(arrayName, arrayComp, -1, -1);};
00291
00292 protected:
00293 vtkDataObjectToDataSetFilter();
00294 ~vtkDataObjectToDataSetFilter();
00295
00296 void Execute();
00297 void ExecuteInformation();
00298 void ComputeInputUpdateExtents(vtkDataObject *output);
00299
00300 char Updating;
00301
00302
00303 int DataSetType;
00304
00305
00306 char *PointArrays[3];
00307 int PointArrayComponents[3];
00308 vtkIdType PointComponentRange[3][2];
00309 int PointNormalize[3];
00310
00311
00312 char *VertsArray;
00313 int VertsArrayComponent;
00314 vtkIdType VertsComponentRange[2];
00315
00316 char *LinesArray;
00317 int LinesArrayComponent;
00318 vtkIdType LinesComponentRange[2];
00319
00320 char *PolysArray;
00321 int PolysArrayComponent;
00322 vtkIdType PolysComponentRange[2];
00323
00324 char *StripsArray;
00325 int StripsArrayComponent;
00326 vtkIdType StripsComponentRange[2];
00327
00328
00329 char *CellTypeArray;
00330 int CellTypeArrayComponent;
00331 vtkIdType CellTypeComponentRange[2];
00332
00333 char *CellConnectivityArray;
00334 int CellConnectivityArrayComponent;
00335 vtkIdType CellConnectivityComponentRange[2];
00336
00337
00338 void SetArrayName(char* &name, char *newName);
00339 vtkIdType ConstructPoints(vtkPointSet *ps);
00340 vtkIdType ConstructPoints(vtkRectilinearGrid *rg);
00341 int ConstructCells(vtkPolyData *pd);
00342 int ConstructCells(vtkUnstructuredGrid *ug);
00343 vtkCellArray *ConstructCellArray(vtkDataArray *da, int comp,
00344 vtkIdType compRange[2]);
00345
00346
00347 int DefaultNormalize;
00348
00349
00350 int Dimensions[3];
00351 float Origin[3];
00352 float Spacing[3];
00353
00354 char *DimensionsArray;
00355 int DimensionsArrayComponent;
00356 vtkIdType DimensionsComponentRange[2];
00357
00358 char *OriginArray;
00359 int OriginArrayComponent;
00360 vtkIdType OriginComponentRange[2];
00361
00362 char *SpacingArray;
00363 int SpacingArrayComponent;
00364 vtkIdType SpacingComponentRange[2];
00365
00366 void ConstructDimensions();
00367 void ConstructSpacing();
00368 void ConstructOrigin();
00369
00370 private:
00371 vtkDataObjectToDataSetFilter(const vtkDataObjectToDataSetFilter&);
00372 void operator=(const vtkDataObjectToDataSetFilter&);
00373 };
00374
00375 #endif