Changeset 219 for osgVisual


Ignore:
Timestamp:
Feb 2, 2011, 9:59:08 AM (13 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual/trunk
Files:
4 edited

Legend:

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

    r216 r219  
    7676    <visibility range="50000" turbidity="2.2" ></visibility>
    7777    <clouds>
    78       <!--<cloudlayer slot="0" type="CUMULONIMBUS_CAPPILATUS" enabled="true" fadetime="15">
     78      <!--<cloudlayer slot="0" type="CUMULONIMBUS_CAPPILATUS" enabled="yes" fadetime="15">
    7979        <geometry baselength="20000" basewidth="20000" thickness="600" baseHeight="1000" density="0.5"></geometry>
    8080      </cloudlayer>-->
    81       <cloudlayer slot="1" type="CUMULUS_CONGESTUS" enabled="true" fadetime="15">
     81      <cloudlayer slot="1" type="CUMULUS_CONGESTUS" enabled="yes" fadetime="15">
    8282        <geometry baselength="50000" basewidth="50000" thickness="1600" baseHeight="1000" density="0.07"></geometry>
    8383        <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation>
    8484      </cloudlayer>
    85       <cloudlayer slot="2" type="CUMULUS_MEDIOCRIS" enabled="true" fadetime="15">
     85      <cloudlayer slot="2" type="CUMULUS_MEDIOCRIS" enabled="yes" fadetime="15">
    8686        <geometry baselength="50000" basewidth="50000" thickness="1600" baseHeight="1000" density="0.07"></geometry>
    8787      </cloudlayer>
    88       <!--<cloudlayer slot="3" type="CIRRUS_FIBRATUS" enabled="true" fadetime="15">
     88      <!--<cloudlayer slot="3" type="CIRRUS_FIBRATUS" enabled="yes" fadetime="15">
    8989        <geometry baselength="5000000" basewidth="5000000" thickness="600" baseHeight="7351" density="0.2"></geometry>
    9090      </cloudlayer>-->
    91       <!--<cloudlayer slot="4" type="CIRROCUMULUS" enabled="true" fadetime="15">
     91      <!--<cloudlayer slot="4" type="CIRROCUMULUS" enabled="yes" fadetime="15">
    9292        <geometry baselength="50000" basewidth="50000" thickness="600" baseHeight="7351" density="0.2"></geometry>
    9393      </cloudlayer>-->
    94       <!--<cloudlayer slot="5" type="STRATOCUMULUS" enabled="true" fadetime="15">
     94      <!--<cloudlayer slot="5" type="STRATOCUMULUS" enabled="yes" fadetime="15">
    9595        <geometry baselength="100000" basewidth="100000" thickness="2500" baseHeight="2000" density="0.3"></geometry>
    9696      </cloudlayer>-->
    97       <!--<cloudlayer slot="6" type="STRATUS" enabled="true" fadetime="15">
     97      <!--<cloudlayer slot="6" type="STRATUS" enabled="yes" fadetime="15">
    9898        <geometry baselength="50000" basewidth="50000" thickness="1500" baseHeight="1500" density="0.3"></geometry>
    9999      </cloudlayer>-->
  • osgVisual/trunk/include/util/visual_util.h

    r218 r219  
    270270        static std::string getAnimationPathFromXMLConfig(std::string configFilename);
    271271
     272        /**
     273         * \brief This function converts a string into a double.
     274         *
     275         * @param s : String to convert.
     276         * @return : double representation of the string.
     277         */
    272278        static int strToDouble(std::string s);
     279
     280        /**
     281         * \brief This function converts a string into an Integer.
     282         *
     283         * @param s : String to convert.
     284         * @return : Integer representation of the string.
     285         */
    273286        static double strToInt(std::string s);
     287
     288        /**
     289         * \brief This function converts a string into a bool.
     290         *
     291         * @param s : String to convert.
     292         * @return : Bool representation of the string. Returns 'false' on error.
     293         */
    274294        static bool strToBool(std::string s);
    275295
  • osgVisual/trunk/src/core/visual_core.cpp

    r216 r219  
    300300                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    301301                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    302                                 if( attr_name == "day" )
    303                                 {
    304                                         std::stringstream sstr(attr_value);
    305                                         sstr >> day;
    306                                 }
    307                                 if( attr_name == "month" )
    308                                 {
    309                                         std::stringstream sstr(attr_value);
    310                                         sstr >> month;
    311                                 }
    312                                 if( attr_name == "year" )
    313                                 {
    314                                         std::stringstream sstr(attr_value);
    315                                         sstr >> year;
    316                                 }
    317                                 if( attr_name == "hour" )
    318                                 {
    319                                         std::stringstream sstr(attr_value);
    320                                         sstr >> hour;
    321                                 }
    322                                 if( attr_name == "minute" )
    323                                 {
    324                                         std::stringstream sstr(attr_value);
    325                                         sstr >> minute;
    326                                 }
     302                                if( attr_name == "day" ) day = util::strToInt(attr_value);
     303                                if( attr_name == "month" ) month = util::strToInt(attr_value);
     304                                if( attr_name == "year" ) year = util::strToInt(attr_value);
     305                                if( attr_name == "hour" ) hour = util::strToInt(attr_value);
     306                                if( attr_name == "minute" ) minute = util::strToInt(attr_value);
     307
    327308                                attr = attr->next;
    328309                        }
     
    343324                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    344325                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    345                                 if( attr_name == "range" )
    346                                 {
    347                                         std::stringstream sstr(attr_value);
    348                                         sstr >> range;
    349                                 }
    350                                 if( attr_name == "turbidity" )
    351                                 {
    352                                         std::stringstream sstr(attr_value);
    353                                         sstr >> turbidity;
    354                                 }
     326                                if( attr_name == "range" ) range = util::strToDouble(attr_value);
     327                                if( attr_name == "turbidity" ) turbidity = util::strToDouble(attr_value);
     328
    355329                                attr = attr->next;
    356330                        }
     
    377351                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    378352                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    379                                 if( attr_name == "bottom" )
    380                                 {
    381                                         std::stringstream sstr(attr_value);
    382                                         sstr >> bottom;
    383                                 }
    384                                 if( attr_name == "top" )
    385                                 {
    386                                         std::stringstream sstr(attr_value);
    387                                         sstr >> top;
    388                                 }
    389                                 if( attr_name == "speed" )
    390                                 {
    391                                         std::stringstream sstr(attr_value);
    392                                         sstr >> speed;
    393                                 }
    394                                 if( attr_name == "direction" )
    395                                 {
    396                                         std::stringstream sstr(attr_value);
    397                                         sstr >> direction;
    398                                 }
     353                                if( attr_name == "bottom" ) bottom = util::strToDouble(attr_value);
     354                                if( attr_name == "top" ) top = util::strToDouble(attr_value);
     355                                if( attr_name == "speed" ) speed = util::strToDouble(attr_value);
     356                                if( attr_name == "direction" ) direction = util::strToDouble(attr_value);
     357
    399358                                attr = attr->next;
    400359                        }
  • osgVisual/trunk/src/sky_Silverlining/visual_skySilverLining.cpp

    r201 r219  
    764764                                        std::string attr_name=reinterpret_cast<const char*>(attr->name);
    765765                                        std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    766                                         if( attr_name == "slot" )
    767                                         {
    768                                                 std::stringstream sstr(attr_value);
    769                                                 sstr >> slot;
    770                                         }
    771                                         if( attr_name == "enabled" )
    772                                         {
    773                                                 if(attr_value=="yes")
    774                                                         enabled = true;
    775                                                 else
    776                                                         enabled = false;
    777                                         }
    778                                         if( attr_name == "fadetime" )
    779                                         {
    780                                                 std::stringstream sstr(attr_value);
    781                                                 sstr >> fadetime;
    782                                         }
     766                                        if( attr_name == "slot" ) slot = util::strToInt(attr_value);
     767                                        if( attr_name == "enabled" ) enabled = util::strToBool(attr_value);
     768                                        if( attr_name == "fadetime" ) fadetime = util::strToInt(attr_value);
    783769                                        if( attr_name == "type" )
    784770                                        {
     
    817803                                                        std::string attr_name=reinterpret_cast<const char*>(attr->name);
    818804                                                        std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    819                                                         if( attr_name == "baselength" )
    820                                                         {
    821                                                                 std::stringstream sstr(attr_value);
    822                                                                 sstr >> baselength;
    823                                                         }
    824                                                         if( attr_name == "basewidth" )
    825                                                         {
    826                                                                 std::stringstream sstr(attr_value);
    827                                                                 sstr >> basewidth;
    828                                                         }
    829                                                         if( attr_name == "thickness" )
    830                                                         {
    831                                                                 std::stringstream sstr(attr_value);
    832                                                                 sstr >> thickness;
    833                                                         }
    834                                                         if( attr_name == "baseHeight" )
    835                                                         {
    836                                                                 std::stringstream sstr(attr_value);
    837                                                                 sstr >> baseHeight;
    838                                                         }
    839                                                         if( attr_name == "density" )
    840                                                         {
    841                                                                 std::stringstream sstr(attr_value);
    842                                                                 sstr >> density;
    843                                                         }
     805                                                        if( attr_name == "baselength" ) baselength = util::strToInt(attr_value);
     806                                                        if( attr_name == "basewidth" )  basewidth = util::strToInt(attr_value);
     807                                                        if( attr_name == "thickness" )  thickness = util::strToInt(attr_value);
     808                                                        if( attr_name == "baseHeight" ) baseHeight = util::strToInt(attr_value);
     809                                                        if( attr_name == "density" ) density = util::strToDouble(attr_value);
     810
    844811                                                        attr = attr->next;
    845812                                                }
     
    853820                                                        std::string attr_name=reinterpret_cast<const char*>(attr->name);
    854821                                                        std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    855                                                         if( attr_name == "rate_mmPerHour_rain" )
    856                                                         {
    857                                                                 std::stringstream sstr(attr_value);
    858                                                                 sstr >> rate_mmPerHour_rain;
    859                                                         }
    860                                                         if( attr_name == "rate_mmPerHour_drySnow" )
    861                                                         {
    862                                                                 std::stringstream sstr(attr_value);
    863                                                                 sstr >> rate_mmPerHour_drySnow;
    864                                                         }
    865                                                         if( attr_name == "rate_mmPerHour_wetSnow" )
    866                                                         {
    867                                                                 std::stringstream sstr(attr_value);
    868                                                                 sstr >> rate_mmPerHour_wetSnow;
    869                                                         }
    870                                                         if( attr_name == "rate_mmPerHour_sleet" )
    871                                                         {
    872                                                                 std::stringstream sstr(attr_value);
    873                                                                 sstr >> rate_mmPerHour_sleet;
    874                                                         }
     822                                                        if( attr_name == "rate_mmPerHour_rain" ) rate_mmPerHour_rain = util::strToDouble(attr_value);
     823                                                        if( attr_name == "rate_mmPerHour_drySnow" ) rate_mmPerHour_drySnow = util::strToDouble(attr_value);
     824                                                        if( attr_name == "rate_mmPerHour_wetSnow" ) rate_mmPerHour_wetSnow = util::strToDouble(attr_value);
     825                                                        if( attr_name == "rate_mmPerHour_sleet" ) rate_mmPerHour_sleet = util::strToDouble(attr_value);
     826
    875827                                                        attr = attr->next;
    876828                                                }
Note: See TracChangeset for help on using the changeset viewer.