Hi Miha,

Thanks for the revisions.  I've just done a review and feel that it
requires a lot of core OSG changes just for a single users
requirement. Conceptually I find it a bit convoluted - osgDB::Registry
and plugins are complex enough that I really don't want to be adding
an extra rules or code to how things behave.

My feeling that the right way for custom behavior like this is to
users should write custom application code to handle their special
case usage.  It should be possible for you to write your own plugin
with it's own extension name and have it invoke the serializers in
much the same way as ReaderWriterOSG2.cpp does, we aren't talking
about a huge amount of code here.

Robert.

On 21 February 2013 12:10, Miha Ravšelj <[email protected]> wrote:
> Hi Robert,
> my apologies for previous submission. I haven't tested the code thorough 
> enough.  Hopefully this one's ok :).
>
> Why I came across seeking alias extension is because I have been building osg 
> nodekit which uses osg serialization framework. Now to make a distinction 
> from osg2 format I tried to alias extension and that's where I ran into 
> trouble. Actually I was misleaded by method addFileExtensionAlias.
>
> My previous submission tried to use same _extAliasMap for aliasing but it 
> resulted in two level aliases. (for instance xyz->osgt->osg ). Mixing user 
> aliases and system plugin aliases lead to bug in my previous submission.
>
> Attached submission extends  OSG functionallity to support User-Defined alias 
> extensions.
>
> Registry::addFileExtensionAlias remains untouched.
>
> Registry::addUserAliasExtension can be used to alias any extension to any 
> existing supported plugin extension. This is actually equivalent to
>  supportsExtension() call inside each ReaderWriter class. Each ReaderWriter 
> checks also for user alias through acceptsExtension method.
>
> Calling 'Registry::addUserFileExtensionAlias("xyz","osgt")' will tell 
> framework to open *.xyz the same way os *.osgt. ReaderWriterOsg2 checks for 
> alias through getUserFileExtensionAlias to get correct supported 
> extension(osgb,osgt,osgx,osg2).
>
> All plugins should work normally with user-defined aliases( although I have 
> not tested all of them ).
>
> Usage:
> osgDB::Registry::instance()->addUserFileExtensionAlias("myimage","jpg"); 
> //myimage will be handled with plugin that handles jpg extension (plugin name 
> jpeg )
> osgDB::Registry::instance()->addUserFileExtensionAlias("mygt","osgt"); // 
> when loading mygt  ReaderWriterOsg2 will check for alias and set option to 
> Ascii based on aliased extensions osgt
>         osgDB::Registry::instance()->addUserFileExtensionAlias("mygb","osgb");
>
> Cheers,
> Miha
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52807#52807
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/openscenegraph_458.zip
>
>
> _______________________________________________
> 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