Changeset 219 for osgVisual/trunk/src
- Timestamp:
- Feb 2, 2011, 9:59:08 AM (14 years ago)
- Location:
- osgVisual/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/core/visual_core.cpp
r216 r219 300 300 std::string attr_name=reinterpret_cast<const char*>(attr->name); 301 301 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 327 308 attr = attr->next; 328 309 } … … 343 324 std::string attr_name=reinterpret_cast<const char*>(attr->name); 344 325 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 355 329 attr = attr->next; 356 330 } … … 377 351 std::string attr_name=reinterpret_cast<const char*>(attr->name); 378 352 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 399 358 attr = attr->next; 400 359 } -
osgVisual/trunk/src/sky_Silverlining/visual_skySilverLining.cpp
r201 r219 764 764 std::string attr_name=reinterpret_cast<const char*>(attr->name); 765 765 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); 783 769 if( attr_name == "type" ) 784 770 { … … 817 803 std::string attr_name=reinterpret_cast<const char*>(attr->name); 818 804 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 844 811 attr = attr->next; 845 812 } … … 853 820 std::string attr_name=reinterpret_cast<const char*>(attr->name); 854 821 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 875 827 attr = attr->next; 876 828 }
Note: See TracChangeset
for help on using the changeset viewer.