Hi,

with recent plugin api there is no way to get directly the available features in terms of node read/write support, image read/write support and soon. The only way to detect a given feature is to run the related method for example readNode and to check the return code, which may result in unpredictable results as already reported.

The appended patch fixes this issue by adding a virtual method named supportedFeatures() to the class ReaderWriter, which could be overriden by a specific plugin to adjust the set of features. Single features are implemented as bits asother enums in ReaderWriter class already does, so that combinations are possible and fast comparison operations are possible

By default all features are enabled.

I have added this virtual method to the dot plugin to get an idea how to use these features.

With this patch osgconv --formats shows an additional line 'features' for each plugin

Plugin E:\daten\osg\install-debug\bin\osgPlugins-2.9.0/osgdb_3dcd.dll
{
   ReaderWriter : 3DC point cloud reader
   {
features : readObject readImage readHeightField readNode readShader writeObject writeImage writeHeightField writeNode writeShader
       extensions : .3dc   3DC point cloud format
       extensions : .asc   3DC point cloud format
   }
}
...
Plugin E:\daten\osg\install-debug\bin\osgPlugins-2.9.0/osgdb_dotd.dll
{
   ReaderWriter : DOT Writer
   {
       features : writeNode
   }
}

Please let me know what you think about such a feature - if it would be usefill and if there are any drawbacks or objections.

If this patch will go into svn, the next step would be to extend the osgdb related code to use the availables features.

Regards
Ralf








Attachment: openscenegraph-readerwriter-direction-patch.tar.bz2
Description: Binary data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to