]> git.mxchange.org Git - simgear.git/commitdiff
Object names for STG groups / nodes.
authorJames Turner <zakalawe@mac.com>
Sat, 22 Jun 2013 13:27:53 +0000 (14:27 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 22 Jun 2013 13:27:53 +0000 (14:27 +0100)
simgear/scene/sky/sky.cxx
simgear/scene/tgdb/ReaderWriterSTG.cxx
simgear/scene/tgdb/obj.cxx

index ce3ceb699253a1a4e7aaa895bb93df9af958ebad..77a491b7c46b33f9e259a9f15009670a28ba10e4 100644 (file)
@@ -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;
index 6f520b9bcfe278427e4d8465b0958cfc53f8bc06..4451206873a646446770d49225c225b83c3baf14 100644 (file)
@@ -118,12 +118,14 @@ struct ReaderWriterSTG::_ModelBin {
         readNode(const std::string&, const osgDB::Options*)
         {
             osg::ref_ptr<osg::Group> 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<osg::Node> node;
                 if (i->_proxy)  {
                     osg::ref_ptr<osg::ProxyNode> 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<osg::Group> 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<osg::Node> 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.
index 5336ada46d0ac3afbb66f33096693d30e83c1693..21427c90b049770da55f775fa6685d1feb768be9 100644 (file)
@@ -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<osg::Group> forestNode;
   osg::ref_ptr<osg::Group> 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));
     }