Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

app-radu/square.hh
Go to the documentation of this file.
00001 /* Unit square
00002  */
00003 
00004 #ifndef app_raduCube_hh
00005 #define app_raduCube_hh
00006 
00007 #include "geometry.hh"
00008 
00009 // ****************************************************************** Square **
00010 
00013 class Square : public concepts::Mesh2 {
00014   static const uint ncell_ = 2;
00015 
00016   class S : public concepts::Scan2 {
00017     uint                 idx_;
00018     concepts::Triangle3d *(&cell_)[ncell_];
00019 
00020   public:
00021     inline S(concepts::Triangle3d *(&cell)[ncell_]) : idx_(0), cell_(cell) {}
00022     inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {}
00023 
00024     inline bool eos() const {return idx_ == ncell_;}
00025     inline concepts::Cell2& operator++(int) {return *cell_[idx_++];}
00026 
00027     inline concepts::Scan2* clone() const {return new S(*this);}
00028   };
00029 
00030   concepts::Vertex   *vtx_[8];
00031   concepts::Edge     *edg_[5];
00032   concepts::Triangle *tri_[ncell_];
00033 
00034   concepts::Triangle3d *cell_[ncell_];
00035 
00036 public:
00037   Square();
00038   virtual ~Square();
00039 
00040   inline uint ncell() const {return ncell_;}
00041   inline concepts::Scan2* scan() {return new S(cell_);}
00042 };
00043 
00044 #endif // app_raduCube_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)