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

app-heier/meshes/oneQuad.hh
Go to the documentation of this file.
00001 #ifndef onequad_hh
00002 #define onequad_hh
00003 
00004 #include "basics/typedefs.hh"
00005 #include "geometry/mesh.hh"
00006 #include "geometry/topology.hh"
00007 #include "geometry/cell2D.hh"
00008 
00009 namespace concepts {
00010 
00011   class OneQuad : public Mesh2 {
00012     static const uint ncell_ = 1;
00013   public:
00014     OneQuad();
00017     OneQuad(Array<uint> attrib);
00018     virtual ~OneQuad();
00019 
00020     inline uint ncell() const { return ncell_; }
00021     inline Scan2* scan() { return new S(cell_); }
00022 
00023     virtual std::ostream& info(std::ostream& os) const;
00024   private:
00025     class S : public Scan<Cell2> {
00026       uint idx_;
00027       Quad2d *(&cell_)[ncell_];
00028     public:
00029       inline S(Quad2d *(&cell)[ncell_]) : idx_(0), cell_(cell) {}
00030       inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {}
00031 
00032       inline bool eos() const { return idx_ == ncell_; }
00033       inline Cell2& operator++(int) { return *cell_[idx_++]; }
00034 
00035       inline Scan2* clone() const { return new S(*this); }
00036     };
00037 
00038     void construct_(const Array<uint>& attrib);
00039 
00040 
00041     Vertex* vtx_[4];
00042     Edge* edg_[4];
00043     Quad* quad_[ncell_];
00044 
00045     Quad2d* cell_[ncell_];
00046   };
00047 
00048 } 
00049 
00050 #endif // onequad_hh

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