
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2007-09-25 Guillaume Duhamel <guillaume.duhamel@lrde.epita.fr> Add mesh_p in sandbox. * main.cc: Update. * mesh_p.hh: New. * mesh_psite.hh: New. --- main.cc | 15 +++++++++++---- mesh_p.hh | 39 +++++++++++++++++++++++++++++++++++++++ mesh_psite.hh | 24 ++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 4 deletions(-) Index: trunk/milena/sandbox/duhamel/mesh_psite.hh =================================================================== --- trunk/milena/sandbox/duhamel/mesh_psite.hh (revision 0) +++ trunk/milena/sandbox/duhamel/mesh_psite.hh (revision 1173) @@ -0,0 +1,24 @@ +#ifndef MLN_MESH_PSITE_HH +# define MLN_MESH_PSITE_HH + +# include "mesh_p.hh" + +namespace mln +{ + + namespace util + { + template<typename P> + class Mesh_psite + { + public: + Mesh_psite() {} + ~Mesh_psite() {} + P to_point () {return m_ptr->loc_[i];} + private: + unsigned i; + Mesh_p<P>* m_ptr; + }; + } // end of util +} // end of mln +#endif // MLN_MESH_PSITE_HH Index: trunk/milena/sandbox/duhamel/main.cc =================================================================== --- trunk/milena/sandbox/duhamel/main.cc (revision 1172) +++ trunk/milena/sandbox/duhamel/main.cc (revision 1173) @@ -1,6 +1,6 @@ #include "graph.hh" -//#include "mesh_p.hh" -//#include "mesh_psite.hh" +#include "mesh_p.hh" +#include "mesh_psite.hh" using namespace mln; @@ -12,12 +12,19 @@ g.add_node (); g.add_node (); g.add_node (); + g.add_node (); + g.add_edge (0,1); + g.add_edge (1, 2); + g.add_edge (0, 2); + g.add_edge (2, 3); + g.add_edge (0, 3); + g.coherence (); g.print_debug (); -// image2d_b<int> out (5, 5, 1); + // image2d_b<int> out (2, 2, 1); + - // debug::println_with_border (out); } Index: trunk/milena/sandbox/duhamel/mesh_p.hh =================================================================== --- trunk/milena/sandbox/duhamel/mesh_p.hh (revision 0) +++ trunk/milena/sandbox/duhamel/mesh_p.hh (revision 1173) @@ -0,0 +1,39 @@ +#ifndef MLN_MESH_P_HH +# define MLN_MESH_P_HH + +#include "graph.hh" + +namespace mln +{ + + namespace util + { + + template<typename P> + class Mesh_p + { + public: + Mesh_p () + { + } + Mesh_p (Graph<void>& gr) + : gr_ (gr) + { + } + + ~Mesh_p () {} + + std::vector<P>& loc_get () + { + return loc_; + } + + private: + Graph<void> gr_; + std::vector<P> loc_; + // Mesh_psite<P> psite; + }; + } // end of util +} // end of mln + +#endif // MLN_MESH_P_HH
participants (1)
-
Guillaume Duhamel