Re: [osg-users] New feature : osgconv --plugins and --formats ReaderWriter::supported*() API

2008-07-24 Thread Robert Osfield
Hi All,

I have just added some further options into osgconv, --format and
--plugin, which allow you to query the details on a specific plugin
i.e.

 osgconv --format obj

Will report:

Plugin osgPlugins-2.5.6/osgdb_obj.so
{
   ReaderWriter : Wavefront OBJ Reader
   {
   extensions : .objAlias Wavefront OBJ format
   options: noRotation  Do not do the default
rotate about X axis
   options: noTesselateLargePolygonsDo not do the default
tesselation of large polygons
   options: noTriStripPolygons  Do not do the default
tri stripping of polygons
   }
}

Tabbing doesn't look so good in email client... better in the console ;-)

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] New feature : osgconv --plugins and --formats ReaderWriter::supported*() API

2008-07-15 Thread Robert Osfield
On Tue, Jul 15, 2008 at 3:15 AM, Paul Martz [EMAIL PROTECTED] wrote:
 This looks like it was a pain in the butt. Thanks for adding this interface.

 Is there any way we can get the supported entry point info that osgio -csv
 was capable of displaying? (You know, a plugin says it supports format ABC,
 but does that mean it can read ABC as a Node? Or write it as an Image? An
 Object? Etc.)

I think this would be best done by just passing in test strings to the
plugin as you did in osgio.  There shouldn't be any need to actual
create files though.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] New feature : osgconv --plugins and --formats ReaderWriter::supported*() API

2008-07-14 Thread Robert Osfield
Hi All,

Yesterday I did a review of Paul Mart'z little osgio app that queried
the OSG plugins for what facilities they had.  I haven't merged Paul's
changes as I feel they tackle the task of querying plugins in a way
that can be bettered if we just refactor the OSG's plugin API a
little.  So... rather than dally around I just go the bit between my
teeth and implemented this extra API.  This API is then implemented in
the plugins to allow more information to be externally querried, and
extra options in osgconv compliment this.   The new API is in
osgDB::ReaderWriter in the form a a few new methods:


class osgDB::ReaderWriter {
   public:

   ...

typedef std::mapstd::string, std::string FormatDescriptionMap;

/** return which protocols are supported by ReaderWriter. */
virtual const FormatDescriptionMap supportedProtocols() const
{ return _supportedProtocols; }

/** return which list of file extensions supported by ReaderWriter. */
virtual const FormatDescriptionMap supportedExtensions()
const { return _supportedExtensions; }

/** return which list of file extensions supported by ReaderWriter. */
virtual const FormatDescriptionMap supportedOptions() const {
return _supportedOptions; }

And a couple of continence methods for populating these maps:

protected:

void supportsProtocol(const std::string fmt, const
std::string description);
void supportsExtension(const std::string fmt, const
std::string description);
void supportsOption(const std::string fmt, const std::string
description);


The plugin now have calls to supports*() in their constructors like:

FLTReaderWriter()
  : _implicitPath( . )
{
supportsExtension(flt,OpenFlight format);

supportsOption(clampToEdge,);
supportsOption(keepExternalReferences,);
supportsOption(preserveFace,);
supportsOption(preserveObject,);
supportsOption(dofAnimation,);
supportsOption(billboardCenter,);
supportsOption(noTextureAlphaForTransparancyBinning,);
supportsOption(readObjectRecordData,);
supportsOption(noUnitsConversion,);
supportsOption(convertToFeet,);
supportsOption(convertToInches,);
supportsOption(convertToMeters,);
supportsOption(convertToKilometers,);
supportsOption(convertToNauticalMiles,);
}

This is what I've added into the OpenFlight loaders one,  You can have
multiple formats supported by one plugin of course so this then looks
like (From the xine plugin):

ReaderWriterXine()
{
supportsExtension(avi,);
supportsExtension(db,);
supportsExtension(flv,);
supportsExtension(mov,);
supportsExtension(mpg,Mpeg movie format);
supportsExtension(mpv,Mpeg movie format);
supportsExtension(wmv,);
supportsExtension(xine,Xine plugin Pseduo plugin);

Now there are quite a few description fields left as , but this is
something the community can help fill out - there is only so much much
RSI can take with this type of stuff (yesterday I updated all 58
plugins with this stuff, ack what an awful job...)Anyway the
result of this effort is that you can now go query the plugins, and to
do this I've added two new parameters to osgconv, --plugins lists the
path to all the plugins, and --formats lists all the supported
protocols, formats and options.  What the results look like on my
system is appended below as an appendix :-)

This is just a first step, others are welcome to dive in add better
descriptions, more query options in osgconv.   We could possibly also
move the functions used into osgDB, as well as move the command line
query support into a osginfo or osg-config application.  However, we
are really close to 2.6 so my main interest is stability right now,
rather than introducing lots of new tools etc.   I'd be happy to see
all this functionality mature fully once 2.6 is out.

Cheers,
Robert.



 osgconv --plugins
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_bmp.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_cfg.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_dae.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_dds.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_dxf.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_geo.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_gif.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_freetype.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_hdr.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_ive.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_jp2.so
Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_md2.so
Plugin 

Re: [osg-users] New feature : osgconv --plugins and --formats ReaderWriter::supported*() API

2008-07-14 Thread Paul Martz
This looks like it was a pain in the butt. Thanks for adding this interface.

Is there any way we can get the supported entry point info that osgio -csv
was capable of displaying? (You know, a plugin says it supports format ABC,
but does that mean it can read ABC as a Node? Or write it as an Image? An
Object? Etc.)
   -Paul

 
 Hi All,
 
 Yesterday I did a review of Paul Mart'z little osgio app that 
 queried the OSG plugins for what facilities they had.  I 
 haven't merged Paul's changes as I feel they tackle the task 
 of querying plugins in a way that can be bettered if we just 
 refactor the OSG's plugin API a little.  So... rather than 
 dally around I just go the bit between my teeth and 
 implemented this extra API.  This API is then implemented in 
 the plugins to allow more information to be externally querried, and
 extra options in osgconv compliment this.   The new API is in
 osgDB::ReaderWriter in the form a a few new methods:
 
 
 class osgDB::ReaderWriter {
public:
 
...
 
 typedef std::mapstd::string, std::string 
 FormatDescriptionMap;
 
 /** return which protocols are supported by ReaderWriter. */
 virtual const FormatDescriptionMap 
 supportedProtocols() const { return _supportedProtocols; }
 
 /** return which list of file extensions supported by 
 ReaderWriter. */
 virtual const FormatDescriptionMap 
 supportedExtensions() const { return _supportedExtensions; }
 
 /** return which list of file extensions supported by 
 ReaderWriter. */
 virtual const FormatDescriptionMap 
 supportedOptions() const { return _supportedOptions; }
 
 And a couple of continence methods for populating these maps:
 
 protected:
 
 void supportsProtocol(const std::string fmt, const 
 std::string description);
 void supportsExtension(const std::string fmt, const 
 std::string description);
 void supportsOption(const std::string fmt, const 
 std::string description);
 
 
 The plugin now have calls to supports*() in their constructors like:
 
 FLTReaderWriter()
   : _implicitPath( . )
 {
 supportsExtension(flt,OpenFlight format);
 
 supportsOption(clampToEdge,);
 supportsOption(keepExternalReferences,);
 supportsOption(preserveFace,);
 supportsOption(preserveObject,);
 supportsOption(dofAnimation,);
 supportsOption(billboardCenter,);
 supportsOption(noTextureAlphaForTransparancyBinning,);
 supportsOption(readObjectRecordData,);
 supportsOption(noUnitsConversion,);
 supportsOption(convertToFeet,);
 supportsOption(convertToInches,);
 supportsOption(convertToMeters,);
 supportsOption(convertToKilometers,);
 supportsOption(convertToNauticalMiles,);
 }
 
 This is what I've added into the OpenFlight loaders one,  You 
 can have multiple formats supported by one plugin of course 
 so this then looks like (From the xine plugin):
 
 ReaderWriterXine()
 {
 supportsExtension(avi,);
 supportsExtension(db,);
 supportsExtension(flv,);
 supportsExtension(mov,);
 supportsExtension(mpg,Mpeg movie format);
 supportsExtension(mpv,Mpeg movie format);
 supportsExtension(wmv,);
 supportsExtension(xine,Xine plugin Pseduo plugin);
 
 Now there are quite a few description fields left as , but 
 this is something the community can help fill out - there is 
 only so much much RSI can take with this type of stuff 
 (yesterday I updated all 58
 plugins with this stuff, ack what an awful job...)Anyway the
 result of this effort is that you can now go query the 
 plugins, and to do this I've added two new parameters to 
 osgconv, --plugins lists the path to all the plugins, and 
 --formats lists all the supported protocols, formats and 
 options.  What the results look like on my system is appended 
 below as an appendix :-)
 
 This is just a first step, others are welcome to dive in add better
 descriptions, more query options in osgconv.   We could possibly also
 move the functions used into osgDB, as well as move the 
 command line query support into a osginfo or osg-config 
 application.  However, we are really close to 2.6 so my main 
 interest is stability right now,
 rather than introducing lots of new tools etc.   I'd be happy to see
 all this functionality mature fully once 2.6 is out.
 
 Cheers,
 Robert.
 
 
 
  osgconv --plugins
 Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_bmp.so
 Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_cfg.so
 Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_dae.so
 Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_dds.so
 Plugin /home/robert/OpenSceneGraph/lib/osgPlugins-2.5.4/osgdb_dxf.so
 Plugin