Ticket #17 (closed defect: fixed)
ASSERT when intersecting "criss-crossed" polygon with box
| Reported by: | koying | Owned by: | barendgehrels |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.4 (Preview 4) |
| Component: | ggl/algorithms | Version: | svn-trunk |
| Keywords: | Cc: | mloskot |
Description
I receive an assert when doing polygon_2d by box_2d intersection in a very specific case (see image attached).
In the context of the Openstreetmap project, someone "cheated" and criss-crossed the polygon segment to avoid doing holes in the polygon. Even if the polygon construct is not valid, it should throw an exception rather than an ASSERT.
This lead to an assert with the following backtrace:
0 msvcrt!_assert C:\WINDOWS\system32\msvcrt.dll 0 1 ggl::traverse<ggl::linear_ring<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::allocator>, ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, ggl::box<ggl::point_xy<double, ggl::cs::cartesian> >, std::deque<ggl::detail::intersection::intersection_point<ggl::point_xy<double, ggl::cs::cartesian> >, std::allocator<ggl::detail::intersection::intersection_point<ggl::point_xy<double, ggl::cs::cartesian> > > >, std::back_insert_iterator<std::vector<ggl::linear_ring<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::allocator>, std::allocator<ggl::linear_ring<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::allocator> > > > > traverse.hpp 372 2 ggl::detail::intersection::intersection_polygon_box<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, ggl::box<ggl::point_xy<double, ggl::cs::cartesian> >, std::back_insert_iterator<std::vector<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, std::allocator<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator> > > >, ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator> >::apply intersection.hpp 225 3 ggl::dispatch::intersection_reversed<ggl::box_tag, ggl::polygon_tag, ggl::polygon_tag, ggl::box<ggl::point_xy<double, ggl::cs::cartesian> >, ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, std::back_insert_iterator<std::vector<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, std::allocator<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator> > > >, ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator> >::apply intersection.hpp 384 4 ggl::intersection<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, ggl::box<ggl::point_xy<double, ggl::cs::cartesian> >, ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, std::back_insert_iterator<std::vector<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator>, std::allocator<ggl::polygon<ggl::point_xy<double, ggl::cs::cartesian>, std::vector, std::vector, std::allocator, std::allocator> > > > > intersection.hpp 427 5 Road::buildPath Road.cpp 623 6 MapView::buildFeatureSet MapView.cpp 332 7 MapView::paintEvent MapView.cpp 190 8 QWidget::event qwidget.cpp 7687 9 MapView::event MapView.cpp 1172 10 QApplicationPrivate::notify_helper qapplication.cpp 4056 11 QApplication::notify qapplication.cpp 4021 12 QCoreApplication::notifyInternal qcoreapplication.cpp 610 13 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 216 14 QWidgetPrivate::drawWidget qwidget.cpp 5079 15 QWidgetBackingStore::sync qbackingstore.cpp 1261 16 QWidgetPrivate::syncBackingStore qwidget.cpp 1603 17 QWidget::event qwidget.cpp 7827 18 QMainWindow::event qmainwindow.cpp 1399 19 QApplicationPrivate::notify_helper qapplication.cpp 4056 20 QApplication::notify qapplication.cpp 4021 ... <More>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

