https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add a variable for C++ compiler flags with full debugging features.
* configure.ac (TESTS_CXXFLAGS_DEBUG): New configure variable.
configure.ac | 32 +++++++++++++++++++++++++++-----
1 file changed, 27 insertions(+), 5 deletions(-)
Index: configure.ac
--- configure.ac (revision 2038)
+++ configure.ac (working copy)
@@ -38,15 +38,21 @@
CXXFLAGS="$CXXFLAGS -pipe"
fi
-# C++ compiler flags for tests.
+# ------------------------------ #
+# C++ compiler flags for tests. #
+# ------------------------------ #
+
+# FIXME: We might want to write an Autoconf macro to factor this.
+
+# Standard flas for tests.
AC_ARG_VAR([TESTS_CXXFLAGS])
# We want no optimization for the tests (it slows down compiling
-# times), and a lot of debugging.
+# times), and debugging information.
if test "$GXX" = yes && test -z "$TESTS_CXXFLAGS"; then
TESTS_CXXFLAGS="-O0 -ggdb -Wall -W"
fi
-# C++ compiler flags for complex tests.
+# Flags for complex tests.
AC_ARG_VAR([TESTS_CXXFLAGS_SPEED])
# We want optimization for complex tests, and keep debugging flags
# (still useful).
@@ -54,9 +60,25 @@
TESTS_CXXFLAGS_SPEED="-O3 -DNDEBUG -ggdb -Wall -W"
fi
-# C++ compiler flags for tools.
+# Flags for tests with with all debugging features turned on.
+AC_ARG_VAR([TESTS_CXXFLAGS_DEBUG])
+# We want no optimization for the tests (it slows down compiling
+# times), and a lot of debugging features.
+# * GNU C++ Library Debug Mode:
+# http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html
+# * GNU C++ Library Compile Time Checks (a.k.a. concept checking):
+# http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch29.html
+if test "$GXX" = yes && test -z "$TESTS_CXXFLAGS_DEBUG"; then
+ TESTS_CXXFLAGS_DEBUG=\
+ "-O0 -ggdb -Wall -W -D_GLIBCXX_DEBUG -D_GLIBCXX_CONCEPT_CHECKS"
+fi
+
+# ----------------- #
+# Flags for tools. #
+# ----------------- #
+
AC_ARG_VAR([TOOLS_CXXFLAGS])
-# On the contrary, we want fast binaries for tools.
+# We want fast binaries for tools.
if test "$GXX" = yes && test -z "$TOOLS_CXXFLAGS"; then
TOOLS_CXXFLAGS="-O3 -DNDEBUG -ggdb -Wall -W"
fi
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Add the ability to plot a point (small cross).
* mln/draw/plot.hh: New. Plot a point.
* mln/draw/all.hh: Update. Add plot.hh.
all.hh | 1
plot.hh | 94
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 95 insertions(+)
Index: mln/draw/plot.hh
--- mln/draw/plot.hh (revision 0)
+++ mln/draw/plot.hh (revision 0)
@@ -0,0 +1,94 @@
+// Copyright (C) 2007 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 inplot 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_DRAW_PLOT_HH
+# define MLN_DRAW_PLOT_HH
+
+/*! \file mln/draw/plot.hh
+ *
+ * \brief Plot a point (small cross) in an image.
+ */
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/line2d.hh>
+# include <mln/level/paste.hh>
+# include <mln/pw/image.hh>
+# include <mln/pw/cst.hh>
+
+
+namespace mln
+{
+
+ namespace draw
+ {
+
+ /*! Plot a point at level \p v in image \p ima between the points
+ * \p beg and \p end.
+ *
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] p The point to be plotted.
+ * \param[in] v The value to assign to all drawn pixels.
+ *
+ * \pre \p ima has to be initialized.
+ * \pre \p ima has \p p.
+ *
+ */
+ template <typename I>
+ void plot(Image<I>& ima,
+ const mln_point(I)& p,
+ const mln_value(I)& v);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I>
+ inline
+ void plot(Image<I>& ima,
+ const mln_point(I)& p,
+ const mln_value(I)& v)
+ {
+ mln_precondition(exact(ima).has_data());
+ mln_precondition(exact(ima).has(p));
+
+ for (unsigned i = 0; i < I::point::dim; i++)
+ {
+ mln_point(I) beg = p, end = p;
+ beg[i] = beg[i] - 1;
+ end[i] = end[i] + 1;
+ level::paste(pw::cst(v) | line2d(beg, end),
+ ima);
+ }
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::draw
+
+} // end of namespace mln
+
+
+#endif // ! MLN_DRAW_PLOT_HH
Index: mln/draw/all.hh
--- mln/draw/all.hh (revision 2032)
+++ mln/draw/all.hh (working copy)
@@ -46,5 +46,6 @@
# include <mln/draw/graph.hh>
# include <mln/draw/label.hh>
# include <mln/draw/line.hh>
+# include <mln/draw/plot.hh>
#endif // ! MLN_DRAW_ALL_HH