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

geometry/meshConverter.hh
Go to the documentation of this file.
00001 
00006 #ifndef meshConverter2D_hh
00007 #define meshConverter2D_hh
00008 
00009 #include <list>
00010 #include "mesh.hh"
00011 #include "cell2D.hh"
00012 
00013 namespace concepts {
00014 
00015   // ****************************************************** ConvertMeshQuads **
00016 
00034   class ConvertMeshQuads : public Mesh2 {
00035   public:
00041     ConvertMeshQuads(Mesh2& m, const uint level);
00042     ~ConvertMeshQuads();
00043 
00044     virtual uint ncell() const { return quadList_.size(); }
00045     virtual Scan2* scan() { return new S(quadList_); }
00046   protected:
00047     virtual std::ostream& info(std::ostream& os) const;
00048   private:
00050     Mesh2& m_;
00052     Joiner<Vertex*, 1>* vertexList_;
00054     Joiner<Edge*, 1>* edgeList_;
00056     Joiner<Quad2d*, 1>* newQuadList_;
00058     std::list<Quad2d*> quadList_;
00060     bool hasQuads, hasTris;
00061 
00063     class S : public Scan2 {
00064     public:
00065       S(std::list<Quad2d*>& cell) :
00066         idx_(cell.begin()), cell_(cell) {}
00067       S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {}
00068       bool eos() const { return idx_ == cell_.end(); }
00069       Quad2d& operator++(int) { return *(*idx_++); }
00070       Scan2* clone() const { return new S(*this); }
00071     private:
00072       std::list<Quad2d*>::iterator idx_;
00073       std::list<Quad2d*>& cell_;
00074     };
00075 
00077     void convertCell_(Cell2& c, const uint level);
00078     void deleteStuff_();
00079   };
00080 
00081 } // namespace concepts
00082 
00083 #endif // meshConverter2D_hh

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