Milena (Olena)
User documentation 2.0a Id
|
00001 // Copyright (C) 2009, 2011 EPITA Research and Development Laboratory 00002 // (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_MIXED_WINDOW_HH 00028 # define MLN_CORE_IMAGE_GRAPH_ELT_MIXED_WINDOW_HH 00029 00034 00035 # include <mln/core/concept/window.hh> 00036 # include <mln/core/internal/neighborhood_base.hh> 00037 # include <mln/core/internal/graph_window_base.hh> 00038 # include <mln/core/image/graph_window_piter.hh> 00039 00040 00041 namespace mln 00042 { 00043 00045 template <typename G, typename S, typename S2> class graph_elt_mixed_window; 00046 template <typename G, typename F> class p_edges; 00047 template <typename G, typename F> class p_vertices; 00048 namespace util 00049 { 00050 template <typename G> class edge; 00051 template <typename G> class vertex; 00052 }; 00053 00054 00055 namespace internal 00056 { 00057 00058 template <typename G, typename S, typename S2, typename E> 00059 struct neighborhood_impl<graph_elt_mixed_window<G,S,S2>,E> 00060 : public neighborhood_extra_impl<graph_elt_mixed_window<G,S,S2>,E> 00061 { 00062 }; 00063 00064 00072 // 00073 template <typename G, typename S, typename S2> 00074 struct graph_mixed_window_iter_dispatch; 00075 00076 template <typename G, typename F, typename F2> 00077 struct graph_mixed_window_iter_dispatch<G, p_vertices<G,F>, p_edges<G,F2> > 00078 { 00079 typedef mln_vertex_nbh_edge_fwd_iter(G) nbh_fwd_iter_; 00080 typedef mln_vertex_nbh_edge_bkd_iter(G) nbh_bkd_iter_; 00081 00082 typedef p_edges<G,F2> target; 00083 }; 00084 00085 00086 } // end of namespace mln::internal 00087 00088 00089 namespace trait 00090 { 00091 00092 template <typename G, typename S, typename S2> 00093 struct window_< mln::graph_elt_mixed_window<G,S,S2> > 00094 { 00095 typedef trait::window::size::unknown size; 00096 typedef trait::window::support::irregular support; 00097 typedef trait::window::definition::varying definition; 00098 }; 00099 00100 } // end of namespace mln::trait 00101 00102 00108 // 00109 template <typename G, typename S, typename S2> 00110 class graph_elt_mixed_window 00111 : public graph_window_base<mln_result(S2::fun_t), 00112 graph_elt_mixed_window<G,S,S2> >, 00113 public internal::graph_mixed_window_iter_dispatch<G,S,S2> 00114 { 00115 typedef graph_elt_mixed_window<G,S,S2> self_; 00116 typedef internal::graph_mixed_window_iter_dispatch<G,S,S2> super_; 00117 00118 typedef typename super_::nbh_fwd_iter_ nbh_fwd_iter_; 00119 typedef typename super_::nbh_bkd_iter_ nbh_bkd_iter_; 00120 00121 public: 00124 typedef typename super_::target target; 00126 typedef mln_psite(target) psite; 00127 00129 typedef mln_psite(S) center_t; 00130 00132 typedef mln_graph_element(target) graph_element; 00133 00136 typedef graph_window_piter<target,self_,nbh_fwd_iter_> fwd_qiter; 00137 00140 typedef graph_window_piter<target,self_,nbh_bkd_iter_> bkd_qiter; 00141 00143 typedef fwd_qiter qiter; 00145 00146 }; 00147 00148 } // end of namespace mln 00149 00150 00151 #endif // ! MLN_CORE_IMAGE_GRAPH_ELT_MIXED_WINDOW_HH