Introduce osg::Object::asNode(), asNodeVisitor(), asStateAttribute() and asUniform() to replace dynamic_cast<> usage in Callback.cpp.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14902 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -235,6 +235,14 @@ class OSG_EXPORT StateAttribute : public Object
|
||||
virtual const char* className() const { return "StateAttribute"; }
|
||||
|
||||
|
||||
/** Convert 'this' into a StateAttribute pointer if Object is a StateAttribute, otherwise return 0.
|
||||
* Equivalent to dynamic_cast<StateAttribute*>(this).*/
|
||||
virtual StateAttribute* asStateAttribute() { return this; }
|
||||
|
||||
/** convert 'const this' into a const StateAttribute pointer if Object is a StateAttribute, otherwise return 0.
|
||||
* Equivalent to dynamic_cast<const StateAttribute*>(this).*/
|
||||
virtual const StateAttribute* asStateAttribute() const { return this; }
|
||||
|
||||
/** Fast alternative to dynamic_cast<> for determining if state attribute is a Texture.*/
|
||||
virtual Texture* asTexture() { return 0; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user