Commit 6891a65c authored by Thierry Geraud's avatar Thierry Geraud
Browse files

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

	Add oln topology class for enlarged bbox.
	
	* oln/core/gen/topo_lbbox.hh: New.
	* oln/core/abstract/dpoint_nd.hh (set_all): New.
	* oln/core/gen/topo_bbox.hh (impl_has_large): New.



git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@548 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 64bd093a
2006-09-18 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Add oln topology class for enlarged bbox.
* oln/core/gen/topo_lbbox.hh: New.
* oln/core/abstract/dpoint_nd.hh (set_all): New.
* oln/core/gen/topo_bbox.hh (impl_has_large): New.
2006-09-15 Thierry GERAUD <theo@tegucigalpa.lrde.epita.fr>
Adapt topology hierarchy to new naming convention.
......
......@@ -82,6 +82,11 @@ namespace oln
return v_[i];
}
void set_all(const coord_t& c)
{
v_.set_all(c);
}
const xtd::vec<n,coord_t>& vec() const
{
return v_;
......
......@@ -87,6 +87,11 @@ namespace oln
return bb_.has(p);
}
bool impl_has_large(const point& p) const
{
return bb_.has(p);
}
protected:
bbox_<point> bb_;
......
// Copyright (C) 2006 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 OLENA_CORE_GEN_TOPO_LBBOX_HH
# define OLENA_CORE_GEN_TOPO_LBBOX_HH
# include <oln/core/gen/bbox.hh>
# include <oln/core/topology_entry.hh>
namespace oln
{
// Forward declarations.
template <typename point> class topo_lbbox_;
// Super type declaration.
template <typename point>
struct set_super_type< topo_lbbox_<point> >
{
typedef topo_lbbox_<point> self_t;
typedef topology_entry<self_t> ret;
};
/// Virtual types associated to oln::bbox_<point>.
template <typename point>
struct vtypes< topo_lbbox_<point> >
{
typedef bbox_<point> bbox_type;
typedef point point_type;
typedef mlc::true_ is_random_accessible_type;
};
/// Bounding box topology based on a point class.
template <typename point>
class topo_lbbox_ : public topology_entry< topo_lbbox_<point> >
{
typedef bbox_<point> bbox_t;
public:
topo_lbbox_()
{
}
topo_lbbox_(const bbox_t& bb, unsigned border)
: bb_(bb), border_(border)
{
typedef oln_type_of(point, dpoint) dpoint_t;
dpoint_t dp;
dp.set_all(border);
lbb_ = bbox_<point>(bb_.pmin() - dp, bb_.pmax() + dp);
}
const bbox_t& impl_bbox() const
{
return bb_;
}
bool impl_has(const point& p) const
{
return bb_.has(p);
}
bool impl_has_large(const point& p) const
{
return lbb_.has(p);
}
const bbox_t& lbbox() const
{
return lbb_;
}
protected:
bbox_<point> bb_;
unsigned border_;
bbox_<point> lbb_; // FIXME: HERE
};
} // end of namespace oln
#endif // ! OLENA_CORE_GEN_TOPO_LBBOX_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