Fix arrangement demo

This commit is contained in:
Andreas Fabri 2023-03-10 14:41:30 +00:00
parent 2de196ac3e
commit 1c00c6490e
4 changed files with 7 additions and 9 deletions

View File

@ -210,7 +210,7 @@ operator()(const Point_2& p, const X_monotone_curve_2& curve) const
auto points = painterOstream.getPointsList(curve); auto points = painterOstream.getPointsList(curve);
QPoint p_viewport = QPoint p_viewport =
view->mapFromScene(QPointF{p.x().doubleValue(), p.y().doubleValue()}); view->mapFromScene(QPointF{CGAL::to_double(p.x()), CGAL::to_double(p.y())});
double minDist = (std::numeric_limits<double>::max)(); double minDist = (std::numeric_limits<double>::max)();
for (auto& vec : points) for (auto& vec : points)

View File

@ -862,7 +862,7 @@ void draw(const Arc_2& arc,
get_pixel_coords(l, y_clip, pix_beg); get_pixel_coords(l, y_clip, pix_beg);
get_pixel_coords(ptmp->left, it->second ? engine.y_max_r : get_pixel_coords(ptmp->left, it->second ? engine.y_max_r :
engine.y_min_r, pix_end); engine.y_min_r, pix_end);
if(CGAL_ABS(ptmp->left - l) <= engine.pixel_w_r*2) { if(CGAL_ABS(Rational(ptmp->left - l)) <= engine.pixel_w_r*2) {
Coordinate_2 xy(Coordinate_1(pt), *support, arc.arcno()); Coordinate_2 xy(Coordinate_1(pt), *support, arc.arcno());
Rational _; Rational _;

View File

@ -694,7 +694,7 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key,
while(der_it != der_begin) { while(der_it != der_begin) {
--der_it; --der_it;
e1 = xsum_abs * e1 + CGAL_ABS(x1 * z1); e1 = xsum_abs * e1 + CGAL_ABS(NT(x1 * z1));
z1 = x0*z1 + x1*y1; z1 = x0*z1 + x1*y1;
y1 = y1*x0 + x1*y0; y1 = y1*x0 + x1*y0;
y0 = x0*y0 + extract(*cache_it)*(*der_it); y0 = x0*y0 + extract(*cache_it)*(*der_it);
@ -725,7 +725,7 @@ bool get_range_QF_1(int var, const NT& l_, const NT& r_, const NT& key,
NT y0 = extract(*cache_it), y1(0), z1(0), e1(0); NT y0 = extract(*cache_it), y1(0), z1(0), e1(0);
while(cache_it != begin) { while(cache_it != begin) {
--cache_it; --cache_it;
e1 = xsum_abs * e1 + CGAL_ABS(x1*z1); e1 = xsum_abs * e1 + CGAL_ABS(NT(x1*z1));
z1 = x0*z1 + x1*y1; z1 = x0*z1 + x1*y1;
y1 = y1*x0 + x1*y0; y1 = y1*x0 + x1*y0;
y0 = x0*y0 + extract(*cache_it); y0 = x0*y0 + extract(*cache_it);

View File

@ -344,7 +344,7 @@ struct Curve_renderer_traits<CORE::BigFloat, class CORE::BigRat>
typedef Integer result_type; typedef Integer result_type;
Integer operator()(const Rational& x) const { Integer operator()(const Rational& x) const {
return x.BigIntValue(); return numerator(x)/denominator(x);
} }
}; };
@ -397,7 +397,7 @@ struct Curve_renderer_traits<CORE::BigRat, CORE::BigRat> :
typedef Integer result_type; typedef Integer result_type;
Integer operator()(const Rational& x) const { Integer operator()(const Rational& x) const {
return x.BigIntValue(); return numerator(x)/denominator(x);
} }
}; };
@ -406,9 +406,7 @@ struct Curve_renderer_traits<CORE::BigRat, CORE::BigRat> :
typedef std::size_t result_type; typedef std::size_t result_type;
inline result_type operator()(const Float& key) const { inline result_type operator()(const Float& key) const {
const CORE::BigRatRep& rep = key.getRep(); return std::hash<Float>()(key);
std::size_t ret = reinterpret_cast<std::size_t>(&rep);
return ret;
} }
}; };
}; };