00001 00004 #ifndef infMeshes_hh 00005 #define infMeshes_hh 00006 00007 #include "basics/typedefs.hh" 00008 #include "mesh.hh" 00009 #include "topology.hh" 00010 #include "cell2D.hh" 00011 00012 namespace concepts { 00013 00014 // ************************************************** SquareTwoInfiniteRects ** 00015 00025 class SquareTwoInfiniteRects : public Mesh2 { 00026 private: 00027 class S : public Scan<Cell2> { 00028 unsigned int idx_; 00029 Cell2 *(&cell_)[3]; 00030 public: 00031 inline S(Cell2 *(&cell)[3]) : idx_(0), cell_(cell) {} 00032 inline S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {} 00033 inline bool eos() const { return idx_ == 3; } 00034 inline Cell2& operator++(int) { return *cell_[idx_++]; } 00035 inline Scan2* clone() const { return new S(*this); } 00036 }; 00037 00038 Vertex *vtx_ [4]; 00039 Edge *edg_ [4]; 00040 InfiniteEdge *infEdg_ [4]; 00041 Quad *quad_ [1]; 00042 InfiniteQuad *infQuad_[2]; 00043 Cell2 *cell_ [3]; 00044 bool periodic_; 00045 public: 00046 SquareTwoInfiniteRects(bool periodic = false); 00047 virtual ~SquareTwoInfiniteRects(); 00048 inline unsigned int ncell() const { return 3; } 00049 inline Scan2* scan() { return new S(cell_); } 00050 virtual std::ostream& info(std::ostream& os) const; 00051 }; 00052 00053 // *************************************************** SquareOneInfiniteRect ** 00054 00069 class SquareOneInfiniteRect : public Mesh2 { 00070 private: 00071 class S : public Scan<Cell2> { 00072 unsigned int idx_; 00073 Cell2 *(&cell_)[2]; 00074 public: 00075 inline S(Cell2 *(&cell)[2]) : idx_(0), cell_(cell) {} 00076 inline S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {} 00077 inline bool eos() const { return idx_ == 2; } 00078 inline Cell2& operator++(int) { return *cell_[idx_++]; } 00079 inline Scan2* clone() const { return new S(*this); } 00080 }; 00081 00082 Vertex *vtx_ [4]; 00083 Edge *edg_ [4]; 00084 InfiniteEdge *infEdg_ [2]; 00085 Quad *quad_ [1]; 00086 InfiniteQuad *infQuad_[1]; 00087 Cell2 *cell_ [2]; 00088 bool periodic_; 00089 public: 00090 SquareOneInfiniteRect(bool periodic = false); 00091 virtual ~SquareOneInfiniteRect(); 00092 inline unsigned int ncell() const { return 2; } 00093 inline Scan2* scan() { return new S(cell_); } 00094 virtual std::ostream& info(std::ostream& os) const; 00095 }; 00096 00097 } // namespace concepts 00098 00099 #endif // infMeshes_hh 00100