00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MLN_CORE_INTERNAL_COMPLEX_WINDOW_BASE_HH
00027 # define MLN_CORE_INTERNAL_COMPLEX_WINDOW_BASE_HH
00028
00032
00033 # include <mln/core/concept/window.hh>
00034 # include <mln/core/site_set/complex_psite.hh>
00035 # include <mln/core/image/complex_window_piter.hh>
00036
00037 # include <mln/topo/centered_iter_adapter.hh>
00038
00039
00040
00041
00042 namespace mln
00043 {
00044
00045 template <typename I, typename G, typename W>
00046 class complex_window_fwd_piter;
00047 template <typename I, typename G, typename W>
00048 class complex_window_bkd_piter;
00049
00050 namespace internal
00051 {
00052 template <unsigned D, typename G, typename F, typename B, typename E>
00053 class complex_window_base;
00054 }
00055
00056
00057 namespace trait
00058 {
00059
00060 template <unsigned D, typename G, typename F, typename B, typename E>
00061 struct window_< mln::internal::complex_window_base<D, G, F, B, E> >
00062 {
00063 typedef trait::window::size::unknown size;
00064 typedef trait::window::support::irregular support;
00065 typedef trait::window::definition::varying definition;
00066 };
00067
00068 }
00069
00070
00071 namespace internal
00072 {
00082 template <unsigned D, typename G, typename F, typename B, typename E>
00083 class complex_window_base : public Window<E>
00084 {
00085 public:
00088 typedef F complex_fwd_iter;
00089 typedef B complex_bkd_iter;
00091
00092 public:
00096 typedef G geom;
00098 typedef complex_psite<D, G> psite;
00100 typedef mln_site(psite) site;
00101
00102
00103 typedef void dpsite;
00104
00105
00106
00107
00108 complex_window_base(bool is_centered = false);
00109
00112 typedef
00113 complex_window_fwd_piter<complex_fwd_iter, G, E> fwd_qiter;
00114
00117 typedef
00118 complex_window_bkd_piter<complex_bkd_iter, G, E> bkd_qiter;
00119
00121 typedef fwd_qiter qiter;
00123
00124 public:
00127
00128
00129
00131 bool is_empty() const;
00133 bool is_centered() const;
00134
00136 bool is_valid() const;
00138
00139 private:
00140 bool is_centered_;
00141 };
00142
00143
00144
00145 # ifndef MLN_INCLUDE_ONLY
00146
00147 template <unsigned D, typename G, typename F, typename B, typename E>
00148 inline
00149 complex_window_base<D, G, F, B, E>::complex_window_base(bool is_centered)
00150 : is_centered_(is_centered)
00151 {
00152 }
00153
00154
00155 template <unsigned D, typename G, typename F, typename B, typename E>
00156 inline
00157 bool
00158 complex_window_base<D, G, F, B, E>::is_empty() const
00159 {
00160 return false;
00161 }
00162
00163 template <unsigned D, typename G, typename F, typename B, typename E>
00164 inline
00165 bool
00166 complex_window_base<D, G, F, B, E>::is_centered() const
00167 {
00168 return is_centered_;
00169 }
00170
00171 template <unsigned D, typename G, typename F, typename B, typename E>
00172 inline
00173 bool
00174 complex_window_base<D, G, F, B, E>::is_valid() const
00175 {
00176 return true;
00177 }
00178
00179 # endif // ! MLN_INCLUDE_ONLY
00180
00181 }
00182
00183 }
00184
00185 #endif // ! MLN_CORE_INTERNAL_COMPLEX_WINDOW_BASE_HH