26 #ifndef MLN_MORPHO_ATTRIBUTE_COUNT_ADJACENT_VERTICES_HH
27 # define MLN_MORPHO_ATTRIBUTE_COUNT_ADJACENT_VERTICES_HH
36 # include <mln/pw/internal/image_base.hh>
37 # include <mln/accu/internal/base.hh>
38 # include <mln/pw/image.hh>
39 # include <mln/util/pix.hh>
40 # include <mln/util/graph_ids.hh>
49 struct count_adjacent_vertices;
60 struct accumulator_< morpho::attribute::count_adjacent_vertices<I> >
62 typedef accumulator::has_untake::no has_untake;
63 typedef accumulator::has_set_value::no has_set_value;
64 typedef accumulator::has_stop::no has_stop;
65 typedef accumulator::when_pix::use_p when_pix;
84 :
public accu::internal::base< unsigned ,
85 count_adjacent_vertices<I> >
87 typedef mln_psite(I) argument;
95 void take(
const argument& px);
98 void take_as_init_(
const argument& px);
115 std::set<util::vertex_id_t> vertices_;
120 # ifndef MLN_INCLUDE_ONLY
122 template <
typename I>
129 template <
typename I>
138 template <
typename I>
143 vertices_.insert(p.v1());
144 vertices_.insert(p.v2());
148 template <
typename I>
151 count_adjacent_vertices<I>::take(
const count_adjacent_vertices<I>& other)
153 vertices_.insert (other.vertices_.begin(), other.vertices_.end());
157 template <
typename I>
160 count_adjacent_vertices<I>::take_as_init_(
const argument& px)
166 template <
typename I>
174 template <
typename I>
179 count__ = vertices_.size();
182 template <
typename I>
191 # endif // ! MLN_INCLUDE_ONLY
199 #endif // ! MLN_MORPHO_ATTRIBUTE_COUNT_ADJACENT_VERTICES_HH