Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

RegularGrid.hh

00001 /*===========================================================================*\
00002  *                                                                           *
00003  *                                IsoEx                                      *
00004  *        Copyright (C) 2002 by Computer Graphics Group, RWTH Aachen         *
00005  *                         www.rwth-graphics.de                              *
00006  *                                                                           *
00007  *---------------------------------------------------------------------------* 
00008  *                                                                           *
00009  *                                License                                    *
00010  *                                                                           *
00011  *  This library is free software; you can redistribute it and/or modify it  *
00012  *  under the terms of the GNU Library General Public License as published   *
00013  *  by the Free Software Foundation, version 2.                              *
00014  *                                                                           *
00015  *  This library is distributed in the hope that it will be useful, but      *
00016  *  WITHOUT ANY WARRANTY; without even the implied warranty of               *
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        *
00018  *  Library General Public License for more details.                         *
00019  *                                                                           *
00020  *  You should have received a copy of the GNU Library General Public        *
00021  *  License along with this library; if not, write to the Free Software      *
00022  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                *
00023  *                                                                           *
00024 \*===========================================================================*/
00025 
00026 //=============================================================================
00027 //
00028 //  CLASS RegularGrid
00029 //
00030 //=============================================================================
00031 
00032 
00033 #ifndef ISOEX_REGULARGRID_HH
00034 #define ISOEX_REGULARGRID_HH
00035 
00036 
00037 //== INCLUDES =================================================================
00038 
00039 #include <IsoEx/Grids/Grid.hh>
00040 
00041 //== NAMESPACES ===============================================================
00042 
00043 namespace IsoEx {
00044 
00045 //== CLASS DEFINITION =========================================================
00046 
00047               
00052 class RegularGrid : public Grid
00053 {
00054 public:
00055    
00066   RegularGrid(const OpenMesh::Vec3f&  _origin,
00067               const OpenMesh::Vec3f&  _x_axis,
00068               const OpenMesh::Vec3f&  _y_axis,
00069               const OpenMesh::Vec3f&  _z_axis,
00070               unsigned int            _x_res,
00071               unsigned int            _y_res,
00072               unsigned int            _z_res)
00073   { initialize(_origin, _x_axis, _y_axis, _z_axis, _x_res, _y_res, _z_res); }
00074 
00075   void initialize(const OpenMesh::Vec3f&  _origin,
00076                   const OpenMesh::Vec3f&  _x_axis,
00077                   const OpenMesh::Vec3f&  _y_axis,
00078                   const OpenMesh::Vec3f&  _z_axis,
00079                   unsigned int            _x_res,
00080                   unsigned int            _y_res,
00081                   unsigned int            _z_res);
00082 
00083 
00084 
00085   //------------------------------------------------------- mandatory interface
00086 
00088   unsigned int n_cubes() const { return n_cubes_; }
00089 
00091   unsigned int n_points() const { return n_points_; }
00092 
00094   PointIdx point_idx(CubeIdx _idx, unsigned char _corner) const;
00095 
00097   OpenMesh::Vec3f  point(PointIdx _idx) const;
00098 
00099 
00100   const OpenMesh::Vec3f& origin() const { return origin_; }
00101   const OpenMesh::Vec3f& x_axis() const { return x_axis_; }
00102   const OpenMesh::Vec3f& y_axis() const { return y_axis_; }
00103   const OpenMesh::Vec3f& z_axis() const { return z_axis_; }
00104   unsigned int x_resolution() const { return x_res_; }
00105   unsigned int y_resolution() const { return y_res_; }
00106   unsigned int z_resolution() const { return z_res_; }
00107 
00108 
00109 private:
00110 
00111   OpenMesh::Vec3f   origin_, x_axis_, y_axis_, z_axis_, dx_, dy_, dz_;
00112   unsigned int      x_res_, y_res_, z_res_, n_cubes_, n_points_;
00113   CubeIdx           offsets_[8];
00114 };
00115 
00116 
00117 //=============================================================================
00118 } // namespace IsoEx
00119 //=============================================================================
00120 #endif // ISOEX_REGULARGRID_HH defined
00121 //=============================================================================
00122 

Generated on Mon Jul 5 18:07:08 2004 for IsoEx by doxygen 1.3.6-20040222