Changeset 189 for osgVisual/trunk/src/core
- Timestamp:
- Jan 9, 2011, 9:50:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/core/visual_core.cpp
r188 r189 91 91 addManipulators(); 92 92 93 loadTerrain(arguments);94 95 93 // create the windows and run the threads. 96 94 viewer->realize(); 97 95 96 loadTerrain(arguments); 97 98 98 // parse Configuration file 99 99 xmlDoc* tmpDoc; 100 xmlNode* sceneryNode = util::getSceneryXMLConfig( "osgVisualConfig.xml", tmpDoc);100 xmlNode* sceneryNode = util::getSceneryXMLConfig(configFilename, tmpDoc); 101 101 parseScenery(sceneryNode); 102 102 if(sceneryNode) … … 311 311 if(cur_node->type == XML_ELEMENT_NODE && node_name == "datetime") 312 312 { 313 //<datetime day="01" month="02" year="2010" hour="23" minute="45"></datetime> 313 int hour, minute; 314 int day=0,month=0,year=0; 315 316 xmlAttr *attr = cur_node->properties; 317 while ( attr ) 318 { 319 std::string attr_name=reinterpret_cast<const char*>(attr->name); 320 std::string attr_value=reinterpret_cast<const char*>(attr->children->content); 321 if( attr_name == "day" ) 322 { 323 std::stringstream sstr(attr_value); 324 sstr >> day; 325 } 326 if( attr_name == "month" ) 327 { 328 std::stringstream sstr(attr_value); 329 sstr >> month; 330 } 331 if( attr_name == "year" ) 332 { 333 std::stringstream sstr(attr_value); 334 sstr >> year; 335 } 336 if( attr_name == "hour" ) 337 { 338 std::stringstream sstr(attr_value); 339 sstr >> hour; 340 } 341 if( attr_name == "minute" ) 342 { 343 std::stringstream sstr(attr_value); 344 sstr >> minute; 345 } 346 attr = attr->next; 347 } 348 if(sky.valid()) 349 { 350 if(day!=0 && month!=0 && year!=0) 351 sky->setDate(year, month, day); 352 sky->setTime(hour,minute,00); 353 } 354 314 355 } 315 356
Note: See TracChangeset
for help on using the changeset viewer.