On Sun, 19 Aug 2007, Robert Osfield wrote:
> Hi Max,
>
> This is not an appropriate change as it'll eat command line entries
> that might not be intended to be part of the option string.
I think that is exactly what the current code does: eat up all options
with -O and pass only the last one to the Reader/Writer Plugin.
If you
> want an option string with spaces in it simply use quotes around the
> string.
>
> Robert.
>
> On 8/19/07, Max Langbein <[EMAIL PROTECTED]> wrote:
> > hello,
> > I have changed the handling of the command line options
> > passed to the reader/writer (with -O)
> >
> > Until now, only one command line option
> > with no spaces in it
> > can be passed on to the reader/writer.
> > (in fact, always the last option given with -O is passed on)
> >
> > With the change, all command line options given with -O
> > are concatenated (with spaces) to a string passed on to the reader/writer.
> >
> > I needed this because I wanted to pass the options
> > PRECISION 10 (note: two words separated with spaces)
> > on to the .osg writer.
> >
> >
> > Testing done:
> >
> > I compiled the new osgconv.cpp and executed
> >
> > osgconv -O PRECISION -O 10 bplan_from3ds.dxf
> >
> > (bplan_from3ds.dxf is a dxf file I wanted to have in a higher precision in
> > the .osg file)
> >
> > The resulting file converted.osg
> > could be loaded into osgviewer without errors;
> >
> > it had now 8 decimals per number instead of 6;
> > (only 8 and not 10 because float doesn't have more precision)
> >
> >
> > In the code, i made the following changes:
> >
> > I Replaced
> >
> > //----------------------------------------------------------
> > std::string str;
> > while (arguments.read("-O",str))
> > {
> > osgDB::ReaderWriter::Options* options = new osgDB::ReaderWriter::Options;
> > options->setOptionString(str);
> > osgDB::Registry::instance()->setOptions(options);
> > }
> > //----------------------------------------------------------
> >
> > with:
> >
> > //----------------------------------------------------------
> > std::string str,optstr="";
> > while(arguments.read("-O",str))
> > optstr+=" "+str;
> >
> > if(optstr!=""){
> > osgDB::ReaderWriter::Options* options = new osgDB::ReaderWriter::Options;
> > options->setOptionString(optstr);
> > osgDB::Registry::instance()->setOptions(options);
> > }
> > //----------------------------------------------------------
> >
> >
> >
> > Greetings,
> > Max Langbein
> > _______________________________________________
> > osg-submissions mailing list
> > [email protected]
> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> >
> >
> >
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org