VTK
dox/Common/DataModel/vtkUniformGrid.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkUniformGrid.h
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 =========================================================================*/
00028 #ifndef __vtkUniformGrid_h
00029 #define __vtkUniformGrid_h
00030 
00031 #include "vtkCommonDataModelModule.h" // For export macro
00032 #include "vtkImageData.h"
00033 
00034 class vtkEmptyCell;
00035 class vtkStructuredVisibilityConstraint;
00036 class vtkUnsignedCharArray;
00037 class vtkAMRBox;
00038 
00039 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
00040 {
00041 public:
00043 
00044   static vtkUniformGrid *New();
00045   vtkTypeMacro(vtkUniformGrid,vtkImageData);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00048 
00051   virtual void CopyStructure(vtkDataSet *ds);
00052 
00054   virtual int GetDataObjectType() {return VTK_UNIFORM_GRID;};
00055 
00057 
00058   virtual vtkCell *GetCell(vtkIdType cellId);
00059   virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
00060   virtual vtkIdType FindCell(
00061     double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
00062     int& subId, double pcoords[3], double *weights);
00063   virtual vtkIdType FindCell(
00064     double x[3], vtkCell *cell, vtkGenericCell *gencell,
00065     vtkIdType cellId, double tol2, int& subId,
00066     double pcoords[3], double *weights);
00067   virtual vtkCell *FindAndGetCell(
00068     double x[3], vtkCell *cell, vtkIdType cellId,
00069     double tol2, int& subId, double pcoords[3],
00070     double *weights);
00071   virtual int GetCellType(vtkIdType cellId);
00072   virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
00073     {vtkStructuredData::GetCellPoints(cellId,ptIds,this->GetDataDescription(),
00074                                       this->GetDimensions());}
00075   virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
00076     {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}
00077   virtual void Initialize();
00078   virtual int GetMaxCellSize() {return 8;}; //voxel is the largest
00080 
00082   int GetGridDescription();
00083 
00084   //  BTX
00089   int Initialize(const vtkAMRBox *def, double* origin, double* spacing);
00094   int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhosts);
00095 
00101   int Initialize(const vtkAMRBox *def, double* origin, double* spacing, const int nGhosts[3]);
00103 
00108   int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhostsI,int nGhostsJ,int nGhostsK);
00109   //ETX
00111 
00113 
00114   virtual void ShallowCopy(vtkDataObject *src);
00115   virtual void DeepCopy(vtkDataObject *src);
00117 
00119 
00123   virtual void BlankPoint(vtkIdType ptId);
00124   virtual void UnBlankPoint(vtkIdType ptId);
00125   virtual void BlankPoint( const int i, const int j, const int k );
00126   virtual void UnBlankPoint( const int i, const int j, const int k );
00128 
00130 
00133   virtual void BlankCell(vtkIdType ptId);
00134   virtual void UnBlankCell(vtkIdType ptId);
00135   virtual void BlankCell( const int i, const int j, const int k );
00136   virtual void UnBlankCell( const int i, const int j, const int k );
00138 
00140   virtual vtkUnsignedCharArray *GetPointVisibilityArray();
00141 
00145   virtual void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
00146 
00148   virtual vtkUnsignedCharArray *GetCellVisibilityArray();
00149 
00153   virtual void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
00154 
00157   virtual void AttachCellVisibilityToCellData( );
00158 
00161   virtual void AttachPointVisibilityToPointData( );
00162 
00165   virtual unsigned char IsPointVisible(vtkIdType ptId);
00166 
00169   virtual unsigned char IsCellVisible(vtkIdType cellId);
00170 
00173   virtual unsigned char GetPointBlanking();
00174 
00177   virtual unsigned char GetCellBlanking();
00178 
00179   virtual vtkImageData* NewImageDataCopy();
00180 
00181   //BTX
00183 
00184   static vtkUniformGrid* GetData(vtkInformation* info);
00185   static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
00186   //ETX
00188 
00189 protected:
00190   vtkUniformGrid();
00191   ~vtkUniformGrid();
00192 
00194   void GetCellDims( int cellDims[3] );
00195 
00197   virtual void ComputeScalarRange();
00198 
00199   vtkStructuredVisibilityConstraint* PointVisibility;
00200 
00201   void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
00202   vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
00203 
00204   vtkStructuredVisibilityConstraint* CellVisibility;
00205 
00206   void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
00207   vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
00208 
00209   vtkEmptyCell* GetEmptyCell();
00210 
00211 private:
00212   vtkUniformGrid(const vtkUniformGrid&);  // Not implemented.
00213   void operator=(const vtkUniformGrid&);  // Not implemented.
00214 
00215   vtkEmptyCell *EmptyCell;
00216 };
00217 
00218 
00219 #endif
00220 
00221 
00222