• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List

complex_window_p_base.hh

00001 // Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
00002 //
00003 // This file is part of Olena.
00004 //
00005 // Olena is free software: you can redistribute it and/or modify it under
00006 // the terms of the GNU General Public License as published by the Free
00007 // Software Foundation, version 2 of the License.
00008 //
00009 // Olena is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Olena.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 // As a special exception, you may use this file as part of a free
00018 // software project without restriction.  Specifically, if other files
00019 // instantiate templates or use macros or inline functions from this
00020 // file, or you compile this file and link it with other files to produce
00021 // an executable, this file does not by itself cause the resulting
00022 // executable to be covered by the GNU General Public License.  This
00023 // exception does not however invalidate any other reasons why the
00024 // executable file might be covered by the GNU General Public License.
00025 
00026 #ifndef MLN_CORE_INTERNAL_COMPLEX_WINDOW_P_BASE_HH
00027 # define MLN_CORE_INTERNAL_COMPLEX_WINDOW_P_BASE_HH
00028 
00033 
00034 # include <mln/core/concept/window.hh>
00035 # include <mln/core/site_set/complex_psite.hh>
00036 # include <mln/core/image/complex_window_piter.hh>
00037 
00038 # include <mln/topo/centered_iter_adapter.hh>
00039 
00040 // FIXME: Factor with mln::internal::complex_neighborhood_base.
00041 
00042 
00043 namespace mln
00044 {
00045   // Forward declarations.
00046   template <typename I, typename G, typename W>
00047   class complex_window_fwd_piter;
00048   template <typename I, typename G, typename W>
00049   class complex_window_bkd_piter;
00050 
00051   namespace internal
00052   {
00053     template <unsigned D, typename G, typename F, typename B, typename E>
00054     class complex_window_p_base;
00055   }
00056 
00057 
00058   namespace trait
00059   {
00060 
00061     template <unsigned D, typename G, typename F, typename B, typename E>
00062     struct window_< mln::internal::complex_window_p_base<D, G, F, B, E> >
00063     {
00064       typedef trait::window::size::unknown       size;
00065       typedef trait::window::support::irregular  support;
00066       typedef trait::window::definition::varying definition;
00067     };
00068 
00069   } // end of namespace mln::trait
00070 
00071 
00072   namespace internal
00073   {
00083     template <unsigned D, typename G, typename F, typename B, typename E>
00084     class complex_window_p_base : public Window<E>
00085     {
00089       typedef F adj_only_fwd_iter_;
00090       typedef B adj_only_bkd_iter_;
00092 
00093     public:
00096       typedef topo::centered_fwd_iter_adapter<D, adj_only_fwd_iter_>
00097       complex_fwd_iter;
00098 
00099       typedef topo::centered_bkd_iter_adapter<D, adj_only_bkd_iter_>
00100       complex_bkd_iter;
00102 
00103     public:
00107       typedef complex_psite<D, G> psite;
00109       typedef mln_site(psite) site;
00110 
00111       // FIXME: This is a dummy value.
00112       typedef void dpsite;
00113 
00116       typedef
00117       complex_window_fwd_piter<complex_fwd_iter, G, E> fwd_qiter;
00118 
00121       typedef
00122       complex_window_bkd_piter<complex_bkd_iter, G, E> bkd_qiter;
00123 
00125       typedef fwd_qiter qiter;
00127 
00128     public:
00131       /* FIXME: mln::morpho::dilation requires these method from models
00132          of concept Window, but Window does not list them in its
00133          requirements.  Who's guilty: morpho::dilation or Window?  */
00135       bool is_empty() const;
00137       bool is_centered() const;
00138 
00140       bool is_valid() const;
00142     };
00143 
00144 
00145 
00146 # ifndef MLN_INCLUDE_ONLY
00147 
00148     template <unsigned D, typename G, typename F, typename B, typename E>
00149     bool
00150     complex_window_p_base<D, G, F, B, E>::is_empty() const
00151     {
00152       return false;
00153     }
00154 
00155     template <unsigned D, typename G, typename F, typename B, typename E>
00156     bool
00157     complex_window_p_base<D, G, F, B, E>::is_centered() const
00158     {
00159       return true;
00160     }
00161 
00162     template <unsigned D, typename G, typename F, typename B, typename E>
00163     bool
00164     complex_window_p_base<D, G, F, B, E>::is_valid() const
00165     {
00166       return true;
00167     }
00168 
00169 # endif // ! MLN_INCLUDE_ONLY
00170 
00171   } // end of namespace mln::internal
00172 
00173 } // end of namespace mln
00174 
00175 #endif // ! MLN_CORE_INTERNAL_COMPLEX_WINDOW_P_BASE_HH

Generated on Thu Sep 8 2011 18:31:42 for Milena (Olena) by  doxygen 1.7.1