566: Properly define fwd_piter_type and bkd_piter_type for the add_neighborhood image morpher.

2006-09-25 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr> Properly define fwd_piter_type and bkd_piter_type for the add_neighborhood image morpher. * oln/core/abstract/image_hierarchies.hh: Remove end blank line. * oln/core/gen/fwd_piter_bbox.hh (change_topology_): New. * oln/core/gen/bkd_piter_bbox.hh (change_topology_): New. * oln/morpher/add_neighborhood.hh (morpher_type): Remove; obsolete cause defined in super class. (fwd_piter_type, bkd_piter_type): New definitions. Index: oln/core/abstract/image_hierarchies.hh =================================================================== --- oln/core/abstract/image_hierarchies.hh (revision 565) +++ oln/core/abstract/image_hierarchies.hh (working copy) @@ -59,4 +59,3 @@ #endif // ! OLENA_CORE_ABSTRACT_IMAGE_HIERARCHIES_HH - Index: oln/core/gen/fwd_piter_bbox.hh =================================================================== --- oln/core/gen/fwd_piter_bbox.hh (revision 565) +++ oln/core/gen/fwd_piter_bbox.hh (working copy) @@ -95,6 +95,12 @@ return ostr; } + template <typename new_topo_t> + struct change_topology_ + { + typedef fwd_piter_bbox_<new_topo_t> ret; + }; + protected: const topo_t& topo_; Index: oln/core/gen/bkd_piter_bbox.hh =================================================================== --- oln/core/gen/bkd_piter_bbox.hh (revision 565) +++ oln/core/gen/bkd_piter_bbox.hh (working copy) @@ -95,6 +95,12 @@ return ostr; } + template <typename new_topo_t> + struct change_topology_ + { + typedef bkd_piter_bbox_<new_topo_t> ret; + }; + protected: const topo_t& topo_; Index: oln/morpher/add_neighborhood.hh =================================================================== --- oln/morpher/add_neighborhood.hh (revision 565) +++ oln/morpher/add_neighborhood.hh (working copy) @@ -55,11 +55,17 @@ template <typename Image, typename Neighb> struct vtypes< morpher::add_neighborhood<Image, Neighb> > { + private: + + typedef oln_type_of(Image, fwd_piter) basic_fwd_piter_type; + typedef oln_type_of(Image, bkd_piter) basic_bkd_piter_type; + + public: // Topology type. typedef topo_add_nbh< oln_type_of(Image, topo), Neighb > topo_type; - // Morpher type. - typedef oln::morpher::tag::identity morpher_type; + typedef typename basic_fwd_piter_type::template change_topology_<topo_type>::ret fwd_piter_type; + typedef typename basic_bkd_piter_type::template change_topology_<topo_type>::ret bkd_piter_type; // Neighborhood type. typedef Neighb neighborhood_type;
participants (1)
-
Thierry GERAUD