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

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

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