Commit 8bd6feca authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Move the responsibility of iteration on window points from

	images to windows.

	* ChangeLog: Add missing former entry.
	* core/concept/image.hh (value): Add missing code.
	(qiter, fwd_qiter, bkd_qiter): Move to...
	* core/concept/window.hh: ...here.
	(point): New virtual type.
	* core/concept/neighborhood.hh (point): Likewise.
	* core/2d/aliases.hh,
	* core/2d/neighb2d.hh,
	* core/2d/dpoint2d.hh,
	* core/2d/window2d.hh,
	* core/2d/box2d.hh: Update.
	* core/gen/dpoints_piter.hh (include): Remove useless ones.
	* oln/core/internal/neighborhood_base.hh: New.
	* core/gen/neighb.hh: Update inheritance.
	* oln/core/internal/window_base.hh: New.
	* core/gen/window.hh: Update inheritance.
	(vtypes): Update.
	* core/internal/point_set_std_based.hh: Fix missing return.
	* core/internal/image_base.hh: Update.
	* core/internal/point2d.hh: Fix wrong visibility.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@858 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent e6d2b7e4
2007-03-08 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Move the responsibility of iteration on window points from
images to windows.
* ChangeLog: Add missing former entry.
* core/concept/image.hh (value): Add missing code.
(qiter, fwd_qiter, bkd_qiter): Move to...
* core/concept/window.hh: ...here.
(point): New virtual type.
* core/concept/neighborhood.hh (point): Likewise.
* core/2d/aliases.hh,
* core/2d/neighb2d.hh,
* core/2d/dpoint2d.hh,
* core/2d/window2d.hh,
* core/2d/box2d.hh: Update.
* core/gen/dpoints_piter.hh (include): Remove useless ones.
* oln/core/internal/neighborhood_base.hh: New.
* core/gen/neighb.hh: Update inheritance.
* oln/core/internal/window_base.hh: New.
* core/gen/window.hh: Update inheritance.
(vtypes): Update.
* core/internal/point_set_std_based.hh: Fix missing return.
* core/internal/image_base.hh: Update.
* core/internal/point2d.hh: Fix wrong visibility.
2007-03-07 Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr>
Fix name lookup for attribute of super classes.
* olena/oln/core/concept/image.hh,
* olena/oln/core/gen/dpoints_piter.hh,
* olena/oln/core/internal/point_base.hh,
* olena/oln/core/internal/dpoint_base.hh: Fix name lookup
for attribute of super classes.
2007-03-06 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Update windows and neighborhoods + remove obsolete files.
......
// Copyright (C) 2001, 2003, 2004, 2005, 2006 EPITA Research and
// Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 EPITA Research and
// Development Laboratory
//
// This file is part of the Olena Library. This library is free
......@@ -35,29 +35,36 @@ namespace oln
/// Forward declarations.
/// \{
template <typename P> class box_;
template <typename P> class box_fwd_piter_;
template <typename P> class box_bkd_piter_;
template <typename D> class neighb_;
template <typename D> class window_;
template <typename P> class topo_lbbox_;
template <typename P> class fwd_piter_bbox_;
template <typename P> class bkd_piter_bbox_;
template <typename P> class fwd_qiter_win_;
template <typename P> class bkd_qiter_win_;
template <typename P> class dpoints_fwd_piter_;
template <typename P> class dpoints_bkd_piter_;
/// \}
/// Aliases.
/// \{
typedef neighb_<dpoint2d> neighb2d;
typedef window_<dpoint2d> window2d;
typedef topo_lbbox_<point2d> topo2d;
typedef box_<point2d> box2d;
typedef box_fwd_piter_<point2d> piter2d;
typedef box_fwd_piter_<point2d> fwd_piter2d;
typedef box_bkd_piter_<point2d> bkd_piter2d;
typedef fwd_piter_bbox_<point2d> fwd_piter2d;
typedef bkd_piter_bbox_<point2d> bkd_piter2d;
typedef neighb_<dpoint2d> neighb2d;
typedef dpoints_fwd_piter_<point2d> niter2d;
typedef dpoints_fwd_piter_<point2d> fwd_niter2d;
typedef dpoints_bkd_piter_<point2d> bkd_niter2d;
typedef fwd_qiter_win_<point2d> fwd_qiter2d;
typedef bkd_qiter_win_<point2d> bkd_qiter2d;
typedef window_<dpoint2d> window2d;
typedef dpoints_fwd_piter_<point2d> qiter2d;
typedef dpoints_fwd_piter_<point2d> fwd_qiter2d;
typedef dpoints_bkd_piter_<point2d> bkd_qiter2d;
/// \}
......
......@@ -30,12 +30,13 @@
# include <oln/core/gen/box.hh>
# include <oln/core/2d/point2d.hh>
# include <oln/core/2d/aliases.hh>
namespace oln
{
typedef box_<point2d> box2d;
// FIXME: box2d should be an actual type, not an alias...
} // end of namespace oln
......
......@@ -88,4 +88,8 @@ namespace oln
} // end of namespace oln
// dpoint2d goes with point2d so:
# include <oln/core/2d/point2d.hh>
#endif // ! OLN_CORE_2D_DPOINT2D_HH
......@@ -31,12 +31,13 @@
# include <oln/core/gen/neighb.hh>
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/2d/aliases.hh>
namespace oln
{
typedef neighb_<dpoint2d> neighb2d;
// FIXME: neighb2d should be an actual type, not an alias...
namespace internal
......
......@@ -88,4 +88,8 @@ namespace oln
} // end of namespace oln
// point2d goes with dpoint2d so:
# include <oln/core/2d/dpoint2d.hh>
#endif // ! OLN_CORE_2D_POINT2D_HH
// Copyright (C) 2006 EPITA Research and Development Laboratory
// Copyright (C) 2006, 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -30,12 +30,13 @@
# include <oln/core/gen/window.hh>
# include <oln/core/2d/dpoint2d.hh>
# include <oln/core/2d/aliases.hh>
namespace oln
{
typedef window_<dpoint2d> window2d;
// FIXME: window2d should be an actual type, not an alias...
window2d mk_square(unsigned odd_len);
......
......@@ -195,9 +195,6 @@ namespace oln
{
stc_using_from(Image, point);
stc_typename(qiter);
stc_typename(fwd_qiter);
stc_typename(bkd_qiter);
bool has(const point& p) const;
protected:
......@@ -454,6 +451,7 @@ namespace oln
typename Value_Wise_Mutable_Image<Exact>::lvaluep
Value_Wise_Mutable_Image<Exact>::value(const typename Value_Wise_Accessible_Image<Exact>::vsite& v)
{
return exact(this)->impl_value_read_write(v);
}
template <typename Exact>
......
......@@ -40,6 +40,7 @@ namespace oln
struct Neighborhood : public Any<Exact>
{
stc_typename(grid);
stc_typename(point);
protected:
Neighborhood();
......
......@@ -29,6 +29,7 @@
# define OLN_CORE_CONCEPT_WINDOW_HH
# include <oln/core/equipment.hh>
# include <oln/core/concept/point.hh>
namespace oln
......@@ -40,6 +41,11 @@ namespace oln
struct Window : public Any<Exact>
{
stc_typename(grid);
stc_typename(point);
stc_typename(qiter);
stc_typename(fwd_qiter);
stc_typename(bkd_qiter);
protected:
Window();
......
......@@ -29,8 +29,6 @@
# define OLN_CORE_GEN_DPOINTS_PITER_HH
# include <oln/core/concept/iterator_on_points.hh>
# include <oln/core/concept/window.hh>
# include <oln/core/concept/neighborhood.hh>
# include <oln/core/internal/dpoints_impl.hh>
......@@ -39,8 +37,8 @@ namespace oln
/// Fwd decls.
template <typename P> struct dpoints_fwd_piter_;
template <typename P> struct dpoints_bkd_piter_;
template <typename P> class dpoints_fwd_piter_;
template <typename P> class dpoints_bkd_piter_;
// Super types.
......
......@@ -30,7 +30,7 @@
# define OLN_CORE_GEN_NEIGHB_HH
# include <oln/core/internal/dpoints_impl.hh>
# include <oln/core/concept/neighborhood.hh>
# include <oln/core/internal/neighborhood_base.hh>
namespace oln
......@@ -46,7 +46,7 @@ namespace oln
struct super_trait_< neighb_<Dp> >
{
typedef neighb_<Dp> current__;
typedef Neighborhood<current__> ret;
typedef internal::neighborhood_base_<current__> ret;
};
......@@ -54,14 +54,14 @@ namespace oln
template <typename Dp>
struct vtypes< neighb_<Dp> >
{
typedef stc_type(Dp, grid) grid;
typedef stc_type(Dp, point) point;
};
/// Generic classical neighborhood class.
template <typename Dp>
class neighb_ : public Neighborhood< neighb_<Dp> >,
class neighb_ : public internal::neighborhood_base_< neighb_<Dp> >,
public internal::dpoints_impl_<Dp>
{
public:
......
......@@ -48,6 +48,8 @@ namespace oln
typedef point psite;
typedef Ps pset;
typedef typename point::coord coord;
typedef T value;
typedef const T& rvalue;
......
......@@ -28,8 +28,9 @@
#ifndef OLN_CORE_GEN_WINDOW_HH
# define OLN_CORE_GEN_WINDOW_HH
# include <oln/core/internal/window_base.hh>
# include <oln/core/internal/dpoints_impl.hh>
# include <oln/core/concept/window.hh>
# include <oln/core/gen/dpoints_piter.hh>
namespace oln
......@@ -45,7 +46,7 @@ namespace oln
struct super_trait_< window_<Dp> >
{
typedef window_<Dp> current__;
typedef Window<current__> ret;
typedef internal::window_base_<current__> ret;
};
......@@ -53,14 +54,16 @@ namespace oln
template <typename Dp>
struct vtypes< window_<Dp> >
{
typedef stc_type(Dp, grid) grid;
typedef stc_type(Dp, point) point;
typedef dpoints_fwd_piter_<point> fwd_qiter;
typedef dpoints_bkd_piter_<point> bkd_qiter;
};
/// Generic classical windoworhood class.
template <typename Dp>
class window_ : public Window< window_<Dp> >,
class window_ : public internal::window_base_< window_<Dp> >,
public internal::dpoints_impl_<Dp>
{
public:
......
......@@ -33,7 +33,6 @@
# include <oln/core/internal/utils.hh>
# include <oln/core/gen/box.hh>
# include <oln/core/gen/image_pset_piter.hh>
# include <oln/core/gen/dpoints_piter.hh>
......@@ -139,10 +138,7 @@ namespace oln
{
typedef stc_deferred(point) point__;
typedef stc::final< point__ > psite;
typedef stc::final< dpoints_fwd_piter_<point__> > fwd_qiter;
typedef stc::final< dpoints_bkd_piter_<point__> > bkd_qiter;
typedef fwd_qiter qiter;
typedef stc::final< point__ > psite;
};
template <typename Exact>
......
// Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 EPITA Research and
// Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLN_CORE_INTERNAL_NEIGHBORHOOD_BASE_HH
# define OLN_CORE_INTERNAL_NEIGHBORHOOD_BASE_HH
# include <oln/core/concept/neighborhood.hh>
namespace oln
{
// Fwd decl.
namespace internal { template <typename Exact> class neighborhood_base_; }
// Super type.
template <typename Exact>
struct super_trait_< internal::neighborhood_base_<Exact> >
{
typedef Neighborhood<Exact> ret;
};
/// Virtual types.
template <typename Exact>
struct vtypes< internal::neighborhood_base_<Exact> >
{
typedef stc::abstract point;
typedef stc_deferred(point) point__;
typedef stc::final< stc_type(point__, grid) > grid;
};
namespace internal
{
/// Base class for implementation of neighborhoods class.
template <typename Exact>
class neighborhood_base_ : public Neighborhood< neighb_<Exact> >
{
protected:
neighborhood_base_();
}; // end of class oln::neighborhood_base_<Exact>
# ifndef OLN_INCLUDE_ONLY
template <typename Exact>
neighborhood_base_<Exact>::neighborhood_base_()
{
}
# endif
} // end of namespace oln::internal
} // end of namespace oln
#endif // ! OLN_CORE_INTERNAL_NEIGHBORHOOD_BASE_HH
......@@ -64,9 +64,9 @@ namespace oln
class point2d_ : public point_base_<Exact>
{
typedef point_base_<Exact> super;
stc_using(coord);
public:
stc_using(coord);
coord row() const;
coord& row();
......
......@@ -109,6 +109,7 @@ namespace oln
for_all(i)
ostr << i.to_point() << ' ';
ostr << "}";
return ostr;
}
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License version 2 as published by the
// Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
// Boston, MA 02111-1307, USA.
//
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLN_CORE_INTERNAL_WINDOW_BASE_HH
# define OLN_CORE_INTERNAL_WINDOW_BASE_HH
# include <oln/core/concept/window.hh>
namespace oln
{
// Fwd decl.
namespace internal { template <typename Exact> class window_base_; }
// Super type.
template <typename Exact>
struct super_trait_< internal::window_base_<Exact> >
{
typedef Window<Exact> ret;
};
/// Virtual types.
template <typename Exact>
struct vtypes< internal::window_base_<Exact> >
{
typedef stc::abstract point;
typedef stc::abstract fwd_qiter;
typedef stc::abstract bkd_qiter;
typedef stc_deferred(point) point__;
typedef stc_deferred(fwd_qiter) fwd_qiter__;
typedef stc::final< stc_type(point__, grid) > grid;
typedef stc::final< fwd_qiter__ > qiter;
};
namespace internal
{
/// Base class for implementation of windows class.
template <typename Exact>
class window_base_ : public Window<Exact>
{
protected:
window_base_();
}; // end of class oln::window_base_<Exact>
# ifndef OLN_INCLUDE_ONLY
template <typename Exact>
window_base_<Exact>::window_base_()
{
}
# endif
} // end of namespace oln::internal
} // end of namespace oln
#endif // ! OLN_CORE_INTERNAL_WINDOW_BASE_HH
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment