Commit b791b86f authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Rename point set types after p_something.

	
	* mln/core/queue_p.hh: Rename as...
	* mln/core/p_queue.hh: ...this.
	* mln/core/queue_p_fast.hh: Rename as...
	* mln/core/p_queue_fast.hh: ...this.
	* mln/core/queue_p_fast_priority.hh: Rename as...
	* mln/core/p_priority_queue_fast.hh: ...this.
	* mln/core/vec_p_piter.hh: Rename as...
	* mln/core/p_array_piter.hh: ...this.
	* mln/core/queue_p_priority.hh: Rename as...
	* mln/core/p_priority_queue.hh: ...this.
	* mln/core/set_p.hh: Rename as...
	* mln/core/p_set.hh: ...this.
	* mln/core/vec_p.hh: Rename as...
	* mln/core/p_array.hh: ...this.
	* mln/convert/to_set_p.hh: Rename as...
	* mln/convert/to_p_set.hh: ...this.
	* mln/convert/to_vec_p.hh: Rename as...
	* mln/convert/to_p_array.hh: ...this.
	* tests/queue_p.cc: Rename as...
	* tests/core_p_queue.cc: ...this.
	* tests/set_p.cc: Rename as...
	* tests/core_p_set.cc: ...this.
	* tests/queue_p_priority.cc: Rename...
	* tests/core_p_priority_queue.cc: ...this.
	* tests/queue_p_fast.cc: Rename as...
	* tests/core_p_queue_fast.cc: ...this.
	* tests/queue_p_fast_priority.cc: Rename as...
	* tests/core_p_priority_queue_fast.cc: ...this.
	* tests/convert_to_set_p.cc: Rename as...
	* tests/convert_to_p_set.cc: ...this.
	* tests/convert_to_vec_p.cc: Rename as...
	* tests/convert_to_p_array.cc: ...this.

	* mln/core/p_queue.hh (queue_p): Rename as...
	(p_queue): ...this.
	* mln/core/p_queue_fast.hh (queue_p_fast): Rename as...
	(p_queue_fast): ...this.
	* mln/core/p_priority_queue_fast.hh
	(queue_p_fast_priority): Rename as...
	(p_priority_queue_fast): ...this.
	* mln/core/p_array_piter.hh
	(vec_p_fwd_piter, vec_p_bkd_piter): Rename as...
	(p_array_fwd_piter, p_array_bkd_piter): ...these.
	* mln/core/p_priority_queue.hh
	(queue_p_priority): Rename as...
	(p_priority_queue): ...this.
	* mln/core/p_set.hh (set_p): Rename as...
	(p_set): ...this.
	* mln/core/p_array.hh (vec_p): Rename as...
	(p_array): ...this.

	* mln/core/line2d.hh,
	* mln/level/sort_points.hh,
	* mln/level/fill.hh,
	* mln/value/rgb.hh,
	* mln/convert/all.hh,
	* mln/geom/seeds2tiling.hh,
	* mln/geom/seeds2tiling_with_chamfer.hh,
	* mln/set/inter.hh,
	* mln/set/diff.hh,
	* mln/set/uni.hh,
	* mln/set/sym_diff.hh,
	* mln/morpho/opening_attribute.hh,
	* mln/morpho/erosion.spe.hh,
	* mln/display/color_pretty.hh,
	* mln/display/all.hh,
	* mln/util/tree_to_image.hh,
	* mln/labeling/regional_minima.hh,
	* mln/labeling/regional_maxima.hh,
	* tests/morpho_dilation_max_h.cc,
	* tests/level_sort_points.cc,
	* tests/morpho_erosion.cc,
	* tests/morpho_erosion_min_h.cc,
	* tests/trait_op_uminus.cc,
	* tests/convert_to_window.cc,
	* tests/tree_fast_to_image.cc,
	* tests/tree_to_image.cc,
	* tests/show.cc,
	* tests/color_pretty.cc,
	* tests/morpho_dilation.cc: Update.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@1460 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent bc6814ac
2007-11-09 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Rename point set types after p_something.
* mln/core/queue_p.hh: Rename as...
* mln/core/p_queue.hh: ...this.
* mln/core/queue_p_fast.hh: Rename as...
* mln/core/p_queue_fast.hh: ...this.
* mln/core/queue_p_fast_priority.hh: Rename as...
* mln/core/p_priority_queue_fast.hh: ...this.
* mln/core/vec_p_piter.hh: Rename as...
* mln/core/p_array_piter.hh: ...this.
* mln/core/queue_p_priority.hh: Rename as...
* mln/core/p_priority_queue.hh: ...this.
* mln/core/set_p.hh: Rename as...
* mln/core/p_set.hh: ...this.
* mln/core/vec_p.hh: Rename as...
* mln/core/p_array.hh: ...this.
* mln/convert/to_set_p.hh: Rename as...
* mln/convert/to_p_set.hh: ...this.
* mln/convert/to_vec_p.hh: Rename as...
* mln/convert/to_p_array.hh: ...this.
* tests/queue_p.cc: Rename as...
* tests/core_p_queue.cc: ...this.
* tests/set_p.cc: Rename as...
* tests/core_p_set.cc: ...this.
* tests/queue_p_priority.cc: Rename...
* tests/core_p_priority_queue.cc: ...this.
* tests/queue_p_fast.cc: Rename as...
* tests/core_p_queue_fast.cc: ...this.
* tests/queue_p_fast_priority.cc: Rename as...
* tests/core_p_priority_queue_fast.cc: ...this.
* tests/convert_to_set_p.cc: Rename as...
* tests/convert_to_p_set.cc: ...this.
* tests/convert_to_vec_p.cc: Rename as...
* tests/convert_to_p_array.cc: ...this.
* mln/core/p_queue.hh (queue_p): Rename as...
(p_queue): ...this.
* mln/core/p_queue_fast.hh (queue_p_fast): Rename as...
(p_queue_fast): ...this.
* mln/core/p_priority_queue_fast.hh
(queue_p_fast_priority): Rename as...
(p_priority_queue_fast): ...this.
* mln/core/p_array_piter.hh
(vec_p_fwd_piter, vec_p_bkd_piter): Rename as...
(p_array_fwd_piter, p_array_bkd_piter): ...these.
* mln/core/p_priority_queue.hh
(queue_p_priority): Rename as...
(p_priority_queue): ...this.
* mln/core/p_set.hh (set_p): Rename as...
(p_set): ...this.
* mln/core/p_array.hh (vec_p): Rename as...
(p_array): ...this.
* mln/core/line2d.hh,
* mln/level/sort_points.hh,
* mln/level/fill.hh,
* mln/value/rgb.hh,
* mln/convert/all.hh,
* mln/geom/seeds2tiling.hh,
* mln/geom/seeds2tiling_with_chamfer.hh,
* mln/set/inter.hh,
* mln/set/diff.hh,
* mln/set/uni.hh,
* mln/set/sym_diff.hh,
* mln/morpho/opening_attribute.hh,
* mln/morpho/erosion.spe.hh,
* mln/display/color_pretty.hh,
* mln/display/all.hh,
* mln/util/tree_to_image.hh,
* mln/labeling/regional_minima.hh,
* mln/labeling/regional_maxima.hh,
* tests/morpho_dilation_max_h.cc,
* tests/level_sort_points.cc,
* tests/morpho_erosion.cc,
* tests/morpho_erosion_min_h.cc,
* tests/trait_op_uminus.cc,
* tests/convert_to_window.cc,
* tests/tree_fast_to_image.cc,
* tests/tree_to_image.cc,
* tests/show.cc,
* tests/color_pretty.cc,
* tests/morpho_dilation.cc: Update.
2007-11-09 Guillaume Duhamel <guillaume.duhamel@lrde.epita.fr>
Fix bug for tree_to_image.
......
......@@ -46,7 +46,7 @@ namespace mln
# include <mln/convert/to_rgb.hh>
# include <mln/convert/to_std_set.hh>
# include <mln/convert/to_tiles.hh>
# include <mln/convert/to_vec_p.hh>
# include <mln/convert/to_p_array.hh>
# include <mln/convert/to_window.hh>
# include <mln/convert/to_w_window.hh>
......
......@@ -28,12 +28,12 @@
#ifndef MLN_CONVERT_TO_VEC_P_HH
# define MLN_CONVERT_TO_VEC_P_HH
/*! \file mln/convert/to_vec_p.hh
/*! \file mln/convert/to_p_array.hh
*
* \brief Conversions to mln::vec_p.
* \brief Conversions to mln::p_array.
*/
# include <mln/core/vec_p.hh>
# include <mln/core/p_array.hh>
# include <mln/core/concept/window.hh>
......@@ -43,23 +43,23 @@ namespace mln
namespace convert
{
/// Convert a point set \p pset into a vec_p (point set vector).
/// Convert a point set \p pset into a p_array (point set vector).
template <typename S>
vec_p<mln_point(S)> to_vec_p(const Point_Set<S>& pset);
p_array<mln_point(S)> to_p_array(const Point_Set<S>& pset);
/// Convert a window \p win centered at point \p p into a vec_p (point set vector).
/// Convert a window \p win centered at point \p p into a p_array (point set vector).
template <typename W>
vec_p<mln_point(W)> to_vec_p(const Window<W>& win, const mln_point(W)& p);
p_array<mln_point(W)> to_p_array(const Window<W>& win, const mln_point(W)& p);
# ifndef MLN_INCLUDE_ONLY
template <typename S>
vec_p<mln_point(S)> to_vec_p(const Point_Set<S>& pset_)
p_array<mln_point(S)> to_p_array(const Point_Set<S>& pset_)
{
const S& pset = exact(pset_);
vec_p<mln_point(S)> v;
p_array<mln_point(S)> v;
v.reserve(pset.npoints());
mln_fwd_piter(S) p(pset);
for_all(p)
......@@ -68,9 +68,9 @@ namespace mln
}
template <typename W>
vec_p<mln_point(W)> to_vec_p(const Window<W>& win, const mln_point(W)& p)
p_array<mln_point(W)> to_p_array(const Window<W>& win, const mln_point(W)& p)
{
vec_p<mln_point(W)> v;
p_array<mln_point(W)> v;
v.reserve(exact(win).ndpoints());
mln_qiter(W) q(win, p);
for_all(q)
......
......@@ -28,16 +28,16 @@
#ifndef MLN_CONVERT_TO_SET_P_HH
# define MLN_CONVERT_TO_SET_P_HH
/*! \file mln/convert/to_set_p.hh
/*! \file mln/convert/to_p_set.hh
*
* \brief Conversions to mln::set_p.
* \brief Conversions to mln::p_set.
*/
# include <set>
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/point_site.hh>
# include <mln/core/set_p.hh>
# include <mln/core/p_set.hh>
# include <mln/pw/image.hh>
# include <mln/pw/cst.hh>
# include <mln/metal/is_a.hh>
......@@ -51,30 +51,30 @@ namespace mln
/// Convert a neighborhood \p nbh into a point set.
template <typename N>
set_p<mln_point(N)> to_set_p(const Neighborhood<N>& nbh);
p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh);
/// Convert a binary image \p ima into a point set.
template <typename I>
set_p<mln_point(I)> to_set_p(const Image<I>& ima);
p_set<mln_point(I)> to_p_set(const Image<I>& ima);
/// Convert a Window \p win into a point set.
template <typename W>
set_p<mln_point(W)> to_set_p(const Window<W>& win);
p_set<mln_point(W)> to_p_set(const Window<W>& win);
/// Convert an std::set \p s of points into a point set.
template <typename D>
set_p<D> to_set_p(const std::set<D>& s);
p_set<D> to_p_set(const std::set<D>& s);
# ifndef MLN_INCLUDE_ONLY
template <typename N>
set_p<mln_point(N)> to_set_p(const Neighborhood<N>& nbh_)
p_set<mln_point(N)> to_p_set(const Neighborhood<N>& nbh_)
{
const N& nbh = exact(nbh_);
typedef mln_dpoint(N) D;
typedef mln_point(N) P;
set_p<P> pset;
p_set<P> pset;
mln_niter(N) n(nbh, P::origin);
for_all(n)
pset.insert(n);
......@@ -82,14 +82,14 @@ namespace mln
}
template <typename I>
set_p<mln_point(I)> to_set_p(const Image<I>& ima_)
p_set<mln_point(I)> to_p_set(const Image<I>& ima_)
{
const I& ima = exact(ima_);
mln_precondition(ima.has_data());
// FIXME: Check that ima is binary!
typedef mln_dpoint(I) D;
typedef mln_point(I) P;
set_p<P> pset;
p_set<P> pset;
mln_piter(I) p(ima.domain());
for_all(p)
if (ima(p))
......@@ -98,11 +98,11 @@ namespace mln
}
template <typename W>
set_p<mln_point(W)> to_set_p(const Window<W>& win)
p_set<mln_point(W)> to_p_set(const Window<W>& win)
{
typedef mln_dpoint(W) D;
typedef mln_point(W) P;
set_p<P> pset;
p_set<P> pset;
mln_qiter(W) q(exact(win), P::origin);
for_all(q)
pset.insert(q);
......@@ -110,10 +110,10 @@ namespace mln
}
template <typename P>
set_p<P> to_set_p(const std::set<P>& s)
p_set<P> to_p_set(const std::set<P>& s)
{
mln::metal::is_a<P, Point_Site>::check();
set_p<P> pset;
p_set<P> pset;
for (typename std::set<P>::const_iterator i = s.begin();
i != s.end(); ++i)
pset.insert(*i);
......
......@@ -36,7 +36,7 @@
# include <vector>
# include <mln/core/internal/point_set_base.hh>
# include <mln/core/vec_p_piter.hh>
# include <mln/core/p_array_piter.hh>
# include <mln/core/box2d.hh>
# include <mln/math/all.hh>
......@@ -52,10 +52,10 @@ namespace mln
public:
/// Forward Point_Iterator associated type.
typedef vec_p_fwd_piter_<point2d> fwd_piter;
typedef p_array_fwd_piter_<point2d> fwd_piter;
/// Backward Point_Iterator associated type.
typedef vec_p_bkd_piter_<point2d> bkd_piter;
typedef p_array_bkd_piter_<point2d> bkd_piter;
/// Constructor from point \p beg to point \p end.
......
......@@ -28,7 +28,7 @@
#ifndef MLN_CORE_VEC_P_HH
# define MLN_CORE_VEC_P_HH
/*! \file mln/core/vec_p.hh
/*! \file mln/core/p_array.hh
*
* \brief Definition of a point set class based on std::vector.
*/
......@@ -43,8 +43,8 @@ namespace mln
{
// Fwd decls.
template <typename P> struct vec_p_fwd_piter_;
template <typename P> struct vec_p_bkd_piter_;
template <typename P> struct p_array_fwd_piter_;
template <typename P> struct p_array_bkd_piter_;
/*! \brief Point set class based on std::vector.
......@@ -57,21 +57,21 @@ namespace mln
* \todo Make it work with P being a Point_Site.
*/
template <typename P>
class vec_p : public internal::point_set_base_< P, vec_p<P> >
class p_array : public internal::point_set_base_< P, p_array<P> >
{
public:
/// Forward Point_Iterator associated type.
typedef vec_p_fwd_piter_<P> fwd_piter;
typedef p_array_fwd_piter_<P> fwd_piter;
/// Backward Point_Iterator associated type.
typedef vec_p_bkd_piter_<P> bkd_piter;
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
vec_p();
p_array();
/// Constructor from a vector \p vect.
vec_p(const std::vector<P>& vect);
p_array(const std::vector<P>& vect);
/// Reserve \p n cells.
void reserve(std::size_t n);
......@@ -86,7 +86,7 @@ namespace mln
const box_<P>& bbox() const;
/// Append a point \p p.
vec_p<P>& append(const P& p);
p_array<P>& append(const P& p);
/// Clear this set.
void clear();
......@@ -115,13 +115,13 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
template <typename P>
vec_p<P>::vec_p()
p_array<P>::p_array()
{
bb_needs_update_ = false;
}
template <typename P>
vec_p<P>::vec_p(const std::vector<P>& vect)
p_array<P>::p_array(const std::vector<P>& vect)
: vect_(vect)
{
bb_needs_update_ = true;
......@@ -129,21 +129,21 @@ namespace mln
template <typename P>
void
vec_p<P>::reserve(std::size_t n)
p_array<P>::reserve(std::size_t n)
{
vect_.reserve(n);
}
template <typename P>
std::vector<P>&
vec_p<P>::hook_()
p_array<P>::hook_()
{
return vect_;
}
template <typename P>
void
vec_p<P>::update_bb_() const
p_array<P>::update_bb_() const
{
bb_.init();
for (unsigned i = 0; i < vect_.size(); ++i)
......@@ -153,7 +153,7 @@ namespace mln
template <typename P>
bool
vec_p<P>::has(const P& p) const
p_array<P>::has(const P& p) const
{
for (unsigned i = 0; i < vect_.size(); ++i)
if (vect_[i] == p)
......@@ -163,14 +163,14 @@ namespace mln
template <typename P>
std::size_t
vec_p<P>::npoints() const
p_array<P>::npoints() const
{
return vect_.size();
}
template <typename P>
const box_<P>&
vec_p<P>::bbox() const
p_array<P>::bbox() const
{
mln_precondition(npoints() != 0);
if (bb_needs_update_)
......@@ -179,8 +179,8 @@ namespace mln
}
template <typename P>
vec_p<P>&
vec_p<P>::append(const P& p)
p_array<P>&
p_array<P>::append(const P& p)
{
vect_.push_back(p);
if (! bb_needs_update_)
......@@ -190,7 +190,7 @@ namespace mln
template <typename P>
void
vec_p<P>::clear()
p_array<P>::clear()
{
vect_.clear();
bb_needs_update_ = false;
......@@ -198,14 +198,14 @@ namespace mln
template <typename P>
const std::vector<P>&
vec_p<P>::vect() const
p_array<P>::vect() const
{
return vect_;
}
template <typename P>
const P&
vec_p<P>::operator[](unsigned i) const
p_array<P>::operator[](unsigned i) const
{
mln_precondition(i < npoints());
return vect_[i];
......@@ -216,7 +216,7 @@ namespace mln
} // end of namespace mln
# include <mln/core/vec_p_piter.hh>
# include <mln/core/p_array_piter.hh>
#endif // ! MLN_CORE_VEC_P_HH
......@@ -28,24 +28,24 @@
#ifndef MLN_CORE_VEC_P_PITER_HH
# define MLN_CORE_VEC_P_PITER_HH
/*! \file mln/core/vec_p_piter.hh
/*! \file mln/core/p_array_piter.hh
*
* \brief Definition of point iterators on mln::vec_p.
* \brief Definition of point iterators on mln::p_array.
*/
# include <mln/core/vec_p.hh>
# include <mln/core/p_array.hh>
namespace mln
{
/*! \brief Forward iterator on points of a vec_p<P>.
/*! \brief Forward iterator on points of a p_array<P>.
*
*/
template <typename P>
struct vec_p_fwd_piter_ : public internal::point_iterator_base_< P, vec_p_fwd_piter_<P> >
struct p_array_fwd_piter_ : public internal::point_iterator_base_< P, p_array_fwd_piter_<P> >
{
typedef vec_p_fwd_piter_<P> self_;
typedef p_array_fwd_piter_<P> self_;
typedef internal::point_iterator_base_< P, self_ > super_;
public:
......@@ -54,7 +54,7 @@ namespace mln
/// Coordinate associated type.
template <typename S>
vec_p_fwd_piter_(const Point_Set<S>& s);
p_array_fwd_piter_(const Point_Set<S>& s);
/// Reference of the corresponding point.
const P& to_point() const;
......@@ -85,13 +85,13 @@ namespace mln
/*! \brief Backward iterator on points of a vec_p<P>.
/*! \brief Backward iterator on points of a p_array<P>.
*
*/
template <typename P>
struct vec_p_bkd_piter_ : public internal::point_iterator_base_< P, vec_p_bkd_piter_<P> >
struct p_array_bkd_piter_ : public internal::point_iterator_base_< P, p_array_bkd_piter_<P> >
{
typedef vec_p_bkd_piter_<P> self_;
typedef p_array_bkd_piter_<P> self_;
typedef internal::point_iterator_base_< P, self_ > super_;
public:
......@@ -100,7 +100,7 @@ namespace mln
/// Coordinate associated type.
template <typename S>
vec_p_bkd_piter_(const Point_Set<S>& s);
p_array_bkd_piter_(const Point_Set<S>& s);
/// Reference of the corresponding point.
const P& to_point() const;
......@@ -133,11 +133,11 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
// vec_p_fwd_piter_<P>
// p_array_fwd_piter_<P>
template <typename P>
template <typename S>
vec_p_fwd_piter_<P>::vec_p_fwd_piter_(const Point_Set<S>& s)
p_array_fwd_piter_<P>::p_array_fwd_piter_(const Point_Set<S>& s)
: vect_(exact(s).vect())
{
invalidate();
......@@ -145,14 +145,14 @@ namespace mln
template <typename P>
const P&
vec_p_fwd_piter_<P>::to_point() const
p_array_fwd_piter_<P>::to_point() const
{
return p_;
}
template <typename P>
mln_coord(P)
vec_p_fwd_piter_<P>::operator[](unsigned i) const
p_array_fwd_piter_<P>::operator[](unsigned i) const
{
mln_precondition(i < dim);
mln_precondition(is_valid());
......@@ -161,21 +161,21 @@ namespace mln
template <typename P>
bool
vec_p_fwd_piter_<P>::is_valid() const
p_array_fwd_piter_<P>::is_valid() const
{
return i_ < vect_.size();
}
template <typename P>
void
vec_p_fwd_piter_<P>::invalidate()
p_array_fwd_piter_<P>::invalidate()
{
i_ = vect_.size();
}
template <typename P>
void
vec_p_fwd_piter_<P>::start()
p_array_fwd_piter_<P>::start()
{
i_ = 0;
if (is_valid())
......@@ -184,7 +184,7 @@ namespace mln
template <typename P>
void
vec_p_fwd_piter_<P>::next_()
p_array_fwd_piter_<P>::next_()
{
++i_;
if (is_valid())
......@@ -192,18 +192,18 @@ namespace mln
}
template <typename P>
vec_p_fwd_piter_<P>::operator P() const
p_array_fwd_piter_<P>::operator P() const
{
mln_precondition(is_valid());
return p_;
}
// vec_p_bkd_piter_<P>
// p_array_bkd_piter_<P>
template <typename P>
template <typename S>
vec_p_bkd_piter_<P>::vec_p_bkd_piter_(const Point_Set<S>& s)
p_array_bkd_piter_<P>::p_array_bkd_piter_(const Point_Set<S>& s)
: vect_(exact(s).vect())
{
invalidate();
......@@ -211,14 +211,14 @@ namespace mln
template <typename P>
const P&
vec_p_bkd_piter_<P>::to_point() const
p_array_bkd_piter_<P>::to_point() const
{
return p_;
}
template <typename P>
mln_coord(P)
vec_p_bkd_piter_<P>::operator[](unsigned i) const
p_array_bkd_piter_<P>::operator[](unsigned i) const
{
mln_precondition(i < dim);
mln_precondition(is_valid());
......@@ -227,21 +227,21 @@ namespace mln
template <typename P>
bool
vec_p_bkd_piter_<P>::is_valid() const
p_array_bkd_piter_<P>::is_valid() const
{
return i_ >= 0;
}
template <typename P>
void
vec_p_bkd_piter_<P>::invalidate()
p_array_bkd_piter_<P>::invalidate()
{
i_ = -1;
}
template <typename P>