00001 #include <esg/explorer/BVExplorer.h> 00002 #include <esg/Group.h> 00003 #include <esg/InspectorSDS.h> 00004 00005 using namespace esg; 00006 00007 bool BVExplorer::_iterate(SceneGraphObject& obj) 00008 { 00009 try { 00010 SDS * pSDS = dynamic_cast<Group&>(obj).getRepository(); 00011 if (pSDS) { 00012 InspectorSDS * pInspector = pSDS->createInspector(_depth); 00013 if (pInspector) { 00014 const Geometry* pGeom = pInspector->firstElement(); 00015 while (pGeom) { 00016 if (_trStack.empty()) 00017 _boundingVolumes.append(pGeom->clone()); 00018 else 00019 _boundingVolumes.append(pGeom->clone(_trStack.top())); 00020 pGeom = pInspector->nextElement(); 00021 } 00022 } 00023 } 00024 } catch(bad_cast) { 00025 // not a group node 00026 } 00027 00028 return Explorer::_iterate(obj); 00029 } 00030