Ignore:
Timestamp:
Feb 2, 2011, 9:36:49 AM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/util/visual_util.cpp

    r198 r218  
    535535        return animationpath;
    536536}
     537
     538int util::strToDouble(std::string s)
     539{
     540        double tmp;
     541        std::stringstream sstr(s);
     542        sstr >> tmp;
     543        return tmp;
     544}
     545
     546double util::strToInt(std::string s)
     547{
     548        int tmp;
     549        std::stringstream sstr(s);
     550        sstr >> tmp;
     551        return tmp;
     552}
     553
     554bool util::strToBool(std::string s)
     555{
     556        if(s=="yes")
     557                return(true);
     558        if(s=="no")
     559                return(false);
     560        OSG_ALWAYS << __FUNCTION__ << "Warning:Unable to convert "<< s <<" to bool, using false as default!" << std::endl;
     561        return(false);
     562}
Note: See TracChangeset for help on using the changeset viewer.