
https://svn.lrde.epita.fr/svn/oln/trunk/olena Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Fix tests/window2d. * oln/core/image_entry.hh (oln::single_vtype<image_entry<E>, typedef_::bkd_qiter_type>): New. * oln/core/iterator_vtypes.hh (oln::single_vtype<image1d<T>, typedef_::fwd_qiter_type>) (oln::single_vtype<image2d<T>, typedef_::fwd_qiter_type>) (oln::single_vtype<image3d<T>, typedef_::fwd_qiter_type>): New. Aesthetic changes. * oln/core/1d/aliases.hh (oln::window_) (oln::fwd_qiter_win_, oln::bkd_qiter_win_): New forward declarations. (oln::window1d, oln::fwd_qiter1d): New typedefs. * oln/core/3d/aliases.hh (oln::window_) (oln::fwd_qiter_win_, oln::bkd_qiter_win_): New forward declarations. (oln::window3d, oln::fwd_qiter3d): New typedefs. 1d/aliases.hh | 10 +++ 2d/aliases.hh | 4 + 3d/aliases.hh | 10 +++ image_entry.hh | 31 +++++++-- iterator_vtypes.hh | 173 ++++++++++++++++++++++++++++++++++++----------------- 5 files changed, 168 insertions(+), 60 deletions(-) Index: oln/core/image_entry.hh --- oln/core/image_entry.hh (revision 631) +++ oln/core/image_entry.hh (working copy) @@ -75,6 +75,13 @@ typedef mlc::undefined value_type; // rvalue_type: see below. + // piter_type: see below. + // fwd_piter_type: see below. + // bkd_piter_type: see below. + + // fwd_qiter_type: see below. + // bkd_qiter_type: see below. + typedef mlc::undefined concrete_type; /// \brief Morpher type. @@ -100,22 +107,24 @@ }; - // Piter. + // Rvalue. template <typename E> - struct single_vtype< image_entry<E>, typedef_::piter_type > + struct single_vtype< image_entry<E>, typedef_::rvalue_type > { - typedef oln_type_of(E, fwd_piter) ret; + typedef oln_type_of(E, value) ret; }; - // Rvalue. + /* FIXME: Should we keep the `piter' vtype, knowing that the macro + `oln_piter' gives the `fwd_piter' vtype (and not the `piter' + vtype)? */ + // Piter. template <typename E> - struct single_vtype< image_entry<E>, typedef_::rvalue_type > + struct single_vtype< image_entry<E>, typedef_::piter_type > { - typedef oln_type_of(E, value) ret; + typedef oln_type_of(E, fwd_piter) ret; }; - // Fwd piter. template <typename E> struct single_vtype< image_entry<E>, typedef_::fwd_piter_type > @@ -130,6 +139,7 @@ typedef mlc::undefined ret; }; + // Fwd qiter. template <typename E> struct single_vtype< image_entry<E>, typedef_::fwd_qiter_type > @@ -137,6 +147,13 @@ typedef mlc::undefined ret; }; + // Bkd qiter. + template <typename E> + struct single_vtype< image_entry<E>, typedef_::bkd_qiter_type > + { + typedef mlc::undefined ret; + }; + } // end of namespace oln Index: oln/core/iterator_vtypes.hh --- oln/core/iterator_vtypes.hh (revision 631) +++ oln/core/iterator_vtypes.hh (working copy) @@ -38,7 +38,123 @@ namespace oln { - // morpher::add_isubset<Image, Isubset> + /*------------------. + | oln::image1d<T>. | + `------------------*/ + + template <typename T> class image1d; + + /// fwd_piter vtype of image1d. + template <typename T> + struct single_vtype< image1d<T>, typedef_::fwd_piter_type > + { + typedef fwd_piter1d ret; + }; + + /// bkd_piter vtype of image1d. + template <typename T> + struct single_vtype< image1d<T>, typedef_::bkd_piter_type > + { + typedef bkd_piter1d ret; + }; + + + /// fwd_qiter vtype of image1d. + template <typename T> + struct single_vtype< image1d<T>, typedef_::fwd_qiter_type > + { + typedef fwd_qiter1d ret; + }; + + // FIXME : Not yet available. + +// /// bkd_qiter vtype of image1d. +// template <typename T> +// struct single_vtype< image1d<T>, typedef_::bkd_qiter_type > +// { +// typedef bkd_qiter1d ret; +// }; + + + /*------------------. + | oln::image2d<T>. | + `------------------*/ + + template <typename T> class image2d; + + /// fwd_piter vtype of image2d. + template <typename T> + struct single_vtype< image2d<T>, typedef_::fwd_piter_type > + { + typedef fwd_piter2d ret; + }; + + /// bkd_piter vtype of image2d. + template <typename T> + struct single_vtype< image2d<T>, typedef_::bkd_piter_type > + { + typedef bkd_piter2d ret; + }; + + + /// fwd_qiter vtype of image2d. + template <typename T> + struct single_vtype< image2d<T>, typedef_::fwd_qiter_type > + { + typedef fwd_qiter2d ret; + }; + + // FIXME : Not yet available. + +// /// bkd_qiter vtype of image2d. +// template <typename T> +// struct single_vtype< image2d<T>, typedef_::bkd_qiter_type > +// { +// typedef bkd_qiter2d ret; +// }; + + + /*------------------. + | oln::image3d<T>. | + `------------------*/ + + template <typename T> class image3d; + + /// fwd_piter vtype of image3d. + template <typename T> + struct single_vtype< image3d<T>, typedef_::fwd_piter_type > + { + typedef fwd_piter3d ret; + }; + + /// bkd_piter vtype of image3d. + template <typename T> + struct single_vtype< image3d<T>, typedef_::bkd_piter_type > + { + typedef bkd_piter3d ret; + }; + + + /// fwd_qiter vtype of image3d. + template <typename T> + struct single_vtype< image3d<T>, typedef_::fwd_qiter_type > + { + typedef fwd_qiter3d ret; + }; + + // FIXME : Not yet available. + +// /// bkd_qiter vtype of image3d. +// template <typename T> +// struct single_vtype< image3d<T>, typedef_::bkd_qiter_type > +// { +// typedef bkd_qiter3d ret; +// }; + + + /*--------------------------------------------. + | oln::morpher::add_isubset<Image, Isubset>. | + `--------------------------------------------*/ namespace morpher { template <typename Image, typename Isubset> struct add_isubset; @@ -85,7 +201,9 @@ }; - // morpher::add_neighborhood<Image, Isubset> + /*-------------------------------------------------. + | oln::morpher::add_neighborhood<Image, Isubset>. | + `-------------------------------------------------*/ namespace morpher { template <typename Image, typename Neighb> struct add_neighborhood; @@ -111,57 +229,6 @@ }; - // image1d<T> - - template <typename T> class image1d; - - template <typename T> - struct single_vtype< image1d<T>, typedef_::fwd_piter_type > - { - typedef fwd_piter1d ret; - }; - - template <typename T> - struct single_vtype< image1d<T>, typedef_::bkd_piter_type > - { - typedef bkd_piter1d ret; - }; - - - // image2d<T> - - template <typename T> class image2d; - - template <typename T> - struct single_vtype< image2d<T>, typedef_::fwd_piter_type > - { - typedef fwd_piter2d ret; - }; - - template <typename T> - struct single_vtype< image2d<T>, typedef_::bkd_piter_type > - { - typedef bkd_piter2d ret; - }; - - - // image3d<T> - - template <typename T> class image3d; - - template <typename T> - struct single_vtype< image3d<T>, typedef_::fwd_piter_type > - { - typedef fwd_piter3d ret; - }; - - template <typename T> - struct single_vtype< image3d<T>, typedef_::bkd_piter_type > - { - typedef bkd_piter3d ret; - }; - - } // end of namespace oln Index: oln/core/1d/aliases.hh --- oln/core/1d/aliases.hh (revision 631) +++ oln/core/1d/aliases.hh (working copy) @@ -38,10 +38,14 @@ template <typename C> class point1d_; template <typename C> class dpoint1d_; template <typename D> class neighb_; + template <typename D> class window_; template <typename P> class bbox_; template <typename P> class topo_lbbox_; template <typename T> class fwd_piter_bbox_; template <typename T> class bkd_piter_bbox_; + template <typename P> class fwd_qiter_win_; +// FIXME: Not yet available. +// template <typename P> class bkd_qiter_win_; class grid1d; /// \} @@ -52,12 +56,18 @@ typedef dpoint1d_<int> dpoint1d; typedef neighb_<dpoint1d> neighb1d; + typedef window_<dpoint1d> window1d; typedef bbox_<point1d> bbox1d; typedef topo_lbbox_<point1d> topo1d; + typedef fwd_piter_bbox_<point1d> fwd_piter1d; typedef bkd_piter_bbox_<point1d> bkd_piter1d; + typedef fwd_qiter_win_<point1d> fwd_qiter1d; +// FIXME: Not yet available. +// typedef bkd_qiter_win_<point1d> fwd_qiter1d; + typedef point1d_<float> point1df; typedef dpoint1d_<float> dpoint1df; /// \} Index: oln/core/2d/aliases.hh --- oln/core/2d/aliases.hh (revision 631) +++ oln/core/2d/aliases.hh (working copy) @@ -44,6 +44,8 @@ template <typename P> class fwd_piter_bbox_; template <typename P> class bkd_piter_bbox_; template <typename P> class fwd_qiter_win_; +// FIXME: Not yet available. +// template <typename P> class bkd_qiter_win_; class grid2d; /// \} @@ -63,6 +65,8 @@ typedef bkd_piter_bbox_<point2d> bkd_piter2d; typedef fwd_qiter_win_<point2d> fwd_qiter2d; +// FIXME: Not yet available. +// typedef bkd_qiter_win_<point2d> fwd_qiter2d; typedef point2d_<float> point2df; typedef dpoint2d_<float> dpoint2df; Index: oln/core/3d/aliases.hh --- oln/core/3d/aliases.hh (revision 631) +++ oln/core/3d/aliases.hh (working copy) @@ -38,10 +38,14 @@ template <typename C> class point3d_; template <typename C> class dpoint3d_; template <typename D> class neighb_; + template <typename D> class window_; template <typename P> class bbox_; template <typename P> class topo_lbbox_; template <typename T> class fwd_piter_bbox_; template <typename T> class bkd_piter_bbox_; + template <typename P> class fwd_qiter_win_; +// FIXME: Not yet available. +// template <typename P> class bkd_qiter_win_; class grid3d; /// \} @@ -52,12 +56,18 @@ typedef dpoint3d_<int> dpoint3d; typedef neighb_<dpoint3d> neighb3d; + typedef window_<dpoint3d> window3d; typedef bbox_<point3d> bbox3d; typedef topo_lbbox_<point3d> topo3d; + typedef fwd_piter_bbox_<point3d> fwd_piter3d; typedef bkd_piter_bbox_<point3d> bkd_piter3d; + typedef fwd_qiter_win_<point3d> fwd_qiter3d; +// FIXME: Not yet available. +// typedef bkd_qiter_win_<point3d> fwd_qiter3d; + typedef point3d_<float> point3df; typedef dpoint3d_<float> dpoint3df; /// \}