Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Remove the final '_' in image_morpher.
* mln/core/internal/image_morpher.hh
(image_morpher_): Rename as...
(image_morpher): ...this.
* mln/trait/images.hh,
* mln/core/translate_image.hh,
* mln/core/internal/image_if_base.hh,
* mln/core/internal/image_identity.hh,
* mln/core/internal/image_domain_morpher.hh,
* mln/core/internal/image_value_morpher.hh,
* mln/core/cast_image.hh,
* mln/core/sub_image.hh,
* mln/core/t_image.hh,
* mln/core/image_if.hh,
* mln/core/hexa.hh,
* mln/neighb/image.hh,
* mln/value/stack.hh,
* mln/border/find.hh,
* sandbox/duhamel/translate_image.hh,
* sandbox/jardonnet/subsampling/sub_sampled_image.hh,
* sandbox/garrigues/image_identity/image_domain_morpher.hh,
* sandbox/garrigues/image_identity/image_value_morpher.hh:
Propagate renaming.
* mln/core/internal/image_base.hh (data): Move into...
* mln/core/internal/data.hh: ...this new file.
mln/border/find.hh | 2
mln/core/cast_image.hh | 2
mln/core/hexa.hh | 2
mln/core/image_if.hh | 2
mln/core/internal/data.hh | 54 +++++++++++++++
mln/core/internal/image_base.hh | 17 ----
mln/core/internal/image_domain_morpher.hh | 2
mln/core/internal/image_identity.hh | 2
mln/core/internal/image_if_base.hh | 2
mln/core/internal/image_morpher.hh | 20 ++---
mln/core/internal/image_value_morpher.hh | 2
mln/core/sub_image.hh | 2
mln/core/t_image.hh | 4 -
mln/core/translate_image.hh | 4 -
mln/neighb/image.hh | 2
mln/trait/images.hh | 2
mln/value/stack.hh | 2
sandbox/duhamel/translate_image.hh | 4 -
sandbox/garrigues/image_identity/image_domain_morpher.hh | 2
sandbox/garrigues/image_identity/image_value_morpher.hh | 2
sandbox/jardonnet/subsampling/sub_sampled_image.hh | 4 -
21 files changed, 88 insertions(+), 47 deletions(-)
Index: mln/trait/images.hh
--- mln/trait/images.hh (revision 2060)
+++ mln/trait/images.hh (working copy)
@@ -175,7 +175,7 @@
template <typename D, typename T, typename I>
- struct default_image_morpher_ : default_image_<T, I>
+ struct default_image_morpher : default_image_<T, I>
{
// misc => delegation except for 'category'
typedef typename image_<D>::size size;
Index: mln/core/translate_image.hh
--- mln/core/translate_image.hh (revision 2060)
+++ mln/core/translate_image.hh (working copy)
@@ -72,7 +72,7 @@
{
template <typename I>
- struct image_< translate_image<I> > : default_image_morpher_< I, mln_value(I),
+ struct image_< translate_image<I> > : default_image_morpher< I, mln_value(I),
translate_image<I> >
{
typedef trait::image::category::domain_morpher category;
@@ -101,7 +101,7 @@
struct translate_image : public mln::internal::image_identity< I, mln_pset(I), translate_image<I> >
{
- typedef mln::internal::image_morpher_< I, mln_pset(I), translate_image<I> > super_;
+ typedef mln::internal::image_morpher< I, mln_pset(I), translate_image<I> > super_;
typedef line_piter_<mln_psite(I)> line_piter;
/// Return type of read-write access.
Index: mln/core/internal/image_if_base.hh
--- mln/core/internal/image_if_base.hh (revision 2060)
+++ mln/core/internal/image_if_base.hh (working copy)
@@ -68,7 +68,7 @@
{
template <typename I, typename F, typename E>
- struct image_< mln::internal::image_if_base_<I,F,E> > : default_image_morpher_< I, mln_value(I), E >
+ struct image_< mln::internal::image_if_base_<I,F,E> > : default_image_morpher< I, mln_value(I), E >
{
private:
typedef mln_trait_image_data(I) I_data_;
Index: mln/core/internal/data.hh
--- mln/core/internal/data.hh (revision 0)
+++ mln/core/internal/data.hh (revision 0)
@@ -0,0 +1,54 @@
+// Copyright (C) 2007, 2008 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 MLN_CORE_INTERNAL_DATA_HH
+# define MLN_CORE_INTERNAL_DATA_HH
+
+/*! \file mln/core/internal/data.hh
+ *
+ * \brief Declaration of the type of image data.
+ */
+
+
+namespace mln
+{
+
+ namespace internal
+ {
+
+ /// \internal Class of image internal data.
+ /// It has to be specialized for every image type.
+
+ template <typename I>
+ struct data;
+
+ } // end of namespace mln::internal
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_INTERNAL_DATA_HH
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2060)
+++ mln/core/internal/image_base.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 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
@@ -37,6 +37,7 @@
# include <mln/core/grids.hh>
# include <mln/core/trait/qlf_value.hh>
# include <mln/core/internal/check/image_all.hh>
+# include <mln/core/internal/data.hh>
# include <mln/util/tracked_ptr.hh>
@@ -56,20 +57,6 @@
namespace mln
{
-
- namespace internal
- {
-
- /// \internal Class of image internal data.
- /// FIXME: Say more about it!
-
- template <typename I>
- struct data;
-
- } // end of namespace mln::internal
-
-
-
namespace internal
{
Index: mln/core/internal/image_morpher.hh
--- mln/core/internal/image_morpher.hh (revision 2060)
+++ mln/core/internal/image_morpher.hh (working copy)
@@ -49,7 +49,7 @@
*
*/
template <typename I, typename S, typename E>
- class image_morpher_ : public image_base<S, E>
+ class image_morpher : public image_base<S, E>
{
public:
@@ -72,7 +72,7 @@
operator I() const; // FIXME: Very dangerous? Remove?
protected:
- image_morpher_();
+ image_morpher();
};
} // end of namespace mln::internal
@@ -87,7 +87,7 @@
// template <typename Subject, typename T,
// typename I, typename S, typename E>
// void init_(Subject s, T& target,
-// const internal::image_morpher_<I,S,E>& model);
+// const internal::image_morpher<I,S,E>& model);
// FIXME: Lines above have been inactivated because they are either
// prioritary or ambiguous.
@@ -108,14 +108,14 @@
template <typename I, typename S, typename E>
inline
- image_morpher_<I,S,E>::image_morpher_()
+ image_morpher<I,S,E>::image_morpher()
{
}
template <typename I, typename S, typename E>
inline
mlc_const(I)*
- image_morpher_<I,S,E>::delegatee_() const
+ image_morpher<I,S,E>::delegatee_() const
{
return this->data_ == 0 ? 0 : & this->data_->ima_;
}
@@ -123,14 +123,14 @@
template <typename I, typename S, typename E>
inline
I*
- image_morpher_<I,S,E>::delegatee_()
+ image_morpher<I,S,E>::delegatee_()
{
return this->data_ == 0 ? 0 : & this->data_->ima_;
}
template <typename I, typename S, typename E>
inline
- image_morpher_<I,S,E>::operator I() const
+ image_morpher<I,S,E>::operator I() const
{
mln_precondition(exact(this)->has_data());
return * this->delegatee_();
@@ -139,7 +139,7 @@
template <typename I, typename S, typename E>
inline
bool
- image_morpher_<I,S,E>::has_data() const
+ image_morpher<I,S,E>::has_data() const
{
return
this->data_ != 0 &&
@@ -154,7 +154,7 @@
// template <typename Subject, typename T,
// typename I, typename S, typename E>
// void init_(Subject s, T& target,
-// const internal::image_morpher_<I,S,E>& model)
+// const internal::image_morpher<I,S,E>& model)
// {
// std::cout << "deleg... ";
// // FIXME: Precondition.
@@ -167,7 +167,7 @@
void init_(Subject s, T& target, const Image<J>& model_)
{
// FIXME: Precondition.
- // FIXME: Properly check that J is an internal::image_morpher_.
+ // FIXME: Properly check that J is an internal::image_morpher.
const J& model = exact(model_);
init_(s, target, * model.delegatee_());
}
Index: mln/core/internal/image_identity.hh
--- mln/core/internal/image_identity.hh (revision 2060)
+++ mln/core/internal/image_identity.hh (working copy)
@@ -48,7 +48,7 @@
*
*/
template <typename I, typename S, typename E>
- class image_identity : public image_morpher_<I, S, E>
+ class image_identity : public image_morpher<I, S, E>
{
public:
Index: mln/core/internal/image_domain_morpher.hh
--- mln/core/internal/image_domain_morpher.hh (revision 2060)
+++ mln/core/internal/image_domain_morpher.hh (working copy)
@@ -48,7 +48,7 @@
*
*/
template <typename I, typename S, typename E>
- class image_domain_morpher : public image_morpher_<I, S, E>
+ class image_domain_morpher : public image_morpher<I, S, E>
{
public:
Index: mln/core/internal/image_value_morpher.hh
--- mln/core/internal/image_value_morpher.hh (revision 2060)
+++ mln/core/internal/image_value_morpher.hh (working copy)
@@ -51,7 +51,7 @@
*
*/
template <typename I, typename E>
- class image_value_morpher : public image_morpher_<I, mln_pset(I), E>
+ class image_value_morpher : public image_morpher<I, mln_pset(I), E>
{
public:
Index: mln/core/cast_image.hh
--- mln/core/cast_image.hh (revision 2060)
+++ mln/core/cast_image.hh (working copy)
@@ -66,7 +66,7 @@
{
template <typename T, typename I>
- struct image_< cast_image_<T,I> > : default_image_morpher_< I, T, cast_image_<T,I> >
+ struct image_< cast_image_<T,I> > : default_image_morpher< I, T, cast_image_<T,I> >
{
typedef trait::image::io::read_only io;
};
Index: mln/core/sub_image.hh
--- mln/core/sub_image.hh (revision 2060)
+++ mln/core/sub_image.hh (working copy)
@@ -67,7 +67,7 @@
{
template <typename I, typename S>
- struct image_< sub_image<I,S> > : default_image_morpher_< I,
+ struct image_< sub_image<I,S> > : default_image_morpher< I,
mln_value(I),
sub_image<I,S> >
{
Index: mln/core/t_image.hh
--- mln/core/t_image.hh (revision 2060)
+++ mln/core/t_image.hh (working copy)
@@ -81,12 +81,12 @@
*/
template <typename I>
class t_image
- : public internal::image_morpher_< I, mln_pset(I), t_image<I> >
+ : public internal::image_morpher< I, mln_pset(I), t_image<I> >
{
public:
/// Super type.
typedef
- internal::image_morpher_< I, mln_pset(I), t_image<I> > super_;
+ internal::image_morpher< I, mln_pset(I), t_image<I> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: mln/core/image_if.hh
--- mln/core/image_if.hh (revision 2060)
+++ mln/core/image_if.hh (working copy)
@@ -68,7 +68,7 @@
{
template <typename I, typename F>
- struct image_< image_if<I,F> > : default_image_morpher_< I,
+ struct image_< image_if<I,F> > : default_image_morpher< I,
mln_value(I),
image_if<I,F> >
{
Index: mln/core/hexa.hh
--- mln/core/hexa.hh (revision 2060)
+++ mln/core/hexa.hh (working copy)
@@ -67,7 +67,7 @@
{
template <typename I>
- struct image_< hexa<I> > : default_image_morpher_< I, mln_value(I),
+ struct image_< hexa<I> > : default_image_morpher< I, mln_value(I),
hexa<I> >
{
// private:
Index: mln/neighb/image.hh
--- mln/neighb/image.hh (revision 2060)
+++ mln/neighb/image.hh (working copy)
@@ -71,7 +71,7 @@
template <typename I, typename N>
struct image_< neighb::image<I, N> >
- : public default_image_morpher_< I, mln_value(I), neighb::image<I, N> >
+ : public default_image_morpher< I, mln_value(I), neighb::image<I, N> >
{
typedef trait::image::category::morpher category;
Index: mln/value/stack.hh
--- mln/value/stack.hh (revision 2060)
+++ mln/value/stack.hh (working copy)
@@ -101,7 +101,7 @@
template <unsigned n, typename I>
struct image_< mln::value::stack_image<n, I> >
- : default_image_morpher_< I,
+ : default_image_morpher< I,
algebra::vec<n, mln_value(I)>,
mln::value::stack_image<n, I> >
{
Index: mln/border/find.hh
--- mln/border/find.hh (revision 2060)
+++ mln/border/find.hh (working copy)
@@ -61,7 +61,7 @@
template <typename I, typename S, typename E>
inline
- unsigned find__(const mln::internal::image_morpher_<I,S,E>& ima)
+ unsigned find__(const mln::internal::image_morpher<I,S,E>& ima)
{
return border::find(*ima.delegatee_());
}
Index: sandbox/duhamel/translate_image.hh
--- sandbox/duhamel/translate_image.hh (revision 2060)
+++ sandbox/duhamel/translate_image.hh (working copy)
@@ -66,7 +66,7 @@
{
template <typename I>
- struct image_< translate_image<I> > : default_image_morpher_< I, mln_value(I),
+ struct image_< translate_image<I> > : default_image_morpher< I, mln_value(I),
translate_image<I> >
{
@@ -89,7 +89,7 @@
struct translate_image : public mln::internal::image_identity< I, mln_pset(I), translate_image<I> >
{
- typedef mln::internal::image_morpher_< I, mln_pset(I), translate_image<I> > super_;
+ typedef mln::internal::image_morpher< I, mln_pset(I), translate_image<I> > super_;
/// Return type of read-write access.
typedef typename internal::morpher_lvalue_<I>::ret lvalue;
Index: sandbox/jardonnet/subsampling/sub_sampled_image.hh
--- sandbox/jardonnet/subsampling/sub_sampled_image.hh (revision 2060)
+++ sandbox/jardonnet/subsampling/sub_sampled_image.hh (working copy)
@@ -68,12 +68,12 @@
template <typename I>
class sub_sampled_image
- : public internal::image_morpher_< I, mln_pset(I), sub_sampled_image<I> >
+ : public internal::image_morpher< I, mln_pset(I), sub_sampled_image<I> >
{
public:
/// Super type.
typedef
- internal::image_morpher_< I, mln_pset(I), sub_sampled_image<I> > super_;
+ internal::image_morpher< I, mln_pset(I), sub_sampled_image<I> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: sandbox/garrigues/image_identity/image_domain_morpher.hh
--- sandbox/garrigues/image_identity/image_domain_morpher.hh (revision 2060)
+++ sandbox/garrigues/image_identity/image_domain_morpher.hh (working copy)
@@ -50,7 +50,7 @@
* \internal
*/
template <typename I, typename S, typename E>
- class image_domain_morpher : public virtual image_morpher_<I, S, E>
+ class image_domain_morpher : public virtual image_morpher<I, S, E>
{
public:
Index: sandbox/garrigues/image_identity/image_value_morpher.hh
--- sandbox/garrigues/image_identity/image_value_morpher.hh (revision 2060)
+++ sandbox/garrigues/image_identity/image_value_morpher.hh (working copy)
@@ -50,7 +50,7 @@
* \internal
*/
template <typename I, typename E>
- class image_value_morpher : public virtual image_morpher_<I, mln_pset(I), E>
+ class image_value_morpher : public virtual image_morpher<I, mln_pset(I), E>
{
public:
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Now you can compile tests (without running them) by using `make tests' in
any subdirectory of milena/tests/:
make -C _build/milena/tests tests
It can be convenient for tests that take a long time to execute (for
instance, the ones from milena/tests/core/ and milena/tests/morpho/).
However, you are still encouraged to often run the test suite before
sending your patches! :)
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add a tests target to Makefiles of tests/.
* tests/tests-recursive.mk: New file.
Include it...
* tests/tests.mk: ...here.
tests-recursive.mk | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tests.mk | 5 ++++-
2 files changed, 56 insertions(+), 1 deletion(-)
Index: tests/tests.mk
--- tests/tests.mk (revision 2059)
+++ tests/tests.mk (working copy)
@@ -1,4 +1,4 @@
-## FIXME: Revamp (see Olena 0.11's test suite).
+## FIXME: Revamp (see Olena 0.11's test suite). -*- Automake -*-
# Look for Milena header in srcdir and for (generated) test headers
# (like data.hh) in builddir.
@@ -15,3 +15,6 @@
TESTS_CXXFLAGS_SPEED = @TESTS_CXXFLAGS_SPEED@
TESTS_CXXFLAGS_DEBUG = @TESTS_CXXFLAGS_DEBUG@
+
+# Inject rules to compile tests (recursively), without running them.
+include $(top_srcdir)/milena/tests/tests-recursive.mk
Index: tests/tests-recursive.mk
--- tests/tests-recursive.mk (revision 0)
+++ tests/tests-recursive.mk (revision 0)
@@ -0,0 +1,52 @@
+# tests-recursive.mk -*- Automake -*-
+# Compile tests recursively, but don't them.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+# Sometimes, we just want to check whether tests compile, without
+# actually running them. Hence this `tests' target, which does half
+# the job of the `check' target.
+
+.PHONY: tests-am tests-recursive tests
+# ``Halved'' version of check-am.
+tests-am: $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+# FIXME: Copied from a generated Makefile.in (rule `$(RECURSIVE_TARGETS)').
+# (Automake does not allow us to interact with the code it generates in
+# Makefile.in.) We might want to propose this as a patch to the Automake
+# project.
+tests-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+tests: tests-recursive
1
0
2059: Fix a precondition in the construction of mln::line_graph_image.
by Roland Levillain 23 Jun '08
by Roland Levillain 23 Jun '08
23 Jun '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Hum, patching without testing is bad! Shame on me!
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix a precondition in the construction of mln::line_graph_image.
* mln/core/line_graph_image.hh
(mln::internal::data_< line_graph_image<P, V> >::data_):
Fix the second precondition.
line_graph_image.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: mln/core/line_graph_image.hh
--- mln/core/line_graph_image.hh (revision 2058)
+++ mln/core/line_graph_image.hh (working copy)
@@ -218,7 +218,7 @@
plg_(g)
{
mln_precondition(g.nvertices() == vertex_val.size());
- mln_precondition(g.edges() == edge_val.size());
+ mln_precondition(g.nedges() == edge_val.size());
}
} // end of namespace mln::internal
1
0
23 Jun '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Remove the '_' postfix in some core internals.
* mln/core/internal/image_base.hh (image_base_): Rename as...
(image_base_): ...this.
(internal::data_): Rename as...
(internal::data): ...this.
* mln/core/internal/image_morpher.hh
(image_morpher_): Rename as...
(image_morpher): ...this.
* mln/core/internal/image_primary.hh
(image_primary_): Rename as...
(image_primary): ...this.
* mln/core/internal/image_identity.hh: .
(image_identity_): Rename as...
(image_identity): ...this.
* mln/core/internal/image_domain_morpher.hh: .
(image_domain_morpher_): Rename as...
(image_domain_morpher): ...this.
* mln/core/internal/image_value_morpher.hh
(image_value_morpher_): Rename as...
(image_value_morpher): ...this.
Propagate renaming.
* mln/core/translate_image.hh,
* mln/core/line_graph_image.hh,
* mln/core/internal/image_if_base.hh,
* mln/core/internal/run_image.hh,
* mln/core/interpolated.hh,
* mln/core/bgraph_image.hh,
* mln/core/cast_image.hh,
* mln/core/graph_image.hh,
* mln/core/sub_image.hh,
* mln/core/image1d.hh,
* mln/core/fi_adaptor.hh,
* mln/core/image3d.hh,
* mln/core/decorated_image.hh,
* mln/core/image_if.hh,
* mln/core/value_enc_image.hh,
* mln/core/hexa.hh,
* mln/core/tr_image.hh,
* mln/core/safe.hh,
* mln/core/concept/image.hh,
* mln/core/plain.hh,
* mln/core/image2d.hh,
* mln/neighb/image.hh,
* mln/value/stack.hh,
* mln/border/find.hh,
* mln/pw/image.hh,
* sandbox/duhamel/translate_image.hh,
* sandbox/duhamel/mesh_image.hh,
* sandbox/nivault/plugin-gimp/src/gimp-image.hh,
* sandbox/garrigues/tiled_image2d/tiled_image2d.hh,
* sandbox/garrigues/image_identity/image_domain_morpher.hh,
* sandbox/garrigues/image_identity/image_value_morpher.hh,
* sandbox/garrigues/image_identity/interpolated.hh,
* sandbox/garrigues/image_identity/image_identity.hh,
* sandbox/ballas/refactorization/rle_image.hh,
* sandbox/ballas/refactorization/image2d.hh,
* sandbox/ballas/refactorization/internal/image_base.hh: Update.
mln/border/find.hh | 2
mln/core/bgraph_image.hh | 4 -
mln/core/cast_image.hh | 2
mln/core/concept/image.hh | 4 -
mln/core/decorated_image.hh | 2
mln/core/fi_adaptor.hh | 2
mln/core/graph_image.hh | 4 -
mln/core/hexa.hh | 2
mln/core/image1d.hh | 2
mln/core/image2d.hh | 32 +++++------
mln/core/image3d.hh | 4 -
mln/core/image_if.hh | 12 ++--
mln/core/internal/image_base.hh | 42 +++++++++------
mln/core/internal/image_domain_morpher.hh | 14 ++---
mln/core/internal/image_identity.hh | 19 +++---
mln/core/internal/image_if_base.hh | 2
mln/core/internal/image_morpher.hh | 4 -
mln/core/internal/image_primary.hh | 6 +-
mln/core/internal/image_value_morpher.hh | 10 +--
mln/core/internal/run_image.hh | 2
mln/core/interpolated.hh | 4 -
mln/core/line_graph_image.hh | 4 -
mln/core/plain.hh | 4 -
mln/core/safe.hh | 4 -
mln/core/sub_image.hh | 12 ++--
mln/core/tr_image.hh | 4 -
mln/core/translate_image.hh | 2
mln/core/value_enc_image.hh | 2
mln/neighb/image.hh | 2
mln/pw/image.hh | 12 ++--
mln/value/stack.hh | 2
sandbox/ballas/refactorization/image2d.hh | 2
sandbox/ballas/refactorization/internal/image_base.hh | 8 +-
sandbox/ballas/refactorization/rle_image.hh | 2
sandbox/duhamel/mesh_image.hh | 4 -
sandbox/duhamel/translate_image.hh | 2
sandbox/garrigues/image_identity/image_domain_morpher.hh | 14 ++---
sandbox/garrigues/image_identity/image_identity.hh | 8 +-
sandbox/garrigues/image_identity/image_value_morpher.hh | 10 +--
sandbox/garrigues/image_identity/interpolated.hh | 4 -
sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 2
sandbox/nivault/plugin-gimp/src/gimp-image.hh | 2
42 files changed, 147 insertions(+), 134 deletions(-)
Index: mln/core/translate_image.hh
--- mln/core/translate_image.hh (revision 2057)
+++ mln/core/translate_image.hh (working copy)
@@ -98,7 +98,7 @@
*
*/
template <typename I>
- struct translate_image : public mln::internal::image_identity_< I, mln_pset(I), translate_image<I> >
+ struct translate_image : public mln::internal::image_identity< I, mln_pset(I), translate_image<I> >
{
typedef mln::internal::image_morpher_< I, mln_pset(I), translate_image<I> > super_;
Index: mln/core/line_graph_image.hh
--- mln/core/line_graph_image.hh (revision 2057)
+++ mln/core/line_graph_image.hh (working copy)
@@ -108,10 +108,10 @@
/// Values are stored on the vertices of the graph.
template <typename P, typename V>
struct line_graph_image :
- public internal::image_primary_< p_line_graph<P>, line_graph_image<P, V> >
+ public internal::image_primary< p_line_graph<P>, line_graph_image<P, V> >
{
/// Super type.
- typedef mln::internal::image_base_< p_line_graph<P>,
+ typedef mln::internal::image_base< p_line_graph<P>,
line_graph_image<P, V> > super_;
/// Value associated type.
Index: mln/core/internal/image_if_base.hh
--- mln/core/internal/image_if_base.hh (revision 2057)
+++ mln/core/internal/image_if_base.hh (working copy)
@@ -99,7 +99,7 @@
*
*/
template <typename I, typename F, typename E>
- struct image_if_base_ : public internal::image_domain_morpher_< I, pset_if<mln_pset(I),F>, E >
+ struct image_if_base_ : public internal::image_domain_morpher< I, pset_if<mln_pset(I),F>, E >
{
/// Give the definition domain.
Index: mln/core/internal/run_image.hh
--- mln/core/internal/run_image.hh (revision 2057)
+++ mln/core/internal/run_image.hh (working copy)
@@ -49,7 +49,7 @@
* Parameter \c E is the Exact type of the image.
*/
template <typename T, typename P, typename E>
- class run_image_ : public internal::image_primary_< p_runs_<P>, E >
+ class run_image_ : public internal::image_primary< p_runs_<P>, E >
{
protected:
run_image_();
Index: mln/core/internal/image_base.hh
--- mln/core/internal/image_base.hh (revision 2057)
+++ mln/core/internal/image_base.hh (working copy)
@@ -40,6 +40,18 @@
# include <mln/util/tracked_ptr.hh>
+// image_base
+// ^
+// |
+// ---------------------------
+// | |
+// image_primary image_morpher
+// ^
+// |
+// -----------------------------------------
+// | | |
+// image_domain_morpher image_value_morpher image_identity
+
namespace mln
{
@@ -52,7 +64,7 @@
/// FIXME: Say more about it!
template <typename I>
- struct data_;
+ struct data;
} // end of namespace mln::internal
@@ -94,7 +106,7 @@
*
*/
template <typename S, typename E>
- struct image_base_
+ struct image_base
:
public image_checked_<E>
@@ -134,23 +146,23 @@
/// Assignment operator.
- image_base_& operator=(const image_base_& rhs);
+ image_base& operator=(const image_base& rhs);
/// Copy constructor.
- image_base_(const image_base_& rhs);
+ image_base(const image_base& rhs);
/// Detach data from an image (free it if nobody else hold it).
void destroy();
- const util::tracked_ptr< internal::data_<E> >& hook_data_() const { return data_; }
+ const util::tracked_ptr< internal::data<E> >& hook_data_() const { return data_; }
const void* id_() const { return data_.ptr_; }
protected:
- image_base_();
+ image_base();
// Internal data, sharable by several images.
- util::tracked_ptr< internal::data_<E> > data_;
+ util::tracked_ptr< internal::data<E> > data_;
};
@@ -159,13 +171,13 @@
template <typename S, typename E>
inline
- image_base_<S,E>::image_base_()
+ image_base<S,E>::image_base()
{
}
template <typename S, typename E>
inline
- image_base_<S,E>::image_base_(const image_base_& rhs)
+ image_base<S,E>::image_base(const image_base& rhs)
: image_checked_<E>()
{
mln_precondition(exact(rhs).has_data()); // FIXME: Is-it too restrictive?
@@ -174,8 +186,8 @@
template <typename S, typename E>
inline
- image_base_<S,E>&
- image_base_<S,E>::operator=(const image_base_<S,E>& rhs)
+ image_base<S,E>&
+ image_base<S,E>::operator=(const image_base<S,E>& rhs)
{
mln_precondition(exact(rhs).has_data()); // FIXME: Is-it too restrictive?
if (& rhs == this) // || ! exact(rhs).has_data())
@@ -187,7 +199,7 @@
template <typename S, typename E>
inline
bool
- image_base_<S,E>::has_data() const
+ image_base<S,E>::has_data() const
{
return data_ != 0;
}
@@ -195,7 +207,7 @@
template <typename S, typename E>
inline
bool
- image_base_<S,E>::has(const psite& p) const
+ image_base<S,E>::has(const psite& p) const
{
mln_precondition(exact(this)->has_data());
return exact(this)->domain().has(p);
@@ -204,7 +216,7 @@
template <typename S, typename E>
inline
std::size_t
- image_base_<S,E>::nsites() const
+ image_base<S,E>::nsites() const
{
mlc_equal(mln_trait_site_set_nsites(S),
mln::trait::site_set::nsites::known)::check();
@@ -215,7 +227,7 @@
template <typename S, typename E>
inline
void
- image_base_<S,E>::destroy()
+ image_base<S,E>::destroy()
{
data_.clean_();
}
Index: mln/core/internal/image_morpher.hh
--- mln/core/internal/image_morpher.hh (revision 2057)
+++ mln/core/internal/image_morpher.hh (working copy)
@@ -49,7 +49,7 @@
*
*/
template <typename I, typename S, typename E>
- class image_morpher_ : public image_base_<S, E>
+ class image_morpher_ : public image_base<S, E>
{
public:
@@ -64,7 +64,7 @@
/* \brief Test if this image has been initialized; default impl.
*
* This default impl is stronger than the one inherited from
- * image_base_.
+ * image_base.
*/
bool has_data() const;
Index: mln/core/internal/image_primary.hh
--- mln/core/internal/image_primary.hh (revision 2057)
+++ mln/core/internal/image_primary.hh (working copy)
@@ -47,10 +47,10 @@
*
*/
template <typename S, typename E>
- struct image_primary_ : public image_base_<S, E>
+ struct image_primary : public image_base<S, E>
{
protected:
- image_primary_();
+ image_primary();
};
@@ -58,7 +58,7 @@
template <typename S, typename E>
inline
- image_primary_<S,E>::image_primary_()
+ image_primary<S,E>::image_primary()
{
}
Index: mln/core/internal/image_identity.hh
--- mln/core/internal/image_identity.hh (revision 2057)
+++ mln/core/internal/image_identity.hh (working copy)
@@ -48,7 +48,7 @@
*
*/
template <typename I, typename S, typename E>
- class image_identity_ : public image_morpher_<I, S, E>
+ class image_identity : public image_morpher_<I, S, E>
{
public:
@@ -81,7 +81,7 @@
protected:
/// Constructor.
- image_identity_();
+ image_identity();
};
@@ -89,14 +89,14 @@
template <typename I, typename S, typename E>
inline
- image_identity_<I,S,E>::image_identity_()
+ image_identity<I,S,E>::image_identity()
{
}
template <typename I, typename S, typename E>
inline
const mln_vset(I)&
- image_identity_<I,S,E>::values() const
+ image_identity<I,S,E>::values() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->values();
@@ -105,7 +105,7 @@
template <typename I, typename S, typename E>
inline
mln_rvalue(I)
- image_identity_<I,S,E>::operator()(const mln_psite(S)& p) const
+ image_identity<I,S,E>::operator()(const mln_psite(S)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->operator()(p);
@@ -113,8 +113,8 @@
template <typename I, typename S, typename E>
inline
- typename image_identity_<I,S,E>::lvalue
- image_identity_<I,S,E>::operator()(const mln_psite(S)& p)
+ typename image_identity<I,S,E>::lvalue
+ image_identity<I,S,E>::operator()(const mln_psite(S)& p)
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->operator()(p);
@@ -123,7 +123,7 @@
template <typename I, typename S, typename E>
inline
const mln_pset(I)&
- image_identity_<I,S,E>::domain() const
+ image_identity<I,S,E>::domain() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->domain();
@@ -132,11 +132,12 @@
template <typename I, typename S, typename E>
inline
bool
- image_identity_<I,S,E>::has(const mln_psite(I)& p) const
+ image_identity<I,S,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->has(p);
}
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::internal
Index: mln/core/internal/image_domain_morpher.hh
--- mln/core/internal/image_domain_morpher.hh (revision 2057)
+++ mln/core/internal/image_domain_morpher.hh (working copy)
@@ -48,7 +48,7 @@
*
*/
template <typename I, typename S, typename E>
- class image_domain_morpher_ : public image_morpher_<I, S, E>
+ class image_domain_morpher : public image_morpher_<I, S, E>
{
public:
@@ -75,7 +75,7 @@
lvalue operator()(const mln_psite(S)& p);
protected:
- image_domain_morpher_();
+ image_domain_morpher();
};
@@ -83,14 +83,14 @@
template <typename I, typename S, typename E>
inline
- image_domain_morpher_<I,S,E>::image_domain_morpher_()
+ image_domain_morpher<I,S,E>::image_domain_morpher()
{
}
template <typename I, typename S, typename E>
inline
const mln_vset(I)&
- image_domain_morpher_<I,S,E>::values() const
+ image_domain_morpher<I,S,E>::values() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->values();
@@ -99,7 +99,7 @@
template <typename I, typename S, typename E>
inline
mln_rvalue(I)
- image_domain_morpher_<I,S,E>::operator()(const mln_psite(S)& p) const
+ image_domain_morpher<I,S,E>::operator()(const mln_psite(S)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->operator()(p);
@@ -107,8 +107,8 @@
template <typename I, typename S, typename E>
inline
- typename image_domain_morpher_<I,S,E>::lvalue
- image_domain_morpher_<I,S,E>::operator()(const mln_psite(S)& p)
+ typename image_domain_morpher<I,S,E>::lvalue
+ image_domain_morpher<I,S,E>::operator()(const mln_psite(S)& p)
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->operator()(p);
Index: mln/core/internal/image_value_morpher.hh
--- mln/core/internal/image_value_morpher.hh (revision 2057)
+++ mln/core/internal/image_value_morpher.hh (working copy)
@@ -51,7 +51,7 @@
*
*/
template <typename I, typename E>
- class image_value_morpher_ : public image_morpher_<I, mln_pset(I), E>
+ class image_value_morpher : public image_morpher_<I, mln_pset(I), E>
{
public:
@@ -59,7 +59,7 @@
bool has(const mln_psite(I)& p) const;
protected:
- image_value_morpher_();
+ image_value_morpher();
};
@@ -67,14 +67,14 @@
template <typename I, typename E>
inline
- image_value_morpher_<I,E>::image_value_morpher_()
+ image_value_morpher<I,E>::image_value_morpher()
{
}
template <typename I, typename E>
inline
const mln_pset(I)&
- image_value_morpher_<I,E>::domain() const
+ image_value_morpher<I,E>::domain() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->domain();
@@ -83,7 +83,7 @@
template <typename I, typename E>
inline
bool
- image_value_morpher_<I,E>::has(const mln_psite(I)& p) const
+ image_value_morpher<I,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->has(p);
Index: mln/core/interpolated.hh
--- mln/core/interpolated.hh (revision 2057)
+++ mln/core/interpolated.hh (working copy)
@@ -64,10 +64,10 @@
*
*/
template <typename I>
- struct interpolated : public mln::internal::image_identity_< I, mln_pset(I), interpolated<I> >
+ struct interpolated : public mln::internal::image_identity< I, mln_pset(I), interpolated<I> >
{
- typedef mln::internal::image_identity_< I, mln_pset(I), interpolated<I> > super_;
+ typedef mln::internal::image_identity< I, mln_pset(I), interpolated<I> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: mln/core/bgraph_image.hh
--- mln/core/bgraph_image.hh (revision 2057)
+++ mln/core/bgraph_image.hh (working copy)
@@ -94,10 +94,10 @@
*/
template <typename P, typename V>
struct bgraph_image :
- public internal::image_primary_< p_bgraph<P>, bgraph_image<P, V> >
+ public internal::image_primary< p_bgraph<P>, bgraph_image<P, V> >
{
- typedef mln::internal::image_base_< p_bgraph<P>, bgraph_image<P, V> >
+ typedef mln::internal::image_base< p_bgraph<P>, bgraph_image<P, V> >
super_;
/// Value associated type.
Index: mln/core/cast_image.hh
--- mln/core/cast_image.hh (revision 2057)
+++ mln/core/cast_image.hh (working copy)
@@ -80,7 +80,7 @@
*
*/
template <typename T, typename I>
- struct cast_image_ : public internal::image_value_morpher_< I, cast_image_<T,I> >
+ struct cast_image_ : public internal::image_value_morpher< I, cast_image_<T,I> >
{
/// Value associated type.
typedef T value;
Index: mln/core/graph_image.hh
--- mln/core/graph_image.hh (revision 2057)
+++ mln/core/graph_image.hh (working copy)
@@ -91,10 +91,10 @@
/// Values are stored on the edges of the graph, not on its vertices.
template <typename P, typename V>
struct graph_image :
- public internal::image_primary_< p_graph<P>, graph_image<P, V> >
+ public internal::image_primary< p_graph<P>, graph_image<P, V> >
{
/// Super type.
- typedef mln::internal::image_base_< p_graph<P>, graph_image<P, V> > super_;
+ typedef mln::internal::image_base< p_graph<P>, graph_image<P, V> > super_;
/// Value associated type.
typedef V value;
Index: mln/core/sub_image.hh
--- mln/core/sub_image.hh (revision 2057)
+++ mln/core/sub_image.hh (working copy)
@@ -51,9 +51,9 @@
/// \internal Data structure for \c mln::sub_image<I,S>.
template <typename I, typename S>
- struct data_< sub_image<I,S> >
+ struct data< sub_image<I,S> >
{
- data_(I& ima, const S& pset);
+ data(I& ima, const S& pset);
I ima_;
S pset_;
@@ -93,7 +93,7 @@
// FIXME: Doc!
template <typename I, typename S>
- struct sub_image : public internal::image_domain_morpher_< I,
+ struct sub_image : public internal::image_domain_morpher< I,
S,
sub_image<I,S> >
{
@@ -150,14 +150,14 @@
}
- // internal::data_< sub_image<I,S> >
+ // internal::data< sub_image<I,S> >
namespace internal
{
template <typename I, typename S>
inline
- data_< sub_image<I,S> >::data_(I& ima, const S& pset)
+ data< sub_image<I,S> >::data(I& ima, const S& pset)
: ima_(ima),
pset_(pset)
{
@@ -187,7 +187,7 @@
sub_image<I,S>::init_(I& ima, const S& pset)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< sub_image<I,S> >(ima, pset);
+ this->data_ = new internal::data< sub_image<I,S> >(ima, pset);
}
template <typename I, typename S>
Index: mln/core/image1d.hh
--- mln/core/image1d.hh (revision 2057)
+++ mln/core/image1d.hh (working copy)
@@ -112,7 +112,7 @@
* thickness before and after data.
*/
template <typename T>
- struct image1d : public internal::image_primary_< box1d, image1d<T> >
+ struct image1d : public internal::image_primary< box1d, image1d<T> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box1d pset;
Index: mln/core/fi_adaptor.hh
--- mln/core/fi_adaptor.hh (revision 2057)
+++ mln/core/fi_adaptor.hh (working copy)
@@ -127,7 +127,7 @@
*/
template <typename I>
- struct fi_adaptor : public internal::image_primary_< box2d, fi_adaptor<I> >
+ struct fi_adaptor : public internal::image_primary< box2d, fi_adaptor<I> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box2d pset;
Index: mln/core/image3d.hh
--- mln/core/image3d.hh (revision 2057)
+++ mln/core/image3d.hh (working copy)
@@ -113,7 +113,7 @@
* thickness around data.
*/
template <typename T>
- struct image3d : public internal::image_primary_< box3d, image3d<T> >
+ struct image3d : public internal::image_primary< box3d, image3d<T> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box3d pset;
@@ -127,7 +127,7 @@
/// Super type
- typedef internal::image_primary_< box3d, image3d<T> > super_;
+ typedef internal::image_primary< box3d, image3d<T> > super_;
/// Value associated type.
typedef T value;
Index: mln/core/decorated_image.hh
--- mln/core/decorated_image.hh (revision 2057)
+++ mln/core/decorated_image.hh (working copy)
@@ -83,7 +83,7 @@
template <typename I, typename D>
struct decorated_image :
public internal::decorated_image_impl_< I, decorated_image<I,D> >,
- public internal::image_identity_< I, mln_pset(I), decorated_image<I,D> >
+ public internal::image_identity< I, mln_pset(I), decorated_image<I,D> >
{
public:
typedef decorated_image<I, D> self_;
Index: mln/core/image_if.hh
--- mln/core/image_if.hh (revision 2057)
+++ mln/core/image_if.hh (working copy)
@@ -53,9 +53,9 @@
/// \internal Data structure for \c mln::image_if<I,F>.
template <typename I, typename F>
- struct data_< image_if<I,F> >
+ struct data< image_if<I,F> >
{
- data_(I& ima, const F& f);
+ data(I& ima, const F& f);
I ima_;
pset_if<mln_pset(I), F> pset_;
@@ -89,7 +89,7 @@
*
*/
template <typename I, typename F>
- struct image_if : public internal::image_domain_morpher_< I,
+ struct image_if : public internal::image_domain_morpher< I,
pset_if<mln_pset(I), F>,
image_if<I, F> >
{
@@ -151,14 +151,14 @@
# ifndef MLN_INCLUDE_ONLY
- // internal::data_< image_if<I,F> >
+ // internal::data< image_if<I,F> >
namespace internal
{
template <typename I, typename F>
inline
- data_< image_if<I,F> >::data_(I& ima, const F& f)
+ data< image_if<I,F> >::data(I& ima, const F& f)
: ima_(ima),
pset_(ima.domain() | f)
{
@@ -188,7 +188,7 @@
image_if<I,F>::init_(I& ima, const F& f)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< image_if<I,F> >(ima, f);
+ this->data_ = new internal::data< image_if<I,F> >(ima, f);
}
template <typename I, typename F>
Index: mln/core/value_enc_image.hh
--- mln/core/value_enc_image.hh (revision 2057)
+++ mln/core/value_enc_image.hh (working copy)
@@ -99,7 +99,7 @@
*/
template <typename P, typename T>
class value_enc_image :
- public internal::image_primary_< pset_array< p_runs_<P> >,
+ public internal::image_primary< pset_array< p_runs_<P> >,
value_enc_image<P, T> >
{
public:
Index: mln/core/hexa.hh
--- mln/core/hexa.hh (revision 2057)
+++ mln/core/hexa.hh (working copy)
@@ -116,7 +116,7 @@
*
*/
template <typename I>
- struct hexa : public internal::image_domain_morpher_< I, box2d_h, hexa<I> >
+ struct hexa : public internal::image_domain_morpher< I, box2d_h, hexa<I> >
{
/// Skeleton.
typedef hexa< tag::image_<I> > skeleton;
Index: mln/core/tr_image.hh
--- mln/core/tr_image.hh (revision 2057)
+++ mln/core/tr_image.hh (working copy)
@@ -69,12 +69,12 @@
*/
template <typename T, typename I>
struct tr_image :
- public mln::internal::image_identity_< I, mln_pset(I), tr_image<T,I> >
+ public mln::internal::image_identity< I, mln_pset(I), tr_image<T,I> >
{
/// Super type.
typedef
- mln::internal::image_identity_< I, mln_pset(I), tr_image<T,I> > super_;
+ mln::internal::image_identity< I, mln_pset(I), tr_image<T,I> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: mln/core/safe.hh
--- mln/core/safe.hh (revision 2057)
+++ mln/core/safe.hh (working copy)
@@ -66,9 +66,9 @@
// FIXME: Doc!
template <typename I>
- class safe_image : public internal::image_identity_< I, mln_pset(I), safe_image<I> >
+ class safe_image : public internal::image_identity< I, mln_pset(I), safe_image<I> >
{
- typedef internal::image_identity_< I, mln_pset(I), safe_image<I> > super_;
+ typedef internal::image_identity< I, mln_pset(I), safe_image<I> > super_;
public:
/// Skeleton.
Index: mln/core/concept/image.hh
--- mln/core/concept/image.hh (revision 2057)
+++ mln/core/concept/image.hh (working copy)
@@ -73,7 +73,7 @@
typedef Image<void> category;
/*
- // provided by internal::image_base_:
+ // provided by internal::image_base:
typedef pset;
typedef site;
@@ -115,7 +115,7 @@
inline
Image<E>::Image()
{
- // provided by internal::image_base_:
+ // provided by internal::image_base:
typedef mln_pset(E) pset;
typedef mln_site(E) site;
Index: mln/core/plain.hh
--- mln/core/plain.hh (revision 2057)
+++ mln/core/plain.hh (working copy)
@@ -66,10 +66,10 @@
*
*/
template <typename I>
- struct plain : public mln::internal::image_identity_< I, mln_pset(I), plain<I> >
+ struct plain : public mln::internal::image_identity< I, mln_pset(I), plain<I> >
{
- typedef mln::internal::image_identity_< I, mln_pset(I), plain<I> > super_;
+ typedef mln::internal::image_identity< I, mln_pset(I), plain<I> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: mln/core/image2d.hh
--- mln/core/image2d.hh (revision 2057)
+++ mln/core/image2d.hh (working copy)
@@ -60,10 +60,10 @@
/// \internal Data structure for \c mln::image2d<T>.
template <typename T>
- struct data_< image2d<T> >
+ struct data< image2d<T> >
{
- data_(const box2d& b, unsigned bdr);
- ~data_();
+ data(const box2d& b, unsigned bdr);
+ ~data();
T* buffer_;
T** array_;
@@ -75,7 +75,7 @@
void update_vb_();
void allocate_();
void deallocate_();
- void swap_(data_< image2d<T> >& other_);
+ void swap_(data< image2d<T> >& other_);
void reallocate_(unsigned new_border);
};
@@ -120,7 +120,7 @@
* thickness around data.
*/
template <typename T>
- struct image2d : public internal::image_primary_< box2d, image2d<T> >
+ struct image2d : public internal::image_primary< box2d, image2d<T> >
{
/// Value associated type.
typedef T value;
@@ -247,13 +247,13 @@
}
- // internal::data_< image2d<T> >
+ // internal::data< image2d<T> >
namespace internal
{
template <typename T>
inline
- data_< image2d<T> >::data_(const box2d& b, unsigned bdr)
+ data< image2d<T> >::data(const box2d& b, unsigned bdr)
: buffer_(0),
array_ (0),
b_ (b),
@@ -264,7 +264,7 @@
template <typename T>
inline
- data_< image2d<T> >::~data_()
+ data< image2d<T> >::~data()
{
deallocate_();
}
@@ -272,7 +272,7 @@
template <typename T>
inline
void
- data_< image2d<T> >::update_vb_()
+ data< image2d<T> >::update_vb_()
{
vb_.pmin() = b_.pmin() - dpoint2d(all_to(bdr_));
vb_.pmax() = b_.pmax() + dpoint2d(all_to(bdr_));
@@ -281,7 +281,7 @@
template <typename T>
inline
void
- data_< image2d<T> >::allocate_()
+ data< image2d<T> >::allocate_()
{
update_vb_();
unsigned
@@ -303,7 +303,7 @@
template <typename T>
inline
void
- data_< image2d<T> >::deallocate_()
+ data< image2d<T> >::deallocate_()
{
if (buffer_)
{
@@ -321,9 +321,9 @@
template <typename T>
inline
void
- data_< image2d<T> >::swap_(data_< image2d<T> >& other_)
+ data< image2d<T> >::swap_(data< image2d<T> >& other_)
{
- data_< image2d<T> > self_ = *this;
+ data< image2d<T> > self_ = *this;
*this = other_;
other_ = self_;
}
@@ -331,9 +331,9 @@
template <typename T>
inline
void
- data_< image2d<T> >::reallocate_(unsigned new_border)
+ data< image2d<T> >::reallocate_(unsigned new_border)
{
- data_< image2d<T> >& tmp = *(new data_< image2d<T> >(this->b_, new_border));
+ data< image2d<T> >& tmp = *(new data< image2d<T> >(this->b_, new_border));
this->swap_(tmp);
}
@@ -369,7 +369,7 @@
image2d<T>::init_(const box2d& b, unsigned bdr)
{
mln_precondition(! this->has_data());
- this->data_ = new internal::data_< image2d<T> >(b, bdr);
+ this->data_ = new internal::data< image2d<T> >(b, bdr);
}
template <typename T>
Index: mln/neighb/image.hh
--- mln/neighb/image.hh (revision 2057)
+++ mln/neighb/image.hh (working copy)
@@ -93,7 +93,7 @@
/// \pre The domains of \c I and \c N must be compatible.
template <typename I, typename N>
struct image
- : public internal::image_identity_ < I, mln_pset(I), image <I, N> >
+ : public internal::image_identity < I, mln_pset(I), image <I, N> >
{
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: mln/value/stack.hh
--- mln/value/stack.hh (revision 2057)
+++ mln/value/stack.hh (working copy)
@@ -146,7 +146,7 @@
*/
template <unsigned n, typename I>
struct stack_image
- : public mln::internal::image_value_morpher_< I, stack_image<n,I> >
+ : public mln::internal::image_value_morpher< I, stack_image<n,I> >
{
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: mln/border/find.hh
--- mln/border/find.hh (revision 2057)
+++ mln/border/find.hh (working copy)
@@ -68,7 +68,7 @@
template <typename S, typename E>
inline
- unsigned find__(const mln::internal::image_base_<S,E>&)
+ unsigned find__(const mln::internal::image_base<S,E>&)
{
return 0;
}
Index: mln/pw/image.hh
--- mln/pw/image.hh (revision 2057)
+++ mln/pw/image.hh (working copy)
@@ -63,9 +63,9 @@
/// \internal Data structure for mln::pw::image
template <typename F, typename S>
- struct data_< mln::pw::image<F,S> >
+ struct data< mln::pw::image<F,S> >
{
- data_(const F& f, const S& ps);
+ data(const F& f, const S& ps);
F f_;
S pset_;
};
@@ -114,7 +114,7 @@
*
*/
template <typename F, typename S>
- struct image : public internal::image_primary_< S, image<F,S> >
+ struct image : public internal::image_primary< S, image<F,S> >
{
/// Skeleton.
typedef image< tag::function_<F>, tag::pset_<S> > skeleton;
@@ -171,14 +171,14 @@
return tmp;
}
- // internal::data_< pw::image<F,S> >
+ // internal::data< pw::image<F,S> >
namespace internal
{
/// \internal
template <typename F, typename S>
inline
- data_< pw::image<F,S> >::data_(const F& f, const S& ps)
+ data< pw::image<F,S> >::data(const F& f, const S& ps)
: f_(f),
pset_(ps)
{
@@ -201,7 +201,7 @@
inline
image<F,S>::image(const Function_p2v<F>& f, const Site_Set<S>& ps)
{
- this->data_ = new internal::data_< pw::image<F,S> >(exact(f), exact(ps));
+ this->data_ = new internal::data< pw::image<F,S> >(exact(f), exact(ps));
}
template <typename F, typename S>
Index: sandbox/duhamel/translate_image.hh
--- sandbox/duhamel/translate_image.hh (revision 2057)
+++ sandbox/duhamel/translate_image.hh (working copy)
@@ -86,7 +86,7 @@
*
*/
template <typename I>
- struct translate_image : public mln::internal::image_identity_< I, mln_pset(I), translate_image<I> >
+ struct translate_image : public mln::internal::image_identity< I, mln_pset(I), translate_image<I> >
{
typedef mln::internal::image_morpher_< I, mln_pset(I), translate_image<I> > super_;
Index: sandbox/duhamel/mesh_image.hh
--- sandbox/duhamel/mesh_image.hh (revision 2057)
+++ sandbox/duhamel/mesh_image.hh (working copy)
@@ -67,10 +67,10 @@
*
*/
template <typename P, typename V>
- struct mesh_image : public internal::image_primary_< mesh_p<P>, mesh_image<P, V> >
+ struct mesh_image : public internal::image_primary< mesh_p<P>, mesh_image<P, V> >
{
- typedef mln::internal::image_base_< mesh_p<P>, mesh_image<P, V> > super_;
+ typedef mln::internal::image_base< mesh_p<P>, mesh_image<P, V> > super_;
/// Value associated type.
typedef V value;
Index: sandbox/nivault/plugin-gimp/src/gimp-image.hh
--- sandbox/nivault/plugin-gimp/src/gimp-image.hh (revision 2057)
+++ sandbox/nivault/plugin-gimp/src/gimp-image.hh (working copy)
@@ -131,7 +131,7 @@
*
*/
template <GimpImageType t>
- struct gimp_image : public internal::image_primary_< box2d, gimp_image<t> >
+ struct gimp_image : public internal::image_primary< box2d, gimp_image<t> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box2d pset;
Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh
--- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2057)
+++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy)
@@ -122,7 +122,7 @@
* FIXME
*/
template <typename T>
- struct tiled_image2d : public internal::image_primary_< box2d, tiled_image2d<T> >
+ struct tiled_image2d : public internal::image_primary< box2d, tiled_image2d<T> >
{
// Warning: just to make effective types appear in Doxygen:
typedef box2d pset;
Index: sandbox/garrigues/image_identity/image_domain_morpher.hh
--- sandbox/garrigues/image_identity/image_domain_morpher.hh (revision 2057)
+++ sandbox/garrigues/image_identity/image_domain_morpher.hh (working copy)
@@ -50,7 +50,7 @@
* \internal
*/
template <typename I, typename S, typename E>
- class image_domain_morpher_ : public virtual image_morpher_<I, S, E>
+ class image_domain_morpher : public virtual image_morpher_<I, S, E>
{
public:
@@ -77,20 +77,20 @@
lvalue operator()(const mln_psite(S)& p);
protected:
- image_domain_morpher_();
+ image_domain_morpher();
};
# ifndef MLN_INCLUDE_ONLY
template <typename I, typename S, typename E>
- image_domain_morpher_<I,S,E>::image_domain_morpher_()
+ image_domain_morpher<I,S,E>::image_domain_morpher()
{
}
template <typename I, typename S, typename E>
const mln_vset(I)&
- image_domain_morpher_<I,S,E>::values() const
+ image_domain_morpher<I,S,E>::values() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->values();
@@ -98,15 +98,15 @@
template <typename I, typename S, typename E>
mln_rvalue(I)
- image_domain_morpher_<I,S,E>::operator()(const mln_psite(S)& p) const
+ image_domain_morpher<I,S,E>::operator()(const mln_psite(S)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->operator()(p);
}
template <typename I, typename S, typename E>
- typename image_domain_morpher_<I,S,E>::lvalue
- image_domain_morpher_<I,S,E>::operator()(const mln_psite(S)& p)
+ typename image_domain_morpher<I,S,E>::lvalue
+ image_domain_morpher<I,S,E>::operator()(const mln_psite(S)& p)
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->operator()(p);
Index: sandbox/garrigues/image_identity/image_value_morpher.hh
--- sandbox/garrigues/image_identity/image_value_morpher.hh (revision 2057)
+++ sandbox/garrigues/image_identity/image_value_morpher.hh (working copy)
@@ -50,7 +50,7 @@
* \internal
*/
template <typename I, typename E>
- class image_value_morpher_ : public virtual image_morpher_<I, mln_pset(I), E>
+ class image_value_morpher : public virtual image_morpher_<I, mln_pset(I), E>
{
public:
@@ -58,20 +58,20 @@
bool has(const mln_psite(I)& p) const;
protected:
- image_value_morpher_();
+ image_value_morpher();
};
# ifndef MLN_INCLUDE_ONLY
template <typename I, typename E>
- image_value_morpher_<I,E>::image_value_morpher_()
+ image_value_morpher<I,E>::image_value_morpher()
{
}
template <typename I, typename E>
const mln_pset(I)&
- image_value_morpher_<I,E>::domain() const
+ image_value_morpher<I,E>::domain() const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->domain();
@@ -79,7 +79,7 @@
template <typename I, typename E>
bool
- image_value_morpher_<I,E>::has(const mln_psite(I)& p) const
+ image_value_morpher<I,E>::has(const mln_psite(I)& p) const
{
mln_precondition(this->delegatee_() != 0);
return this->delegatee_()->has(p);
Index: sandbox/garrigues/image_identity/interpolated.hh
--- sandbox/garrigues/image_identity/interpolated.hh (revision 2057)
+++ sandbox/garrigues/image_identity/interpolated.hh (working copy)
@@ -62,10 +62,10 @@
*
*/
template <typename I>
- struct interpolated : public mln::internal::image_identity_< I, mln_pset(I), interpolated<I> >
+ struct interpolated : public mln::internal::image_identity< I, mln_pset(I), interpolated<I> >
{
- typedef mln::internal::image_identity_< I, mln_pset(I), interpolated<I> > super_;
+ typedef mln::internal::image_identity< I, mln_pset(I), interpolated<I> > super_;
/// Point_Site associated type.
typedef mln_psite(I) psite;
Index: sandbox/garrigues/image_identity/image_identity.hh
--- sandbox/garrigues/image_identity/image_identity.hh (revision 2057)
+++ sandbox/garrigues/image_identity/image_identity.hh (working copy)
@@ -50,20 +50,20 @@
* \internal
*/
template <typename I, typename S, typename E>
- class image_identity_ : public image_domain_morpher_<I, S, E>,
- public image_value_morpher_<I, E>
+ class image_identity : public image_domain_morpher<I, S, E>,
+ public image_value_morpher<I, E>
{
public:
protected:
- image_identity_();
+ image_identity();
};
# ifndef MLN_INCLUDE_ONLY
template <typename I, typename S, typename E>
- image_identity_<I,S,E>::image_identity_()
+ image_identity<I,S,E>::image_identity()
{
}
Index: sandbox/ballas/refactorization/rle_image.hh
--- sandbox/ballas/refactorization/rle_image.hh (revision 2057)
+++ sandbox/ballas/refactorization/rle_image.hh (working copy)
@@ -11,7 +11,7 @@
// note P must be a point
template <typename P, typename T>
class rle_image :
- public internal::image_base_<rle_pset<P>, rle_image<P, T> >
+ public internal::image_base<rle_pset<P>, rle_image<P, T> >
{
public:
Index: sandbox/ballas/refactorization/image2d.hh
--- sandbox/ballas/refactorization/image2d.hh (revision 2057)
+++ sandbox/ballas/refactorization/image2d.hh (working copy)
@@ -9,7 +9,7 @@
{
template <typename T>
- class image2d : public internal::image_base_< box2d<int>, image2d<T> >
+ class image2d : public internal::image_base< box2d<int>, image2d<T> >
{
public:
Index: sandbox/ballas/refactorization/internal/image_base.hh
--- sandbox/ballas/refactorization/internal/image_base.hh (revision 2057)
+++ sandbox/ballas/refactorization/internal/image_base.hh (working copy)
@@ -10,7 +10,7 @@
/// Image base
/// S is the point set type
template <typename S, typename E>
- struct image_base_ : public Image<E>
+ struct image_base : public Image<E>
{
typedef S pset;
typedef typename S::psite psite;
@@ -22,7 +22,7 @@
bool has(const psite& ps) const;
protected:
- image_base_();
+ image_base();
};
///FIXME: is_ready
@@ -30,13 +30,13 @@
# ifndef MLN_INCLUDE_ONLY
template <typename S, typename E>
- image_base_<S, E>::image_base_()
+ image_base<S, E>::image_base()
{
}
template <typename S, typename E>
bool
- image_base_<S, E>::has(const psite& ps) const
+ image_base<S, E>::has(const psite& ps) const
{
return exact(this)->has(ps);
}
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix the labeling in Meyer's WST algorithm.
* mln/morpho/meyer_wst.hh: Use 0 for the label of the watershed,
to be consistent with other labeling algorithms (computation of
regional minima, for instance).
meyer_wst.hh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: mln/morpho/meyer_wst.hh
--- mln/morpho/meyer_wst.hh (revision 2056)
+++ mln/morpho/meyer_wst.hh (working copy)
@@ -110,7 +110,8 @@
/* FIXME: Ensure the input image has scalar values. */
typedef L marker;
- const marker unmarked = mln_min(marker);
+ // FIXME: Use literal::zero.
+ const marker unmarked = 0;
// Initialize the output with the markers (minima components).
mln_ch_value(I, marker) output =
1
0
23 Jun '08
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
More checks in the construction of graph-based images.
* mln/core/graph_image.hh
(mln::internal::data_< graph_image<P, V> >::data_)
* mln/core/line_graph_image.hh
(mln::internal::data_< line_graph_image<P, V> >::data_):
Ensure the graph pset and its associated data are consistent.
graph_image.hh | 1 +
line_graph_image.hh | 2 ++
2 files changed, 3 insertions(+)
Index: mln/core/graph_image.hh
--- mln/core/graph_image.hh (revision 2055)
+++ mln/core/graph_image.hh (working copy)
@@ -188,6 +188,7 @@
: val_ (val),
pg_ (g)
{
+ mln_precondition(g.nvertices() == val.size());
}
} // end of namespace mln::internal
Index: mln/core/line_graph_image.hh
--- mln/core/line_graph_image.hh (revision 2055)
+++ mln/core/line_graph_image.hh (working copy)
@@ -217,6 +217,8 @@
edge_val_(edge_val),
plg_(g)
{
+ mln_precondition(g.nvertices() == vertex_val.size());
+ mln_precondition(g.edges() == edge_val.size());
}
} // end of namespace mln::internal
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Start a 3-D mesh surface skeletonization tool.
* apps/statues/mesh-skel.cc: New.
* apps/statues/io.hh: Update header guards.
(write_faces_asc_binary, write_off_binary): New functions.
* apps/statues/Makefile.am (bin_PROGRAMS): Add mesh-skel.
(mesh_skel_SOURCES): New.
Add mesh-skel.cc and io.hh.
Makefile.am | 3
io.hh | 48 ++++++++++++-
mesh-skel.cc | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 258 insertions(+), 4 deletions(-)
Index: apps/statues/mesh-skel.cc
--- apps/statues/mesh-skel.cc (revision 0)
+++ apps/statues/mesh-skel.cc (revision 0)
@@ -0,0 +1,211 @@
+// 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
+// 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.
+
+/// \file apps/statues/mesh-segm.cc
+/// \brief A program computing a skeleton of the surface of the
+/// (triangle) mesh of a statue.
+
+// FIXME: Factor commons parts between mesh-segm and mesh-skel.
+
+#include <cstdlib>
+#include <cmath>
+
+#include <utility>
+#include <iostream>
+
+#include <TriMesh.h>
+
+#include <mln/value/rgb8.hh>
+
+#include <mln/core/point3d.hh>
+#include <mln/make/point3d.hh>
+
+#include <mln/util/graph.hh>
+#include <mln/core/graph_image.hh>
+#include <mln/core/graph_elt_neighborhood.hh>
+
+#include <mln/morpho/closing_area.hh>
+#include <mln/labeling/regional_minima.hh>
+
+#include "io.hh"
+
+
+// Doesn't C++ have a better way to express Pi ?
+const float pi = 4 * atanf(1);
+
+
+int main(int argc, char* argv[])
+{
+ if (argc != 4)
+ {
+ std::cerr << "usage: " << argv[1] << " input.off lambda output.off";
+ exit(1);
+ }
+
+ std::string input_filename = argv[1];
+ unsigned lambda = atoi(argv[2]);
+ std::string output_filename = argv[3];
+
+
+ /*-------.
+ | Mesh. |
+ `-------*/
+
+ // TriMesh is a pain: it systematically allocates on the heap.
+ // Introduce another name to manipulate the mesh as a (non-pointer)
+ // object.
+ TriMesh* mesh_ptr = TriMesh::read(input_filename.c_str());
+ if (!mesh_ptr)
+ exit(2);
+ TriMesh& mesh = *mesh_ptr;
+
+ // Computes faces (triangles).
+ mesh.need_faces();
+ // Computation of the mean curvature on each vertex of the mesh.
+ mesh.need_curvatures();
+ std::vector<float> vertex_h_inv(mesh.faces.size(), 0.f);
+ for (unsigned v = 0; v < mesh.vertices.size(); ++v)
+ {
+ float h = (mesh.curv1[v] + mesh.curv2[v]) / 2;
+ float h_inv = 1 / pi * atan(-h) + pi / 2;
+ vertex_h_inv[v] = h_inv;
+ }
+ // Computation of the mean curvature on each face of the mesh.
+ /* FIXME: Our implementation of the computation of the regional
+ minima doesn't work well with floats (yet). Convert floating
+ point values to a proportional integer value for the moment. */
+ typedef int curv_t;
+ std::vector<curv_t> face_h_inv(mesh.faces.size(), 0.f);
+ for (unsigned f = 0; f < mesh.faces.size(); ++f)
+ {
+ float h_inv =
+ (vertex_h_inv[mesh.faces[f][0]] +
+ vertex_h_inv[mesh.faces[f][1]] +
+ vertex_h_inv[mesh.faces[f][2]])
+ / 3;
+ /* FIXME: This coefficient is used to distinguish small
+ curvature values. We should get rid of it as soon as
+ labeling::regional_minima works correctly on images of float
+ values. */
+ face_h_inv[f] = 1000 * h_inv;
+ }
+
+ /*--------.
+ | Graph. |
+ `--------*/
+
+ /* Build a graph whose vertices correspond to the faces of the mesh,
+ whose edges (between two vertices) correspond to edges (between
+ two faces) of the mesh. */
+
+ /* FIXME: We don't have the required site type yet. Simulate with a
+ dummy type (point3d). */
+ mln::util::graph<mln::point3d> g;
+ // Populate the graph with vertices.
+ for (unsigned i = 0; i < mesh.faces.size(); ++i)
+ g.add_vertex (mln::make::point3d(i, i, i));
+
+ // Populate the graph with edges.
+ mesh.need_across_edge();
+ for (unsigned f = 0; f < mesh.faces.size(); ++f)
+ for (unsigned e = 0; e < 3; ++e)
+ {
+ int f_adj = mesh.across_edge[f][e];
+ if (f_adj != -1)
+ // Add an edge into the graph.
+ g.add_edge(f, f_adj);
+ }
+
+ /*--------------.
+ | Graph image. |
+ `--------------*/
+
+ mln::p_graph<mln::point3d> pg(g);
+
+ typedef mln::graph_image<mln::point3d, curv_t> ima_t;
+ ima_t g_ima(pg, face_h_inv);
+
+ /*-----------------.
+ | Simplification. |
+ `-----------------*/
+
+ typedef mln::graph_elt_neighborhood<mln::point3d> nbh_t;
+ nbh_t nbh;
+
+ ima_t closed_g_ima (g_ima.domain());
+ mln::morpho::closing_area(g_ima, nbh, lambda, closed_g_ima);
+
+ /*------------------.
+ | Regional minima. |
+ `------------------*/
+
+ typedef unsigned label_t;
+ label_t nlabels;
+ typedef mln::graph_image<mln::point3d, label_t> label_ima_t;
+ label_ima_t minima =
+ mln::labeling::regional_minima(closed_g_ima, nbh, nlabels);
+ std::cout << "nlabels = " << nlabels << std::endl;
+
+ /*-----------.
+ | Skeleton. |
+ `-----------*/
+
+ // FIXME: To do.
+
+ /*---------.
+ | Output. |
+ `---------*/
+
+ /* FIXME We should created a boolean graph_image instead. But as
+ we cannot directly save a graph_image as an OFF file now, just
+ store the values of this would-be image into an array. */
+ // Assign a boolean value to graph vertices (mesh faces).
+ std::vector<bool> face_value (minima.domain().nvertices(), true);
+ mln_piter_(label_ima_t) pm(minima.domain());
+ for_all(pm)
+ // FIXME: Use literal::zero.
+ if (minima(pm) != 0)
+ {
+ // The face belongs to a regional minima: ``remove'' it from
+ // the mesh by tagging it as false.
+ mln_psite_(label_ima_t) pp(pm);
+ face_value[pp.id().to_equiv()] = false;
+ }
+
+ // Taken and adapted from TriMesh_io.cc
+ FILE* f_out = fopen(output_filename.c_str(), "wb");
+ if (!f_out)
+ {
+ std::cerr << "Error opening " << output_filename.c_str()
+ << " for writing." << std::endl;
+ exit(2);
+ }
+ write_off_binary(mesh_ptr, face_value, f_out);
+ fclose(f_out);
+
+ delete mesh_ptr;
+}
Index: apps/statues/io.hh
--- apps/statues/io.hh (revision 2054)
+++ apps/statues/io.hh (working copy)
@@ -25,11 +25,17 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef SANDBOX_LEVILLAIN_IO_HH
-# define SANDBOX_LEVILLAIN_IO_HH
+#ifndef APPS_STATUES_IO_HH
+# define APPS_STATUES_IO_HH
+/// \file apps/statues/io.hh
/// \brief I/O routines adapted from TriMesh's ones.
+#include <algorithm>
+
+#include <TriMesh.h>
+
+
/// Taken from TriMesh_io.cc
/// \{
// Convert colors float -> uchar
@@ -112,4 +118,40 @@
/// \}
-#endif // ! SANDBOX_LEVILLAIN_IO_HH
+/// Taken and adapted from TriMesh_io.cc
+/// \{
+/// Write a bunch of faces to an ASCII file, removing the ones tagged
+/// as ``false'' in \a face_value.
+inline void write_faces_asc_binary(TriMesh *mesh,
+ const std::vector<bool>& face_value,
+ FILE *f,
+ const char *before_face,
+ const char *after_line)
+{
+ mesh->need_faces();
+ for (int i = 0; i < mesh->faces.size(); i++)
+ if (face_value[i])
+ {
+ fprintf(f, "%s%d %d %d%s\n",
+ before_face,
+ mesh->faces[i][0], mesh->faces[i][1], mesh->faces[i][2],
+ after_line);
+ }
+}
+
+/// Write an off file, removing faces tagged as ``false'' in \a face_value.
+inline void write_off_binary(TriMesh *mesh,
+ const std::vector<bool>& face_value,
+ FILE *f)
+{
+ fprintf(f, "OFF\n");
+ mesh->need_faces();
+ unsigned long nfaces =
+ std::count(face_value.begin(), face_value.end(), true);
+ fprintf(f, "%lu %lu 0\n", (unsigned long) mesh->vertices.size(), nfaces);
+ write_verts_asc(mesh, f, "", 0, 0, false, 0, "");
+ write_faces_asc_binary(mesh, face_value, f, "3 ", "");
+}
+/// \}
+
+#endif // ! APPS_STATUES_IO_HH
Index: apps/statues/Makefile.am
--- apps/statues/Makefile.am (revision 2054)
+++ apps/statues/Makefile.am (working copy)
@@ -7,7 +7,8 @@
# Find trimesh archive.
AM_LDFLAGS = -L$(top_builddir)/external/trimesh/libsrc -ltrimesh
-bin_PROGRAMS = mesh-segm
+bin_PROGRAMS = mesh-segm mesh-skel
mesh_segm_SOURCES = mesh-segm.cc io.hh
+mesh_skel_SOURCES = mesh-skel.cc io.hh
TESTS = test
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Fix apps/statues/mesh-segm.
* apps/statues/mesh-segm.cc (main): Actually use a vector of
curv_t (int) instead of a vector of floats.
mesh-segm.cc | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
Index: apps/statues/mesh-segm.cc
--- apps/statues/mesh-segm.cc (revision 2053)
+++ apps/statues/mesh-segm.cc (working copy)
@@ -25,6 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
+/// \file apps/statues/mesh-segm.cc
+/// \brief A program performing a WST-based segmentation of the
+/// surface of the (triangle) mesh of a statue.
+
+// FIXME: Factor commons parts between mesh-segm and mesh-skel.
+
#include <cstdlib>
#include <cmath>
@@ -82,10 +88,10 @@
// Computation of the mean curvature on each vertex of the mesh.
mesh.need_curvatures();
/* FIXME: Our implementation of the WST doesn't work well with
- floats. Convert floating point values to a proportional integer
- value for the moment. */
+ floats (yet). Convert floating point values to a proportional
+ integer value for the moment. */
typedef int curv_t;
- std::vector<float> vertex_h_inv(mesh.vertices.size(), 0.f);
+ std::vector<curv_t> vertex_h_inv(mesh.vertices.size(), 0.f);
for (unsigned v = 0; v < mesh.vertices.size(); ++v)
{
float h = (mesh.curv1[v] + mesh.curv2[v]) / 2;
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk
Index: milena/ChangeLog
===================================================================
--- milena/ChangeLog (revision 2052)
+++ milena/ChangeLog (revision 2053)
@@ -31,7 +31,7 @@
Fix priority queue-based point sets.
These problems were spotted using TESTS_CXXFLAGS_DEBUG.
- * mln/core/p_priority_queue.hh:
+ * mln/core/p_priority_queue.hh:
(mln::p_priority_queue<P, T>::queue_map_t): New typedef.
Use it...
(mln::p_priority_queue<P, T>::q_): ...here, and fix the type
@@ -134,10 +134,10 @@
(graph_psite(const p_graph<P>&, util::vertex_id)):
Likewise.
* mln/core/p_line_graph_piter.hh
- (p_line_graph_fwd_piter_<P>::next_):
+ (p_line_graph_fwd_piter_<P>::next_):
(p_line_graph_bkd_piter_<P>::next_):
Adjust.
- * tests/morpho/lena_line_graph_image_wst1.cc: Adjust.
+ * tests/morpho/lena_line_graph_image_wst1.cc: Adjust.
2008-06-07 Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
@@ -214,7 +214,7 @@
Add more documentation.
Aesthetic changes.
(mln::accu::count_<T>::result)
- (mln::accu::volume_<I>::result):
+ (mln::accu::volume_<I>::result):
Remove useless typedef.
* mln/accu/volume.hh:
(mln::accu::volume_<I>::height__): Rename member as...
@@ -225,7 +225,7 @@
(mln::accu::volume_<I>::init): Likewise.
Actually initialize all members.
(mln::accu::count_adjacent_vertices_<P, V>::set_value): Reset
- member ref_level__ and area__.
+ member ref_level__ and area__.
* mln/accu/count_adjacent_vertices.hh
(mln::accu::count_adjacent_vertices_<P, V>::set_value): Reset
member vertices_.
@@ -325,7 +325,7 @@
Have graph vertex and edge creation return the created identifier.
- * mln/util/internal/graph_base.hh:
+ * mln/util/internal/graph_base.hh:
(mln::util::internal::graph_base<N, E>::add_node_)
(mln::util::internal::graph_base<N, E>::add_edge_)
* mln/util/graph.hh
@@ -346,7 +346,7 @@
* mln/morpho/erosion.hh
(erosion_on_function_, erosion_on_set_): Change 'has' to 'owns_'.
* mln/morpho/dilation.hh
- (dilation_on_function_, dilation_on_set_): Likewise.
+ (dilation_on_function_, dilation_on_set_): Likewise.
* mln/labeling/regional_minima.hh
(regional_minima_functor): Fix initialization of 'attr'; use
the proper command instead of ctor call.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 2052)
+++ ChangeLog (revision 2053)
@@ -6,7 +6,7 @@
Autoconfiscate trimesh2.
- * configure.ac: Require Autoconf 2.16 and Automake 1.10.
+ * configure.ac: Require Autoconf 2.61 and Automake 1.10.
Configure external/Makefile.
Configure subdirectory external/trimesh/.
Fix the definition of TESTS_CXXFLAGS_DEBUG.
@@ -22,7 +22,7 @@
* external/: New directory.
* external/README: New.
- * external/trimesh/
+ * external/trimesh/,
* external/trimesh/COPYING,
* external/trimesh/Makedefs.Darwin,
* external/trimesh/Makedefs.Linux,
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Prefer p() than p_ in site iterators.
For optimization purpose, we can have in site iterators a couple
of current location (see, e.g., in pset_if_piter.hh we have
this->p_ inherited plus the local pi_ attribute).
* mln/core/internal/site_iterator_base.hh (p): New.
(current_p_): New; can be overridden.
* mln/core/box_piter.hh: Update.
* mln/core/pset_if_piter.hh: Update.
* mln/core/box.hh: Update.
box.hh | 3 +++
box_piter.hh | 36 ++++++++++++++++++------------------
internal/site_iterator_base.hh | 23 +++++++++++++++++++----
pset_if_piter.hh | 11 +++++++----
4 files changed, 47 insertions(+), 26 deletions(-)
Index: mln/core/internal/site_iterator_base.hh
--- mln/core/internal/site_iterator_base.hh (revision 2051)
+++ mln/core/internal/site_iterator_base.hh (working copy)
@@ -41,6 +41,13 @@
# include <mln/core/concept/site_iterator.hh>
# include <mln/core/concept/pseudo_site.hh> // Use of if_possible::change_target.
+// site_iterator_base<S> where S is a Site_Set
+// {
+// s_ : const S*
+// }
+
+
+
namespace mln
{
@@ -96,6 +103,12 @@
/// Change the iterator target.
void change_target(const S& s);
+ mln_psite(S)& p() { return exact(this)->current_p_(); }
+ const mln_psite(S)& p() const { return exact(this)->current_p_(); }
+
+ mln_psite(S)& current_p_() { return p_; }
+ const mln_psite(S)& current_p_() const { return p_; }
+
protected:
site_iterator_base();
@@ -103,6 +116,8 @@
/// The target.
const S* s_;
+ private:
+
/// The psite designated by this iterator.
mln_psite(S) p_;
};
@@ -131,7 +146,7 @@
site_iterator_base<S, E>::to_site() const
{
mln_precondition(exact(*this).is_valid()); // FIXME: OK?
- return internal::to_site( exact(this)->unproxy() );
+ return internal::to_site( p() );
}
template <typename S, typename E>
@@ -139,7 +154,7 @@
const mln_psite(S)&
site_iterator_base<S, E>::unproxy() const
{
- return p_;
+ return p();
}
template <typename S, typename E>
@@ -156,9 +171,9 @@
site_iterator_base<S, E>::change_target(const S& s)
{
s_ = & s;
- // p_ might be also updated since it can hold a pointer towards
+ // p might be also updated since it can hold a pointer towards
// the set it designates, so:
- if_possible::change_target(p_, s);
+ if_possible::change_target(p(), s);
// Last:
this->invalidate();
}
Index: mln/core/box_piter.hh
--- mln/core/box_piter.hh (revision 2051)
+++ mln/core/box_piter.hh (working copy)
@@ -79,9 +79,9 @@
/// Go to the next point.
void next_();
- protected:
+ using super_::p;
- using super_::p_;
+ protected:
using super_::s_;
};
@@ -126,9 +126,9 @@
/// Go to the next point.
void next_();
- protected:
+ using super_::p;
- using super_::p_;
+ protected:
using super_::s_;
};
@@ -158,7 +158,7 @@
bool
box_fwd_piter_<P>::is_valid_() const
{
- return p_[0] != s_->pmax()[0] + 1;
+ return p()[0] != s_->pmax()[0] + 1;
}
template <typename P>
@@ -166,7 +166,7 @@
void
box_fwd_piter_<P>::invalidate_()
{
- p_[0] = s_->pmax()[0] + 1;
+ p()[0] = s_->pmax()[0] + 1;
}
template <typename P>
@@ -174,7 +174,7 @@
void
box_fwd_piter_<P>::start_()
{
- p_ = s_->pmin();
+ p() = s_->pmin();
}
template <typename P>
@@ -183,14 +183,14 @@
box_fwd_piter_<P>::next_()
{
for (int i = dim - 1; i >= 0; --i)
- if (p_[i] == s_->pmax()[i])
- p_[i] = s_->pmin()[i];
+ if (p()[i] == s_->pmax()[i])
+ p()[i] = s_->pmin()[i];
else
{
- ++p_[i];
+ ++p()[i];
break;
}
- if (p_ == s_->pmin())
+ if (p() == s_->pmin())
invalidate_();
}
@@ -215,7 +215,7 @@
bool
box_bkd_piter_<P>::is_valid_() const
{
- return p_[0] != s_->pmin()[0] - 1;
+ return p()[0] != s_->pmin()[0] - 1;
}
template <typename P>
@@ -223,7 +223,7 @@
void
box_bkd_piter_<P>::invalidate_()
{
- p_[0] = s_->pmin()[0] - 1;
+ p()[0] = s_->pmin()[0] - 1;
}
template <typename P>
@@ -231,7 +231,7 @@
void
box_bkd_piter_<P>::start_()
{
- p_ = s_->pmax();
+ p() = s_->pmax();
}
template <typename P>
@@ -240,14 +240,14 @@
box_bkd_piter_<P>::next_()
{
for (int i = dim - 1; i >= 0; --i)
- if (p_[i] == s_->pmin()[i])
- p_[i] = s_->pmax()[i];
+ if (p()[i] == s_->pmin()[i])
+ p()[i] = s_->pmax()[i];
else
{
- --p_[i];
+ --p()[i];
break;
}
- if (p_ == s_->pmax())
+ if (p() == s_->pmax())
invalidate_();
}
Index: mln/core/pset_if_piter.hh
--- mln/core/pset_if_piter.hh (revision 2051)
+++ mln/core/pset_if_piter.hh (working copy)
@@ -76,6 +76,9 @@
mln_fwd_piter(S)& hook_pi_() { return pi_; }
+ mln_psite(S)& current_p_() { return pi_.p(); }
+ const mln_psite(S)& current_p_() const { return pi_.p(); }
+
private:
mln_fwd_piter(S) pi_;
@@ -134,8 +137,8 @@
pi_.start();
while (pi_.is_valid() && ! this->s_->pred(pi_))
pi_.next();
- if (is_valid_())
- this->p_ = pi_;
+// if (is_valid_())
+// this->p_ = pi_;
}
template <typename S, typename F>
@@ -146,8 +149,8 @@
do
pi_.next();
while (pi_.is_valid() && ! this->s_->pred(pi_));
- if (is_valid_())
- this->p_ = pi_;
+// if (is_valid_())
+// this->p_ = pi_;
}
Index: mln/core/box.hh
--- mln/core/box.hh (revision 2051)
+++ mln/core/box.hh (working copy)
@@ -85,6 +85,9 @@
/// Forward Site_Iterator associated type.
typedef box_fwd_piter_<P> fwd_piter;
+ /// Site_Iterator associated type.
+ typedef fwd_piter piter;
+
/// Backward Site_Iterator associated type.
typedef box_bkd_piter_<P> bkd_piter;
1
0