From 1cd4089d8e24488d32ada952655c344b68431f8d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 29 Nov 2006 22:00:39 +0000 Subject: [PATCH] Added handling of loops --- src/osgUtil/PlaneIntersector.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/osgUtil/PlaneIntersector.cpp b/src/osgUtil/PlaneIntersector.cpp index 829e22da6..fd97d61c3 100644 --- a/src/osgUtil/PlaneIntersector.cpp +++ b/src/osgUtil/PlaneIntersector.cpp @@ -254,6 +254,12 @@ namespace PlaneIntersectorUtils // remove entries for the end of the end_poly and the start of the start_poly _endPolylineMap.erase(end_itr); _startPolylineMap.erase(start_itr); + + if (end_poly==start_poly) + { + _polylines.push_back(end_poly); + } + } void fuse_end_to_end(PolylineMap::iterator end1_itr, PolylineMap::iterator end2_itr) @@ -308,17 +314,26 @@ namespace PlaneIntersectorUtils osg::notify(osg::NOTICE)<<" line - end = "<first<<" polyline size = "<second->_polyline.size()<second); + } + + for(PolylineList::iterator pitr = _polylines.begin(); + pitr != _polylines.end(); + ++pitr) { osg::notify(osg::NOTICE)<<"polyline:"<second->_polyline; - for(RefPolyline::Polyline::iterator pitr = polyline.begin(); - pitr != polyline.end(); - ++pitr) + RefPolyline::Polyline& polyline = (*pitr)->_polyline; + for(RefPolyline::Polyline::iterator vitr = polyline.begin(); + vitr != polyline.end(); + ++vitr) { - osg::notify(osg::NOTICE)<<" "<<*pitr<