VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Common/DataModel/vtkUniformGridAMR.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkHierarchicalBoxDataSet.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 =========================================================================*/
00015 //
00016 // .SECTION Description
00017 // vtkUniformGridAMR is a concrete implementation of
00018 // vtkCompositeDataSet. The dataset type is restricted to
00019 // vtkUniformGrid.
00020 
00021 
00022 #ifndef vtkUniformGridAMR_h
00023 #define vtkUniformGridAMR_h
00024 
00025 #include "vtkCommonDataModelModule.h" // For export macro
00026 #include "vtkCompositeDataSet.h"
00027 
00028 class vtkCompositeDataIterator;
00029 class vtkUniformGrid;
00030 class vtkAMRInformation;
00031 class vtkAMRDataInternals;
00032 
00033 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGridAMR: public vtkCompositeDataSet
00034 {
00035 public:
00036   static vtkUniformGridAMR *New();
00037   vtkTypeMacro(vtkUniformGridAMR,vtkCompositeDataSet);
00038 
00039   // Description:
00040   // Return a new iterator (the iterator has to be deleted by the user).
00041   virtual vtkCompositeDataIterator* NewIterator();
00042 
00043   // Description:
00044   // Return class name of data type (see vtkType.h for definitions).
00045   virtual int GetDataObjectType() {return VTK_UNIFORM_GRID_AMR;}
00046 
00047   // Description:  // Print internal states
00048   void PrintSelf(ostream& os, vtkIndent indent);
00049 
00050   // Description:
00051   // Restore data object to initial
00052   virtual void Initialize();
00053 
00054   // Description:
00055   // Initialize the AMR.
00056   virtual void Initialize(int numLevels, const int * blocksPerLevel);
00057 
00058   // Description:
00059   // Set/Get the data description of this uniform grid instance,
00060   // e.g. VTK_XYZ_GRID
00061   void SetGridDescription(int gridDescription);
00062   int GetGridDescription();
00063 
00064   // Description:
00065   // Return the number of levels
00066   unsigned int GetNumberOfLevels();
00067 
00068   // Description:
00069   // Return the total number of blocks, including NULL blocks
00070   virtual unsigned int GetTotalNumberOfBlocks();
00071 
00072   // Description:
00073   // Returns the number of datasets at the given level, including null blocks
00074   unsigned int GetNumberOfDataSets(const unsigned int level);
00075 
00076   // Description:
00077   // Retrieve the bounds of the AMR domain
00078   void GetBounds(double bounds[6]);
00079   const double* GetBounds();
00080   void GetMin(double min[3]);
00081   void GetMax(double max[3]);
00082 
00083   // Description:
00084   // Unhiding superclass method.
00085   virtual void SetDataSet(
00086     vtkCompositeDataIterator* iter, vtkDataObject* dataObj);
00087 
00088   // Description:
00089   // At the passed in level, set grid as the idx'th block at that level.
00090   // idx must be less than the number of data sets at that level.
00091   virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid *grid);
00092 
00093   // Description:
00094   // Return the data set pointed to by iter
00095   vtkDataObject* GetDataSet(vtkCompositeDataIterator* iter);
00096 
00097   // Description:
00098   // Get the data set using the index pair
00099   vtkUniformGrid* GetDataSet(unsigned int level, unsigned int idx);
00100 
00101   // Description:
00102   // Retrieves the composite index  associated with the data at the given
00103   // (level,index) pair.
00104   int GetCompositeIndex( const unsigned int level, const unsigned int index );
00105 
00106   // Description:
00107   // Givenes the composite Idx (as set by SetCompositeIdx) this method returns the
00108   // corresponding level and dataset index within the level.
00109   void GetLevelAndIndex(
00110       const unsigned int compositeIdx, unsigned int &level, unsigned int &idx );
00111 
00112   // Description:
00113   // Override ShallowCopy/DeepCopy and CopyStructure
00114   virtual void ShallowCopy(vtkDataObject *src);
00115   virtual void DeepCopy(vtkDataObject *src);
00116   virtual void CopyStructure(vtkCompositeDataSet *src);
00117 
00118   // Retrieve an instance of this class from an information object.
00119   static vtkUniformGridAMR* GetData(vtkInformation* info);
00120   static vtkUniformGridAMR* GetData(vtkInformationVector* v, int i=0);
00121   //ETX
00122 
00123 protected:
00124   vtkUniformGridAMR();
00125   virtual ~vtkUniformGridAMR();
00126 
00127   // Description:
00128   // Get/Set the meta AMR meta data
00129   vtkGetObjectMacro(AMRData, vtkAMRDataInternals);
00130 
00131   vtkAMRInformation* AMRInfo;
00132   vtkAMRDataInternals* AMRData;
00133   double Bounds[6];
00134 
00135   // Description:
00136   // Get/Set the meta AMR meta data
00137   vtkGetObjectMacro(AMRInfo, vtkAMRInformation);
00138   virtual void SetAMRInfo(vtkAMRInformation*);
00139 
00140 
00141 private:
00142   vtkUniformGridAMR(const vtkUniformGridAMR&);  // Not implemented.
00143   void operator=(const vtkUniformGridAMR&);  // Not implemented.
00144 
00145   friend class vtkUniformGridAMRDataIterator;
00146 };
00147 
00148 #endif