An Implementation of the Marching Cubes Algorithm
1.0
|
00001 00025 #ifndef GRID_HPP 00026 #define GRID_HPP 00027 00028 #include "exceptionobject.hpp" // common::ExceptionObject 00029 #include "3dvector.hpp" // common::t3DVector 00030 00031 00048 namespace mc { 00049 00050 00051 using common::ExceptionObject ; 00052 using common::t3DVector ; 00053 00054 00063 class Grid { 00064 public: 00065 // --------------------------------------------------------------- 00066 // 00067 // Public methods 00068 // 00069 // --------------------------------------------------------------- 00070 00082 Grid( unsigned sx , unsigned sy , unsigned sz , const t3DVector& og , const t3DVector& sp ) ; 00083 00084 00092 Grid( const Grid& g ) ; 00093 00094 00100 ~Grid() ; 00101 00102 00110 unsigned get_size_x() const 00111 { 00112 return _sizex ; 00113 } 00114 00115 00123 unsigned get_size_y() const 00124 { 00125 return _sizey ; 00126 } 00127 00128 00136 unsigned get_size_z() const 00137 { 00138 return _sizez ; 00139 } 00140 00141 00149 double get_spacing_x() const 00150 { 00151 return _spac._x ; 00152 } 00153 00154 00162 double get_spacing_y() const 00163 { 00164 return _spac._y ; 00165 } 00166 00167 00175 double get_spacing_z() const 00176 { 00177 return _spac._z ; 00178 } 00179 00180 00188 t3DVector get_origin() const 00189 { 00190 return _orig ; 00191 } 00192 00193 00203 double get_value( unsigned i , unsigned j , unsigned k ) const throw (ExceptionObject) ; 00204 00205 00219 void set_value( unsigned i , unsigned j , unsigned k , double f ) throw (ExceptionObject) ; 00220 00221 00222 private: 00223 // --------------------------------------------------------------- 00224 // 00225 // Private attributes 00226 // 00227 // --------------------------------------------------------------- 00228 00229 unsigned _sizex ; 00230 unsigned _sizey ; 00231 unsigned _sizez ; 00232 t3DVector _orig ; 00233 t3DVector _spac ; 00234 double ***_f ; 00235 } ; 00236 00237 } // end of namespace mc 00238 00239 //end of group class. 00241 00242 #endif // GRID_HPP