From fd8d6b7f3b1c6a4a02b835e5f844ba0c2f233791 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 3 Dec 2006 12:52:38 +0000 Subject: [PATCH] Cleaned up debugging info. --- src/osgSim/ElevationSlice.cpp | 11 ++++++++++ src/osgUtil/PlaneIntersector.cpp | 35 +++++++++++++------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/osgSim/ElevationSlice.cpp b/src/osgSim/ElevationSlice.cpp index c662df084..9251063c1 100644 --- a/src/osgSim/ElevationSlice.cpp +++ b/src/osgSim/ElevationSlice.cpp @@ -94,9 +94,20 @@ void ElevationSlice::computeIntersections(osg::Node* scene) scene->accept(_intersectionVisitor); osgUtil::PlaneIntersector::Intersections& intersections = intersector->getIntersections(); + osg::notify(osg::NOTICE)<getIntersections()="<<&(intersector->getIntersections())< poly1 = start1_itr->second; osg::ref_ptr poly2 = start2_itr->second; @@ -237,8 +235,6 @@ namespace PlaneIntersectorUtils void fuse_start_to_end(PolylineMap::iterator start_itr, PolylineMap::iterator end_itr) { - osg::notify(osg::NOTICE)<<"Fusing start to end - DONE"< end_poly = end_itr->second; osg::ref_ptr start_poly = start_itr->second; @@ -266,8 +262,6 @@ namespace PlaneIntersectorUtils void fuse_end_to_end(PolylineMap::iterator end1_itr, PolylineMap::iterator end2_itr) { - osg::notify(osg::NOTICE)<<"Fusing end to end - DONE 3"< poly1 = end1_itr->second; @@ -294,6 +288,17 @@ namespace PlaneIntersectorUtils } + void consolidatePolylineLists() + { + // move the remaining open ended line segments into the polyline list + for(PolylineMap::iterator sitr = _startPolylineMap.begin(); + sitr != _startPolylineMap.end(); + ++sitr) + { + _polylines.push_back(sitr->second); + } + } + void report() { osg::notify(osg::NOTICE)<<"report()"<second); - } - for(PolylineList::iterator pitr = _polylines.begin(); pitr != _polylines.end(); ++pitr) @@ -551,7 +548,7 @@ void PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable ti.set(_plane,_polytope); drawable->accept(ti); - ti._polylineConnector.report(); + ti._polylineConnector.consolidatePolylineLists(); if (ti._hit) { @@ -561,7 +558,9 @@ void PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable pitr != ti._polylineConnector._polylines.end(); ++pitr) { + unsigned int pos = intersections.size(); + intersections.push_back(Intersection()); Intersection& new_intersection = intersections[pos]; @@ -569,12 +568,6 @@ void PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable new_intersection.nodePath = iv.getNodePath(); new_intersection.drawable = drawable; } - - osg::notify(osg::NOTICE)<