00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef ISOEX_REGULARGRID_HH
00034 #define ISOEX_REGULARGRID_HH
00035
00036
00037
00038
00039 #include <IsoEx/Grids/Grid.hh>
00040
00041
00042
00043 namespace IsoEx {
00044
00045
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
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 }
00119
00120 #endif // ISOEX_REGULARGRID_HH defined
00121
00122