* mln/topo/n_face.hh
(mln::topo::n_face<D>::lower_dim_adj_faces)
(mln::topo::n_face<D>::higher_dim_adj_faces):
Return algebraic n-faces.
(mln::topo::make_n_face): Remove useless helper.
(mln::topo::edge(const n_face<0, D>&, const n_face<0, D>&)):
Have this helper return an algebraic 1-face, and move it...
* milena/mln/topo/face.hh: ...here.
---
milena/ChangeLog | 13 ++++++
milena/mln/topo/algebraic_n_face.hh | 53 +++++++++++++++++++++++
milena/mln/topo/n_face.hh | 78 +++-------------------------------
3 files changed, 73 insertions(+), 71 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8f68af8..334b083 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,18 @@
2008-10-23 Roland Levillain <roland(a)lrde.epita.fr>
+ Adjust (non algebraic) n-faces.
+
+ * mln/topo/n_face.hh
+ (mln::topo::n_face<D>::lower_dim_adj_faces)
+ (mln::topo::n_face<D>::higher_dim_adj_faces):
+ Return algebraic n-faces.
+ (mln::topo::make_n_face): Remove useless helper.
+ (mln::topo::edge(const n_face<0, D>&, const n_face<0, D>&)):
+ Have this helper return an algebraic 1-face, and move it...
+ * milena/mln/topo/face.hh: ...here.
+
+2008-10-23 Roland Levillain <roland(a)lrde.epita.fr>
+
Add an algebraic (oriented) face handle (descriptor).
* mln/topo/algebraic_face.hh: New.
diff --git a/milena/mln/topo/algebraic_n_face.hh b/milena/mln/topo/algebraic_n_face.hh
index fbfccf4..9228963 100644
--- a/milena/mln/topo/algebraic_n_face.hh
+++ b/milena/mln/topo/algebraic_n_face.hh
@@ -134,6 +134,32 @@ namespace mln
operator<<(std::ostream& ostr, const algebraic_n_face<N, D>& f);
+ /// \brief Helpers
+ /// \{
+
+ /** \brief Return the algebraic 1-face (edge) linking the 0-faces
+ (vertices) \a f1 and \a f2. If there is no 1-face between \a
+ f1 and \a f2, return an invalid 1-face.
+
+ \pre \a f1 and \a f2 must belong to the same complex.
+
+ Note: this routine assumes the complex is not degenerated, i.e,
+ \li it does not check that \a f1 and \a f2 are the only
+ 0-faces adjacent to an hypothetical 1-face; it just checks
+ that \a f1 and \a f2 <em>share</em> a common 1-face;
+
+ \li if there are several ajacent 1-faces shared by \a f1 and
+ \a f2 (if the complex is ill-formed), there is no
+ guarantee on the returned 1-face (the current
+ implementation return the first 1-face found, but client
+ code should not rely on this implementation-defined
+ behavior). */
+ template <unsigned D>
+ algebraic_n_face<1, D>
+ edge(const n_face<0, D>& f1, const n_face<0, D>& f2);
+ /// \}
+
+
# ifndef MLN_INCLUDE_ONLY
@@ -253,6 +279,33 @@ namespace mln
<< ", id = " << f.face_id() << ", sign = " << f.sign()<< ')';
}
+ /*----------.
+ | Helpers. |
+ `----------*/
+
+ template <unsigned D>
+ algebraic_n_face<1, D>
+ edge(const n_face<0, D>& f1, const n_face<0, D>& f2)
+ {
+ typedef std::vector< algebraic_n_face<0, D> > n0_faces_t;
+ typedef std::vector< algebraic_n_face<1, D> > n1_faces_t;
+
+ n1_faces_t f1_adj_edges = f1.higher_dim_adj_faces();
+ for (typename n1_faces_t::const_iterator e = f1_adj_edges.begin();
+ e != f1_adj_edges.end(); ++e)
+ {
+ n0_faces_t e_adj_vertices = e->lower_dim_adj_faces();
+ for (typename n0_faces_t::const_iterator w = e_adj_vertices.begin();
+ w != e_adj_vertices.end(); ++w)
+ if (*w == f2)
+ // E is the edge linking F1 and F2.
+ return *e;
+ }
+
+ // If no shared edge was found, retun an empty (invalid) 1-face.
+ return algebraic_n_face<1, D>();
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::topo
diff --git a/milena/mln/topo/n_face.hh b/milena/mln/topo/n_face.hh
index 68a9512..2f8a7e0 100644
--- a/milena/mln/topo/n_face.hh
+++ b/milena/mln/topo/n_face.hh
@@ -46,6 +46,7 @@ namespace mln
// Forward declaration.
template <unsigned D> class complex;
template <unsigned N, unsigned D> class face_data;
+ template <unsigned N, unsigned D> class algebraic_n_face;
/*---------.
@@ -57,8 +58,9 @@ namespace mln
/// Contrary to an mln::topo::face, the dimension of an
/// mln::topo::n_face is fixed.
template <unsigned N, unsigned D>
- struct n_face
+ class n_face
{
+ public:
// The type of the complex this handle points to.
typedef complex<D> complex_type;
@@ -98,9 +100,9 @@ namespace mln
/* FIXME: We should not provide lower_dim_adj_faces() when N ==
0 nor higher_dim_adj_faces() when N == D. */
/// \Return an array of face handles pointing to adjacent (n-1)-faces.
- std::vector< n_face<N - 1, D> > lower_dim_adj_faces() const;
+ std::vector< algebraic_n_face<N - 1, D> > lower_dim_adj_faces() const;
/// Return an array of face handles pointing to adjacent (n+1)-faces.
- std::vector< n_face<N + 1, D> > higher_dim_adj_faces() const;
+ std::vector< algebraic_n_face<N + 1, D> > higher_dim_adj_faces() const;
/// \}
private:
@@ -114,12 +116,6 @@ namespace mln
};
- /// Create a handle for \p N-face of a \p D-complex.
- template <unsigned N, unsigned D>
- n_face<N, D>
- make_n_face(const complex<D>& c, unsigned face_id);
-
-
/// Comparison of two instances of mln::topo::n_face.
/// \{
@@ -155,31 +151,6 @@ namespace mln
operator<<(std::ostream& ostr, const n_face<N, D>& f);
- /// \brief Helpers
- /// \{
-
- /** \brief Return the 1-face (edge) linking the 0-faces (vertices)
- \a f1 and \a f2. If there is no 1-face between \a f1 and \a
- f2, return an invalid 1-face.
-
- \pre \a f1 and \a f2 must belong to the same complex.
-
- Note: this routine assumes the complex is not degenerated, i.e,
- \li it does not check that \a f1 and \a f2 are the only
- 0-faces adjacent to an hypothetical 1-face; it just checks
- that \a f1 and \a f2 <em>share</em> a common 1-face;
-
- \li if there are several ajacent 1-faces shared by \a f1 and
- \a f2 (if the complex is ill-formed), there is no
- guarantee on the returned 1-face (the current
- implementation return the first 1-face found, but client
- code should not rely on this implementation-defined
- behavior). */
- template <unsigned D>
- n_face<1, D> edge(const n_face<0, D>& f1, const n_face<0, D>& f2);
- /// \}
-
-
# ifndef MLN_INCLUDE_ONLY
@@ -285,7 +256,7 @@ namespace mln
template <unsigned N, unsigned D>
inline
- std::vector< n_face<N - 1, D> >
+ std::vector< algebraic_n_face<N - 1, D> >
n_face<N, D>::lower_dim_adj_faces() const
{
mln_precondition(N > 0);
@@ -295,7 +266,7 @@ namespace mln
template <unsigned N, unsigned D>
inline
- std::vector< n_face<N + 1, D> >
+ std::vector< algebraic_n_face<N + 1, D> >
n_face<N, D>::higher_dim_adj_faces() const
{
mln_precondition(N <= D);
@@ -306,15 +277,6 @@ namespace mln
template <unsigned N, unsigned D>
inline
- n_face<N, D>
- make_n_face(const complex<D>& c, unsigned face_id)
- {
- return n_face<N, D>(&c, face_id);
- }
-
-
- template <unsigned N, unsigned D>
- inline
bool
operator==(const n_face<N, D>& lhs, const n_face<N, D>& rhs)
{
@@ -353,32 +315,6 @@ namespace mln
<< ", id = " << f.face_id() << ')';
}
- /*----------.
- | Helpers. |
- `----------*/
-
- template <unsigned D>
- n_face<1, D> edge(const n_face<0, D>& f1, const n_face<0, D>& f2)
- {
- typedef std::vector< n_face<0, D> > n0_faces_t;
- typedef std::vector< n_face<1, D> > n1_faces_t;
-
- n1_faces_t f1_adj_edges = f1.higher_dim_adj_faces();
- for (typename n1_faces_t::const_iterator e = f1_adj_edges.begin();
- e != f1_adj_edges.end(); ++e)
- {
- n0_faces_t e_adj_vertices = e->lower_dim_adj_faces();
- for (typename n0_faces_t::const_iterator w = e_adj_vertices.begin();
- w != e_adj_vertices.end(); ++w)
- if (*w == f2)
- // E is the edge linking F1 and F2.
- return *e;
- }
-
- // If no shared edge was found, retun an empty (invalid) 1-face.
- return n_face<1, D>();
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::topo
--
1.5.6.5
* mln/topo/algebraic_face.hh: New.
---
milena/ChangeLog | 6 +
milena/mln/topo/algebraic_face.hh | 285 +++++++++++++++++++++++++++++++++++++
2 files changed, 291 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/topo/algebraic_face.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 57d15fd..8f68af8 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-10-23 Roland Levillain <roland(a)lrde.epita.fr>
+ Add an algebraic (oriented) face handle (descriptor).
+
+ * mln/topo/algebraic_face.hh: New.
+
+2008-10-23 Roland Levillain <roland(a)lrde.epita.fr>
+
Add an algebraic (oriented) n-face handle (descriptor).
* mln/topo/algebraic_n_face.hh: New.
diff --git a/milena/mln/topo/algebraic_face.hh b/milena/mln/topo/algebraic_face.hh
new file mode 100644
index 0000000..79f9116
--- /dev/null
+++ b/milena/mln/topo/algebraic_face.hh
@@ -0,0 +1,285 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_ALGEBRAIC_FACE_HH
+# define MLN_TOPO_ALGEBRAIC_FACE_HH
+
+/// \file mln/topo/algebraic_face.hh
+/// \brief Algebraic face of a complex.
+
+#include <mln/topo/face.hh>
+
+
+namespace mln
+{
+
+ namespace topo
+ {
+
+ // Forward declarations.
+ template <unsigned D> class complex;
+ template <unsigned N, unsigned D> class n_face;
+ template <unsigned N, unsigned D> class face_data;
+
+
+ /*-------.
+ | Face. |
+ `-------*/
+
+ /// \brief Algebraic face handle in a complex; the face dimension
+ /// is dynamic.
+ ///
+ /// Contrary to an mln::topo::algebraic_n_face, the dimension of an
+ /// mln::topo::algebraic_face is not fixed.
+ template <unsigned D>
+ struct algebraic_face : public face<D>
+ {
+ typedef face<D> super_;
+
+ public:
+ // The type of the complex this handle points to.
+ typedef complex<D> complex_type;
+
+ /// Build a non-initialized algebraic face handle.
+ algebraic_face();
+ /// Build an algebraic face handle from \a complex and \a face_id.
+ algebraic_face(complex<D>& complex, unsigned n, unsigned face_id,
+ bool sign);
+ /// Build an algebraic face handle from an mln::face.
+ algebraic_face(const face<D>& f, bool sign);
+
+ /// Build a face handle from an mln::topo::algebraic_n_face.
+ template <unsigned N>
+ algebraic_face(const algebraic_n_face<N, D>& f);
+
+ /// Accessors.
+ /// \{
+ /// Return the sign of this face.
+ bool sign() const;
+ /// Set the sign of this face.
+ void set_sign(bool sign);
+ /// \}
+
+ private:
+ /// The sign of this algebraic face.
+ bool sign_;
+ };
+
+
+ /// Create an algebraic face handle of a \p D-complex.
+ template <unsigned D>
+ algebraic_face<D>
+ make_algebraic_face(const face<D>& f, bool sign);
+
+
+ /// Inversion operators.
+ /// \{
+ template <unsigned D>
+ algebraic_face<D>
+ operator-(const face<D>& f);
+
+ template <unsigned D>
+ algebraic_face<D>
+ operator-(const algebraic_face<D>& f);
+ /// \}
+
+
+ /// Comparison of two instances of mln::topo::algebraic_face.
+ /// \{
+
+ /// \brief Is \a lhs equal to \a rhs?
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned D>
+ bool operator==(const algebraic_face<D>& lhs,
+ const algebraic_face<D>& rhs);
+
+ /// \brief Is \a lhs different from \a rhs?
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned D>
+ bool operator!=(const algebraic_face<D>& lhs,
+ const algebraic_face<D>& rhs);
+
+ /// \brief Is \a lhs ``less'' than \a rhs?
+ ///
+ /// This comparison is required by algorithms sorting algebraic
+ /// face handles.
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ /// \pre Arguments \a lhs and \a rhs must have the same dimension.
+ template <unsigned D>
+ bool operator< (const algebraic_face<D>& lhs,
+ const algebraic_face<D>& rhs);
+
+ /// \}
+
+
+ /// Print an mln::topo::algebraic_face.
+ template <unsigned D>
+ std::ostream&
+ operator<<(std::ostream& ostr, const algebraic_face<D>& f);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <unsigned D>
+ inline
+ algebraic_face<D>::algebraic_face()
+ : super_(), sign_(true)
+ {
+ }
+
+ template <unsigned D>
+ inline
+ algebraic_face<D>::algebraic_face(complex<D>& c, unsigned n,
+ unsigned face_id, bool sign)
+ : super_(c, n, face_id), sign_(sign)
+ {
+ // Ensure N is compatible with D.
+ mln_precondition(n <= D);
+ }
+
+ template <unsigned D>
+ inline
+ algebraic_face<D>::algebraic_face(const face<D>& f, bool sign)
+ : super_(f), sign_(sign)
+ {
+ // Ensure N is compatible with D.
+ mln_precondition(f.n() <= D);
+ }
+
+ template <unsigned D>
+ template <unsigned N>
+ inline
+ algebraic_face<D>::algebraic_face(const algebraic_n_face<N, D>& f)
+ : super_(f), sign_(f.sign())
+ {
+ // Ensure N is compatible with D.
+ metal::bool_< N <= D >::check();
+ }
+
+
+ template <unsigned D>
+ inline
+ bool
+ algebraic_face<D>::sign() const
+ {
+ return sign_;
+ }
+
+ template <unsigned D>
+ inline
+ void
+ algebraic_face<D>::set_sign(bool sign)
+ {
+ sign_ = sign;
+ }
+
+
+ template <unsigned D>
+ algebraic_face<D>
+ make_algebraic_face(const face<D>& f, bool sign)
+ {
+ return algebraic_face<D>(f, sign);
+ }
+
+
+ template <unsigned D>
+ algebraic_face<D>
+ operator-(const face<D>& f)
+ {
+ return algebraic_face<D>(f, false);
+ }
+
+ template <unsigned D>
+ algebraic_face<D>
+ operator-(const algebraic_face<D>& f)
+ {
+ algebraic_face<D> f2(f);
+ f2.set_sign(!f.sign());
+ return f2;
+ }
+
+
+ template <unsigned D>
+ inline
+ bool
+ operator==(const algebraic_face<D>& lhs, const algebraic_face<D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return
+ lhs.n() == rhs.n() &&
+ lhs.face_id() == rhs.face_id() &&
+ lhs.sign() == rhs.sign();
+ }
+
+ template <unsigned D>
+ inline
+ bool
+ operator!=(const algebraic_face<D>& lhs, const algebraic_face<D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return !(lhs == rhs);
+ }
+
+ template <unsigned D>
+ inline
+ bool
+ operator< (const algebraic_face<D>& lhs, const algebraic_face<D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ // Ensure LHS and RHS have the same dimension.
+ mln_precondition(lhs.n() == rhs.n());
+ return lhs.face_id() < rhs.face_id();
+ }
+
+
+ template <unsigned D>
+ inline
+ std::ostream&
+ operator<<(std::ostream& ostr, const algebraic_face<D>& f)
+ {
+ return
+ ostr << "(cplx = " << f.cplx().addr() << ", dim = " << f.n()
+ << ", id = " << f.face_id() << ", sign = " << f.sign()<< ')';
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_FACE_HH
--
1.5.6.5
* mln/topo/algebraic_n_face.hh: New.
---
milena/ChangeLog | 6 +
milena/mln/topo/algebraic_n_face.hh | 262 +++++++++++++++++++++++++++++++++++
2 files changed, 268 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/topo/algebraic_n_face.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6bf9126..57d15fd 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-10-23 Roland Levillain <roland(a)lrde.epita.fr>
+ Add an algebraic (oriented) n-face handle (descriptor).
+
+ * mln/topo/algebraic_n_face.hh: New.
+
+2008-10-23 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix a bug in OFF file saving.
* mln/io/off/save.hh
diff --git a/milena/mln/topo/algebraic_n_face.hh b/milena/mln/topo/algebraic_n_face.hh
new file mode 100644
index 0000000..fbfccf4
--- /dev/null
+++ b/milena/mln/topo/algebraic_n_face.hh
@@ -0,0 +1,262 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_ALGEBRAIC_N_FACE_HH
+# define MLN_TOPO_ALGEBRAIC_N_FACE_HH
+
+/// \file mln/topo/algebraic_n_face.hh
+/// \brief Algebraic n-face of a complex.
+
+#include <mln/topo/n_face.hh>
+
+
+namespace mln
+{
+
+ namespace topo
+ {
+
+ /*-------------------.
+ | Algebraic n-Face. |
+ `-------------------*/
+
+ /// \brief Algebraic \p N-face handle in a complex.
+ ///
+ /// Contrary to an mln::topo::algebraic_face, the dimension of an
+ /// mln::topo::algebraic_n_face is fixed.
+ template <unsigned N, unsigned D>
+ class algebraic_n_face : public n_face<N, D>
+ {
+ typedef n_face<N, D> super_;
+
+ public:
+ /// Build a non-initialized algebraic face handle.
+ algebraic_n_face();
+ /// Build an algebraic face handle from \a complex and \a face_id.
+ algebraic_n_face(complex<D>& complex, unsigned face_id, bool sign);
+ /// Build an algebraic face handle from an mln::n_face.
+ algebraic_n_face(const n_face<N, D>& f, bool sign);
+
+ /// Accessors.
+ /// \{
+ /// Return the sign of this face.
+ bool sign() const;
+ /// Set the sign of this face.
+ void set_sign(bool sign);
+ /// \}
+
+ private:
+ bool sign_;
+ };
+
+
+ /// Create an algebraic \p N-face handle of a \p D-complex.
+ template <unsigned N, unsigned D>
+ algebraic_n_face<N, D>
+ make_algebraic_n_face(const n_face<N, D>& f, bool sign);
+
+
+ /// Inversion operators.
+ /// \{
+ template <unsigned N, unsigned D>
+ algebraic_n_face<N, D>
+ operator-(const n_face<N, D>& f);
+
+ template <unsigned N, unsigned D>
+ algebraic_n_face<N, D>
+ operator-(const algebraic_n_face<N, D>& f);
+ /// \}
+
+
+ /// Comparison of two instances of mln::topo::algebraic_n_face.
+ /// \{
+
+ /// \brief Is \a lhs equal to \a rhs?
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned N, unsigned D>
+ bool
+ operator==(const algebraic_n_face<N, D>& lhs,
+ const algebraic_n_face<N, D>& rhs);
+
+ /// \brief Is \a lhs different from \a rhs?
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned N, unsigned D>
+ bool
+ operator!=(const algebraic_n_face<N, D>& lhs,
+ const algebraic_n_face<N, D>& rhs);
+
+ /// \brief Is \a lhs ``less'' than \a rhs?
+ ///
+ /// This comparison is required by algorithms sorting algebraic
+ /// face handles.
+ ///
+ /// \pre Arguments \a lhs and \a rhs must belong to the same
+ /// mln::topo::complex.
+ template <unsigned N, unsigned D>
+ bool
+ operator< (const algebraic_n_face<N, D>& lhs,
+ const algebraic_n_face<N, D>& rhs);
+
+ /// \}
+
+
+ /// Print an mln::topo::algebraic_n_face.
+ template <unsigned N, unsigned D>
+ std::ostream&
+ operator<<(std::ostream& ostr, const algebraic_n_face<N, D>& f);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <unsigned N, unsigned D>
+ inline
+ algebraic_n_face<N, D>::algebraic_n_face()
+ : super_(), sign_(true)
+ {
+ // Ensure N is compatible with D.
+ metal::bool_< N <= D >::check();
+ mln_postcondition(!this->is_valid());
+ }
+
+ template <unsigned N, unsigned D>
+ inline
+ algebraic_n_face<N, D>::algebraic_n_face(complex<D>& c, unsigned face_id,
+ bool sign)
+ : super_(c, face_id), sign_(sign)
+ {
+ // Ensure N is compatible with D.
+ metal::bool_< N <= D >::check();
+ }
+
+ template <unsigned N, unsigned D>
+ inline
+ algebraic_n_face<N, D>::algebraic_n_face(const n_face<N, D>& f, bool sign)
+ : super_(f), sign_(sign)
+ {
+ // Ensure N is compatible with D.
+ metal::bool_< N <= D >::check();
+ }
+
+
+ template <unsigned N, unsigned D>
+ inline
+ bool
+ algebraic_n_face<N, D>::sign() const
+ {
+ return sign_;
+ }
+
+ template <unsigned N, unsigned D>
+ inline
+ void
+ algebraic_n_face<N, D>::set_sign(bool sign)
+ {
+ sign_ = sign;
+ }
+
+
+ template <unsigned N, unsigned D>
+ algebraic_n_face<N, D>
+ make_algebraic_n_face(const n_face<N, D>& f, bool sign)
+ {
+ return algebraic_n_face<N, D>(f, sign);
+ }
+
+
+ template <unsigned N, unsigned D>
+ algebraic_n_face<N, D>
+ operator-(const n_face<N, D>& f)
+ {
+ return algebraic_n_face<N, D>(f, false);
+ }
+
+ template <unsigned N, unsigned D>
+ algebraic_n_face<N, D>
+ operator-(const algebraic_n_face<N, D>& f)
+ {
+ algebraic_n_face<N, D> f2(f);
+ f2.set_sign(!f.sign());
+ return f2;
+ }
+
+
+ template <unsigned N, unsigned D>
+ inline
+ bool
+ operator==(const algebraic_n_face<N, D>& lhs,
+ const algebraic_n_face<N, D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return lhs.face_id() == rhs.face_id() && lhs.sign() == rhs.sign();
+ }
+
+ template <unsigned N, unsigned D>
+ inline
+ bool
+ operator!=(const algebraic_n_face<N, D>& lhs,
+ const algebraic_n_face<N, D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return !(lhs == rhs);
+ }
+
+ template <unsigned N, unsigned D>
+ inline
+ bool
+ operator< (const algebraic_n_face<N, D>& lhs,
+ const algebraic_n_face<N, D>& rhs)
+ {
+ // Ensure LHS and RHS belong to the same complex.
+ mln_precondition(lhs.cplx() == rhs.cplx());
+ return lhs.face_id() < rhs.face_id();
+ }
+
+
+ template <unsigned N, unsigned D>
+ inline
+ std::ostream&
+ operator<<(std::ostream& ostr, const algebraic_n_face<N, D>& f)
+ {
+ return
+ ostr << "(cplx = " << f.cplx().addr() << ", dim = " << f.n()
+ << ", id = " << f.face_id() << ", sign = " << f.sign()<< ')';
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_ALGEBRAIC_N_FACE_HH
--
1.5.6.5
* doc/tutorial/samples/fun-p2b-1.tex,
* doc/tutorial/samples/graph-output-1.tex,
* doc/tutorial/samples/ima2d-display-1.tex,
* doc/tutorial/samples/ima2d-display-2.tex,
* doc/tutorial/samples/parray-display-1.tex,
* doc/tutorial/samples/paste.tex: Fix indentation
* doc/tutorial/samples/dpoint-1-output.tex,
* doc/tutorial/samples/dpoint-1.tex,
* doc/tutorial/samples/win-create-1-display.tex,
* doc/tutorial/samples/win-create-1.tex,
* doc/tutorial/samples/win-create-2.tex: new sample code.
* doc/tutorial/tutorial.tex: Update.
- Start writing section about windows and neighborhoods.
- Write section about dpoints.
- Add a section about the global variables.
---
milena/ChangeLog | 22 ++
milena/doc/tutorial/samples/dpoint-1-output.tex | 1 +
milena/doc/tutorial/samples/dpoint-1.tex | 11 +
milena/doc/tutorial/samples/fun-p2b-1.tex | 2 +-
milena/doc/tutorial/samples/graph-output-1.tex | 4 +-
milena/doc/tutorial/samples/ima2d-display-1.tex | 12 +-
milena/doc/tutorial/samples/ima2d-display-2.tex | 6 +-
milena/doc/tutorial/samples/parray-display-1.tex | 6 +-
milena/doc/tutorial/samples/paste.tex | 6 +-
.../doc/tutorial/samples/win-create-1-display.tex | 3 +
milena/doc/tutorial/samples/win-create-1.tex | 5 +
milena/doc/tutorial/samples/win-create-2.tex | 8 +
milena/doc/tutorial/tutorial.tex | 333 +++++++++++++++++++-
13 files changed, 386 insertions(+), 33 deletions(-)
create mode 100644 milena/doc/tutorial/samples/dpoint-1-output.tex
create mode 100644 milena/doc/tutorial/samples/dpoint-1.tex
create mode 100644 milena/doc/tutorial/samples/win-create-1-display.tex
create mode 100644 milena/doc/tutorial/samples/win-create-1.tex
create mode 100644 milena/doc/tutorial/samples/win-create-2.tex
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 4aca6f2..524fd7c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,25 @@
+2008-10-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update tutorial.
+
+ * doc/tutorial/samples/fun-p2b-1.tex,
+ * doc/tutorial/samples/graph-output-1.tex,
+ * doc/tutorial/samples/ima2d-display-1.tex,
+ * doc/tutorial/samples/ima2d-display-2.tex,
+ * doc/tutorial/samples/parray-display-1.tex,
+ * doc/tutorial/samples/paste.tex: Fix indentation
+
+ * doc/tutorial/samples/dpoint-1-output.tex,
+ * doc/tutorial/samples/dpoint-1.tex,
+ * doc/tutorial/samples/win-create-1-display.tex,
+ * doc/tutorial/samples/win-create-1.tex,
+ * doc/tutorial/samples/win-create-2.tex: new sample code.
+
+ * doc/tutorial/tutorial.tex: Update.
+ - Start writing section about windows and neighborhoods.
+ - Write section about dpoints.
+ - Add a section about the global variables.
+
2008-10-23 Nicolas Ballas <ballas(a)lrde.epita.fr>
Make extension images and cast image work with fill_with_value routine.
diff --git a/milena/doc/tutorial/samples/dpoint-1-output.tex b/milena/doc/tutorial/samples/dpoint-1-output.tex
new file mode 100644
index 0000000..8982f0f
--- /dev/null
+++ b/milena/doc/tutorial/samples/dpoint-1-output.tex
@@ -0,0 +1 @@
+(0, 1)
diff --git a/milena/doc/tutorial/samples/dpoint-1.tex b/milena/doc/tutorial/samples/dpoint-1.tex
new file mode 100644
index 0000000..65b2628
--- /dev/null
+++ b/milena/doc/tutorial/samples/dpoint-1.tex
@@ -0,0 +1,11 @@
+#include <mln/core/alias/point2d.hh>
+#include <mln/core/alias/dpoint2d.hh>
+int main()
+{
+ using namespace mln;
+
+ dpoint2d dp(-1,0);
+ point2d p(1,1);
+
+ std::cout << p + dp << std::endl;
+}
diff --git a/milena/doc/tutorial/samples/fun-p2b-1.tex b/milena/doc/tutorial/samples/fun-p2b-1.tex
index a43ca77..0354bcb 100644
--- a/milena/doc/tutorial/samples/fun-p2b-1.tex
+++ b/milena/doc/tutorial/samples/fun-p2b-1.tex
@@ -1,4 +1,4 @@
bool row_oddity(mln::point2d p)
{
-return p.row() % 2;
+ return p.row() % 2;
}
diff --git a/milena/doc/tutorial/samples/graph-output-1.tex b/milena/doc/tutorial/samples/graph-output-1.tex
index d3bf445..4647780 100644
--- a/milena/doc/tutorial/samples/graph-output-1.tex
+++ b/milena/doc/tutorial/samples/graph-output-1.tex
@@ -1,5 +1,5 @@
-0 1 2 3 4
-.-----------
+ 0 1 2 3 4
+ .-----------
0 | 0 2
1 | \ / |
2 | 1 |
diff --git a/milena/doc/tutorial/samples/ima2d-display-1.tex b/milena/doc/tutorial/samples/ima2d-display-1.tex
index 3929a1b..56c17da 100644
--- a/milena/doc/tutorial/samples/ima2d-display-1.tex
+++ b/milena/doc/tutorial/samples/ima2d-display-1.tex
@@ -1,7 +1,7 @@
-c 0 1 2 3
+ c 0 1 2 3
r
-+-+-+-+-+
-0 | |x| | |
-+-+-+-+-+
-1 | | | | |
-+-+-+-+-+
+ +-+-+-+-+
+0 | |x| | |
+ +-+-+-+-+
+1 | | | | |
+ +-+-+-+-+
diff --git a/milena/doc/tutorial/samples/ima2d-display-2.tex b/milena/doc/tutorial/samples/ima2d-display-2.tex
index cd5144f..ce18cb0 100644
--- a/milena/doc/tutorial/samples/ima2d-display-2.tex
+++ b/milena/doc/tutorial/samples/ima2d-display-2.tex
@@ -1,7 +1,7 @@
c 6 7 8 9
r
-+-+-+-+
+ +-+-+-+
3 | |x| |
-+-+-+-+-+
+ +-+-+-+-+
4 | | |
-+-+-+
+ +-+-+
diff --git a/milena/doc/tutorial/samples/parray-display-1.tex b/milena/doc/tutorial/samples/parray-display-1.tex
index 2003777..734594b 100644
--- a/milena/doc/tutorial/samples/parray-display-1.tex
+++ b/milena/doc/tutorial/samples/parray-display-1.tex
@@ -1,4 +1,4 @@
arr[] = 0 1 2 3 4
-+-+-+-+-+-+
-| |x| | | |
-+-+-+-+-+-+
+ +-+-+-+-+-+
+ | |x| | | |
+ +-+-+-+-+-+
diff --git a/milena/doc/tutorial/samples/paste.tex b/milena/doc/tutorial/samples/paste.tex
index cf1bcf3..327b226 100644
--- a/milena/doc/tutorial/samples/paste.tex
+++ b/milena/doc/tutorial/samples/paste.tex
@@ -1,7 +1,7 @@
template <typename I, typename J>
void paste(const I& data, J& dest)
{
-mln_piter(I) p(data.domain());
-for_all(p)
-dest(p) = data(p);
+ mln_piter(I) p(data.domain());
+ for_all(p)
+ dest(p) = data(p);
}
diff --git a/milena/doc/tutorial/samples/win-create-1-display.tex b/milena/doc/tutorial/samples/win-create-1-display.tex
new file mode 100644
index 0000000..028b663
--- /dev/null
+++ b/milena/doc/tutorial/samples/win-create-1-display.tex
@@ -0,0 +1,3 @@
+o -
+o X
+o -
diff --git a/milena/doc/tutorial/samples/win-create-1.tex b/milena/doc/tutorial/samples/win-create-1.tex
new file mode 100644
index 0000000..9e86ffb
--- /dev/null
+++ b/milena/doc/tutorial/samples/win-create-1.tex
@@ -0,0 +1,5 @@
+window2d win;
+win.insert(-1, 0)
+win.insert(0, -1)
+win.insert(-1,-1);
+
diff --git a/milena/doc/tutorial/samples/win-create-2.tex b/milena/doc/tutorial/samples/win-create-2.tex
new file mode 100644
index 0000000..a76e9c2
--- /dev/null
+++ b/milena/doc/tutorial/samples/win-create-2.tex
@@ -0,0 +1,8 @@
+bool b[9] = { 1, 0, 0,
+ 1, 0, 0,
+ 1, 0, 0 };
+bool b2[3][3] = { { 1, 0, 0 },
+ { 1, 0, 0 },
+ { 1, 0, 0 } };
+window2d win = convert::to<window2d>(b)
+window2d win2 = convert::to<window2d>(b2);
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index d91f56f..d6a9226 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -48,25 +48,147 @@ showstringspaces=false,linewidth=14cm}
\backslash page #1 #2%
\backslash htmlonly%
}
+
+% #1 : section name
+% #2 : section title
\newcommand{\doxysection}[2]{%
\label{#1}
\backslash endhtmlonly%
\backslash section #1 #2%
\backslash htmlonly%
}
+\newcommand{\doxysubsection}[2]{%
+\label{#1}
+\backslash endhtmlonly%
+\backslash subsection #1 #2%
+\backslash htmlonly%
+}
+
\newcommand{\doxycode}[1]{
\backslash endhtmlonly%
\backslash include #1.tex%
\backslash htmlonly%
}
+\newenvironment{doxymath}
+{
+%\backslash endhtmlonly%
+%\backslash f\$
+%\begin{rawtext}
+$$
+}
+{
+$$
+%\end{rawtext}
+%\backslash f\$
+%\backslash htmlonly%
+}
+
%\begin{latexonly}
\renewcommand{\doxychapter}[2]{\chapter{#2}\label{#1}}
\renewcommand{\doxysection}[2]{\section{#2}\label{#1}}
+\renewcommand{\doxysubsection}[2]{\subsection{#2}\label{#1}}
\renewcommand{\doxycode}[1]{\lstinputlisting[frame=single]{samples/#1}}
+\renewenvironment{doxymath}
+{
+ $$
+}
+{
+ $$
+}
+
%\end{latexonly}
+\usetikzlibrary{er}
+\newcommand{\neighcfour}{%
+\begin{latexonly}
+\begin{tikzpicture}%
+ \tikzstyle{every entity}=[draw=blue!50,fill=blue!20,thick]%
+ %center
+ \draw (0,0) node[fill=orange!20,draw=orange] {} ;
+ %left
+ \draw (-0.25,0) node[entity,draw] {};
+ %right
+ \draw (0.26,0) node[entity,draw] {};%
+ %top
+ \draw (0,0.25) node[entity,draw] {};%
+ %bottom
+ \draw (0,-0.25) node[entity,draw] {};%
+\end{tikzpicture}%
+\end{latexonly}
+}
+
+\newcommand{\neighceight}{%
+\begin{latexonly}
+\begin{tikzpicture}%
+ \tikzstyle{every entity}=[draw=blue!50,fill=blue!20,thick]%
+ %center
+ \draw (0,0) node[fill=orange!20,draw=orange] {} ;
+ %left
+ \draw (-0.25,0) node[entity,draw] {};
+ %right
+ \draw (0.26,0) node[entity,draw] {};%
+ %top
+ \draw (0,0.25) node[entity,draw] {};%
+ %bottom
+ \draw (0,-0.25) node[entity,draw] {};%
+ %Top left
+ \draw (-0.25,0.25) node[entity,draw] {};
+ %Top right
+ \draw (0.26,0.25) node[entity,draw] {};%
+ %Bottom left
+ \draw (-0.25,-0.25) node[entity,draw] {};%
+ %Bottom Right
+ \draw (0.26,-0.25) node[entity,draw] {};%
+\end{tikzpicture}%
+\end{latexonly}
+}
+
+\newcommand{\wincfour}{%
+\begin{latexonly}
+\begin{tikzpicture}%
+ \tikzstyle{every entity}=[draw=blue!50,fill=blue!20,thick]%
+ %center
+ \draw (0,0) node[entity,draw] {} ;
+ %left
+ \draw (-0.25,0) node[entity,draw] {};
+ %right
+ \draw (0.26,0) node[entity,draw] {};%
+ %top
+ \draw (0,0.25) node[entity,draw] {};%
+ %bottom
+ \draw (0,-0.25) node[entity,draw] {};%
+
+\end{tikzpicture}%
+\end{latexonly}
+}
+
+\newcommand{\winceight}{%
+\begin{latexonly}
+\begin{tikzpicture}%
+ \tikzstyle{every entity}=[draw=blue!50,fill=blue!20,thick]%
+ %center
+ \draw (0,0) node[entity,draw] {} ;
+ %left
+ \draw (-0.25,0) node[entity,draw] {};
+ %right
+ \draw (0.26,0) node[entity,draw] {};%
+ %top
+ \draw (0,0.25) node[entity,draw] {};%
+ %bottom
+ \draw (0,-0.25) node[entity,draw] {};%
+ %Top left
+ \draw (-0.25,0.25) node[entity,draw] {};
+ %Top right
+ \draw (0.26,0.25) node[entity,draw] {};%
+ %Bottom left
+ \draw (-0.25,-0.25) node[entity,draw] {};%
+ %Bottom Right
+ \draw (0.26,-0.25) node[entity,draw] {};%
+\end{tikzpicture}%
+\end{latexonly}
+}
\begin{document}
@@ -85,6 +207,7 @@ showstringspaces=false,linewidth=14cm}
- \backslash subpage graphandima
- \backslash subpage arithmops
- \backslash subpage mathtools
+- \backslash subpage globalvars
\backslash htmlonly
\end{htmlonly}
@@ -206,6 +329,18 @@ means we have the following equivalence:
The site does not store any value but refer to an area where we will be able
to read its value.
+Sites may have a different types, depending on the image type:
+
+\begin{tabular}{l|l}
+Name & Description \\
+\hline
+point2d & 2D point on a regular grid \\
+point & Generic point ($n-D$) on a regular grid \\
+util::vec & Algebraic vector \\
+util::vertex & Graph vertex \\
+util::edge & Graph edge \\
+\end{tabular}
+
[Illustration : grille + intersection + pmin() + pmax() + distance entre 2
points en x et en y = 1]\\
@@ -311,19 +446,38 @@ constant time retrieval.
\doxysection{definition}{Definition}
An image is composed both of:
\begin{itemize}
-\item A function $$
+\item A function
+\begin{doxymath}
ima : \left\{
\begin{array}{lll}
Site &\rightarrow & Value \\
p & \mapsto & ima(p)
\end{array}
\right.
-$$
+\end{doxymath}
\item A site set, also called the "domain".
\end{itemize}
%**************************
-\doxysection{imavalues}{Possible value types}
+\doxysection{imatypes}{Possible image types}
+
+Here is a short list of the main/usual image types you may want to use with
+Olena: \\
+\bigskip
+
+\begin{tabular}{l|l}
+Name & Description \\
+\hline
+image1d & 1D image \\
+image2d & 2D image \\
+image3d & 3D image \\
+flat\_image & Constant value image \\
+image\_if & Image defined by a function \\
+FIXME & FIXME \\
+\end{tabular}
+
+%**************************
+\doxysection{imapossvalues}{Possible value types}
Every image type must take its type of value as parameter.
The value type can be one of the builtins one:
@@ -370,7 +524,7 @@ rgb8.hh.
%----------------
-\subsection{About value, rvalue and lvalue}
+\doxysubsection{imavalues}{About value, rvalue and lvalue}
Since the values are of a specific type, it exists a set of all the possible
site values. This set is called "destination" set. It may be iterable and
@@ -632,7 +786,7 @@ case will be detailed further in section \ref{iterators}.
-%================================================
+s%================================================
\doxysection{imasize}{Image size}
Most typical image types owns special methods to retrieve the image size.
@@ -661,13 +815,128 @@ Output:
%====================================
\clearpage
\newpage
-\doxychapter{winneigh}{Window and neighborhood}
+\doxychapter{winneigh}{Structural elements: Window and neighborhood}
-%**************************
-\doxysection{winfixme}{FIXME}
-FIXME
+In Olena, there are both the window and neighborhood concept. A window can be
+defined on any sites around a central site which may also be included.
+A neighborhood is more restrictive and must not include the central site.
+Therefore these two concepts are really similar and are detailed together in
+this section.
-\doxycode{ima2d-display-1}
+By default, structural elements are centered. The central site is located at the
+origin of the grid: ``literal::origin''. With image2d, the central site is
+(0,0).
+
+
+\doxysection{sedef}{Define an element}
+
+\doxysubsection{winwin}{Window}
+
+\subsubsection*{Generic Predefined windows}
+
+\begin{tabular}{l|l|l}
+Name & Description & Representation \\
+\hline
+win\_c4p & 4-connectivity & \wincfour \\
+win\_c8p & 8-connectivity & \winceight \\
+\end{tabular}
+%
+\bigskip
+%
+
+\subsubsection*{1D Predefined windows}
+
+\begin{tabular}{l|l|l}
+Name & Description & Representation \\
+\hline
+segment1d & 1D segment & - \\
+\end{tabular}
+%
+\bigskip
+%
+
+\subsubsection*{2D Predefined windows}
+
+\begin{tabular}{l|l|l}
+Name & Description & Representation \\
+\hline
+backdiag2d & Back diagonal & - \\
+diag2d & 2D diagonal & - \\
+disk2d & 2D disk & - \\
+hline2d & 2D horizontal line & - \\
+octagon2d & 2D octogon & - \\
+rectangle2d & 2D rectangle & - \\
+vline2d & 2D vertical line & - \\
+\end{tabular}
+%
+\bigskip
+%
+
+\subsubsection*{3D Predefined windows}
+
+\begin{tabular}{l|l|l}
+Name & Description & Representation \\
+\hline
+cube3d & 3D Cube & - \\
+cuboid3d & Cuboid & - \\
+\end{tabular}
+
+These predefined windows can be passed directly to a function. The headers are
+located in mln/core/alias/window*.hh.
+
+
+
+\doxysubsection{neighborhood}{Neighborhood}
+
+Predefined neighborhood:\\
+
+\begin{tabular}{l|l|l}
+Name & Description & Representation \\
+\hline
+c4 & 4-connectivity & \neighcfour \\
+c8 & 8-connectivity & \neighceight \\
+\end{tabular}
+
+These predefined neighborhood can be passed directly to a function. The headers are
+located in mln/core/alias/neigh*.hh.
+
+Use case example:
+\doxycode{ima2d-decl-2-blobs}
+
+\doxysubsection{customse}{Custom structural elements}
+
+\subsubsection{Windows}
+
+There are several ways to define a new window.
+The first and the most common way is to declare a window variable and insert
+dpoints:
+\doxycode{win-create-1}
+This code creates the following window where ``X'' is the central point from
+which the window is computed:
+\doxycode{win-create-1-display}
+
+Another way to define the same window is to provide a bool array:
+\doxycode{win-create-2}
+
+Note that ``win'' == ``win2''.
+The boolean array must always have an odd size.
+While creating a windows thanks to a bool array/matrix, the window's center is the
+central site of the array/matrix.
+
+
+\subsubsection{Neighborhood}
+
+
+\doxysubsection{sitedepse}{Site dependent structural elements}
+
+\doxysubsection{convneighwin}{Conversion between Neighborhoods and Windows}
+
+Windows are not convertible to a Neighborhood.
+Neighborhood are convertible to a window though.
+
+A neighborhood has a method ``win()'' which returns the definition window.
+Be ware that this window is not centered, thus does not include the central
+point.
@@ -767,14 +1036,24 @@ owns the method "coord row() const" which is defined as
"return exact(this)-$>$to\_site().row()"
%**************************
-\doxysection{sitesdpoint}{Need for dpoint}
-//FIXME
+\doxysection{sitesdpoint}{Dpoint}
+Dpoints are relative sites. They are usually used in window and neighborhood
+definitions. Since the central site is not constant, windows and neighborhoods
+must be recomputed and dpoints help in doing that.
+
+\doxycode{dpoint-1}
+Output:
+\doxycode{dpoint-1-output}
%====================================
\clearpage
\newpage
+%Ugly workaround to avoid missing chapter references in doxygen.
+\begin{htmlonly}
+\doxychapter{1}{}
+\end{htmlonly}
\doxychapter{iterators}{Iterators}
Each container object in Olena like site sets or images have iterators.
@@ -1009,7 +1288,7 @@ image. \\
level::compute() & compute an accumulator on the values of an image. \\
\end{tabular}
-\subsection{Accumulators}
+\doxysubsection{accu}{Accumulators}
An accumulator is a special object accumulating data while iterating all over
the image values or sites. Hereby follows a list of accumulators available in
Olena.
@@ -1074,7 +1353,7 @@ You cannot write:
Instead, you must write:
\doxycode{accu-right-instanciation}
-\subsection{Example with labeling::compute()}
+\doxysubsection{exlblcompute}{Example with labeling::compute()}
In this example we will try to retrieve the bounding box of each component in an
image.
@@ -1100,8 +1379,8 @@ set the background to 0, we will want to iterate from 1 to nlabels included.
Output:
\doxycode{labeling-compute-result-output}
-\subsection{Routines based on accumulators and *::compute()}
+\subsection{Routines based on accumulators and *::compute()}
In order to make the code cleaner, small routines are available for the
most used accumulators.
@@ -1218,6 +1497,8 @@ site set.
%====================================
\newpage
\clearpage
+%Ugly workaround to avoid missing chapter references in doxygen.
+\doxychapter{2}{}
\doxychapter{graphandima}{Graphes and images}
FIXME: REWRITE
@@ -1393,4 +1674,26 @@ FIXME write it
FIXME write it
+%====================================
+\newpage
+\clearpage
+\doxychapter{globalvars}{Useful global variables}
+
+\begin{tabular}{l|p{8cm}|l}
+\hline
+Name & Description & Possible values \\
+\hline
+literal::zero & Generic zero value. Can be used with various types such as
+util::vec, dpoint\dots & n.a.\\
+& & \\
+literal::one & Generic one value. Can be used with various types such as
+util::vec, dpoint\dots & n.a.\\
+& & \\
+literal::origin & Generic value for the origin point on a grid.& n.a.\\
+& & \\
+border::thickness & Set the default border thickness of images & $[0-UINT_MAX]$\\
+& & \\
+trace::quiet & Enable trace printing & true/false \\
+\end{tabular}
+
\end{document}
--
1.5.6.5