Changeset 189 for osgVisual


Ignore:
Timestamp:
Jan 9, 2011, 9:50:33 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/bin/osgVisualConfig.xml

    r183 r189  
    5050      </model>
    5151    </models>
    52     <datetime day="01" month="02" year="2010" hour="23" minute="45"></datetime>
     52    <datetime day="0" month="0" year="0" hour="15" minute="30"></datetime>
    5353    <visibility range="50000" turbidity="2.2" ></visibility>
    5454    <cloudlayer slot="1" type="cumulusCongestus" enabled="true" fadetime="15">
  • osgVisual/trunk/src/core/visual_core.cpp

    r188 r189  
    9191        addManipulators();
    9292
    93         loadTerrain(arguments);
    94 
    9593        // create the windows and run the threads.
    9694        viewer->realize();
    9795
     96        loadTerrain(arguments);
     97
    9898        // parse Configuration file
    9999        xmlDoc* tmpDoc;
    100         xmlNode* sceneryNode = util::getSceneryXMLConfig( "osgVisualConfig.xml", tmpDoc);
     100        xmlNode* sceneryNode = util::getSceneryXMLConfig(configFilename, tmpDoc);
    101101        parseScenery(sceneryNode);
    102102        if(sceneryNode)
     
    311311                if(cur_node->type == XML_ELEMENT_NODE && node_name == "datetime")
    312312                {
    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
    314355                }
    315356
Note: See TracChangeset for help on using the changeset viewer.