* mln/core/image/complex_neighborhoods.hh: New.
Replace...
* mln/core/image/complex_lower_neighborhood.hh,
* mln/core/image/complex_higher_neighborhood.hh,
* mln/core/image/complex_lower_higher_neighborhood.hh:
...these files.
Remove.
* tests/core/image/complex_image.cc: Adjust.
---
milena/ChangeLog | 13 +++++
.../mln/core/image/complex_higher_neighborhood.hh | 53 --------------------
.../mln/core/image/complex_lower_neighborhood.hh | 53 --------------------
...er_neighborhood.hh => complex_neighborhoods.hh} | 38 ++++++++++++--
milena/tests/core/image/complex_image.cc | 10 ++--
5 files changed, 49 insertions(+), 118 deletions(-)
delete mode 100644 milena/mln/core/image/complex_higher_neighborhood.hh
delete mode 100644 milena/mln/core/image/complex_lower_neighborhood.hh
rename milena/mln/core/image/{complex_lower_higher_neighborhood.hh => complex_neighborhoods.hh} (60%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index aa31232..28c9b28 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,18 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Factor neighborhoods of complex images.
+
+ * mln/core/image/complex_neighborhoods.hh: New.
+ Replace...
+ * mln/core/image/complex_lower_neighborhood.hh,
+ * mln/core/image/complex_higher_neighborhood.hh,
+ * mln/core/image/complex_lower_higher_neighborhood.hh:
+ ...these files.
+ Remove.
+ * tests/core/image/complex_image.cc: Adjust.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix and factor windows of complex images.
* mln/core/image/complex_windows.hh: New.
diff --git a/milena/mln/core/image/complex_higher_neighborhood.hh b/milena/mln/core/image/complex_higher_neighborhood.hh
deleted file mode 100644
index d68051a..0000000
--- a/milena/mln/core/image/complex_higher_neighborhood.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// 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.
-
-#ifndef MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
-# define MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
-
-/// \file mln/core/image/complex_higher_neighborhood.hh
-/// \brief A neighborhood centered on a n-face of complex returning its
-/// adjacent (n+1)-faces.
-
-# include <mln/core/internal/complex_neighborhood_base.hh>
-# include <mln/topo/adj_higher_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_higher_neighborhood
- : internal::complex_neighborhood_base< D, G,
- topo::adj_higher_face_fwd_iter<D>,
- topo::adj_higher_face_bkd_iter<D>,
- complex_higher_neighborhood<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
diff --git a/milena/mln/core/image/complex_lower_neighborhood.hh b/milena/mln/core/image/complex_lower_neighborhood.hh
deleted file mode 100644
index c7fc882..0000000
--- a/milena/mln/core/image/complex_lower_neighborhood.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// 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.
-
-#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
-
-/// \file mln/core/image/complex_lower_neighborhood.hh
-/// \brief A neighborhood centered on a n-face of complex returning its
-/// adjacent (n-1)-faces.
-
-# include <mln/core/internal/complex_neighborhood_base.hh>
-# include <mln/topo/adj_lower_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_lower_neighborhood
- : internal::complex_neighborhood_base< D, G,
- topo::adj_lower_face_fwd_iter<D>,
- topo::adj_lower_face_bkd_iter<D>,
- complex_lower_neighborhood<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
diff --git a/milena/mln/core/image/complex_lower_higher_neighborhood.hh b/milena/mln/core/image/complex_neighborhoods.hh
similarity index 60%
rename from milena/mln/core/image/complex_lower_higher_neighborhood.hh
rename to milena/mln/core/image/complex_neighborhoods.hh
index 593982d..174f263 100644
--- a/milena/mln/core/image/complex_lower_higher_neighborhood.hh
+++ b/milena/mln/core/image/complex_neighborhoods.hh
@@ -25,20 +25,46 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+#ifndef MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
+# define MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
-/// \file mln/core/image/complex_lower_higher_neighborhood.hh
-/// \brief A neighborhood centered on a n-face of complex returning its
-/// adjacent (n-1)-faces and (n+1)-faces.
+/// \file mln/core/image/complex_neighborhoods.hh
+/// \brief Definitions of some neighborhoods of complex images.
# include <mln/core/internal/complex_neighborhood_base.hh>
+
+# include <mln/topo/adj_lower_face_iter.hh>
+# include <mln/topo/adj_higher_face_iter.hh>
# include <mln/topo/adj_lower_higher_face_iter.hh>
namespace mln
{
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// its adjacent (n-1)-faces.
+ template <unsigned D, typename G>
+ struct complex_lower_neighborhood
+ : internal::complex_neighborhood_base< D, G,
+ topo::adj_lower_face_fwd_iter<D>,
+ topo::adj_lower_face_bkd_iter<D>,
+ complex_lower_neighborhood<D, G> >
+ {
+ };
+
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// its adjacent (n+1)-faces.
+ template <unsigned D, typename G>
+ struct complex_higher_neighborhood
+ : internal::complex_neighborhood_base< D, G,
+ topo::adj_higher_face_fwd_iter<D>,
+ topo::adj_higher_face_bkd_iter<D>,
+ complex_higher_neighborhood<D, G> >
+ {
+ };
+
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// its adjacent (n-1)-faces and (n+1)-faces.
template <unsigned D, typename G>
struct complex_lower_higher_neighborhood
: internal::complex_neighborhood_base<
@@ -52,4 +78,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+#endif // ! MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
diff --git a/milena/tests/core/image/complex_image.cc b/milena/tests/core/image/complex_image.cc
index 4b81713..a2252ad 100644
--- a/milena/tests/core/image/complex_image.cc
+++ b/milena/tests/core/image/complex_image.cc
@@ -37,9 +37,7 @@
#include <mln/core/image/complex_image.hh>
// FIXME: Include these elsewhere? (In complex_image.hh?)
-#include <mln/core/image/complex_lower_neighborhood.hh>
-#include <mln/core/image/complex_higher_neighborhood.hh>
-#include <mln/core/image/complex_lower_higher_neighborhood.hh>
+#include <mln/core/image/complex_neighborhoods.hh>
#include <mln/core/image/complex_neighborhood_piter.hh>
/* FIXME: Split this test (and maybe factor common parts, like the
@@ -215,9 +213,9 @@ int main()
- iterators on N-faces with N in a subset of [0, D];
- etc. */
- // ---------------------------------------- //
- // Iterators on windows and neighborhoods. //
- // ---------------------------------------- //
+ // ---------------------------- //
+ // Iterators on neighborhoods. //
+ // ---------------------------- //
// FIXME: Factor: these three test cases only differ by their
// neighborhoods.
--
1.6.0.1
* mln/core/image/complex_windows.hh: New.
Replace...
* mln/core/image/complex_lower_window_p.hh,
* mln/core/image/complex_higher_window_p.hh,
* mln/core/image/complex_lower_higher_window_p.hh:
...these files.
Remove.
* mln/core/internal/complex_window_p_base.hh: Fix headers
inclusions.
* tests/morpho/complex_image_morpho.cc: Adjust.
---
milena/ChangeLog | 15 +++
milena/mln/core/image/complex_higher_window_p.hh | 53 ---------
.../core/image/complex_lower_higher_window_p.hh | 54 ---------
milena/mln/core/image/complex_lower_window_p.hh | 53 ---------
milena/mln/core/image/complex_windows.hh | 119 ++++++++++++++++++++
milena/mln/core/internal/complex_window_p_base.hh | 3 +-
milena/tests/morpho/complex_image_morpho.cc | 4 +-
7 files changed, 137 insertions(+), 164 deletions(-)
delete mode 100644 milena/mln/core/image/complex_higher_window_p.hh
delete mode 100644 milena/mln/core/image/complex_lower_higher_window_p.hh
delete mode 100644 milena/mln/core/image/complex_lower_window_p.hh
create mode 100644 milena/mln/core/image/complex_windows.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 09d633d..aa31232 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,20 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix and factor windows of complex images.
+
+ * mln/core/image/complex_windows.hh: New.
+ Replace...
+ * mln/core/image/complex_lower_window_p.hh,
+ * mln/core/image/complex_higher_window_p.hh,
+ * mln/core/image/complex_lower_higher_window_p.hh:
+ ...these files.
+ Remove.
+ * mln/core/internal/complex_window_p_base.hh: Fix headers
+ inclusions.
+ * tests/morpho/complex_image_morpho.cc: Adjust.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Factor concrete windows of complex image.
* mln/core/image/complex_lower_window_p.hh,
diff --git a/milena/mln/core/image/complex_higher_window_p.hh b/milena/mln/core/image/complex_higher_window_p.hh
deleted file mode 100644
index cca6871..0000000
--- a/milena/mln/core/image/complex_higher_window_p.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// 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.
-
-#ifndef MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
-# define MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
-
-/// \file mln/core/image/complex_higher_window_p.hh
-/// \brief Definition of a window centered on a n-face of complex
-/// returning its adjacent (n+1)-faces as well as the center n-face.
-
-# include <mln/core/internal/complex_window_p_base.hh>
-# include <mln/topo/adj_higher_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_higher_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_higher_face_fwd_iter<D>,
- topo::adj_higher_face_bkd_iter<D>,
- complex_higher_window_p<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_lower_higher_window_p.hh b/milena/mln/core/image/complex_lower_higher_window_p.hh
deleted file mode 100644
index 7ad62fa..0000000
--- a/milena/mln/core/image/complex_lower_higher_window_p.hh
+++ /dev/null
@@ -1,54 +0,0 @@
-// 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.
-
-#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
-
-/// \file mln/core/image/complex_lower_higher_window_p.hh
-/// \brief Definition of a window centered on a n-face of complex
-/// returning its adjacent (n-1)-faces and (n+1)-faces as well as the
-/// center n-face.
-
-# include <mln/core/internal/complex_window_p_base.hh>
-# include <mln/topo/adj_lower_higher_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_lower_higher_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_lower_higher_face_fwd_iter<D>,
- topo::adj_lower_higher_face_bkd_iter<D>,
- complex_lower_higher_window_p<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_lower_window_p.hh b/milena/mln/core/image/complex_lower_window_p.hh
deleted file mode 100644
index 7bd3cd1..0000000
--- a/milena/mln/core/image/complex_lower_window_p.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// 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.
-
-#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
-
-/// \file mln/core/image/complex_lower_window_p.hh
-/// \brief Definition of a window centered on a n-face of complex
-/// returning its adjacent (n-1)-faces as well as the center n-face.
-
-# include <mln/core/internal/complex_window_p_base.hh>
-# include <mln/topo/adj_lower_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_lower_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_lower_face_fwd_iter<D>,
- topo::adj_lower_face_bkd_iter<D>,
- complex_lower_window_p<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_windows.hh b/milena/mln/core/image/complex_windows.hh
new file mode 100644
index 0000000..662b528
--- /dev/null
+++ b/milena/mln/core/image/complex_windows.hh
@@ -0,0 +1,119 @@
+// 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.
+
+#ifndef MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
+# define MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
+
+/// \file mln/core/image/complex_windows.hh
+/// \brief Definitions of some windows of complex images.
+
+# include <mln/core/internal/complex_window_p_base.hh>
+
+# include <mln/topo/adj_lower_face_iter.hh>
+# include <mln/topo/adj_higher_face_iter.hh>
+# include <mln/topo/adj_lower_higher_face_iter.hh>
+
+
+namespace mln
+{
+
+ /// \brief Window centered on an n-face of complex returning its
+ /// adjacent (n-1)-faces as well as the center n-face.
+ template <unsigned D, typename G>
+ struct complex_lower_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_lower_face_fwd_iter<D>,
+ topo::adj_lower_face_bkd_iter<D>,
+ complex_lower_window_p<D, G> >
+ {
+ };
+
+ /// \brief Window centered on an n-face of complex returning its
+ /// adjacent (n+1)-faces as well as the center n-face.
+ template <unsigned D, typename G>
+ struct complex_higher_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_higher_face_fwd_iter<D>,
+ topo::adj_higher_face_bkd_iter<D>,
+ complex_higher_window_p<D, G> >
+ {
+ };
+
+ /// \brief Window centered on an n-face of complex returning its
+ /// adjacent (n-1)-faces and (n+1)-faces as well as the center
+ /// n-face.
+ template <unsigned D, typename G>
+ struct complex_lower_higher_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_lower_higher_face_fwd_iter<D>,
+ topo::adj_lower_higher_face_bkd_iter<D>,
+ complex_lower_higher_window_p<D, G> >
+ {
+ };
+
+
+ namespace trait
+ {
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_lower_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_lower_face_fwd_iter<D>,
+ mln::topo::adj_lower_face_bkd_iter<D>,
+ mln::complex_lower_window_p<D, G> >
+ >
+ {
+ };
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_higher_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_higher_face_fwd_iter<D>,
+ mln::topo::adj_higher_face_bkd_iter<D>,
+ mln::complex_higher_window_p<D, G> >
+ >
+ {
+ };
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_lower_higher_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_lower_higher_face_fwd_iter<D>,
+ mln::topo::adj_lower_higher_face_bkd_iter<D>,
+ mln::complex_lower_higher_window_p<D, G> >
+ >
+ {
+ };
+
+ } // end of namespace mln::trait
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh
index a50d594..3494552 100644
--- a/milena/mln/core/internal/complex_window_p_base.hh
+++ b/milena/mln/core/internal/complex_window_p_base.hh
@@ -36,7 +36,8 @@
# include <mln/core/concept/window.hh>
# include <mln/core/site_set/complex_psite.hh>
-# include <mln/topo/adj_lower_face_iter.hh>
+# include <mln/topo/centered_iter_adapter.hh>
+
// FIXME: Factor with mln::internal::complex_neighborhood_base.
diff --git a/milena/tests/morpho/complex_image_morpho.cc b/milena/tests/morpho/complex_image_morpho.cc
index baf0f68..e3823c7 100644
--- a/milena/tests/morpho/complex_image_morpho.cc
+++ b/milena/tests/morpho/complex_image_morpho.cc
@@ -37,9 +37,7 @@
#include <mln/core/image/complex_image.hh>
// FIXME: Include these elsewhere? (In complex_image.hh?)
-#include <mln/core/image/complex_lower_window_p.hh>
-#include <mln/core/image/complex_higher_window_p.hh>
-#include <mln/core/image/complex_lower_higher_window_p.hh>
+#include <mln/core/image/complex_windows.hh>
#include <mln/core/image/complex_window_piter.hh>
#include <mln/debug/iota.hh>
--
1.6.0.1
* mln/core/internal/complex_window_p_base.hh: New.
---
milena/ChangeLog | 6 +
milena/mln/core/internal/complex_window_p_base.hh | 166 +++++++++++++++++++++
2 files changed, 172 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/core/internal/complex_window_p_base.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1a4fe48..ae50733 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a factored implementation of window of complex image.
+
+ * mln/core/internal/complex_window_p_base.hh: New.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Factor concrete neighborhoods of complex image.
* mln/core/image/complex_lower_neighborhood.hh,
diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh
new file mode 100644
index 0000000..a50d594
--- /dev/null
+++ b/milena/mln/core/internal/complex_window_p_base.hh
@@ -0,0 +1,166 @@
+// 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.
+
+#ifndef MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
+# define MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
+
+/// \file mln/core/image/complex_window_p_base.hh
+/// \brief Definition of a generic window centered on the face
+/// of a complex, based on a pair of (forward and backward) complex
+/// iterators. The center (site) is part of the window.
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/site_set/complex_psite.hh>
+
+# include <mln/topo/adj_lower_face_iter.hh>
+
+// FIXME: Factor with mln::internal::complex_neighborhood_base.
+
+
+namespace mln
+{
+ // Forward declarations.
+ template <typename I, typename G, typename W>
+ class complex_window_fwd_piter;
+ template <typename I, typename G, typename W>
+ class complex_window_bkd_piter;
+
+ namespace internal
+ {
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ class complex_window_p_base;
+ }
+
+
+ namespace trait
+ {
+
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ struct window_< mln::internal::complex_window_p_base<D, G, F, B, E> >
+ {
+ typedef trait::window::size::unknown size;
+ typedef trait::window::support::irregular support;
+ typedef trait::window::definition::varying definition;
+ };
+
+ } // end of namespace mln::trait
+
+
+ namespace internal
+ {
+ /** \brief Generic window centered on the face of a complex, based
+ on an pair of (forward and backward) complex iterators. The
+ center (site) is part of the window.
+
+ \tparam D The dimension of the complex.
+ \tparam G The geometry functor of the complex.
+ \tparam F The underlying forward iterator.
+ \tparam B The underlying backward iterator.
+ \tparam E The exact type. */
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ class complex_window_p_base : public Window<E>
+ {
+ /// The complex iterators <em>on the adjacent faces only</em>
+ /// (without the center point).
+ /// \{
+ typedef F adj_only_fwd_iter_;
+ typedef B adj_only_bkd_iter_;
+ /// \}
+
+ public:
+ /// The associated complex iterators.
+ /// \{
+ typedef topo::centered_fwd_iter_adapter<D, adj_only_fwd_iter_>
+ complex_fwd_iter;
+
+ typedef topo::centered_bkd_iter_adapter<D, adj_only_bkd_iter_>
+ complex_bkd_iter;
+ /// \}
+
+ public:
+ /// Associated types.
+ /// \{
+ /// The type of psite corresponding to the window.
+ typedef complex_psite<D, G> psite;
+ /// The type of site corresponding to the window.
+ typedef mln_site(psite) site;
+
+ // FIXME: This is a dummy value.
+ typedef void dpsite;
+
+ /// \brief Site_Iterator type to browse the psites of the window
+ /// w.r.t. the ordering of vertices.
+ typedef
+ complex_window_fwd_piter<complex_fwd_iter, G, E> fwd_qiter;
+
+ /// \brief Site_Iterator type to browse the psites of the window
+ /// w.r.t. the reverse ordering of vertices.
+ typedef
+ complex_window_bkd_piter<complex_bkd_iter, G, E> bkd_qiter;
+
+ /// The default qiter type.
+ typedef fwd_qiter qiter;
+ /// \}
+
+ public:
+ /// Services.
+ /// \{
+ /* FIXME: mln::morpho::dilation requires these method from models
+ of concept Window, but Window does not list them in its
+ requirements. Who's guilty: morpho::dilation or Window? */
+ /// Is this window empty? (Always returns \c false).
+ bool is_empty() const;
+ /// Is this window centered? (Always returns \c true).
+ bool is_centered() const;
+ /// \}
+ };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ bool
+ complex_window_p_base<D, G, F, B, E>::is_empty() const
+ {
+ return false;
+ }
+
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ bool
+ complex_window_p_base<D, G, F, B, E>::is_centered() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::internal
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
--
1.6.0.1
* mln/core/internal/complex_neighborhood_base.hh: New.
---
milena/ChangeLog | 6 +
.../mln/core/internal/complex_neighborhood_base.hh | 130 ++++++++++++++++++++
2 files changed, 136 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/core/internal/complex_neighborhood_base.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index d8b0307..774c861 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Add a factored implementation of neighborhood of complex image.
+
+ * mln/core/internal/complex_neighborhood_base.hh: New.
+
2008-10-16 Roland Levillain <roland(a)lrde.epita.fr>
Exercise mln::io::load on OFF file (with no color data).
diff --git a/milena/mln/core/internal/complex_neighborhood_base.hh b/milena/mln/core/internal/complex_neighborhood_base.hh
new file mode 100644
index 0000000..9ecf09f
--- /dev/null
+++ b/milena/mln/core/internal/complex_neighborhood_base.hh
@@ -0,0 +1,130 @@
+// 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.
+
+#ifndef MLN_CORE_IMAGE_INTERNAL_COMPLEX_NEIGHBORHOOD_BASE_HH
+# define MLN_CORE_IMAGE_INTERNAL_COMPLEX_NEIGHBORHOOD_BASE_HH
+
+/// \file mln/core/internal/complex_neighborhood_base.hh
+/// \brief Definition of a generic neighborhood centered on the face
+/// of a complex, based on a pair of (forward and backward) complex
+/// iterators.
+
+# include <mln/core/concept/neighborhood.hh>
+# include <mln/core/site_set/complex_psite.hh>
+
+// FIXME: Factor with mln::internal::complex_window_base.
+
+
+namespace mln
+{
+ // Forward declarations.
+ template <typename I, typename G, typename N>
+ class complex_neighborhood_fwd_piter;
+ template <typename I, typename G, typename N>
+ class complex_neighborhood_bkd_piter;
+
+ namespace internal
+ {
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ class complex_neighborhood_base;
+ }
+
+
+ namespace internal
+ {
+ /** \brief Generic neighborhood centered on the face of a complex,
+ based on an pair of (forward and backward) complex iterators.
+
+ \tparam D The dimension of the complex.
+ \tparam G The geometry functor of the complex.
+ \tparam F The underlying forward iterator.
+ \tparam B The underlying backward iterator.
+ \tparam E The exact type. */
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ class complex_neighborhood_base : public Neighborhood<E>
+ {
+ public:
+ /// The associated complex iterators.
+ /// \{
+ typedef F complex_fwd_iter;
+ typedef B complex_bkd_iter;
+ /// \}
+
+ public:
+ /// Associated types.
+ /// \{
+ /// The type of psite corresponding to the neighborhood.
+ typedef complex_psite<D, G> psite;
+ /// The type of site corresponding to the neighborhood.
+ typedef mln_site(psite) site;
+
+ /// \brief Site_Iterator type to browse the psites of the neighborhood
+ /// w.r.t. the ordering of vertices.
+ typedef
+ complex_neighborhood_fwd_piter<complex_fwd_iter, G, E> fwd_niter;
+
+ /// \brief Site_Iterator type to browse the psites of the neighborhood
+ /// w.r.t. the reverse ordering of vertices.
+ typedef
+ complex_neighborhood_bkd_piter<complex_bkd_iter, G, E> bkd_niter;
+
+ /// The default niter type.
+ typedef fwd_niter niter;
+ /// \}
+
+ /// Conversions.
+ /// \{
+ /// The window type corresponding to this neighborhood.
+ // FIXME: Dummy.
+ typedef E window;
+ /// Create a window corresponding to this neighborhood.
+ const window& win() const;
+ /// \}
+ };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ // FIXME: Dummy.
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ inline
+ // FIXME: Change (dummy) type.
+ const typename complex_neighborhood_base<D, G, F, B, E>::window&
+ complex_neighborhood_base<D, G, F, B, E>::win() const
+ {
+ // FIXME: Dummy.
+ return exact(*this);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::internal
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_IMAGE_INTERNAL_COMPLEX_NEIGHBORHOOD_BASE_HH
--
1.6.0.1