Open yoavmil opened 4 years ago
By default the vertices are int32. If you want the full scale of 64bit int, then you have to provide your own traits
https://www.boost.org/doc/libs/1_72_0/libs/polygon/doc/voronoi_advanced_tutorial.htm
Actually I am using traits and I'm following the tutorial. Please take a glance at my code.
struct Point { int64 X, Y; }
namespace boost {
namespace polygon {
template <>
struct geometry_concept<Point> {
typedef point_concept type;
};
template <>
struct point_traits<Point> {
typedef int64 coordinate_type;
static inline coordinate_type get(
const Point& point, orientation_2d orient) {
return (orient == HORIZONTAL) ? point.X : point.Y;
}
};
template <>
struct geometry_concept<BoostSegment> {
typedef segment_concept type;
};
template <>
struct segment_traits<BoostSegment> {
typedef Point point_type;
static inline point_type get(const BoostSegment& segment, direction_1d dir) {
return dir.to_int() ? segment.first : segment.second;
}
};
} // polygon
} // boost
My datatype is int64, and for some reason Boost is converting it to int.
struct Point { int64 X, Y; }
Maybe I'm doing something wrong, please advise, and maybe it is similar to this.