On 15/12/09 3:57 PM, Paul Martz wrote:
> Ulrich Hertlein wrote:
>> Isn't the following the case?
>> - plugin X will automatically be associated with extension 'X'.
>> - to support more extensions the plugin must say that it supports 'Y'
>> *and*
>>   the Registry must map extension 'Y' to 'X', because otherwise plugin
>> 'X' won't be
>>   considered/loaded for extension 'Y'.
> 
> Not really, the plugin doesn't need to "say that it supports Y". But the
> extension alias does need to be registered. Once it's registered, the
> Registry will load the plugin and try to read Y with it.
> 
> Do a search on the OSG source for "supportsExtension" and you will see
> that OSG calls it only rarely. I forget the circumstances, but it
> certainly doesn't bother to call supportsExtension before initial load
> and calling in to read a file for the first time.

Most of the plugins have something like:
   if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED;

'ReaderWriter::acceptsExtension()' checks the _supportedExtensions list, so if 
extension
'Y' isn't in there then the plugin won't handle the file.

Of course, if the plugin doesn't use acceptsExtension (or overloads it) then 
everything
works fine.

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

Reply via email to