Added new statc prototype() and create() methods to CullVisitor and DatabasePager to allow overriding of the default implementations

This commit is contained in:
Robert Osfield
2007-08-08 08:10:38 +00:00
parent 58db6fd81a
commit e3b7b2f617
7 changed files with 108 additions and 10 deletions

View File

@@ -45,6 +45,19 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
DatabasePager();
DatabasePager(const DatabasePager& rhs);
/** Create a shallow copy on the DatabasePager.*/
virtual DatabasePager* clone() const { return new DatabasePager(*this); }
/** get the prototype singleton used by DatabasePager::create().*/
static osg::ref_ptr<DatabasePager>& prototype();
/** create a DatabasePager by cloning DatabasePager::prototype().*/
static DatabasePager* create();
/** Add a request to load a node file to end the the database request list.*/
virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
float priority, const osg::FrameStamp* framestamp);

View File

@@ -53,9 +53,18 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
CullVisitor();
virtual ~CullVisitor();
/// Copy constructor that does a shallow copy.
CullVisitor(const CullVisitor&);
virtual CullVisitor* cloneType() const { return new CullVisitor(); }
/** Create a shallow copy on the CullVisitor.*/
virtual CullVisitor* clone() const { return new CullVisitor(*this); }
/** get the prototype singleton used by CullVisitor::create().*/
static osg::ref_ptr<CullVisitor>& prototype();
/** create a CullVisitor by cloning CullVisitor::prototype().*/
static CullVisitor* create();
virtual void reset();
@@ -258,6 +267,8 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
protected:
virtual ~CullVisitor();
/** Prevent unwanted copy operator.*/
CullVisitor& operator = (const CullVisitor&) { return *this; }