[osg-users] osgviewerQT, qt4.4.0 and .osg file
robert.osfield at gmail.com
Fri Jul 18 04:07:20 PDT 2008
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.
On Fri, Jul 11, 2008 at 10:42 AM, Robert Osfield
<robert.osfield at gmail.com> 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.
> On Fri, Jul 11, 2008 at 10:31 AM, Johan Nouvel
> <openscenegraph at archivideo.com> 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 ?
>> Norman Vine a écrit :
>>> GDAL had a similar issue
>>> Here is their custom atof() with some discussion of the issues
>>> osg-users mailing list
>>> osg-users at lists.openscenegraph.org
>> Johan Nouvel, R&D Project Manager
>> tel : +33 (0)2 99 86 30 20
>> ARCHIVIDEO, 40 rue des Veyettes, 35000 RENNES, FRANCE
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
More information about the osg-users