Commit 3955922c authored by Thierry Geraud's avatar Thierry Geraud
Browse files

2006-09-15 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>

	Adapt topology hierarchy to new naming convention.
	
	* oln/core/topo_entry.hh: Rename into...
	* oln/core/topology_entry.hh: ...this.
	* oln/core/abstract/topo.hh: Rename into...
	* oln/core/abstract/topology.hh: ...this.
	* oln/core/abstract/topo_with_bbox.hh: Rename into...
	* oln/core/abstract/topology_having_bbox.hh: ...this.
	* oln/core/abstract/topo_hierarchies.hh: Rename into...
	* oln/core/abstract/topology_hierarchies.hh: ...this.
	* oln/core/abstract/topo_ra.hh: Rename into...
	* oln/core/abstract/topology_being_random_accessible.hh: ...this.
	* oln/core/gen/bbox_topo.hh: Rename into...
	* oln/core/gen/topo_bbox.hh: ...this.
	* oln/core/typedefs.hh (is_random_accessible_type): New.
	* oln/core/2d/aliases.hh: Update.
	* oln/basics2d.hh: Update.
	* oln/Makefile.am: Update.



git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@546 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent e21bc163
2006-09-15 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Adapt topology hierarchy to new naming convention.
* oln/core/topo_entry.hh: Rename into...
* oln/core/topology_entry.hh: ...this.
* oln/core/abstract/topo.hh: Rename into...
* oln/core/abstract/topology.hh: ...this.
* oln/core/abstract/topo_with_bbox.hh: Rename into...
* oln/core/abstract/topology_having_bbox.hh: ...this.
* oln/core/abstract/topo_hierarchies.hh: Rename into...
* oln/core/abstract/topology_hierarchies.hh: ...this.
* oln/core/abstract/topo_ra.hh: Rename into...
* oln/core/abstract/topology_being_random_accessible.hh: ...this.
* oln/core/gen/bbox_topo.hh: Rename into...
* oln/core/gen/topo_bbox.hh: ...this.
* oln/core/typedefs.hh (is_random_accessible_type): New.
* oln/core/2d/aliases.hh: Update.
* oln/basics2d.hh: Update.
* oln/Makefile.am: Update.
2006-09-15 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Add operator- to n-dimensional dpoint types.
......
......@@ -2,59 +2,59 @@
olndir = $(includedir)/oln
nobase_oln_HEADERS = \
core/1d/grid1d.hh \
\
core/2d/grid2d.hh \
core/2d/aliases.hh \
core/2d/dpoint2d.hh \
core/2d/grid2d.hh \
core/2d/image2d.hh \
core/2d/point2d.hh \
\
core/3d/grid3d.hh \
\
core/abstract/internal/image_impl.hh \
\
core/abstract/any.hh \
core/abstract/bbox.hh \
core/abstract/dpoint.hh \
core/abstract/dpoint_nd.hh \
core/abstract/entry.hh \
core/abstract/grid.hh \
core/abstract/image_dimension.hh \
core/abstract/image.hh \
core/abstract/image_hierarchies.hh \
core/abstract/image_type.hh \
core/abstract/image_type_integre.hh \
core/abstract/iter.hh \
core/abstract/piter.hh \
core/abstract/point.hh \
core/abstract/point_nd.hh \
core/abstract/pset_bboxed.hh \
core/abstract/pset_cnx.hh \
core/abstract/pset_fixed.hh \
core/abstract/pset.hh \
core/abstract/pset_hierarchies.hh \
core/abstract/pset_ra.hh \
core/abstract/topo.hh \
core/abstract/topo_hierarchies.hh \
core/abstract/topo_ra.hh \
core/abstract/topo_with_bbox.hh \
\
core/gen/bbox.hh \
core/gen/bbox_topo.hh \
core/gen/bkd_piter.hh \
core/gen/fwd_piter.hh \
\
core/case.hh \
core/image_entry.hh \
core/macros.hh \
core/pset_entry.hh \
core/traits.hh \
core/traits_id.hh \
core/topo_entry.hh \
core/typedefs.hh \
core/type.hh \
\
nobase_oln_HEADERS = \
core/1d/grid1d.hh \
\
core/2d/grid2d.hh \
core/2d/aliases.hh \
core/2d/dpoint2d.hh \
core/2d/grid2d.hh \
core/2d/image2d.hh \
core/2d/point2d.hh \
\
core/3d/grid3d.hh \
\
core/abstract/internal/image_impl.hh \
\
core/abstract/any.hh \
core/abstract/bbox.hh \
core/abstract/dpoint.hh \
core/abstract/dpoint_nd.hh \
core/abstract/entry.hh \
core/abstract/grid.hh \
core/abstract/image_dimension.hh \
core/abstract/image.hh \
core/abstract/image_hierarchies.hh \
core/abstract/image_type.hh \
core/abstract/image_type_integre.hh \
core/abstract/iter.hh \
core/abstract/piter.hh \
core/abstract/point.hh \
core/abstract/point_nd.hh \
core/abstract/pset_bboxed.hh \
core/abstract/pset_cnx.hh \
core/abstract/pset_fixed.hh \
core/abstract/pset.hh \
core/abstract/pset_hierarchies.hh \
core/abstract/pset_ra.hh \
core/abstract/topology.hh \
core/abstract/topology_hierarchies.hh \
core/abstract/topology_being_random_accessible.hh \
core/abstract/topology_having_bbox.hh \
\
core/gen/bbox.hh \
core/gen/topo_bbox.hh \
core/gen/bkd_piter.hh \
core/gen/fwd_piter.hh \
\
core/case.hh \
core/image_entry.hh \
core/macros.hh \
core/pset_entry.hh \
core/traits.hh \
core/traits_id.hh \
core/topology_entry.hh \
core/typedefs.hh \
core/type.hh \
\
basics2d.hh
......@@ -47,8 +47,8 @@ namespace oln { template class fwd_piter_<point2d>; }
# include <oln/core/gen/bkd_piter.hh>
namespace oln { template class bkd_piter_<point2d>; }
# include <oln/core/gen/bbox_topo.hh>
namespace oln { template class bbox_topo_<point2d>; }
# include <oln/core/gen/topo_bbox.hh>
namespace oln { template class topo_bbox_<point2d>; }
# include <oln/core/2d/image2d.hh>
......
......@@ -38,7 +38,7 @@ namespace oln
template <typename C> class point2d_;
template <typename C> class dpoint2d_;
template <typename P> class bbox_;
template <typename P> class bbox_topo_;
template <typename P> class topo_bbox_;
template <typename P> class fwd_piter_;
template <typename P> class bkd_piter_;
class grid2d;
......@@ -53,7 +53,7 @@ namespace oln
typedef bbox_<point2d> bbox2d;
typedef fwd_piter_<point2d> fwd_piter2d;
typedef bkd_piter_<point2d> bkd_piter2d;
typedef bbox_topo_<point2d> topo2d;
typedef topo_bbox_<point2d> topo2d;
typedef point2d_<float> point2df;
typedef dpoint2d_<float> dpoint2df;
......
......@@ -25,8 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLENA_CORE_ABSTRACT_TOPO_HH
# define OLENA_CORE_ABSTRACT_TOPO_HH
#ifndef OLENA_CORE_ABSTRACT_TOPOLOGY_HH
# define OLENA_CORE_ABSTRACT_TOPOLOGY_HH
# include <oln/core/typedefs.hh>
......@@ -34,21 +34,25 @@
namespace oln
{
namespace abstract
{
/// Abstract point class.
/// Abstract topology class.
template <typename E>
class topo : public virtual stc::any__simple<E>,
public virtual oln::type
class topology : public virtual stc::any__simple<E>,
public virtual oln::type
{
public:
struct decl
{
stc_virtual_typedef(bbox); // for being bboxed; provides .bbox()
stc_virtual_typedef(ra); // for random access; provides .has(p)
stc_virtual_typedef(bbox);
// for being bboxed; provides .bbox()
stc_virtual_typedef(is_random_accessible);
// provides .has(p) and .has_large(p)
stc_virtual_typedef(point);
......@@ -61,12 +65,12 @@ namespace oln
protected:
topo()
topology()
{}
~topo() { decl(); }
~topology() { decl(); }
}; // end of class oln::abstract::topo<E>
}; // end of class oln::abstract::topology<E>
......@@ -76,8 +80,8 @@ namespace oln
# include <oln/core/abstract/topo_hierarchies.hh>
# include <oln/core/abstract/topology_hierarchies.hh>
#endif // ! OLENA_CORE_ABSTRACT_TOPO_HH
#endif // ! OLENA_CORE_ABSTRACT_TOPOLOGY_HH
......@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLENA_CORE_ABSTRACT_TOPO_RA_HH
# define OLENA_CORE_ABSTRACT_TOPO_RA_HH
#ifndef OLENA_CORE_ABSTRACT_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
# define OLENA_CORE_ABSTRACT_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
# include <oln/core/abstract/topo.hh>
# include <oln/core/abstract/topology.hh>
......@@ -40,7 +40,7 @@ namespace oln
template <typename E>
class ra_topo : public virtual topo<E>
class topology_being_random_accessible : public virtual topology<E>
{
typedef oln_type_of(E, point) point_t;
......@@ -52,7 +52,8 @@ namespace oln
}
protected:
ra_topo()
topology_being_random_accessible()
{}
};
......@@ -61,14 +62,14 @@ namespace oln
template <typename E>
struct case_ < topo_ra_hierarchy, E, 1 >
: where_< mlc::eq_< oln_type_of(E, ra), mlc::true_ > >
struct case_ < topology_hierarchy_wrt_accessibility, E, 1 >
: where_< mlc::eq_< oln_type_of(E, is_random_accessible), mlc::true_ > >
{
typedef abstract::ra_topo<E> ret;
typedef abstract::topology_being_random_accessible<E> ret;
};
} // end of namespace oln
#endif // ! OLENA_CORE_ABSTRACT_TOPO_RA_HH
#endif // ! OLENA_CORE_ABSTRACT_TOPOLOGY_BEING_RANDOM_ACCESSIBLE_HH
......@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLENA_CORE_ABSTRACT_TOPO_WITH_BBOX_HH
# define OLENA_CORE_ABSTRACT_TOPO_WITH_BBOX_HH
#ifndef OLENA_CORE_ABSTRACT_TOPOLOGY_HAVING_BBOX_HH
# define OLENA_CORE_ABSTRACT_TOPOLOGY_HAVING_BBOX_HH
# include <oln/core/abstract/topo.hh>
# include <oln/core/abstract/topology.hh>
namespace oln
......@@ -39,7 +39,7 @@ namespace oln
template <typename E>
class topo_with_bbox : public virtual topo<E>
class topology_having_bbox : public virtual topology<E>
{
typedef oln_type_of(E, bbox) bbox_t;
......@@ -59,7 +59,7 @@ namespace oln
protected:
topo_with_bbox()
topology_having_bbox()
{}
};
......@@ -68,14 +68,14 @@ namespace oln
template <typename E>
struct case_ < topo_with_bbox_hierarchy, E, 1 >
struct case_ < topology_hierarchy_wrt_bbox, E, 1 >
: where_< mlc::neq_< oln_type_of(E, bbox), mlc::none > >
{
typedef abstract::topo_with_bbox<E> ret;
typedef abstract::topology_having_bbox<E> ret;
};
} // end of namespace oln
#endif // ! OLENA_CORE_ABSTRACT_TOPO_WITH_BBOX_HH
#endif // ! OLENA_CORE_ABSTRACT_TOPOLOGY_HAVING_BBOX_HH
......@@ -25,25 +25,28 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLENA_CORE_ABSTRACT_TOPO_HIERARCHIES_HH
# define OLENA_CORE_ABSTRACT_TOPO_HIERARCHIES_HH
#ifndef OLENA_CORE_ABSTRACT_TOPOLOGY_HIERARCHIES_HH
# define OLENA_CORE_ABSTRACT_TOPOLOGY_HIERARCHIES_HH
# include <oln/core/abstract/topo.hh>
# include <oln/core/abstract/topology.hh>
namespace oln
{
typedef hierarchy< abstract::topo, 1 > topo_ra_hierarchy;
typedef hierarchy< abstract::topo, 2 > topo_with_bbox_hierarchy;
typedef hierarchy< abstract::topology, 1 > topology_hierarchy_wrt_accessibility;
typedef hierarchy< abstract::topology, 2 > topology_hierarchy_wrt_bbox;
} // end of namespace oln
# include <oln/core/abstract/topo_ra.hh>
# include <oln/core/abstract/topo_with_bbox.hh>
// hierarchy 1: topology wrt accessibility
# include <oln/core/abstract/topology_being_random_accessible.hh>
// hierarchy 2: topology wrt bbox
# include <oln/core/abstract/topology_having_bbox.hh>
#endif // ! OLENA_CORE_ABSTRACT_TOPO_HIERARCHIES_HH
#endif // ! OLENA_CORE_ABSTRACT_TOPOLOGY_HIERARCHIES_HH
......@@ -25,11 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLENA_CORE_GEN_BBOX_TOPO_HH
# define OLENA_CORE_GEN_BBOX_TOPO_HH
#ifndef OLENA_CORE_GEN_TOPO_BBOX_HH
# define OLENA_CORE_GEN_TOPO_BBOX_HH
# include <oln/core/gen/bbox.hh>
# include <oln/core/topo_entry.hh>
# include <oln/core/topology_entry.hh>
......@@ -38,41 +38,41 @@ namespace oln
// Forward declarations.
template <typename point> class bbox_topo_;
template <typename point> class topo_bbox_;
// Super type declaration.
template <typename point>
struct set_super_type< bbox_topo_<point> >
struct set_super_type< topo_bbox_<point> >
{
typedef bbox_topo_<point> self_t;
typedef topo_entry<self_t> ret;
typedef topo_bbox_<point> self_t;
typedef topology_entry<self_t> ret;
};
/// Virtual types associated to oln::bbox_<point>.
template <typename point>
struct vtypes< bbox_topo_<point> >
struct vtypes< topo_bbox_<point> >
{
typedef bbox_<point> bbox_type;
typedef point point_type;
typedef mlc::true_ ra_type;
typedef mlc::true_ is_random_accessible_type;
};
/// Bounding box topology based on a point class.
template <typename point>
class bbox_topo_ : public topo_entry< bbox_topo_<point> >
class topo_bbox_ : public topology_entry< topo_bbox_<point> >
{
typedef bbox_<point> bbox_t;
public:
bbox_topo_()
topo_bbox_()
{
}
bbox_topo_(const bbox_t& bb)
topo_bbox_(const bbox_t& bb)
: bb_(bb)
{
}
......@@ -82,6 +82,11 @@ namespace oln
return bb_;
}
bool impl_has(const point& p) const
{
return bb_.has(p);
}
protected:
bbox_<point> bb_;
......@@ -92,4 +97,4 @@ namespace oln
} // end of namespace oln
#endif // ! OLENA_CORE_GEN_BBOX_TOPO_HH
#endif // ! OLENA_CORE_GEN_TOPO_BBOX_HH
......@@ -25,11 +25,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef OLENA_CORE_TOPO_ENTRY_HH
# define OLENA_CORE_TOPO_ENTRY_HH
#ifndef OLENA_CORE_TOPOLOGY_ENTRY_HH
# define OLENA_CORE_TOPOLOGY_ENTRY_HH
# include <oln/core/abstract/entry.hh>
# include <oln/core/abstract/topo.hh>
# include <oln/core/abstract/topology.hh>
......@@ -37,30 +37,30 @@ namespace oln
{
/// Entry class for point sets: topo_entry<E> is an alias for
/// entry< abstract::topo, E>.
/// Entry class for point sets: topology_entry<E> is an alias for
/// entry< abstract::topology, E>.
template <typename E>
struct topo_entry : public entry< abstract::topo, E>
struct topology_entry : public entry< abstract::topology, E>
{
protected:
topo_entry() {}
topology_entry() {}
};
/// Virtual types associated to topo_entry<E>.
/// Virtual types associated to topology_entry<E>.
template <typename E>
struct vtypes< topo_entry<E> >
struct vtypes< topology_entry<E> >
{
typedef mlc::undefined point_type;
typedef mlc::undefined bbox_type;
typedef mlc::undefined ra_type;
typedef mlc::undefined point_type;
typedef mlc::undefined is_random_accessible_type;
};
} // end of namespace oln
#endif // ! OLENA_CORE_TOPO_ENTRY_HH
#endif // ! OLENA_CORE_TOPOLOGY_ENTRY_HH
......@@ -105,6 +105,7 @@ namespace oln
mlc_decl_typedef(fixed_type);
mlc_decl_typedef(ra_type);
mlc_decl_typedef(is_random_accessible_type);
mlc_decl_typedef(cnx_type);
......
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