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
00057 #ifndef __vtkStructuredGrid_h
00058 #define __vtkStructuredGrid_h
00059
00060 #include "vtkPointSet.h"
00061 #include "vtkStructuredData.h"
00062 class vtkVertex;
00063 class vtkLine;
00064 class vtkQuad;
00065 class vtkHexahedron;
00066
00067
00068 class VTK_EXPORT vtkStructuredGrid : public vtkPointSet {
00069 public:
00070 static vtkStructuredGrid *New();
00071
00072 vtkTypeMacro(vtkStructuredGrid,vtkPointSet);
00073 void PrintSelf(ostream& os, vtkIndent indent);
00074
00076 int GetDataObjectType() {return VTK_STRUCTURED_GRID;};
00077
00079 vtkDataObject *MakeObject() {return vtkStructuredGrid::New();};
00080
00083 void CopyStructure(vtkDataSet *ds);
00084
00086 int GetNumberOfPoints() {return vtkPointSet::GetNumberOfPoints();};
00087 float *GetPoint(int ptId) {return this->vtkPointSet::GetPoint(ptId);};
00088 void GetPoint(int ptId, float p[3]) {this->vtkPointSet::GetPoint(ptId,p);};
00089 vtkCell *GetCell(int cellId);
00090 void GetCell(int cellId, vtkGenericCell *cell);
00091 void GetCellBounds(int cellId, float bounds[6]);
00092 int GetCellType(int cellId);
00093 int GetNumberOfCells();
00094 void GetCellPoints(int cellId, vtkIdList *ptIds);
00095 void GetPointCells(int ptId, vtkIdList *cellIds)
00096 {vtkStructuredData::GetPointCells(ptId,cellIds,this->Dimensions);}
00097 void Initialize();
00098 int GetMaxCellSize() {return 8;};
00099 void GetCellNeighbors(int cellId, vtkIdList *ptIds, vtkIdList *cellIds);
00100
00102 void SetDimensions(int i, int j, int k);
00103 void SetDimensions(int dim[3]);
00104
00106 vtkGetVectorMacro(Dimensions,int,3);
00107
00109 int GetDataDimension();
00110
00112 void BlankingOn();
00113 void BlankingOff();
00114 int GetBlanking() {return this->Blanking;};
00115 void BlankPoint(int ptId);
00116 void UnBlankPoint(int ptId);
00117
00119 int IsPointVisible(int ptId);
00120
00124 void SetUpdateExtent(int piece, int numPieces, int ghostLevel);
00125 void SetUpdateExtent(int piece, int numPieces)
00126 {this->SetUpdateExtent(piece, numPieces, 0);}
00127
00129 void SetUpdateExtent( int x1, int x2, int y1, int y2, int z1, int z2 )
00130 { this->vtkPointSet::SetUpdateExtent( x1, x2, y1, y2, z1, z2 ); };
00131 void SetUpdateExtent( int ext[6] )
00132 { this->vtkPointSet::SetUpdateExtent( ext ); };
00133
00137 void SetExtent(int extent[6]);
00138 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00139 vtkGetVector6Macro(Extent,int);
00140
00146 unsigned long GetActualMemorySize();
00147
00149 void ShallowCopy(vtkDataObject *src);
00150 void DeepCopy(vtkDataObject *src);
00151
00152 #ifndef VTK_REMOVE_LEGACY_CODE
00153
00154 void GetCellPoints(int cellId, vtkIdList &ptIds)
00155 {VTK_LEGACY_METHOD(GetCellPoints,"3.2"); this->GetCellPoints(cellId, &ptIds);}
00156 void GetPointCells(int ptId, vtkIdList &cellIds)
00157 {VTK_LEGACY_METHOD(GetPointCells,"3.2"); this->GetPointCells(ptId, &cellIds);}
00158 #endif
00159
00160 protected:
00161 vtkStructuredGrid();
00162 ~vtkStructuredGrid();
00163 vtkStructuredGrid(const vtkStructuredGrid&) {};
00164 void operator=(const vtkStructuredGrid&) {};
00165
00166
00167 vtkVertex *Vertex;
00168 vtkLine *Line;
00169 vtkQuad *Quad;
00170 vtkHexahedron *Hexahedron;
00171
00172
00173 int GetExtentType() { return VTK_3D_EXTENT; };
00174
00175 int Dimensions[3];
00176 int DataDescription;
00177 int Blanking;
00178 vtkScalars *PointVisibility;
00179 void AllocatePointVisibility();
00180
00181
00182 private:
00184 void GetCellNeighbors(int cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00185 {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00186
00187
00188 void InternalStructuredGridCopy(vtkStructuredGrid *src);
00189
00190 };
00191
00192
00193 inline int vtkStructuredGrid::GetNumberOfCells()
00194 {
00195 int nCells=1;
00196 int i;
00197
00198 for (i=0; i<3; i++)
00199 {
00200 if (this->Dimensions[i] > 1)
00201 {
00202 nCells *= (this->Dimensions[i]-1);
00203 }
00204 }
00205
00206 return nCells;
00207 }
00208
00209 inline int vtkStructuredGrid::GetDataDimension()
00210 {
00211 return vtkStructuredData::GetDataDimension(this->DataDescription);
00212 }
00213
00214
00215 inline int vtkStructuredGrid::IsPointVisible(int ptId)
00216 {
00217 if (!this->Blanking)
00218 {
00219 return 1;
00220 }
00221 else
00222 {
00223 return (int) this->PointVisibility->GetScalar(ptId);
00224 }
00225 }
00226
00227 #endif
00228
00229
00230
00231
00232
00233