Milena (Olena)
User documentation 2.0a Id
|
00001 // Copyright (C) 2007, 2008, 2009 EPITA Research and Development 00002 // Laboratory (LRDE) 00003 // 00004 // This file is part of Olena. 00005 // 00006 // Olena is free software: you can redistribute it and/or modify it under 00007 // the terms of the GNU General Public License as published by the Free 00008 // Software Foundation, version 2 of the License. 00009 // 00010 // Olena is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Olena. If not, see <http://www.gnu.org/licenses/>. 00017 // 00018 // As a special exception, you may use this file as part of a free 00019 // software project without restriction. Specifically, if other files 00020 // instantiate templates or use macros or inline functions from this 00021 // file, or you compile this file and link it with other files to produce 00022 // an executable, this file does not by itself cause the resulting 00023 // executable to be covered by the GNU General Public License. This 00024 // exception does not however invalidate any other reasons why the 00025 // executable file might be covered by the GNU General Public License. 00026 00027 #ifndef MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH 00028 # define MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH 00029 00033 00034 # include <mln/core/concept/window.hh> 00035 # include <mln/core/internal/neighborhood_base.hh> 00036 # include <mln/core/internal/graph_window_base.hh> 00037 # include <mln/core/image/graph_window_piter.hh> 00038 00039 00040 namespace mln 00041 { 00042 00044 template <typename G, typename S> class graph_elt_window; 00045 template <typename G, typename F> class p_edges; 00046 template <typename G, typename F> class p_vertices; 00047 namespace util 00048 { 00049 template <typename G> class edge; 00050 template <typename G> class vertex; 00051 }; 00052 00053 00054 namespace internal 00055 { 00056 00057 template <typename G, typename S, typename E> 00058 struct neighborhood_impl<graph_elt_window<G,S>,E> 00059 : public neighborhood_extra_impl<graph_elt_window<G,S>,E> 00060 { 00061 }; 00062 00063 00069 // 00070 template <typename G, typename S> 00071 struct graph_window_iter_dispatch; 00072 00073 template <typename G, typename F> 00074 struct graph_window_iter_dispatch<G, p_edges<G,F> > 00075 { 00076 typedef mln_edge_nbh_edge_fwd_iter(G) nbh_fwd_iter_; 00077 typedef mln_edge_nbh_edge_bkd_iter(G) nbh_bkd_iter_; 00078 }; 00079 00080 template <typename G, typename F> 00081 struct graph_window_iter_dispatch<G, p_vertices<G,F> > 00082 { 00083 typedef mln_vertex_nbh_vertex_fwd_iter(G) nbh_fwd_iter_; 00084 typedef mln_vertex_nbh_vertex_bkd_iter(G) nbh_bkd_iter_; 00085 }; 00086 00087 } // end of namespace mln::internal 00088 00089 00090 namespace trait 00091 { 00092 00093 template <typename G, typename S> 00094 struct window_< mln::graph_elt_window<G,S> > 00095 { 00096 typedef trait::window::size::unknown size; 00097 typedef trait::window::support::irregular support; 00098 typedef trait::window::definition::varying definition; 00099 }; 00100 00101 } // end of namespace mln::trait 00102 00103 00109 // 00110 template <typename G, typename S> 00111 class graph_elt_window 00112 : public graph_window_base<mln_result(S::fun_t), 00113 graph_elt_window<G,S> >, 00114 public internal::graph_window_iter_dispatch<G,S> 00115 { 00116 typedef graph_elt_window<G,S> self_; 00117 typedef internal::graph_window_iter_dispatch<G,S> super_; 00118 00119 typedef typename super_::nbh_fwd_iter_ nbh_fwd_iter_; 00120 typedef typename super_::nbh_bkd_iter_ nbh_bkd_iter_; 00121 00122 public: 00125 typedef S target; 00126 00128 typedef mln_psite(S) psite; 00129 00131 typedef mln_psite(S) center_t; 00132 00134 typedef mln_graph_element(S) graph_element; 00135 00138 typedef graph_window_piter<S,self_,nbh_fwd_iter_> fwd_qiter; 00139 00142 typedef graph_window_piter<S,self_,nbh_bkd_iter_> bkd_qiter; 00143 00145 typedef fwd_qiter qiter; 00147 00148 }; 00149 00150 } // end of namespace mln 00151 00152 00153 #endif // ! MLN_CORE_IMAGE_GRAPH_ELT_WINDOW_HH