* mln/core/internal/site_set_iterator_base.hh
* mln/core/internal/site_relative_iterator_base.hh:
Do it.
---
milena/ChangeLog | 8 ++++++++
.../core/internal/site_relative_iterator_base.hh | 7 ++++---
milena/mln/core/internal/site_set_iterator_base.hh | 3 +++
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 18f27e1..f8750e4 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Update the Doxygen documentation of iterator internal classes.
+
+ * mln/core/internal/site_set_iterator_base.hh
+ * mln/core/internal/site_relative_iterator_base.hh:
+ Do it.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Update the Doxygen documentation of site set internal classes.
* mln/core/internal/site_set_base.hh: Do it.
diff --git a/milena/mln/core/internal/site_relative_iterator_base.hh b/milena/mln/core/internal/site_relative_iterator_base.hh
index f9b582f..b488ee7 100644
--- a/milena/mln/core/internal/site_relative_iterator_base.hh
+++ b/milena/mln/core/internal/site_relative_iterator_base.hh
@@ -49,14 +49,15 @@ namespace mln
namespace internal
{
- /*! \brief A generic forward iterator on points of windows and of
+ /*! \brief A generic iterator on points of windows and of
* neighborhoods.
*
* Parameter \c S is the targeted "site set definition" type. It
* can be either a Window, or a Neighborhood.
*
- * IMPORTANT: Sub-classes have to define do_start_, do_next_, and
- * compute_p_. They shall define NEITHER start_ NOR next_.
+ * IMPORTANT: Sub-classes have to define do_start_, do_next_,
+ * is_valid_, invalidate_ and compute_p_. They shall define
+ * NEITHER start_ NOR next_.
*/
template <typename S, typename E>
class site_relative_iterator_base : public site_iterator_base< S, E >
diff --git a/milena/mln/core/internal/site_set_iterator_base.hh b/milena/mln/core/internal/site_set_iterator_base.hh
index 376e5d6..6b76994 100644
--- a/milena/mln/core/internal/site_set_iterator_base.hh
+++ b/milena/mln/core/internal/site_set_iterator_base.hh
@@ -46,6 +46,9 @@ namespace mln
/*! \internal A base class for site iterators.
*
* Parameter \c S is the targeted site set type.
+ *
+ * IMPORTANT: Sub-classes have to define start_, next_,
+ * is_valid_ and invalidate_.
*/
template <typename S, typename E>
class site_set_iterator_base : public site_iterator_base<S, E>
--
1.6.0.1
* mln/core/internal/site_set_base.hh: Do it.
---
milena/ChangeLog | 6 ++++++
milena/mln/core/internal/site_set_base.hh | 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index a98db9a..18f27e1 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Update the Doxygen documentation of site set internal classes.
+
+ * mln/core/internal/site_set_base.hh: Do it.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Update line graph image.
* mln/core/image/line_graph_image.hh
diff --git a/milena/mln/core/internal/site_set_base.hh b/milena/mln/core/internal/site_set_base.hh
index 42c0199..de2eaeb 100644
--- a/milena/mln/core/internal/site_set_base.hh
+++ b/milena/mln/core/internal/site_set_base.hh
@@ -46,7 +46,11 @@ namespace mln
/*! \internal A base class for site set classes.
- * \p P is a psite type.
+ *
+ * \arg \p P The psite type of what is ``contained'' in the site
+ * set, not the psite of the site set (which is
+ * different, and defined by the site set itself).
+ * \arg \p E The exact type of the site set.
*/
template <typename P, typename E>
struct site_set_base_ : public Site_Set<E>
--
1.6.0.1
* mln/core/image/line_graph_elt_neighborhood.hh,
* mln/core/image/line_graph_elt_window.hh
(mln::line_graph_elt_neighborhood<P>::site)
(mln::line_graph_elt_window<P>::site):
Deduce these typedefs from their respective psites.
(mln::line_graph_elt_neighborhood<P>::compute_sites_)
(mln::line_graph_elt_window<P>::compute_sites_):
Adjust to the new psite interface.
s/pref()/center()/.
s/plg()/center().site_set()/.
---
milena/ChangeLog | 15 +++++++++++++++
.../mln/core/image/line_graph_elt_neighborhood.hh | 19 ++++++++++---------
milena/mln/core/image/line_graph_elt_window.hh | 16 +++++++++-------
3 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 763076d..f41074f 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,20 @@
2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Update line graph elementary neighborhood and window.
+
+ * mln/core/image/line_graph_elt_neighborhood.hh,
+ * mln/core/image/line_graph_elt_window.hh
+ (mln::line_graph_elt_neighborhood<P>::site)
+ (mln::line_graph_elt_window<P>::site):
+ Deduce these typedefs from their respective psites.
+ (mln::line_graph_elt_neighborhood<P>::compute_sites_)
+ (mln::line_graph_elt_window<P>::compute_sites_):
+ Adjust to the new psite interface.
+ s/pref()/center()/.
+ s/plg()/center().site_set()/.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a site_set accessor on site_relative_iterator_base.
* mln/core/internal/site_relative_iterator_base.hh
diff --git a/milena/mln/core/image/line_graph_elt_neighborhood.hh b/milena/mln/core/image/line_graph_elt_neighborhood.hh
index 80dc0f3..38b7d8f 100644
--- a/milena/mln/core/image/line_graph_elt_neighborhood.hh
+++ b/milena/mln/core/image/line_graph_elt_neighborhood.hh
@@ -38,7 +38,9 @@
- mln::graph_elt_window
- mln::graph_elt_neighborhood
- mln::line_graph_elt_window
- - mln::line_graph_elt_neighborhood. */
+ - mln::line_graph_elt_neighborhood.
+
+ See https://trac.lrde.org/olena/ticket/139. */
/* FIXME: Due to the poor interface of mln::p_line_graph and
mln::util::graph, we show to much implementation details here.
@@ -70,10 +72,10 @@ namespace mln
public:
/// Associated types.
/// \{
- /// The type of site corresponding to the neighborhood.
- typedef P site;
/// The type of psite corresponding to the neighborhood.
typedef line_graph_psite<P> psite;
+ /// The type of site corresponding to the neighborhood.
+ typedef mln_site(psite) site;
// The type of the set of neighbors (edge ids adjacent to the
// reference psite).
typedef std::set<util::edge_id> sites_t;
@@ -98,7 +100,6 @@ namespace mln
window to_window() const;
/// \}
-
/// Services for iterators.
/// \{
/// Compute the set of sites for this neighborhood around \a piter.
@@ -126,15 +127,15 @@ namespace mln
line_graph_elt_neighborhood<P>::compute_sites_(Site_Iterator<Piter>& piter_) const
{
Piter& piter = exact(piter_);
- util::edge_id ref_edge_id = piter.p_ref().id();
+ util::edge_id ref_edge_id = piter.center().edge_id();
sites_t& sites = piter.sites();
sites.clear();
/* FIXME: Move this computation out of the neighborhood. In fact,
this should be a service of the graph, also proposed by the
p_line_graph. */
// Ajacent edges connected through vertex 1.
- util::vertex_id id1 = piter.p_ref().first_id();
- const util::vertex<P>& vertex1 = piter.plg().gr_->vertex(id1);
+ util::vertex_id id1 = piter.center().first_id();
+ const util::vertex<P>& vertex1 = piter.center().site_set().gr_->vertex(id1);
for (std::vector<util::edge_id>::const_iterator e =
vertex1.edges.begin(); e != vertex1.edges.end(); ++e)
// We explicitly enforce that the reference piter edge id is
@@ -142,8 +143,8 @@ namespace mln
if (*e != ref_edge_id)
sites.insert(*e);
// Ajacent edges connected through vertex 2.
- util::vertex_id id2 = piter.p_ref().second_id();
- const util::vertex<P>& vertex2 = piter.plg().gr_->vertex(id2);
+ util::vertex_id id2 = piter.center().second_id();
+ const util::vertex<P>& vertex2 = piter.center().site_set().gr_->vertex(id2);
for (std::vector<util::edge_id>::const_iterator e =
vertex2.edges.begin(); e != vertex2.edges.end(); ++e)
// Same remark as above.
diff --git a/milena/mln/core/image/line_graph_elt_window.hh b/milena/mln/core/image/line_graph_elt_window.hh
index 04bc542..8649372 100644
--- a/milena/mln/core/image/line_graph_elt_window.hh
+++ b/milena/mln/core/image/line_graph_elt_window.hh
@@ -38,7 +38,9 @@
- mln::graph_elt_window
- mln::graph_elt_neighborhood
- mln::line_graph_elt_window
- - mln::line_graph_elt_neighborhood. */
+ - mln::line_graph_elt_neighborhood.
+
+ See https://trac.lrde.org/olena/ticket/139. */
/* FIXME: Due to the poor interface of mln::p_line_graph and
mln::util::graph, we show to much implementation details here.
@@ -65,10 +67,10 @@ namespace mln
public:
/// Associated types.
/// \{
- /// The type of site corresponding to the window.
- typedef P site;
/// The type of psite corresponding to the window.
typedef line_graph_psite<P> psite;
+ /// The type of site corresponding to the window.
+ typedef mln_site(psite) site;
// The type of the set of window sites (edge ids adjacent to the
// reference psite).
typedef std::set<util::edge_id> sites_t;
@@ -142,14 +144,14 @@ namespace mln
id) itself into SITES, since it is part of the set of edges
adjacent to VERTEX1 and VERTEX2, and will therefore be
automatically added. */
- util::vertex_id id1 = piter.p_ref().first_id();
- const util::vertex<P>& vertex1 = piter.plg().gr_->vertex(id1);
+ util::vertex_id id1 = piter.center().first_id();
+ const util::vertex<P>& vertex1 = piter.center().site_set().gr_->vertex(id1);
for (std::vector<util::edge_id>::const_iterator e =
vertex1.edges.begin(); e != vertex1.edges.end(); ++e)
sites.insert(*e);
// Ajacent edges connected through vertex 2.
- util::vertex_id id2 = piter.p_ref().second_id();
- const util::vertex<P>& vertex2 = piter.plg().gr_->vertex(id2);
+ util::vertex_id id2 = piter.center().second_id();
+ const util::vertex<P>& vertex2 = piter.center().site_set().gr_->vertex(id2);
for (std::vector<util::edge_id>::const_iterator e =
vertex2.edges.begin(); e != vertex2.edges.end(); ++e)
sites.insert(*e);
--
1.6.0.1
* mln/core/internal/site_relative_iterator_base.hh
(mln::internal::site_relative_iterator_base<S, E>::site_set):
New method.
---
milena/ChangeLog | 8 ++++++++
.../core/internal/site_relative_iterator_base.hh | 15 ++++++++++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 75826ef..763076d 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a site_set accessor on site_relative_iterator_base.
+
+ * mln/core/internal/site_relative_iterator_base.hh
+ (mln::internal::site_relative_iterator_base<S, E>::site_set):
+ New method.
+
+2008-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Update line graph psite set iterators.
* mln/core/site_set/p_line_graph_piter.hh
diff --git a/milena/mln/core/internal/site_relative_iterator_base.hh b/milena/mln/core/internal/site_relative_iterator_base.hh
index ea30c22..f9b582f 100644
--- a/milena/mln/core/internal/site_relative_iterator_base.hh
+++ b/milena/mln/core/internal/site_relative_iterator_base.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// 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
@@ -75,6 +75,10 @@ namespace mln
/// Go to the next point.
void next_();
+ /// Give the site set (neighborhood or window) that this
+ /// iterator browses.
+ const S& site_set() const;
+
/// The psite around which this iterator moves.
const mln_psite(S)& center() const;
@@ -172,6 +176,15 @@ namespace mln
template <typename S, typename E>
inline
+ const S&
+ site_relative_iterator_base<S, E>::site_set() const
+ {
+ mln_precondition(this->s_ != 0);
+ return *this->s_;
+ }
+
+ template <typename S, typename E>
+ inline
const mln_psite(S)&
site_relative_iterator_base<S,E>::subj_()
{
--
1.6.0.1