Commit af52e7a2 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Fix many various tests.

	* tests/morpho/hit_or_miss.cc,
	* mln/util/tree_to_image.hh,
	* mln/topo/internal/complex_iterator_base.hh,
	* mln/topo/internal/complex_relative_iterator_sequence.hh,
	* mln/topo/algebraic_face.hh,
	* mln/core/image/image2d.hh,
	* mln/core/image/image2d_h.hh,
	* mln/core/alias/complex_geometry.hh,
	* mln/accu/count_adjacent_vertices.hh: update comments.

	* tests/fun/x2x/rotation.cc,
	* mln/value/internal/convert.hh,
	* mln/topo/all.hh,
	* mln/morpho/opening_area_on_vertices.hh,
	* mln/registration/internal/rms.hh,
	* mln/morpho/erosion.hh,
	* mln/morpho/general.hh,
	* mln/morpho/general.spe.hh,
	* mln/morpho/closing_area_on_vertices.hh,
	* mln/debug/println_with_border.hh,
	* mln/fun/p2p/mirror.hh,
	* mln/core/site_set/attic/p_complex_faces_piter.hh,
	* mln/core/internal/neighb_niter_impl.hh,
	* mln/core/image/complex_neighborhood_piter.hh,
	* mln/convert/to.hh,
	* mln/accu/land_basic.hh,
	* mln/accu/lor.hh,
	* mln/accu/lor_basic.hh,
	* mln/binarization/includes.hh,
	* mln/border/get.hh,
	* mln/accu/land.hh: add missing/fix includes.

	* mln/canvas/browsing/depth_first_search.hh: use template parameter G
	instead of util::graph.

	* mln/convert/from_to.hh: add a new overload from_to() for conversion
	from a type T to itself.

	* mln/core/clock_neighb.hh: add a missing typedef window and win()
	member.

	* mln/core/image/hexa.hh: remove duplicate method has() and try to fix
	image properties.

	* mln/core/image/hexa_piter.hh: update attribute name.

	* mln/core/internal/piter_adaptor.hh: update change_target();

	* mln/debug/iota.spe.hh: cleanup.

	* mln/debug/println.spe.hh: remove wrong ifndef.

	* mln/labeling/relabel.hh: fix infinite recursion.

	* mln/metal/has_neighborhood.hh: remove. Not needed anymore.


	* mln/morpho/hit_or_miss.hh: improve dispatch and fix a wrong
	precondition.

	* mln/morpho/line_gradient.hh: update with the new graph structure.

	* mln/subsampling/gaussian_subsampling.hh: add missing coma.

	* mln/topo/face_iter.hh,
	* mln/topo/internal/complex_set_iterator_base.hh,
	* mln/topo/internal/complex_relative_iterator_base.hh,
	* mln/topo/adj_lower_face_iter.hh,
	* mln/topo/adj_lower_higher_face_iter.hh,
	* mln/topo/adj_higher_face_iter.hh: add missing forward declarations.

	* mln/trait/neighborhood.hh: Fix wrong declaration order.

	* tests/morpho/complex_image_wst.cc,
	* tests/border/resize_image_if.cc,
	* tests/border/get.cc: fix test.

	* tests/border/resize_image3d_3.cc: write test.

	* tests/core/image/Makefile.am: enable hexa and image2d_h tests.

	* tests/core/image/hexa.cc,
	* tests/core/image/image2d_h.cc: make the test compile.

	* tests/labeling/relabel.cc: fix typo.

	* tests/unit_test/build_unit_test.sh: do not compile headers
	located in mln/concept/doc.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3036 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 31a10ae3
2008-12-11 Guillaume Lazzara <z@lrde.epita.fr>
Fix many various tests.
* tests/morpho/hit_or_miss.cc,
* mln/util/tree_to_image.hh,
* mln/topo/internal/complex_iterator_base.hh,
* mln/topo/internal/complex_relative_iterator_sequence.hh,
* mln/topo/algebraic_face.hh,
* mln/core/image/image2d.hh,
* mln/core/image/image2d_h.hh,
* mln/core/alias/complex_geometry.hh,
* mln/accu/count_adjacent_vertices.hh: update comments.
* tests/fun/x2x/rotation.cc,
* mln/value/internal/convert.hh,
* mln/topo/all.hh,
* mln/morpho/opening_area_on_vertices.hh,
* mln/registration/internal/rms.hh,
* mln/morpho/erosion.hh,
* mln/morpho/general.hh,
* mln/morpho/general.spe.hh,
* mln/morpho/closing_area_on_vertices.hh,
* mln/debug/println_with_border.hh,
* mln/fun/p2p/mirror.hh,
* mln/core/site_set/attic/p_complex_faces_piter.hh,
* mln/core/internal/neighb_niter_impl.hh,
* mln/core/image/complex_neighborhood_piter.hh,
* mln/convert/to.hh,
* mln/accu/land_basic.hh,
* mln/accu/lor.hh,
* mln/accu/lor_basic.hh,
* mln/binarization/includes.hh,
* mln/border/get.hh,
* mln/accu/land.hh: add missing/fix includes.
* mln/canvas/browsing/depth_first_search.hh: use template parameter G
instead of util::graph.
* mln/convert/from_to.hh: add a new overload from_to() for conversion
from a type T to itself.
* mln/core/clock_neighb.hh: add a missing typedef window and win()
member.
* mln/core/image/hexa.hh: remove duplicate method has() and try to fix
image properties.
* mln/core/image/hexa_piter.hh: update attribute name.
* mln/core/internal/piter_adaptor.hh: update change_target();
* mln/debug/iota.spe.hh: cleanup.
* mln/debug/println.spe.hh: remove wrong ifndef.
* mln/labeling/relabel.hh: fix infinite recursion.
* mln/metal/has_neighborhood.hh: remove. Not needed anymore.
* mln/morpho/hit_or_miss.hh: improve dispatch and fix a wrong
precondition.
* mln/morpho/line_gradient.hh: update with the new graph structure.
* mln/subsampling/gaussian_subsampling.hh: add missing coma.
* mln/topo/face_iter.hh,
* mln/topo/internal/complex_set_iterator_base.hh,
* mln/topo/internal/complex_relative_iterator_base.hh,
* mln/topo/adj_lower_face_iter.hh,
* mln/topo/adj_lower_higher_face_iter.hh,
* mln/topo/adj_higher_face_iter.hh: add missing forward declarations.
* mln/trait/neighborhood.hh: Fix wrong declaration order.
* tests/morpho/complex_image_wst.cc,
* tests/border/resize_image_if.cc,
* tests/border/get.cc: fix test.
* tests/border/resize_image3d_3.cc: write test.
* tests/core/image/Makefile.am: enable hexa and image2d_h tests.
* tests/core/image/hexa.cc,
* tests/core/image/image2d_h.cc: make the test compile.
* tests/labeling/relabel.cc: fix typo.
* tests/unit_test/build_unit_test.sh: do not compile headers
located in mln/concept/doc.
2008-12-12 Ugo Jardonnet <jardonnet@lrde.epita.fr>
 
Strengthen unit_test. Beautify file generation.
......
......@@ -30,6 +30,7 @@
# define MLN_ACCU_COUNT_ADJACENT_VERTICES_HH
/// \file mln/accu/count_adjacent_vertices.hh
///
/// Define an accumulator that counts the vertices adjacent to a
/// set of p_edges psites.
......
......@@ -35,6 +35,7 @@
///
/// \todo Have land be parameterized.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
......
......@@ -35,6 +35,7 @@
///
/// \todo Have land_basic be parameterized.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
......
......@@ -35,6 +35,7 @@
///
/// \todo Have lor be parameterized.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
......
......@@ -35,6 +35,7 @@
///
/// \todo Have lor_basic be parameterized.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
......
// Copyright (C) 2008 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,16 +29,13 @@
#ifndef MLN_BINARIZATION_INCLUDES_HH
# define MLN_BINARIZATION_INCLUDES_HH
/*! \file mln/binarization/includes.hh
*
* \brief Basic list of includes for all files in mln/binarization/.
*/
/// \file mln/binarization/includes.hh
///
/// Basic list of includes for all files in mln/binarization/.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/window.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/metal/has_neighborhood.hh>
#endif // ! MLN_BINARIZATION_INCLUDES_HH
......@@ -29,13 +29,12 @@
#ifndef MLN_BORDER_GET_HH
# define MLN_BORDER_GET_HH
/*! \file mln/border/get.hh
*
* \brief Define function that returns the real border thickness of image.
*/
/// \file mln/border/get.hh
///
/// Define function that returns the real border thickness of image.
# include <mln/trait/images.hh>
# include <mln/trace/all.hh>
namespace mln
{
......@@ -72,7 +71,7 @@ namespace mln
unsigned get_(trait::image::ext_domain::some, trait::image::category::morpher,
const I& ima)
{
return border::get( *ima.delegatee_() );
return border::get(*ima.delegatee_());
}
......
......@@ -62,7 +62,12 @@
**
*/
# include <queue>
# include <mln/core/concept/iterator.hh>
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/graph.hh>
# include <mln/util/vertex.hh>
namespace mln
{
......@@ -96,7 +101,7 @@ namespace mln
f.init(g);
mln_vertex_iter(util::graph) v(g);
mln_vertex_iter(G) v(g);
for_all(v)
if (f.to_be_treated(v.id()))
{
......@@ -105,7 +110,7 @@ namespace mln
f.update_treated(v.id());
while (!queue.empty())
{
util::vertex<util::graph> current_v = g.vertex(queue.front());
util::vertex<G> current_v = g.vertex(queue.front());
queue.pop();
for (unsigned nv = 0; nv < current_v.nmax_nbh_vertices(); ++nv)
if (f.to_be_queued(current_v.ith_nbh_vertex(nv)))
......
......@@ -63,8 +63,11 @@ namespace mln
template <typename T>
void
from_to(const float& from, Object<T>& to);
from_to(const T& from, T& to);
template <typename T>
void
from_to(const float& from, Object<T>& to);
template <typename T>
void
......@@ -87,6 +90,14 @@ namespace mln
mlc_abort(F)::check();
}
// T -> T
template <typename T>
inline
void
from_to(const T& from, T& to)
{
to = from;
}
// Image -> Site_Set.
template <typename I, typename S>
......
......@@ -37,6 +37,7 @@
# include <mln/core/routine/exact.hh>
# include <mln/metal/equal.hh>
# include <mln/trace/all.hh>
# include <mln/convert/from_to.hh>
# include <mln/convert/from_to.hxx>
......
......@@ -29,7 +29,8 @@
# define MLN_CORE_ALIAS_COMPLEX_GEOMETRY_HH
/// \file mln/core/alias/complex_geometry.hh
/// \brief Definition of mln::geom::complex_geometry aliases.
///
/// Definition of mln::geom::complex_geometry aliases.
# include <mln/geom/complex_geometry.hh>
# include <mln/core/alias/point3df.hh>
......
......@@ -35,13 +35,14 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/window.hh>
# include <mln/core/dpoint.hh>
# include <mln/core/site_set/p_array.hh>
namespace mln
{
// fwd decls
// forward declarations
template <typename D> class dpsites_fwd_piter;
template <typename D> class dpsites_bkd_piter;
......@@ -60,6 +61,9 @@ namespace mln
/// Site associated type.
typedef mln_psite(D) site;
/// Window associated type.
typedef window<dpsite> window;
/// Site_Iterator type to browse the psites of a generic
/// neighborhood w.r.t. the ordering of delta-psites.
///
......@@ -93,11 +97,15 @@ namespace mln
///
clock_neighb<D>& append(const D& dp);
/// \}
const std::vector<D>& vect() const
{
return vec_;
}
/// Return the dpsites of this neighborhood.
const std::vector<D>& vect() const;
/// Return the corresponding window.
/// FIXME: not in constant time!
mln::window<D> win() const;
private:
std::vector<D> vec_;
};
......@@ -119,7 +127,24 @@ namespace mln
return *this;
}
template <typename D>
inline
const std::vector<D>&
clock_neighb<D>::vect() const
{
return vec_;
}
template <typename D>
inline
window<D>
clock_neighb<D>::win() const
{
window<D> result;
for (unsigned i = 0; i < vec_.size(); ++i)
result.insert(vec_[i]);
return result;
}
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
......
......@@ -29,8 +29,10 @@
# define MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOOD_PITER_HH
/// \file mln/core/image/complex_neighborhood_piter.hh
/// \brief Definition of a site iterator on a complex neighborhood.
///
/// Definition of a site iterator on a complex neighborhood.
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/internal/site_relative_iterator_base.hh>
// FIXME: These might be factor-able, both between fwd/bkd and nbh/win.
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
//
// 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,11 +31,10 @@
# define MLN_CORE_IMAGE_HEXA_HH
/*! \file mln/core/image/hexa.hh
*
* \brief Definition of a morpher that makes hexagonal the mesh of an
* image.
*/
/// \file mln/core/image/hexa.hh
///
/// Definition of a morpher that makes hexagonal the mesh of an
/// image.
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/alias/point2d_h.hh>
......@@ -65,7 +65,7 @@ namespace mln
namespace trait
{
/// FIXME: use the right properties.
template <typename I>
struct image_< hexa<I> > : default_image_morpher< I, mln_value(I),
hexa<I> >
......@@ -77,14 +77,14 @@ namespace mln
typedef trait::image::category::domain_morpher category;
typedef mln_trait_image_pw_io(I) pw_io; // un-write when I const
typedef mln_trait_image_dimension(I) dimension;
typedef mln_trait_image_border(I) border; // have a border only if I does.
typedef mln_trait_image_io_from_(I) io; // un-write when I const
typedef mln_trait_image_data_from_(I) data;
// Extended domain
typedef mln_trait_image_ext_domain(I) ext_domain; // have a border only if I does.
typedef mln_trait_image_ext_value(I) ext_value;
typedef mln_trait_image_ext_io(I) ext_io; // un-write when I const
typedef trait::image::support::regular support;
// typedef mlc_if( I_data_are_linear_,
// trait::data::stored, // if linear then just stored
// I_data_ ) data; // otherwise like I
......@@ -157,7 +157,6 @@ namespace mln
/// Test if \p p belongs to the image domain.
bool has(const psite& p) const;
bool has(const psite& p) const;
/// Read-only access of pixel value at hexa point site \p p.
rvalue operator()(const point2d_h& p) const;
......@@ -267,14 +266,6 @@ namespace mln
}
template <typename I>
inline
bool
hexa<I>::has(const psite& p) const
{
return this->has(p);
}
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,10 +29,9 @@
#ifndef MLN_CORE_IMAGE_HEXA_PITER_HH
# define MLN_CORE_IMAGE_HEXA_PITER_HH
/*! \file mln/core/image/hexa_piter.hh
*
* \brief Definition of iterators on hexagonal points.
*/
/// \file mln/core/image/hexa_piter.hh
///
/// Definition of iterators on hexagonal points.
# include <mln/core/internal/piter_adaptor.hh>
......@@ -42,13 +42,13 @@
namespace mln
{
/*! \brief A generic forward iterator on points of subsets.
*
* Parameter \c S is a point set type; parameter F is a function
* from point to Boolean.
*
* \see mln::hexa
*/
/// A generic forward iterator on points of subsets.
///
/// Parameter \c S is a point set type; parameter F is a function
/// from point to Boolean.
///
/// \see mln::hexa
///
template <typename S>
class hexa_fwd_piter_
: public internal::piter_adaptor_< mln_fwd_piter(S),
......@@ -111,9 +111,9 @@ namespace mln
void
hexa_fwd_piter_<S>::start()
{
this->piter_.start();
p_[0] = this->piter_[0];
p_[1] = this->piter_[1];
this->pi_.start();
p_[0] = this->pi_[0];
p_[1] = this->pi_[1];
}
template <typename S>
......@@ -121,9 +121,9 @@ namespace mln
void
hexa_fwd_piter_<S>::next_()
{
this->piter_.next();
p_[0] = this->piter_[0] * 2;
p_[1] = this->piter_[1] * 2 + this->piter_[0] % 2;
this->pi_.next();
p_[0] = this->pi_[0] * 2;
p_[1] = this->pi_[1] * 2 + this->pi_[0] % 2;
}
template <typename S>
......
......@@ -30,7 +30,7 @@
# define MLN_CORE_IMAGE_IMAGE2D_HH
/// \file mln/core/image/image2d.hh
/// \brief Definition of the basic mln::image2d class.
/// Definition of the basic mln::image2d class.
///
/// \todo Re-activate include at EOF when make::image2d is up again.
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,11 +29,10 @@
#ifndef MLN_CORE_IMAGE_IMAGE2D_H_HH
# define MLN_CORE_IMAGE_IMAGE2D_H_HH
/*! \file mln/core/image/image2d_h.hh
*
* \brief Definition of an alias for a 2d image based on an hexagonal
* mesh.
*/
/// \file mln/core/image/image2d_h.hh
///
/// Definition of an alias for a 2d image based on an hexagonal
/// mesh.
# include <mln/core/image/image2d.hh>
# include <mln/core/image/hexa.hh>
......
......@@ -32,6 +32,8 @@
///
/// Optional implementation for neigbh_niter.
# include <mln/core/macros.hh>
# include <mln/core/internal/force_exact.hh>
namespace mln
{
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,15 +29,14 @@
#ifndef MLN_CORE_INTERNAL_PITER_ADAPTOR_HH
# define MLN_CORE_INTERNAL_PITER_ADAPTOR_HH
/*! \file mln/core/internal/piter_adaptor.hh
*
* \brief Definition of iterators on points of boxes.
*
* \todo Rename as site_iterator_adaptor_base.
*
* \todo Distinguish between adaptors of site_set_iterator,
* site_relative_iterator, etc. (?)
*/
/// \file mln/core/internal/piter_adaptor.hh
///
/// \brief Definition of iterators on points of boxes.
///
/// \todo Rename as site_iterator_adaptor_base.
///
/// \todo Distinguish between adaptors of site_set_iterator,
/// site_relative_iterator, etc. (?)
# include <mln/core/internal/site_iterator_base.hh>
......@@ -47,11 +47,11 @@ namespace mln
namespace internal
{
/*! A base class for point iterator adaptors.
*
* Parameter \c Pi is the type of the point iterator adaptee;
* parameter E is the exact type.
*/
/// A base class for point iterator adaptors.
///
/// Parameter \c Pi is the type of the point iterator adaptee;
/// parameter E is the exact type.
///
template <typename Pi, typename S, typename E>
class piter_adaptor_ : public internal::site_iterator_base< S, E >
{
......@@ -78,7 +78,7 @@ namespace mln
/// Hook to the current location.
const mln_psite(S)& p_hook_() const;
/// Change the site set targeted by this iterator.
/// Change the site set targeted by this iterator.
void change_target(const S& s);
/// Change the site set targeted by pi_. This default impl is a
......@@ -166,6 +166,7 @@ namespace mln
void
piter_adaptor_<Pi,S,E>::pi_change_target_(const S& s)
{
this->pi_.change_target(s);
}
# endif // ! MLN_INCLUDE_ONLY
......
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