Hi Ralf,

Sorry for the delay on review, I've been a busy boy...  I have now
done the review and I'm happy with this features approach, with one
little tweak.  The tweak is related that I really don't want to have
to go an modify all the plugins to add the feature set for it, one
because it's a lot of work, and two because it's something that could
easily get out of sync.

The solution to the problem of exposing the features support could
come in the form of the supportFeatures method in ReaderWriter
manually trying out the various read*() and write*() methods to see
which ones succeed or fail.  To make this work an extra tweak to
ReaderWriter::ReadResult and WriteResult will be required - an extra
NOT_IMPLEMENTED in the enums that will be returned by all the default
implementations in the ReaderWriter base class.

I will check in your basic Features interface right now and then have
a bash at implementing the above automatic query of the features.

Robert.

On Tue, Feb 24, 2009 at 9:15 AM, Ralf Habacker <[email protected]> wrote:
> 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
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to