Changeset 189
- Timestamp:
- Jan 9, 2011, 9:50:33 PM (14 years ago)
- Location:
- osgVisual/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/bin/osgVisualConfig.xml
r183 r189 50 50 </model> 51 51 </models> 52 <datetime day="0 1" month="02" year="2010" hour="23" minute="45"></datetime>52 <datetime day="0" month="0" year="0" hour="15" minute="30"></datetime> 53 53 <visibility range="50000" turbidity="2.2" ></visibility> 54 54 <cloudlayer slot="1" type="cumulusCongestus" enabled="true" fadetime="15"> -
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.