00001 /* square made out of one or two hexahedron 00002 */ 00003 00004 #ifndef threequads_hh 00005 #define threequads_hh 00006 00007 #include "basics/typedefs.hh" 00008 #include "geometry/mesh.hh" 00009 #include "geometry/topology.hh" 00010 #include "geometry/cell2D.hh" 00011 #include "toolbox.hh" 00012 00013 namespace concepts { 00014 00015 // ***************************************************************** Square3 ** 00016 00023 class ThreeQuads : public Mesh2 { 00024 // static const uint ncell_ = 3; 00025 public: 00026 ThreeQuads(); 00029 ThreeQuads(Array<uint> attrib); 00030 virtual ~ThreeQuads(); 00031 00032 inline uint ncell() const { return cell_.size(); } 00033 // inline Scan2* scan() { return new S(cell_); } 00034 inline Scan2* scan() { 00035 return new PStlVectorScan<Cell2>(cell_.begin(), cell_.end()); 00036 } 00037 // return new S(cell_.begin(), cell_.end()); } 00038 00039 virtual std::ostream& info(std::ostream& os) const; 00040 private: 00041 // class S : public Scan<Cell2> { 00042 // // index 00043 // uint idx_; 00044 // // stored C-array 00045 // Quad2d *(&cell_)[ncell_]; 00046 // public: 00047 // inline S(Quad2d *(&cell)[ncell_]) : idx_(0), cell_(cell) {} 00048 // inline S(const S &scan) : idx_(scan.idx_), cell_(scan.cell_) {} 00049 00050 // inline bool eos() const { return idx_ == ncell_; } 00051 00052 // // increment operator over the C-array 00053 // // inline Cell2& operator++(int) { 00054 // // return *cell_[idx_++]; } 00055 00056 // // increment operator over the C-array 00057 // inline Cell2& operator++(int) { 00058 // return *cell_[idx_++]; } 00059 00060 // inline Scan2* clone() const { 00061 // return new S(*this); } 00062 // }; 00063 00064 // Class for a scanner over a STL vector 00065 00066 00067 // class S : public Scan<Cell2> { 00068 // // iterator 00069 // Sequence<Quad2d*>::iterator i_; 00070 // // iterator after the last element 00071 // Sequence<Quad2d*>::iterator end_; 00072 // public: 00073 // inline S(Sequence<Quad2d*>::iterator i, 00074 // Sequence<Quad2d*>::iterator end) : i_(i), end_(end) {} 00075 // // copy constructor 00076 // inline S(const S &scan) : i_(scan.i_), end_(scan.end_) {} 00077 00078 // inline bool eos() const { return i_ == end_; } 00079 00080 // // increment operator over the C-array 00081 // inline Cell2& operator++(int) { 00082 // return **(i_++); 00083 // } 00084 00085 // inline Scan2* clone() const { return new S(*this); } 00086 // }; 00087 00088 void construct_(const Array<uint>& attrib); 00089 00090 00091 Sequence<Vertex*> vtx_; 00092 Sequence<Edge*> edg_; 00093 Sequence<Quad*> quad_; 00094 //Vertex* vtx_[7]; 00095 //Edge* edg_[9]; 00096 //Quad* quad_[ncell_]; 00097 00098 // Quad2d* cell_[ncell_]; 00099 Sequence<Cell2*> cell_; 00100 }; 00101 00102 } // namespace concepts 00103 00104 #endif // square_hh