From Mattias Linde, "Nice, this almost gets the job done, one way communication into the plugin is possible.
I've done some additional small modification regarding constness in ReaderWriter and added mutable on _pluginData so passing data back would be possible too. Have updated the collada plugin (ReaderWriterDAE.cpp) to use the map to handle options and have attached the changes. The stuff in daeReader.h and daeWriter.h are just cosmetic changes to get rid of a warning."
This commit is contained in:
@@ -122,7 +122,7 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
CacheHintOptions getObjectCacheHint() const { return _objectCacheHint; }
|
||||
|
||||
/** Sets a plugindata value PluginData with a string */
|
||||
void setPluginData(const std::string& s, void* v) { _pluginData[s] = v; }
|
||||
void setPluginData(const std::string& s, void* v) const { _pluginData[s] = v; }
|
||||
|
||||
/** Get a value from the PluginData */
|
||||
void* getPluginData(const std::string& s) { return _pluginData[s]; }
|
||||
@@ -135,7 +135,7 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
}
|
||||
|
||||
/** Remove a value from the PluginData */
|
||||
void removePluginData(const std::string& s) { _pluginData.erase(s); }
|
||||
void removePluginData(const std::string& s) const { _pluginData.erase(s); }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -146,7 +146,7 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
CacheHintOptions _objectCacheHint;
|
||||
|
||||
typedef std::map<std::string,void*> PluginDataMap;
|
||||
PluginDataMap _pluginData;
|
||||
mutable PluginDataMap _pluginData;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user