Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkStructuredGrid.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkStructuredGrid.h,v $
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 =========================================================================*/
00047 #ifndef __vtkStructuredGrid_h
00048 #define __vtkStructuredGrid_h
00049 
00050 #include "vtkPointSet.h"
00051 
00052 #include "vtkStructuredData.h" // Needed for inline methods
00053 
00054 class vtkEmptyCell;
00055 class vtkHexahedron;
00056 class vtkLine;
00057 class vtkQuad;
00058 class vtkStructuredVisibilityConstraint;
00059 class vtkUnsignedCharArray;
00060 class vtkVertex;
00061 
00062 class VTK_FILTERING_EXPORT vtkStructuredGrid : public vtkPointSet 
00063 {
00064 public:
00065   static vtkStructuredGrid *New();
00066 
00067   vtkTypeRevisionMacro(vtkStructuredGrid,vtkPointSet);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069  
00071   int GetDataObjectType() {return VTK_STRUCTURED_GRID;}
00072 
00075   void CopyStructure(vtkDataSet *ds);
00076 
00078 
00079   vtkIdType GetNumberOfPoints() {return vtkPointSet::GetNumberOfPoints();}
00080   double *GetPoint(vtkIdType ptId) {return this->vtkPointSet::GetPoint(ptId);}
00081   void GetPoint(vtkIdType ptId, double p[3])
00082     {this->vtkPointSet::GetPoint(ptId,p);}
00083   vtkCell *GetCell(vtkIdType cellId);
00084   void GetCell(vtkIdType cellId, vtkGenericCell *cell);
00085   void GetCellBounds(vtkIdType cellId, double bounds[6]);
00086   int GetCellType(vtkIdType cellId);
00087   vtkIdType GetNumberOfCells();
00088   void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
00089   void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
00090     {
00091       vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());
00092     }
00093   void Initialize();
00094   int GetMaxCellSize() {return 8;}; //hexahedron is the largest
00095   void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
00096                         vtkIdList *cellIds);
00097   virtual void GetScalarRange(double range[2]);
00098   double *GetScalarRange() {return this->Superclass::GetScalarRange();}
00100 
00102 
00103   void SetDimensions(int i, int j, int k);
00104   void SetDimensions(int dim[3]);
00106 
00108 
00109   virtual int *GetDimensions ();
00110   virtual void GetDimensions (int dim[3]);
00112 
00114   int GetDataDimension();
00115   
00117 
00120   void SetExtent(int extent[6]);
00121   void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
00122   vtkGetVector6Macro(Extent, int);
00124 
00130   unsigned long GetActualMemorySize();
00131 
00133 
00134   void ShallowCopy(vtkDataObject *src);  
00135   void DeepCopy(vtkDataObject *src);
00137 
00139   int GetExtentType() { return VTK_3D_EXTENT; }
00140 
00142 
00146   void BlankPoint(vtkIdType ptId);
00147   void UnBlankPoint(vtkIdType ptId);
00149 
00151 
00155   void BlankCell(vtkIdType ptId);
00156   void UnBlankCell(vtkIdType ptId);
00158   
00160   vtkUnsignedCharArray *GetPointVisibilityArray(); 
00161 
00165   void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
00166 
00168   vtkUnsignedCharArray *GetCellVisibilityArray(); 
00169 
00173   void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
00174 
00177   unsigned char IsPointVisible(vtkIdType ptId);
00178   
00181   unsigned char IsCellVisible(vtkIdType cellId);
00182 
00185   unsigned char GetPointBlanking();
00186 
00189   unsigned char GetCellBlanking();
00190 
00194   virtual void Crop();
00195 
00196   //BTX
00198 
00199   static vtkStructuredGrid* GetData(vtkInformation* info);
00200   static vtkStructuredGrid* GetData(vtkInformationVector* v, int i=0);
00201   //ETX
00203 
00204 protected:
00205   vtkStructuredGrid();
00206   ~vtkStructuredGrid();
00207 
00208   // for the GetCell method
00209   vtkVertex *Vertex;
00210   vtkLine *Line;
00211   vtkQuad *Quad;  
00212   vtkHexahedron *Hexahedron;
00213   vtkEmptyCell *EmptyCell;
00214   
00215   int Dimensions[3];
00216   int DataDescription;
00217 
00218   int Extent[6];
00219 
00220   vtkStructuredVisibilityConstraint* PointVisibility;
00221 
00222   void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
00223   vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
00224 
00225   vtkStructuredVisibilityConstraint* CellVisibility;
00226 
00227   void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
00228   vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
00229 
00230 private:
00232 
00233   void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
00234     {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
00236 
00237   // Internal method used by DeepCopy and ShallowCopy.
00238   void InternalStructuredGridCopy(vtkStructuredGrid *src);
00239 
00240 private:
00241   vtkStructuredGrid(const vtkStructuredGrid&);  // Not implemented.
00242   void operator=(const vtkStructuredGrid&);  // Not implemented.
00243 };
00244 
00245 
00246 inline vtkIdType vtkStructuredGrid::GetNumberOfCells() 
00247 {
00248   int nCells=1;
00249   int dims[3];
00250   int i;
00251 
00252   this->GetDimensions(dims);
00253   for (i=0; i<3; i++)
00254     {
00255     if (dims[i] <= 0)
00256       {
00257       return 0;
00258       }
00259     if (dims[i] > 1)
00260       {
00261       nCells *= (dims[i]-1);
00262       }
00263     }
00264 
00265   return nCells;
00266 }
00267 
00268 inline int vtkStructuredGrid::GetDataDimension()
00269 {
00270   return vtkStructuredData::GetDataDimension(this->DataDescription);
00271 }
00272 
00273 #endif
00274 
00275 
00276 
00277 
00278 
00279 

Generated on Mon Jan 21 23:07:21 2008 for VTK by  doxygen 1.4.3-20050530