static inline void apply(Polygon const& poly, Point& centroid, Strategy const& strategy) { if (range_ok(exterior_ring(poly), centroid)) { typename Strategy::state_type state; centroid_polygon_state::apply(poly, strategy, state); strategy.result(state, centroid); } }
static inline void apply(Range const& range, Point& centroid, Strategy const& strategy) { if (range_ok(range, centroid)) { typename Strategy::state_type state; centroid_range_state<Closure>::apply(range, strategy, state); strategy.result(state, centroid); } }
static inline void apply(Ring const& ring, Point& centroid, Strategy const& strategy) { if (range_ok(ring, centroid)) { typename Strategy::state_type state; centroid_ring_state < Ring, Strategy >::apply(ring, strategy, state); Strategy::result(state, centroid); } }
static inline bool apply(Polygon const& poly, Point& centroid, Strategy const& strategy) { if (range_ok(exterior_ring(poly), centroid)) { // prepare translation transformer translating_transformer<Polygon> transformer(*boost::begin(exterior_ring(poly))); typename Strategy::state_type state; centroid_polygon_state::apply(poly, transformer, strategy, state); if ( strategy.result(state, centroid) ) { // translate the result back transformer.apply_reverse(centroid); return true; } } return false; }
static inline bool apply(Range const& range, Point& centroid, Strategy const& strategy) { if (range_ok(range, centroid)) { // prepare translation transformer translating_transformer<Range> transformer(*boost::begin(range)); typename Strategy::state_type state; centroid_range_state<Closure>::apply(range, transformer, strategy, state); if ( strategy.result(state, centroid) ) { // translate the result back transformer.apply_reverse(centroid); return true; } } return false; }