Changeset 127 for osgVisual/src
- Timestamp:
- Sep 5, 2010, 8:56:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/src/core/visual_core.cpp
r125 r127 82 82 loadTerrain(arguments); 83 83 84 // create the windows and run the threads. 85 viewer->realize(); 86 87 // setup scenery 88 setupScenery(); 89 90 // parse Configuration file 91 parseConfigFile(arguments); 92 84 93 // All modules are initialized - now check arguments for any unused parameter. 85 94 checkCommandlineArgumentsForFinalErrors(); 86 87 // create the windows and run the threads.88 viewer->realize();89 90 // setup scenery91 setupScenery();92 95 93 96 // Run visual main loop … … 253 256 void visual_core::parseConfigFile(osg::ArgumentParser& arguments_) 254 257 { 258 configFileValid = false; 259 255 260 std::string filename; 256 261 if( arguments.read("-c", filename) || arguments.read("--config", filename) ) 257 262 { 263 OSG_ALWAYS << "Using configuration file.." << std::endl; 258 264 if( osgDB::fileExists(filename) ) 259 265 { … … 274 280 275 281 // Parse the XML document. 276 282 checkXMLNode(root_element); 277 283 278 284 // free the document … … 291 297 void visual_core::checkXMLNode(xmlNode * a_node) 292 298 { 293 299 for (xmlNode *cur_node = a_node; cur_node; cur_node = cur_node->next) 300 { 301 std::string node_name=reinterpret_cast<const char*>(cur_node->name); 302 if(cur_node->type == XML_ELEMENT_NODE && node_name == "osgvisualconfiguration") 303 { 304 OSG_DEBUG << "XML node osgvisualconfiguration found" << std::endl; 305 configFileValid = true; 306 // Iterate to the next nodes to configure modules and scenery. 307 checkXMLNode(cur_node->children); 308 } 309 310 if (cur_node->type == XML_ELEMENT_NODE && node_name == "module") 311 { 312 OSG_DEBUG << "XML node module found" << std::endl; 313 314 parseModule(cur_node); 315 316 //OSG_DEBUG << "node type=Element, name:" << cur_node->name << std::endl; 317 //OSG_DEBUG << "Processing children at " << cur_node->children << std::endl; 318 } // IF(module) END 319 320 if (cur_node->type == XML_ELEMENT_NODE && node_name == "scenery") 321 { 322 OSG_DEBUG << "XML node scenery found" << std::endl; 323 324 parseScenery(cur_node); 325 326 //OSG_DEBUG << "node type=Element, name:" << cur_node->name << std::endl; 327 //OSG_DEBUG << "Processing children at " << cur_node->children << std::endl; 328 } // IF(scenery) END 329 } // FOR END 330 } 331 332 void visual_core::parseModule(xmlNode * a_node) 333 { 334 OSG_ALWAYS << "parseModule()" << std::endl; 294 335 } 295 336 296 337 void visual_core::parseScenery(xmlNode * a_node) 297 338 { 298 339 OSG_ALWAYS << "parseScenery()" << std::endl; 299 340 } 300 341
Note: See TracChangeset
for help on using the changeset viewer.