00001 #include <iostream> 00002 00003 #include "basics.hh" 00004 #include "formula.hh" 00005 #include "function.hh" 00006 #include "geometry.hh" 00007 #include "graphics.hh" 00008 #include "hp2D.hh" 00009 #include "operator.hh" 00010 #include "space.hh" 00011 #include "toolbox.hh" 00012 00013 class StrangeMesh : public concepts::Mesh2 { 00014 00015 public: 00016 StrangeMesh(int rows, int cols); 00017 virtual ~StrangeMesh(); 00018 00019 unsigned int ncell() const { return num_cols*num_rows; }; 00020 concepts::Scan2* scan() { return new S(cell_, ncell()); }; 00021 00022 private: 00023 unsigned int num_r_vert; 00024 unsigned int num_c_vert; 00025 00026 unsigned int num_cols; 00027 unsigned int num_rows; 00028 00029 concepts::Vertex** vtx_; 00030 00031 concepts::Edge** h_edg_; 00032 concepts::Edge** v_edg_; 00033 00034 concepts::Quad** quad_; 00035 concepts::Cell2** cell_; 00036 00037 class S : public concepts::Scan<concepts::Cell2> { 00038 unsigned int act_ind; 00039 unsigned int num_cells; 00040 concepts::Cell2** (&cell_); 00041 public: 00042 S(concepts::Cell2** (&cells), uint num_cells) \ 00043 : act_ind(0), num_cells(num_cells), cell_(cells) {} 00044 S(const S& scan) : act_ind(scan.act_ind), \ 00045 num_cells(scan.num_cells), \ 00046 cell_(scan.cell_) {} 00047 bool eos() const { return act_ind==num_cells; } 00048 concepts::Cell2& operator++(int) { 00049 return *cell_[act_ind++]; 00050 } 00051 concepts::Scan2* clone() const { return new S(*this); } 00052 }; 00053 00054 };