Discovery of specified extension
The basic principles of searching and locating a plugin for the handling of a specified file type can be described in two steps:
Firstly, OSG manages a commonly-used plugin list in the osgDB::Registry
class. This class is designed as a singleton and can be only instantiated and obtained with the instance()
method. The protected plugin list of the osgDB registry can help quickly find and call the corresponding reading or writing entries of the required format, based on the chain-of-responsibility design pattern. This means that each plugin object, called a reader-writer in OSG, will try to process the extension of the input file, and pass it off to the next plugin in the list if the extension is unrecognizable to that plugin.
In case all prestored reader-writers fail to handle the file extension, OSG will use the extension as a keyword to find and load a plugin from an external shared module, that is, the osgdb_<ext>
library file. Here,<ext>
represents...