diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/segment_identifier.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/overlay/segment_identifier.hpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp b/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp index 007113ffba..516ec349e8 100644 --- a/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp +++ b/boost/geometry/algorithms/detail/overlay/segment_identifier.hpp @@ -14,19 +14,19 @@ # define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER #endif +#if defined(BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER) +#include <iostream> +#endif -#include <vector> - - -#include <boost/geometry/core/access.hpp> -#include <boost/geometry/core/coordinate_dimension.hpp> +#include <boost/geometry/algorithms/detail/signed_index_type.hpp> namespace boost { namespace geometry { + // Internal struct to uniquely identify a segment // on a linestring,ring // or polygon (needs ring_index) @@ -40,7 +40,10 @@ struct segment_identifier , segment_index(-1) {} - inline segment_identifier(int src, int mul, int rin, int seg) + inline segment_identifier(signed_index_type src, + signed_index_type mul, + signed_index_type rin, + signed_index_type seg) : source_index(src) , multi_index(mul) , ring_index(rin) @@ -68,20 +71,20 @@ struct segment_identifier #if defined(BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER) friend std::ostream& operator<<(std::ostream &os, segment_identifier const& seg_id) { - std::cout + os << "s:" << seg_id.source_index - << ", v:" << seg_id.segment_index // ~vertex + << ", v:" << seg_id.segment_index // v:vertex because s is used for source ; - if (seg_id.ring_index >= 0) std::cout << ", r:" << seg_id.ring_index; - if (seg_id.multi_index >= 0) std::cout << ", m:" << seg_id.multi_index; + if (seg_id.ring_index >= 0) os << ", r:" << seg_id.ring_index; + if (seg_id.multi_index >= 0) os << ", m:" << seg_id.multi_index; return os; } #endif - int source_index; - int multi_index; - int ring_index; - int segment_index; + signed_index_type source_index; + signed_index_type multi_index; + signed_index_type ring_index; + signed_index_type segment_index; }; |