From: James Turner Date: Sat, 22 Jun 2013 13:27:53 +0000 (+0100) Subject: Object names for STG groups / nodes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6f54fb90ebe610146811c0297d7bfde25c32dc5c;p=simgear.git Object names for STG groups / nodes. --- diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index ce3ceb69..77a491b7 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -61,7 +61,7 @@ SGSky::SGSky( void ) { pre_root->setStateSet(preStateSet); cloud_root = new osg::Group; cloud_root->setNodeMask(simgear::MODEL_BIT); - + cloud_root->setName("SGSky-cloud-root"); pre_selector = new osg::Switch; pre_transform = new osg::Group; diff --git a/simgear/scene/tgdb/ReaderWriterSTG.cxx b/simgear/scene/tgdb/ReaderWriterSTG.cxx index 6f520b9b..44512068 100644 --- a/simgear/scene/tgdb/ReaderWriterSTG.cxx +++ b/simgear/scene/tgdb/ReaderWriterSTG.cxx @@ -118,12 +118,14 @@ struct ReaderWriterSTG::_ModelBin { readNode(const std::string&, const osgDB::Options*) { osg::ref_ptr group = new osg::Group; + group->setName("STG-group-A"); group->setDataVariance(osg::Object::STATIC); for (std::list<_ObjectStatic>::iterator i = _objectStaticList.begin(); i != _objectStaticList.end(); ++i) { osg::ref_ptr node; if (i->_proxy) { osg::ref_ptr proxy = new osg::ProxyNode; + proxy->setName("proxyNode"); proxy->setLoadingExternalReferenceMode(osg::ProxyNode::DEFER_LOADING_TO_DATABASE_PAGER); proxy->setFileName(0, i->_name); proxy->setDatabaseOptions(i->_options.get()); @@ -147,6 +149,7 @@ struct ReaderWriterSTG::_ModelBin { osg::MatrixTransform* matrixTransform; matrixTransform = new osg::MatrixTransform(matrix); + matrixTransform->setName("positionStaticObject"); matrixTransform->setDataVariance(osg::Object::STATIC); matrixTransform->addChild(node.get()); group->addChild(matrixTransform); @@ -368,7 +371,8 @@ struct ReaderWriterSTG::_ModelBin { osg::ref_ptr terrainGroup = new osg::Group; terrainGroup->setDataVariance(osg::Object::STATIC); - + terrainGroup->setName("terrain"); + if (_foundBase) { for (std::list<_Object>::iterator i = _objectList.begin(); i != _objectList.end(); ++i) { osg::ref_ptr node; @@ -385,6 +389,7 @@ struct ReaderWriterSTG::_ModelBin { osg::Node* node = SGOceanTile(bucket, options->getMaterialLib()); if (node) { + node->setName("SGOceanTile"); terrainGroup->addChild(node); } else { SG_LOG( SG_TERRAIN, SG_ALERT, @@ -410,6 +415,7 @@ struct ReaderWriterSTG::_ModelBin { } else { osg::PagedLOD* pagedLOD = new osg::PagedLOD; pagedLOD->setCenterMode(osg::PagedLOD::USE_BOUNDING_SPHERE_CENTER); + pagedLOD->setName("pagedObjectLOD"); // This should be visible in any case. // If this is replaced by some lower level of detail, the parent LOD node handles this. diff --git a/simgear/scene/tgdb/obj.cxx b/simgear/scene/tgdb/obj.cxx index 5336ada4..21427c90 100644 --- a/simgear/scene/tgdb/obj.cxx +++ b/simgear/scene/tgdb/obj.cxx @@ -399,12 +399,15 @@ struct SGTileGeometryBin { if (matlib) mat = matlib->find(i->first); eg = new EffectGeode; + eg->setName("EffectGeode"); if (mat) eg->setEffect(mat->get_effect(i->second)); eg->addDrawable(geometry); eg->runGenerators(geometry); // Generate extra data needed by effect - if (group) + if (group) { + group->setName("surfaceGeometryGroup"); group->addChild(eg); + } } if (group) return group; @@ -953,7 +956,8 @@ SGLoadBTG(const std::string& path, const simgear::SGReaderWriterOptions* options osg::ref_ptr forestNode; osg::ref_ptr buildingNode; osg::Group* terrainGroup = new osg::Group; - + terrainGroup->setName("BTGTerrainGroup"); + osg::Node* node = tileGeometryBin.getSurfaceGeometry(matlib); if (node) terrainGroup->addChild(node); @@ -1001,6 +1005,7 @@ SGLoadBTG(const std::string& path, const simgear::SGReaderWriterOptions* options osg::MatrixTransform* position = new osg::MatrixTransform(transformMat); + position->setName("positionRandomeModel"); position->addChild(node); models.push_back(ModelLOD(position, obj.lod)); }