Changeset 220 for osgVisual/trunk
- Timestamp:
- Feb 2, 2011, 10:14:57 AM (14 years ago)
- Location:
- osgVisual/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/bin/osgVisualConfig.xml
r219 r220 83 83 <precipitation rate_mmPerHour_rain="5.0" rate_mmPerHour_drySnow="7.0" rate_mmPerHour_wetSnow="10.0" rate_mmPerHour_sleet="0.0"></precipitation> 84 84 </cloudlayer> 85 <cloudlayer slot="2" type="CUMULUS_MEDIOCRIS" enabled=" yes" fadetime="15">85 <cloudlayer slot="2" type="CUMULUS_MEDIOCRIS" enabled="no" fadetime="15"> 86 86 <geometry baselength="50000" basewidth="50000" thickness="1600" baseHeight="1000" density="0.07"></geometry> 87 87 </cloudlayer> -
osgVisual/trunk/include/util/visual_util.h
r219 r220 276 276 * @return : double representation of the string. 277 277 */ 278 static intstrToDouble(std::string s);278 static double strToDouble(std::string s); 279 279 280 280 /** … … 284 284 * @return : Integer representation of the string. 285 285 */ 286 static doublestrToInt(std::string s);286 static int strToInt(std::string s); 287 287 288 288 /** -
osgVisual/trunk/src/util/visual_util.cpp
r218 r220 536 536 } 537 537 538 intutil::strToDouble(std::string s)538 double util::strToDouble(std::string s) 539 539 { 540 540 double tmp; 541 541 std::stringstream sstr(s); 542 sstr >> tmp; 543 return tmp; 544 } 545 546 double util::strToInt(std::string s) 542 if (!(sstr >> tmp)) 543 { 544 OSG_ALWAYS << __FUNCTION__ << "Warning:Unable to convert "<< s <<" to double, using 0.0 as default!" << std::endl; 545 return 0.0; 546 } 547 else 548 return tmp; 549 } 550 551 int util::strToInt(std::string s) 547 552 { 548 553 int tmp; 549 554 std::stringstream sstr(s); 550 sstr >> tmp; 551 return tmp; 555 if (!(sstr >> tmp)) 556 { 557 OSG_ALWAYS << __FUNCTION__ << "Warning:Unable to convert "<< s <<" to int, using 0 as default!" << std::endl; 558 return 0; 559 } 560 else 561 return tmp; 552 562 } 553 563
Note: See TracChangeset
for help on using the changeset viewer.