00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00044 #ifndef __vtkStructuredGrid_h
00045 #define __vtkStructuredGrid_h
00046
00047 #include "vtkPointSet.h"
00048
00049 #include "vtkStructuredData.h"
00050
00051 class vtkEmptyCell;
00052 class vtkHexahedron;
00053 class vtkLine;
00054 class vtkQuad;
00055 class vtkStructuredVisibilityConstraint;
00056 class vtkUnsignedCharArray;
00057 class vtkVertex;
00058
00059 class VTK_FILTERING_EXPORT vtkStructuredGrid : public vtkPointSet
00060 {
00061 public:
00062 static vtkStructuredGrid *New();
00063
00064 vtkTypeRevisionMacro(vtkStructuredGrid,vtkPointSet);
00065 void PrintSelf(ostream& os, vtkIndent indent);
00066
00068 int GetDataObjectType() {return VTK_STRUCTURED_GRID;}
00069
00072 void CopyStructure(vtkDataSet *ds);
00073
00075
00076 vtkIdType GetNumberOfPoints() {return vtkPointSet::GetNumberOfPoints();}
00077 double *GetPoint(vtkIdType ptId) {return this->vtkPointSet::GetPoint(ptId);}
00078 void GetPoint(vtkIdType ptId, double p[3])
00079 {this->vtkPointSet::GetPoint(ptId,p);}
00080 vtkCell *GetCell(vtkIdType cellId);
00081 void GetCell(vtkIdType cellId, vtkGenericCell *cell);
00082 void GetCellBounds(vtkIdType cellId, double bounds[6]);
00083 int GetCellType(vtkIdType cellId);
00084 vtkIdType GetNumberOfCells();
00085 void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
00086 void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
00087 {
00088 vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());
00089 }
00090 void Initialize();
00091 int GetMaxCellSize() {return 8;};
00092 void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00093 vtkIdList *cellIds);
00094 virtual void GetScalarRange(double range[2]);
00095 double *GetScalarRange() {return this->Superclass::GetScalarRange();}
00097
00099
00100 void SetDimensions(int i, int j, int k);
00101 void SetDimensions(int dim[3]);
00103
00105
00106 virtual int *GetDimensions ();
00107 virtual void GetDimensions (int dim[3]);
00109
00111 int GetDataDimension();
00112
00114
00117 void SetExtent(int extent[6]);
00118 void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00119 vtkGetVector6Macro(Extent, int);
00121
00127 unsigned long GetActualMemorySize();
00128
00130
00131 void ShallowCopy(vtkDataObject *src);
00132 void DeepCopy(vtkDataObject *src);
00134
00136 int GetExtentType() { return VTK_3D_EXTENT; }
00137
00139
00143 void BlankPoint(vtkIdType ptId);
00144 void UnBlankPoint(vtkIdType ptId);
00146
00148
00152 void BlankCell(vtkIdType ptId);
00153 void UnBlankCell(vtkIdType ptId);
00155
00157 vtkUnsignedCharArray *GetPointVisibilityArray();
00158
00162 void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
00163
00165 vtkUnsignedCharArray *GetCellVisibilityArray();
00166
00170 void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
00171
00174 unsigned char IsPointVisible(vtkIdType ptId);
00175
00178 unsigned char IsCellVisible(vtkIdType cellId);
00179
00182 unsigned char GetPointBlanking();
00183
00186 unsigned char GetCellBlanking();
00187
00191 virtual void Crop();
00192
00193
00195
00196 static vtkStructuredGrid* GetData(vtkInformation* info);
00197 static vtkStructuredGrid* GetData(vtkInformationVector* v, int i=0);
00198
00200
00207 void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent = true);
00208
00209 protected:
00210 vtkStructuredGrid();
00211 ~vtkStructuredGrid();
00212
00213
00214 vtkVertex *Vertex;
00215 vtkLine *Line;
00216 vtkQuad *Quad;
00217 vtkHexahedron *Hexahedron;
00218 vtkEmptyCell *EmptyCell;
00219
00220 int Dimensions[3];
00221 int DataDescription;
00222
00223 int Extent[6];
00224
00225 vtkStructuredVisibilityConstraint* PointVisibility;
00226
00227 void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
00228 vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
00229
00230 vtkStructuredVisibilityConstraint* CellVisibility;
00231
00232 void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
00233 vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
00234
00235 private:
00237
00238 void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00239 {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00241
00242
00243 void InternalStructuredGridCopy(vtkStructuredGrid *src);
00244
00245 private:
00246 vtkStructuredGrid(const vtkStructuredGrid&);
00247 void operator=(const vtkStructuredGrid&);
00248 };
00249
00250
00251 inline vtkIdType vtkStructuredGrid::GetNumberOfCells()
00252 {
00253 int nCells=1;
00254 int dims[3];
00255 int i;
00256
00257 this->GetDimensions(dims);
00258 for (i=0; i<3; i++)
00259 {
00260 if (dims[i] <= 0)
00261 {
00262 return 0;
00263 }
00264 if (dims[i] > 1)
00265 {
00266 nCells *= (dims[i]-1);
00267 }
00268 }
00269
00270 return nCells;
00271 }
00272
00273 inline int vtkStructuredGrid::GetDataDimension()
00274 {
00275 return vtkStructuredData::GetDataDimension(this->DataDescription);
00276 }
00277
00278 #endif
00279
00280
00281
00282
00283
00284