From 6fa4eecdd597f0511494cd888ed1361f3504a7c9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 20 Nov 2004 13:35:49 +0000 Subject: [PATCH] Changed ReaderWriter::Options to derive from osg::Object to add clone() ability. --- include/osgDB/ImageOptions | 16 ++++++++++++++++ include/osgDB/ReaderWriter | 9 ++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/osgDB/ImageOptions b/include/osgDB/ImageOptions index d9a7fe3e4..1e048b685 100644 --- a/include/osgDB/ImageOptions +++ b/include/osgDB/ImageOptions @@ -26,6 +26,22 @@ class OSGDB_EXPORT ImageOptions : public osgDB::ReaderWriter::Options ImageOptions(const std::string& str); + ImageOptions(const ImageOptions& options,const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): + Options(options,copyop), + _sourceImageSamplingMode(options._sourceImageSamplingMode), + _sourceImageWindowMode(options._sourceImageWindowMode), + _sourceRatioWindow(options._sourceRatioWindow), + _sourcePixelWindow(options._sourcePixelWindow), + _destinationImage(options._destinationImage), + _destinationImageWindowMode(options._destinationImageWindowMode), + _destinationRatioWindow(options._destinationRatioWindow), + _destinationPixelWindow(options._destinationPixelWindow), + _destinationDataType(options._destinationDataType), + _destinationPixelFormat(options._destinationPixelFormat) {} + + + META_Object(osgDB,ImageOptions); + /** RatioWindow stores the window (as ratios of 0.0 to 1.0) from the overall imagery from which to extract the osg::Image*/ struct RatioWindow { diff --git a/include/osgDB/ReaderWriter b/include/osgDB/ReaderWriter index 65729cd92..146f33632 100644 --- a/include/osgDB/ReaderWriter +++ b/include/osgDB/ReaderWriter @@ -44,13 +44,20 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object virtual bool acceptsExtension(const std::string& /*extension*/) { return false; } /** Options base class used for passing options into plugins to control their operation.*/ - class Options : public osg::Referenced + class Options : public osg::Object { public: Options() {} Options(const std::string& str):_str(str) {} + Options(const Options& options,const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): + Object(options,copyop), + _str(options._str), + _databasePath(options._databasePath) {} + + META_Object(osgDB,Options); + /** Set the general Options string.*/ void setOptionString(const std::string& str) { _str = str; }