Added computeDataVariance method into osg::Object and implementations in Drawable and StateSet,

and calling of osgUtil::StaticObjectDetectionVisitor in osgViewer::Viewer
This commit is contained in:
Robert Osfield
2007-02-14 11:24:42 +00:00
parent 5dcb7af6a4
commit 89c99a88fa
256 changed files with 503 additions and 393 deletions

View File

@@ -125,6 +125,10 @@ class OSG_EXPORT Drawable : public Object
virtual const Geometry* asGeometry() const { return 0; }
/** Compute the DataVariance based on an assestment of callback etc.*/
virtual void computeDataVariance();
/** A vector of osg::Node pointers which is used to store the parent(s) of drawable.*/
typedef std::vector<Node*> ParentList;

View File

@@ -102,6 +102,9 @@ class OSG_EXPORT Object : public Referenced
/** Get the data variance of this object.*/
inline DataVariance getDataVariance() const { return _dataVariance; }
/** Compute the DataVariance based on an assestment of callback etc.*/
virtual void computeDataVariance() {}
/**

View File

@@ -92,6 +92,10 @@ class OSG_EXPORT StateSet : public Object
inline unsigned int getNumParents() const { return _parents.size(); }
/** Compute the DataVariance based on an assestment of callback etc.*/
virtual void computeDataVariance();
/** Set all the modes to on or off so that it defines a
complete state, typically used for a default global state.*/
void setGlobalDefaults();
@@ -426,8 +430,6 @@ class OSG_EXPORT StateSet : public Object
/** call release on all StateAttributes contained within this StateSet.*/
virtual void releaseGLObjects(State* state=0) const;
protected :