From eb3260708eb241d8da337f4be73b41d69d33cd09 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Thu, 5 Dec 2013 19:36:58 +0100 Subject: [PATCH] [geometry] Remove all trailing spaces (algorithms) --- include/boost/geometry/algorithms/append.hpp | 4 +- include/boost/geometry/algorithms/area.hpp | 4 +- include/boost/geometry/algorithms/assign.hpp | 4 +- .../boost/geometry/algorithms/centroid.hpp | 2 +- .../algorithms/comparable_distance.hpp | 2 +- include/boost/geometry/algorithms/convert.hpp | 28 +++--- .../boost/geometry/algorithms/convex_hull.hpp | 2 +- include/boost/geometry/algorithms/correct.hpp | 2 +- .../boost/geometry/algorithms/covered_by.hpp | 6 +- .../algorithms/detail/assign_box_corners.hpp | 6 +- .../detail/assign_indexed_point.hpp | 2 +- .../detail/convert_indexed_to_indexed.hpp | 20 ++-- .../detail/equals/collect_vectors.hpp | 6 +- .../algorithms/detail/extreme_points.hpp | 30 +++--- .../algorithms/detail/get_left_turns.hpp | 28 +++--- .../algorithms/detail/occupation_info.hpp | 10 +- .../detail/overlay/append_no_duplicates.hpp | 2 +- .../overlay/append_no_dups_or_spikes.hpp | 2 +- .../detail/overlay/backtrack_check_si.hpp | 12 +-- .../overlay/calculate_distance_policy.hpp | 2 +- .../algorithms/detail/overlay/follow.hpp | 96 +++++++++---------- .../algorithms/detail/overlay/get_turns.hpp | 20 ++-- .../detail/overlay/handle_tangencies.hpp | 12 +-- .../detail/overlay/select_rings.hpp | 14 +-- .../algorithms/detail/overlay/traverse.hpp | 14 +-- .../algorithms/detail/overlay/turn_info.hpp | 2 +- .../geometry/algorithms/detail/partition.hpp | 2 +- .../algorithms/detail/recalculate.hpp | 2 +- .../detail/throw_on_empty_input.hpp | 2 +- .../boost/geometry/algorithms/difference.hpp | 2 +- .../boost/geometry/algorithms/distance.hpp | 4 +- .../boost/geometry/algorithms/envelope.hpp | 2 +- include/boost/geometry/algorithms/equals.hpp | 4 +- include/boost/geometry/algorithms/length.hpp | 2 +- .../boost/geometry/algorithms/num_points.hpp | 2 +- .../geometry/algorithms/point_on_surface.hpp | 8 +- .../geometry/algorithms/remove_spikes.hpp | 2 +- include/boost/geometry/algorithms/reverse.hpp | 2 +- 38 files changed, 183 insertions(+), 183 deletions(-) diff --git a/include/boost/geometry/algorithms/append.hpp b/include/boost/geometry/algorithms/append.hpp index 71d0b18c4..3e6e07020 100644 --- a/include/boost/geometry/algorithms/append.hpp +++ b/include/boost/geometry/algorithms/append.hpp @@ -227,7 +227,7 @@ struct append > RangeOrPoint const& m_range_or_point; int m_ring_index; int m_multi_index; - + visitor(RangeOrPoint const& range_or_point, int ring_index, int multi_index): @@ -235,7 +235,7 @@ struct append > m_ring_index(ring_index), m_multi_index(multi_index) {} - + template void operator()(Geometry& geometry) const { diff --git a/include/boost/geometry/algorithms/area.hpp b/include/boost/geometry/algorithms/area.hpp index 840d7064f..348047cfa 100644 --- a/include/boost/geometry/algorithms/area.hpp +++ b/include/boost/geometry/algorithms/area.hpp @@ -258,7 +258,7 @@ inline typename default_area_result::type area(Geometry const& geometr >::type strategy_type; // detail::throw_on_empty_input(geometry); - + return resolve_variant::area::apply(geometry, strategy_type()); } @@ -293,7 +293,7 @@ inline typename Strategy::return_type area( concept::check(); // detail::throw_on_empty_input(geometry); - + return resolve_variant::area::apply(geometry, strategy); } diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index 97a033d1d..fd23f1ddb 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -144,9 +144,9 @@ inline void assign(Geometry1& geometry1, Geometry2 const& geometry2) { concept::check_concepts_and_equal_dimensions(); - bool const same_point_order = + bool const same_point_order = point_order::value == point_order::value; - bool const same_closure = + bool const same_closure = closure::value == closure::value; BOOST_MPL_ASSERT_MSG diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index 4c13170da..106818d67 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -381,7 +381,7 @@ struct centroid > }; template - static inline void + static inline void apply(boost::variant const& geometry, Point& out, Strategy const& strategy) diff --git a/include/boost/geometry/algorithms/comparable_distance.hpp b/include/boost/geometry/algorithms/comparable_distance.hpp index 3467045ca..4f0563a8a 100644 --- a/include/boost/geometry/algorithms/comparable_distance.hpp +++ b/include/boost/geometry/algorithms/comparable_distance.hpp @@ -28,7 +28,7 @@ namespace boost { namespace geometry \details The free function comparable_distance does not necessarily calculate the distance, but it calculates a distance measure such that two distances are comparable to each other. For example: for the Cartesian coordinate system, Pythagoras is used but the square root - is not taken, which makes it faster and the results of two point pairs can still be + is not taken, which makes it faster and the results of two point pairs can still be compared to each other. \tparam Geometry1 first geometry type \tparam Geometry2 second geometry type diff --git a/include/boost/geometry/algorithms/convert.hpp b/include/boost/geometry/algorithms/convert.hpp index 1497a768f..ad411ec57 100644 --- a/include/boost/geometry/algorithms/convert.hpp +++ b/include/boost/geometry/algorithms/convert.hpp @@ -51,7 +51,7 @@ namespace boost { namespace geometry // Silence warning C4127: conditional expression is constant // Silence warning C4512: assignment operator could not be generated #if defined(_MSC_VER) -#pragma warning(push) +#pragma warning(push) #pragma warning(disable : 4127 4512) #endif @@ -127,22 +127,22 @@ struct segment_to_range } }; -template +template < - typename Range1, - typename Range2, + typename Range1, + typename Range2, bool Reverse = false > struct range_to_range { typedef typename reversible_view < - Range1 const, + Range1 const, Reverse ? iterate_reverse : iterate_forward >::type rview_type; typedef typename closeable_view < - rview_type const, + rview_type const, geometry::closure::value >::type view_type; @@ -178,7 +178,7 @@ struct polygon_to_polygon { typedef range_to_range < - typename geometry::ring_type::type, + typename geometry::ring_type::type, typename geometry::ring_type::type, geometry::point_order::value != geometry::point_order::value @@ -188,7 +188,7 @@ struct polygon_to_polygon { // Clearing managed per ring, and in the resizing of interior rings - per_ring::apply(geometry::exterior_ring(source), + per_ring::apply(geometry::exterior_ring(source), geometry::exterior_ring(destination)); // Container should be resizeable @@ -292,8 +292,8 @@ struct convert struct convert : detail::conversion::range_to_range - < - Ring1, + < + Ring1, Ring2, geometry::point_order::value != geometry::point_order::value @@ -314,8 +314,8 @@ template struct convert : detail::conversion::box_to_range < - Box, - Ring, + Box, + Ring, geometry::closure::value == closed, geometry::point_order::value == counterclockwise > @@ -438,8 +438,8 @@ struct convert, Geometry2> \brief Converts one geometry to another geometry \details The convert algorithm converts one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only works if it is possible and applicable. -If the point-order is different, or the closure is different between two -geometry types, it will be converted correctly by explicitly reversing the +If the point-order is different, or the closure is different between two +geometry types, it will be converted correctly by explicitly reversing the points or closing or opening the polygon rings. \ingroup convert \tparam Geometry1 \tparam_geometry diff --git a/include/boost/geometry/algorithms/convex_hull.hpp b/include/boost/geometry/algorithms/convex_hull.hpp index 72aee0f2a..d5bd4d92a 100644 --- a/include/boost/geometry/algorithms/convex_hull.hpp +++ b/include/boost/geometry/algorithms/convex_hull.hpp @@ -230,7 +230,7 @@ struct convex_hull > }; template - static inline void + static inline void apply(boost::variant const& geometry, OutputGeometry& out, Strategy const& strategy) diff --git a/include/boost/geometry/algorithms/correct.hpp b/include/boost/geometry/algorithms/correct.hpp index 12442ee3e..6f53e88a6 100644 --- a/include/boost/geometry/algorithms/correct.hpp +++ b/include/boost/geometry/algorithms/correct.hpp @@ -45,7 +45,7 @@ namespace boost { namespace geometry // Silence warning C4127: conditional expression is constant #if defined(_MSC_VER) -#pragma warning(push) +#pragma warning(push) #pragma warning(disable : 4127) #endif diff --git a/include/boost/geometry/algorithms/covered_by.hpp b/include/boost/geometry/algorithms/covered_by.hpp index 5c3b75be7..01405d81b 100644 --- a/include/boost/geometry/algorithms/covered_by.hpp +++ b/include/boost/geometry/algorithms/covered_by.hpp @@ -120,8 +120,8 @@ struct covered_by { concept::within::check < - typename tag::type, - typename tag::type, + typename tag::type, + typename tag::type, typename tag_cast::type, areal_tag>::type, Strategy >(); @@ -141,7 +141,7 @@ struct covered_by { typedef typename point_type::type point_type1; typedef typename point_type::type point_type2; - + typedef typename strategy::covered_by::services::default_strategy < typename tag::type, diff --git a/include/boost/geometry/algorithms/detail/assign_box_corners.hpp b/include/boost/geometry/algorithms/detail/assign_box_corners.hpp index 1637c30cc..f1bc59613 100644 --- a/include/boost/geometry/algorithms/detail/assign_box_corners.hpp +++ b/include/boost/geometry/algorithms/detail/assign_box_corners.hpp @@ -26,7 +26,7 @@ namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL -namespace detail +namespace detail { // Note: this is moved to namespace detail because the names and parameter orders // are not yet 100% clear. @@ -69,8 +69,8 @@ inline void assign_box_corners(Box const& box, // Silence warning C4127: conditional expression is constant #if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable : 4127) +#pragma warning(push) +#pragma warning(disable : 4127) #endif diff --git a/include/boost/geometry/algorithms/detail/assign_indexed_point.hpp b/include/boost/geometry/algorithms/detail/assign_indexed_point.hpp index a1cffb80a..acfc37e25 100644 --- a/include/boost/geometry/algorithms/detail/assign_indexed_point.hpp +++ b/include/boost/geometry/algorithms/detail/assign_indexed_point.hpp @@ -25,7 +25,7 @@ namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL -namespace detail +namespace detail { /*! diff --git a/include/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp b/include/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp index d39824a61..fccdf4bb1 100644 --- a/include/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp +++ b/include/boost/geometry/algorithms/detail/convert_indexed_to_indexed.hpp @@ -33,9 +33,9 @@ namespace detail { namespace conversion template < - typename Source, - typename Destination, - std::size_t Dimension, + typename Source, + typename Destination, + std::size_t Dimension, std::size_t DimensionCount > struct indexed_to_indexed @@ -44,25 +44,25 @@ struct indexed_to_indexed { typedef typename coordinate_type::type coordinate_type; - geometry::set(destination, + geometry::set(destination, boost::numeric_cast( geometry::get(source))); - geometry::set(destination, + geometry::set(destination, boost::numeric_cast( geometry::get(source))); - + indexed_to_indexed < - Source, Destination, + Source, Destination, Dimension + 1, DimensionCount >::apply(source, destination); } }; -template +template < - typename Source, - typename Destination, + typename Source, + typename Destination, std::size_t DimensionCount > struct indexed_to_indexed diff --git a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp index 9c2fe2805..54f0eaf22 100644 --- a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp +++ b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp @@ -75,9 +75,9 @@ struct collected_vector inline bool same_direction(collected_vector const& other) const { - // For high precision arithmetic, we have to be + // For high precision arithmetic, we have to be // more relaxed then using == - // Because 2/sqrt( (0,0)<->(2,2) ) == 1/sqrt( (0,0)<->(1,1) ) + // Because 2/sqrt( (0,0)<->(2,2) ) == 1/sqrt( (0,0)<->(1,1) ) // is not always true (at least, it is not for ttmath) return math::equals_with_epsilon(dx, other.dx) && math::equals_with_epsilon(dy, other.dy); @@ -150,7 +150,7 @@ struct range_collect_vectors } // If first one has same direction as last one, remove first one - if (boost::size(collection) > 1 + if (boost::size(collection) > 1 && collection.front().same_direction(collection.back())) { collection.erase(collection.begin()); diff --git a/include/boost/geometry/algorithms/detail/extreme_points.hpp b/include/boost/geometry/algorithms/detail/extreme_points.hpp index 2d18749ea..772735522 100644 --- a/include/boost/geometry/algorithms/detail/extreme_points.hpp +++ b/include/boost/geometry/algorithms/detail/extreme_points.hpp @@ -26,7 +26,7 @@ #include #include - + #include #include @@ -55,7 +55,7 @@ template inline void move_along_vector(PointType& point, PointType const& extreme, CoordinateType const& base_value) { // Moves a point along the vector (point, extreme) in the direction of the extreme point - // This adapts the possibly uneven legs of the triangle (or trapezium-like shape) + // This adapts the possibly uneven legs of the triangle (or trapezium-like shape) // _____extreme _____ // / \ / \ . // /base \ => / \ point . @@ -78,7 +78,7 @@ inline void move_along_vector(PointType& point, PointType const& extreme, Coordi CoordinateType const diff = geometry::get(vector); // diff should never be zero - // because of the way our triangle/trapezium is build. + // because of the way our triangle/trapezium is build. // We just return if it would be the case. if (geometry::math::equals(diff, 0)) { @@ -122,8 +122,8 @@ struct extreme_points_on_ring template static inline bool extend(CirclingIterator& it, - std::size_t n, - coordinate_type max_coordinate_value, + std::size_t n, + coordinate_type max_coordinate_value, Points& points, int direction) { std::size_t safe_index = 0; @@ -146,8 +146,8 @@ struct extreme_points_on_ring // Overload without adding to poinst template static inline bool extend(CirclingIterator& it, - std::size_t n, - coordinate_type max_coordinate_value, + std::size_t n, + coordinate_type max_coordinate_value, int direction) { std::size_t safe_index = 0; @@ -166,7 +166,7 @@ struct extreme_points_on_ring } template - static inline bool extent_both_sides(Ring const& ring, + static inline bool extent_both_sides(Ring const& ring, point_type extreme, CirclingIterator& left, CirclingIterator& right) @@ -187,9 +187,9 @@ struct extreme_points_on_ring } template - static inline bool collect(Ring const& ring, + static inline bool collect(Ring const& ring, point_type extreme, - Collection& points, + Collection& points, CirclingIterator& left, CirclingIterator& right) { @@ -221,11 +221,11 @@ struct extreme_points_on_ring return; } coordinate_type const min_value = geometry::get(*std::min_element(boost::begin(extremes), boost::end(extremes), compare())); - + // Also select left/right (if Dimension=1) coordinate_type const other_min = geometry::get<1 - Dimension>(*std::min_element(boost::begin(extremes), boost::end(extremes), compare<1 - Dimension>())); coordinate_type const other_max = geometry::get<1 - Dimension>(*std::max_element(boost::begin(extremes), boost::end(extremes), compare<1 - Dimension>())); - + std::size_t defensive_check_index = 0; // in case we skip over left/right check, collect modifies right too std::size_t const n = boost::size(ring); while (left != right && defensive_check_index < n) @@ -325,7 +325,7 @@ struct extreme_points_on_ring { return false; } - + int const index = std::distance(boost::begin(ring), max_it); //std::cout << "Extreme point lies at " << index << " having " << geometry::wkt(*max_it) << std::endl; @@ -456,7 +456,7 @@ struct extreme_points /*! -\brief Returns extreme points (for Edge=1 in dimension 1, so the top, +\brief Returns extreme points (for Edge=1 in dimension 1, so the top, for Edge=0 in dimension 0, the right side) \note We could specify a strategy (less/greater) to get bottom/left side too. However, until now we don't need that. */ @@ -465,7 +465,7 @@ inline bool extreme_points(Geometry const& geometry, Extremes& extremes, Intrude { concept::check(); - // Extremes is not required to follow a geometry concept (but it should support an output iterator), + // Extremes is not required to follow a geometry concept (but it should support an output iterator), // but its elements should fulfil the point-concept concept::check::type>(); diff --git a/include/boost/geometry/algorithms/detail/get_left_turns.hpp b/include/boost/geometry/algorithms/detail/get_left_turns.hpp index d23f1e4c2..4f127b255 100644 --- a/include/boost/geometry/algorithms/detail/get_left_turns.hpp +++ b/include/boost/geometry/algorithms/detail/get_left_turns.hpp @@ -30,8 +30,8 @@ template inline void debug_left_turn(AngleInfo const& ai, AngleInfo const& previous) { #ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION - std::cout << "Angle: " << (ai.incoming ? "i" : "o") - << " " << si(ai.seg_id) + std::cout << "Angle: " << (ai.incoming ? "i" : "o") + << " " << si(ai.seg_id) << " " << (math::r2d * (ai.angle) ) << " turn: " << ai.turn_index << "[" << ai.operation_index << "]" ; @@ -52,12 +52,12 @@ inline void debug_left_turn(std::string const& caption, AngleInfo const& ai, Ang #ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION std::cout << " " << caption << " turn: " << ai.turn_index << "[" << ai.operation_index << "]" - << " " << si(ai.seg_id) - << " " << (ai.incoming ? "i" : "o") + << " " << si(ai.seg_id) + << " " << (ai.incoming ? "i" : "o") << " " << (math::r2d * (ai.angle) ) << " turn: " << previous.turn_index << "[" << previous.operation_index << "]" - << " " << si(previous.seg_id) - << " " << (previous.incoming ? "i" : "o") + << " " << si(previous.seg_id) + << " " << (previous.incoming ? "i" : "o") << " " << (math::r2d * (previous.angle) ) ; @@ -71,7 +71,7 @@ inline void debug_left_turn(std::string const& caption, AngleInfo const& ai, Ang template -inline bool include_operation(Operation const& op, +inline bool include_operation(Operation const& op, segment_identifier const& outgoing_seg_id, segment_identifier const& incoming_seg_id) { @@ -157,7 +157,7 @@ inline bool prefer_by_other(Turns const& turns, } std::set segment_occuring_once; - for (std::map::const_iterator mit = map.begin(); + for (std::map::const_iterator mit = map.begin(); mit != map.end();++mit) { if (mit->second == 1) @@ -261,7 +261,7 @@ inline void prefer_by_priority(Turns const& turns, std::set& indices) } template -inline void calculate_left_turns(Angles const& angles, +inline void calculate_left_turns(Angles const& angles, Turns& turns, TurnSegmentIndices const& turn_segment_indices, std::set& keep_indices) { @@ -295,9 +295,9 @@ inline void calculate_left_turns(Angles const& angles, typename AngleInfo::angle_type eps = 0.00001; int b = 1; - for(std::size_t d = 0; - math::abs(prev->angle - back->angle) < eps - && ! back->incoming + for(std::size_t d = 0; + math::abs(prev->angle - back->angle) < eps + && ! back->incoming && d < n; d++) { @@ -309,8 +309,8 @@ inline void calculate_left_turns(Angles const& angles, int f = 1; circling_iterator forward = cit + 1; for(std::size_t d = 0; - math::abs(cit->angle - forward->angle) < eps - && forward->incoming + math::abs(cit->angle - forward->angle) < eps + && forward->incoming && d < n; d++) { diff --git a/include/boost/geometry/algorithms/detail/occupation_info.hpp b/include/boost/geometry/algorithms/detail/occupation_info.hpp index f4d5adac8..fecf32fec 100644 --- a/include/boost/geometry/algorithms/detail/occupation_info.hpp +++ b/include/boost/geometry/algorithms/detail/occupation_info.hpp @@ -44,7 +44,7 @@ public : inline relaxed_less() { - // TODO: adapt for ttmath, and maybe build the map in another way + // TODO: adapt for ttmath, and maybe build the map in another way // (e.g. exact constellations of segment-id's), maybe adaptive. epsilon = std::numeric_limits::epsilon() * 100.0; } @@ -226,7 +226,7 @@ public : template inline void add_incoming_and_outgoing_angles(Point const& map_point, Point const& intersection_point, - Ring const& ring, + Ring const& ring, int turn_index, int operation_index, segment_identifier seg_id, @@ -266,8 +266,8 @@ inline void add_incoming_and_outgoing_angles(Point const& map_point, Point const // Don't upgrade the ID it = advance_circular(it, ring, seg_id); } - for (int defensive_check = 0; - comparator.equals(intersection_point, *it) && defensive_check < n; + for (int defensive_check = 0; + comparator.equals(intersection_point, *it) && defensive_check < n; defensive_check++) { it = advance_circular(it, ring, real_seg_id); @@ -294,7 +294,7 @@ public : typename map_type::iterator it = map.find(point); if (it == boost::end(map)) { - std::pair pair + std::pair pair = map.insert(std::make_pair(point, OccupationInfo())); it = pair.first; } diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp index 2c0f88e2a..37066192a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/append_no_duplicates.hpp @@ -29,7 +29,7 @@ template inline void append_no_duplicates(Range& range, Point const& point, bool force = false) { if (boost::size(range) == 0 - || force + || force || ! geometry::detail::equals::equals_point_point(*(boost::end(range)-1), point)) { #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp index 29094de90..8112e3e6b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp @@ -38,7 +38,7 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point) // If a point is equal, or forming a spike, remove the pen-ultimate point because this one caused the spike. // If so, the now-new-pen-ultimate point can again cause a spike (possibly at a corner). So keep doing this. // Besides spikes it will also avoid duplicates. - while(boost::size(range) >= 3 + while(boost::size(range) >= 3 && point_is_spike_or_equal(point, *(boost::end(range) - 3), *(boost::end(range) - 2))) { // Use the Concept/traits, so resize and append again diff --git a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp index 356569eec..580fe431a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp @@ -55,8 +55,8 @@ inline void clear_visit_info(Turns& turns) struct backtrack_state { bool m_good; - - inline backtrack_state() : m_good(true) {} + + inline backtrack_state() : m_good(true) {} inline void reset() { m_good = true; } inline bool good() const { return m_good; } }; @@ -80,7 +80,7 @@ public : typedef state state_type; template - static inline void apply(std::size_t size_at_start, + static inline void apply(std::size_t size_at_start, Rings& rings, typename boost::range_value::type& ring, Turns& turns, Operation& operation, std::string const& , @@ -91,7 +91,7 @@ public : ) { state.m_good = false; - + // Check self-intersections and throw exception if appropriate if (! state.m_checked) { @@ -124,7 +124,7 @@ public : typedef backtrack_state state_type; template - static inline void apply(std::size_t size_at_start, + static inline void apply(std::size_t size_at_start, Rings& rings, typename boost::range_value::type& ring, Turns& turns, Operation& operation, std::string const& reason, @@ -134,7 +134,7 @@ public : ) { std::cout << " REJECT " << reason << std::endl; - + state.m_good = false; rings.resize(size_at_start); diff --git a/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp b/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp index a365ccf90..1c8bba65f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp @@ -34,7 +34,7 @@ struct calculate_distance_policy static bool const include_degenerate = false; static bool const include_opposite = false; - template + template < typename Info, typename Point1, diff --git a/include/boost/geometry/algorithms/detail/overlay/follow.hpp b/include/boost/geometry/algorithms/detail/overlay/follow.hpp index 07ecba8fa..56cd1bc6a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/follow.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/follow.hpp @@ -33,7 +33,7 @@ namespace detail { namespace overlay namespace following { - + template static inline bool is_entering(Turn const& /* TODO remove this parameter */, Operation const& op) { @@ -45,17 +45,17 @@ static inline bool is_entering(Turn const& /* TODO remove this parameter */, Ope ; } -template +template < - typename Turn, - typename Operation, - typename LineString, + typename Turn, + typename Operation, + typename LineString, typename Polygon > -static inline bool last_covered_by(Turn const& turn, Operation const& op, +static inline bool last_covered_by(Turn const& turn, Operation const& op, LineString const& linestring, Polygon const& polygon) { - // Check any point between the this one and the first IP + // Check any point between the this one and the first IP typedef typename geometry::point_type::type point_type; point_type point_in_between; detail::point_on_border::midpoint_helper @@ -68,20 +68,20 @@ static inline bool last_covered_by(Turn const& turn, Operation const& op, } -template +template < - typename Turn, - typename Operation, - typename LineString, + typename Turn, + typename Operation, + typename LineString, typename Polygon > -static inline bool is_leaving(Turn const& turn, Operation const& op, - bool entered, bool first, +static inline bool is_leaving(Turn const& turn, Operation const& op, + bool entered, bool first, LineString const& linestring, Polygon const& polygon) { if (op.operation == operation_union) { - return entered + return entered || turn.method == method_crosses || (first && last_covered_by(turn, op, linestring, polygon)) ; @@ -90,20 +90,20 @@ static inline bool is_leaving(Turn const& turn, Operation const& op, } -template +template < - typename Turn, - typename Operation, - typename LineString, + typename Turn, + typename Operation, + typename LineString, typename Polygon > -static inline bool is_staying_inside(Turn const& turn, Operation const& op, - bool entered, bool first, +static inline bool is_staying_inside(Turn const& turn, Operation const& op, + bool entered, bool first, LineString const& linestring, Polygon const& polygon) { if (turn.method == method_crosses) { - // The normal case, this is completely covered with entering/leaving + // The normal case, this is completely covered with entering/leaving // so stay out of this time consuming "covered_by" return false; } @@ -116,11 +116,11 @@ static inline bool is_staying_inside(Turn const& turn, Operation const& op, return false; } -template +template < - typename Turn, - typename Operation, - typename Linestring, + typename Turn, + typename Operation, + typename Linestring, typename Polygon > static inline bool was_entered(Turn const& turn, Operation const& op, bool first, @@ -148,14 +148,14 @@ struct action_selector { template < - typename OutputIterator, - typename LineStringOut, - typename LineString, - typename Point, + typename OutputIterator, + typename LineStringOut, + typename LineString, + typename Point, typename Operation > static inline void enter(LineStringOut& current_piece, - LineString const& , + LineString const& , segment_identifier& segment_id, int , Point const& point, Operation const& operation, OutputIterator& ) @@ -167,10 +167,10 @@ struct action_selector template < - typename OutputIterator, - typename LineStringOut, - typename LineString, - typename Point, + typename OutputIterator, + typename LineStringOut, + typename LineString, + typename Point, typename Operation > static inline void leave(LineStringOut& current_piece, @@ -212,28 +212,28 @@ struct action_selector template < - typename OutputIterator, - typename LineStringOut, - typename LineString, - typename Point, + typename OutputIterator, + typename LineStringOut, + typename LineString, + typename Point, typename Operation > - static inline void enter(LineStringOut& current_piece, - LineString const& linestring, - segment_identifier& segment_id, - int index, Point const& point, + static inline void enter(LineStringOut& current_piece, + LineString const& linestring, + segment_identifier& segment_id, + int index, Point const& point, Operation const& operation, OutputIterator& out) { - normal_action::leave(current_piece, linestring, segment_id, index, + normal_action::leave(current_piece, linestring, segment_id, index, point, operation, out); } template < - typename OutputIterator, - typename LineStringOut, - typename LineString, - typename Point, + typename OutputIterator, + typename LineStringOut, + typename LineString, + typename Point, typename Operation > static inline void leave(LineStringOut& current_piece, @@ -298,7 +298,7 @@ class follow inline bool use_operation(Turn const& left, Turn const& right) const { - // If they are the same, OK. + // If they are the same, OK. return operation_order(left) < operation_order(right); } diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 278727003..70c7edad3 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -66,10 +66,10 @@ namespace boost { namespace geometry // Silence warning C4127: conditional expression is constant #if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable : 4127) +#pragma warning(push) +#pragma warning(disable : 4127) #endif - + #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace get_turns @@ -150,12 +150,12 @@ class get_turns_in_sections < typename tag_cast < - typename geometry::tag::type, + typename geometry::tag::type, areal_tag - >::type, + >::type, areal_tag >::value - && index1 == 0 + && index1 == 0 && index2 >= n - 2 ; } @@ -584,8 +584,8 @@ struct get_turns_cs bp[0], bp[1], bp[2], bp[3], rescale_policy, turns, interrupt_policy); - // Future performance enhancement: - // return if told by the interrupt policy + // Future performance enhancement: + // return if told by the interrupt policy } } } @@ -806,7 +806,7 @@ struct get_turns_reversed Geometry2, Geometry1, Reverse2, Reverse1, TurnPolicy - >::apply(source_id2, g2, source_id1, g1, rescale_policy, + >::apply(source_id2, g2, source_id1, g1, rescale_policy, turns, interrupt_policy); } }; @@ -884,7 +884,7 @@ inline void get_turns(Geometry1 const& geometry1, } #if defined(_MSC_VER) -#pragma warning(pop) +#pragma warning(pop) #endif }} // namespace boost::geometry diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp index 6873b9fa1..1c1d96a18 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp @@ -68,9 +68,9 @@ private : typename geometry::coordinate_system::type > robust_point_type; - inline void get_situation_map(Indexed const& left, Indexed const& right, - robust_point_type& pi_rob, robust_point_type& pj_rob, - robust_point_type& ri_rob, robust_point_type& rj_rob, + inline void get_situation_map(Indexed const& left, Indexed const& right, + robust_point_type& pi_rob, robust_point_type& pj_rob, + robust_point_type& ri_rob, robust_point_type& rj_rob, robust_point_type& si_rob, robust_point_type& sj_rob) const { typename geometry::point_type::type pi, pj, ri, rj, si, sj; @@ -84,9 +84,9 @@ private : geometry::copy_segment_points(m_geometry1, m_geometry2, right.subject.other_id, si, sj); - geometry::zoom_to_robust(pi, pj, ri, rj, si, sj, - pi_rob, pj_rob, - ri_rob, rj_rob, + geometry::zoom_to_robust(pi, pj, ri, rj, si, sj, + pi_rob, pj_rob, + ri_rob, rj_rob, si_rob, sj_rob); } diff --git a/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp b/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp index f664b1951..487bd6c37 100644 --- a/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp @@ -40,14 +40,14 @@ namespace dispatch struct select_rings { template - static inline void apply(Box const& box, Geometry const& , + static inline void apply(Box const& box, Geometry const& , ring_identifier const& id, Map& map, bool midpoint) { map[id] = typename Map::mapped_type(box, midpoint); } template - static inline void apply(Box const& box, + static inline void apply(Box const& box, ring_identifier const& id, Map& map, bool midpoint) { map[id] = typename Map::mapped_type(box, midpoint); @@ -68,7 +68,7 @@ namespace dispatch } template - static inline void apply(Ring const& ring, + static inline void apply(Ring const& ring, ring_identifier const& id, Map& map, bool midpoint) { if (boost::size(ring) > 0) @@ -248,7 +248,7 @@ template typename IntersectionMap, typename SelectionMap > inline void select_rings(Geometry1 const& geometry1, Geometry2 const& geometry2, - IntersectionMap const& intersection_map, + IntersectionMap const& intersection_map, SelectionMap& selection_map, bool midpoint) { typedef typename geometry::tag::type tag1; @@ -271,16 +271,16 @@ template typename IntersectionMap, typename SelectionMap > inline void select_rings(Geometry const& geometry, - IntersectionMap const& intersection_map, + IntersectionMap const& intersection_map, SelectionMap& selection_map, bool midpoint) { typedef typename geometry::tag::type tag; SelectionMap map_with_all; - dispatch::select_rings::apply(geometry, + dispatch::select_rings::apply(geometry, ring_identifier(0, -1, -1), map_with_all, midpoint); - update_selection_map(geometry, geometry, intersection_map, + update_selection_map(geometry, geometry, intersection_map, map_with_all, selection_map); } diff --git a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp index 989a32ba8..3317dcea8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp @@ -40,7 +40,7 @@ namespace detail { namespace overlay template #ifdef BOOST_GEOMETRY_DEBUG_TRAVERSE -inline void debug_traverse(Turn const& turn, Operation op, +inline void debug_traverse(Turn const& turn, Operation op, std::string const& header) { std::cout << header @@ -109,7 +109,7 @@ inline bool assign_next_ip(G1 const& g1, G2 const& g2, // If there is no next IP on this segment if (info.enriched.next_ip_index < 0) { - if (info.enriched.travels_to_vertex_index < 0 + if (info.enriched.travels_to_vertex_index < 0 || info.enriched.travels_to_ip_index < 0) { return false; @@ -292,7 +292,7 @@ public : *iit, current_seg_id)) { Backtrack::apply( - size_at_start, + size_at_start, rings, current_output, turns, *current_iit, "No next IP", geometry1, geometry2, rescale_policy, state); @@ -305,7 +305,7 @@ public : current_iit)) { Backtrack::apply( - size_at_start, + size_at_start, rings, current_output, turns, *iit, "Dead end at start", geometry1, geometry2, rescale_policy, state); @@ -327,7 +327,7 @@ public : // It visits a visited node again, without passing the start node. // This makes it suspicious for endless loops Backtrack::apply( - size_at_start, + size_at_start, rings, current_output, turns, *iit, "Visit again", geometry1, geometry2, rescale_policy, state); @@ -361,7 +361,7 @@ public : // Should not occur in self-intersecting polygons without spikes // Might occur in polygons with spikes Backtrack::apply( - size_at_start, + size_at_start, rings, current_output, turns, *iit, "Dead end", geometry1, geometry2, rescale_policy, state); @@ -377,7 +377,7 @@ public : // than turn points. // Turn points marked as "ii" can be visited twice. Backtrack::apply( - size_at_start, + size_at_start, rings, current_output, turns, *iit, "Endless loop", geometry1, geometry2, rescale_policy, state); diff --git a/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp index 89a60b21a..6bd8d3156 100644 --- a/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp @@ -103,7 +103,7 @@ struct turn_info { return has12(type, type); } - + inline bool has(operation_type type) const { return this->operations[0].operation == type diff --git a/include/boost/geometry/algorithms/detail/partition.hpp b/include/boost/geometry/algorithms/detail/partition.hpp index 45ff52ccb..a2d4912e3 100644 --- a/include/boost/geometry/algorithms/detail/partition.hpp +++ b/include/boost/geometry/algorithms/detail/partition.hpp @@ -39,7 +39,7 @@ inline void divide_box(Box const& box, Box& lower_box, Box& upper_box) } // Divide collection into three subsets: lower, upper and oversized -// (not-fitting) +// (not-fitting) // (lower == left or bottom, upper == right or top) template static inline void divide_into_subsets(Box const& lower_box, diff --git a/include/boost/geometry/algorithms/detail/recalculate.hpp b/include/boost/geometry/algorithms/detail/recalculate.hpp index 32240a74f..03f634eac 100644 --- a/include/boost/geometry/algorithms/detail/recalculate.hpp +++ b/include/boost/geometry/algorithms/detail/recalculate.hpp @@ -98,7 +98,7 @@ struct recalculate_indexed<0> namespace dispatch { -template +template < typename Geometry1, typename Geometry2, diff --git a/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp b/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp index 62328a0d8..3d83e6930 100644 --- a/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp +++ b/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp @@ -16,7 +16,7 @@ // BSG 2012-02-06: we use this currently only for distance. // For other scalar results area,length,perimeter it is commented on purpose. -// Reason is that for distance there is no other choice. distance of two +// Reason is that for distance there is no other choice. distance of two // empty geometries (or one empty) should NOT return any value. // But for area it is no problem to be 0. // Suppose: area(intersection(a,b)). We (probably) don't want a throw there... diff --git a/include/boost/geometry/algorithms/difference.hpp b/include/boost/geometry/algorithms/difference.hpp index 2f32b344c..dad1f942b 100644 --- a/include/boost/geometry/algorithms/difference.hpp +++ b/include/boost/geometry/algorithms/difference.hpp @@ -53,7 +53,7 @@ inline OutputIterator difference_insert(Geometry1 const& geometry1, concept::check(); concept::check(); concept::check(); - + return geometry::dispatch::intersection_insert < Geometry1, Geometry2, diff --git a/include/boost/geometry/algorithms/distance.hpp b/include/boost/geometry/algorithms/distance.hpp index 97c6cb20f..8a0d0c830 100644 --- a/include/boost/geometry/algorithms/distance.hpp +++ b/include/boost/geometry/algorithms/distance.hpp @@ -472,7 +472,7 @@ struct distance Segment const& segment, Strategy const& strategy) { - + typename point_type::type p[2]; geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); @@ -534,7 +534,7 @@ distance(Geometry1 const& geometry1, { concept::check(); concept::check(); - + detail::throw_on_empty_input(geometry1); detail::throw_on_empty_input(geometry2); diff --git a/include/boost/geometry/algorithms/envelope.hpp b/include/boost/geometry/algorithms/envelope.hpp index 88ae433b2..30bea6b12 100644 --- a/include/boost/geometry/algorithms/envelope.hpp +++ b/include/boost/geometry/algorithms/envelope.hpp @@ -174,7 +174,7 @@ struct envelope > }; template - static inline void + static inline void apply(boost::variant const& geometry, Box& box) { diff --git a/include/boost/geometry/algorithms/equals.hpp b/include/boost/geometry/algorithms/equals.hpp index 1ff73fbb9..5feed19a1 100644 --- a/include/boost/geometry/algorithms/equals.hpp +++ b/include/boost/geometry/algorithms/equals.hpp @@ -358,9 +358,9 @@ struct equals< /*! \brief \brief_check{are spatially equal} -\details \details_check12{equals, is spatially equal}. Spatially equal means +\details \details_check12{equals, is spatially equal}. Spatially equal means that the same point set is included. A box can therefore be spatially equal - to a ring or a polygon, or a linestring can be spatially equal to a + to a ring or a polygon, or a linestring can be spatially equal to a multi-linestring or a segment. This only works theoretically, not all combinations are implemented yet. \ingroup equals diff --git a/include/boost/geometry/algorithms/length.hpp b/include/boost/geometry/algorithms/length.hpp index a984c855b..6420bbb40 100644 --- a/include/boost/geometry/algorithms/length.hpp +++ b/include/boost/geometry/algorithms/length.hpp @@ -269,7 +269,7 @@ length(Geometry const& geometry, Strategy const& strategy) concept::check(); // detail::throw_on_empty_input(geometry); - + return resolve_variant::length::apply(geometry, strategy); } diff --git a/include/boost/geometry/algorithms/num_points.hpp b/include/boost/geometry/algorithms/num_points.hpp index 95a3bb866..e3557ddc1 100644 --- a/include/boost/geometry/algorithms/num_points.hpp +++ b/include/boost/geometry/algorithms/num_points.hpp @@ -36,7 +36,7 @@ namespace boost { namespace geometry // Silence warning C4127: conditional expression is constant #if defined(_MSC_VER) -#pragma warning(push) +#pragma warning(push) #pragma warning(disable : 4127) #endif diff --git a/include/boost/geometry/algorithms/point_on_surface.hpp b/include/boost/geometry/algorithms/point_on_surface.hpp index e662b1938..e6427b628 100644 --- a/include/boost/geometry/algorithms/point_on_surface.hpp +++ b/include/boost/geometry/algorithms/point_on_surface.hpp @@ -53,7 +53,7 @@ struct specific_coordinate_first CoordinateType const lh = geometry::get(lhs); CoordinateType const rh = geometry::get(rhs); - // If both lhs and rhs equal m_value_to_be_first, + // If both lhs and rhs equal m_value_to_be_first, // we should handle conform if lh < rh = FALSE // The first condition meets that, keep it first if (geometry::math::equals(rh, m_value_to_be_first)) @@ -148,7 +148,7 @@ inline void calculate_centroid(Point& point, Segments const& segments) if (segments.size() == 3) { // In almost all cases, the segments do have 3 values. In that case we use another - // centroid calculation, which should be slightly faster + // centroid calculation, which should be slightly faster // and is more precise (case #geos_1_test_overlay => normal centroid is outside! TODO) typedef typename geometry::coordinate_type::type coordinate_type; @@ -229,7 +229,7 @@ inline void replace_extremes_for_self_tangencies(Extremes& extremes, Intruders& // Then intruders (here "i1" but there may be more) are sorted from left to right // Finally points "a","b" and "c" (in this order) are selected as a new triangle. - // This triangle will have a centroid which is inside (assumed that intruders left segment + // This triangle will have a centroid which is inside (assumed that intruders left segment // is not equal to extremes left segment, but that polygon would be invalid) // Find highest non-self tangent intrusion, if any @@ -264,7 +264,7 @@ inline void replace_extremes_for_self_tangencies(Extremes& extremes, Intruders& // (alternatively we could use the last two points of extremes, and first point of last intruder...): //// ALTERNATIVE: std::copy(extremes.rbegin(), extremes.rbegin() + 2, std::back_inserter(triangle)); //// ALTERNATIVE: triangle.push_back(intruders.back().front()); - + // Now replace extremes with this smaller subset, a triangle, such that centroid calculation will result in a point inside extremes = triangle; } diff --git a/include/boost/geometry/algorithms/remove_spikes.hpp b/include/boost/geometry/algorithms/remove_spikes.hpp index 89f7dd676..634391b64 100644 --- a/include/boost/geometry/algorithms/remove_spikes.hpp +++ b/include/boost/geometry/algorithms/remove_spikes.hpp @@ -78,7 +78,7 @@ struct range_remove_spikes typedef typename boost::range_iterator::type iterator; std::deque cleaned; - for (typename boost::range_iterator::type it = boost::begin(range); + for (typename boost::range_iterator::type it = boost::begin(range); it != boost::end(range); ++it) { // Add point diff --git a/include/boost/geometry/algorithms/reverse.hpp b/include/boost/geometry/algorithms/reverse.hpp index 6990533e6..215cb5b59 100644 --- a/include/boost/geometry/algorithms/reverse.hpp +++ b/include/boost/geometry/algorithms/reverse.hpp @@ -107,7 +107,7 @@ namespace resolve_variant { template -struct reverse +struct reverse { static void apply(Geometry& geometry) {