Hi Johan, I have now written an osg_atof function and placed this in src/osgDB/Field.cpp, this is now used in the Field::getFloat methods that the .osg plugins uses. This new function always assumes that a '.' is a decimal place.
Could you do an svn update and let me know if it works fine. Cheers, Robert. On Fri, Jul 11, 2008 at 10:42 AM, Robert Osfield <[EMAIL PROTECTED]> wrote: > Hi Johan, > > I believe what we'd need to do is just enforce the rule that .osg > files all use . for their decimal places, then constrain the writing > and reading of .osg files so that it uses this convention. Reading is > more straight forward, as it'd just require a modification to > Field::getFloat() method and would certainly be a useful first step. > > Robert. > > On Fri, Jul 11, 2008 at 10:31 AM, Johan Nouvel > <[EMAIL PROTECTED]> wrote: >> Hi Norman, >> >> Thanks for the link. >> With GDAL way, no need for controlling the output, it's during the reading >> phase that conversion in done >> >> To resume : >> 1- searching local decimal separator >> 2- replace separator character into input string >> 3- convert string using standard method (atof for example) >> >> Step 1 could be done at initialization time. >> Steps 2 and 3 should be done each reading. The overhead is only step 2, as >> step 3 must be and is already called. >> >> As far as I known, only osgDB::Field should be changed, for getFloat and >> calculateFieldType methods. >> With only this, reading an osg file will work regardless of locale. >> >> Robert and others : >> I'm right ? Do you think it worth the effort ? Forgot something ? >> >> Johan. >> >> Norman Vine a écrit : >>> >>> GDAL had a similar issue >>> >>> Here is their custom atof() with some discussion of the issues >>> http://trac.osgeo.org/gdal/browser/trunk/gdal/port/cpl_strtod.cpp >>> >>> Norman >>> >>> _______________________________________________ >>> osg-users mailing list >>> [email protected] >>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> >> -- >> Johan Nouvel, R&D Project Manager >> http://www.archivideo.com >> tel : +33 (0)2 99 86 30 20 >> ARCHIVIDEO, 40 rue des Veyettes, 35000 RENNES, FRANCE >> >> >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

