Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14244 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-05 16:26:13 +00:00
parent 35d6cb812f
commit 977ec20751
64 changed files with 590 additions and 471 deletions

View File

@@ -46,7 +46,7 @@ public:
parent->setMatrixInSkeletonSpace( osg::Matrix::translate(offset) *
parent->getMatrixInSkeletonSpace() );
osgAnimation::UpdateBone* updateBone =
static_cast<osgAnimation::UpdateBone*>( parent->getUpdateCallback() );
dynamic_cast<osgAnimation::UpdateBone*>( parent->getUpdateCallback() );
if ( updateBone )
{
osgAnimation::StackedTransform& stack = updateBone->getStackedTransforms();

View File

@@ -758,7 +758,7 @@ daeReader::ChannelPart* daeReader::processSampler(domChannel* pDomChannel, Sourc
return NULL;
}
osgAnimation::Target* findChannelTarget(osg::NodeCallback* nc, const std::string& targetName, bool& rotation)
osgAnimation::Target* findChannelTarget(osg::Callback* nc, const std::string& targetName, bool& rotation)
{
if (osgAnimation::UpdateMatrixTransform* umt = dynamic_cast<osgAnimation::UpdateMatrixTransform*>(nc))
{
@@ -827,7 +827,7 @@ void daeReader::processChannel(domChannel* pDomChannel, SourceMap& sources, Targ
domChannelOsgAnimationUpdateCallbackMap::iterator iter = _domChannelOsgAnimationUpdateCallbackMap.find(pDomChannel);
if (iter != _domChannelOsgAnimationUpdateCallbackMap.end())
{
osg::NodeCallback* nc = iter->second.get();
osg::Callback* nc = iter->second.get();
std::string channelName, targetName, componentName;
extractTargetName(pDomChannel->getTarget(), channelName, targetName, componentName);

View File

@@ -44,7 +44,7 @@ osg::Transform* daeReader::processOsgMatrixTransform(domNode *node, bool isBone)
resultNode = new osg::MatrixTransform;
}
osg::NodeCallback* pNodeCallback = resultNode->getUpdateCallback();
osg::Callback* pNodeCallback = resultNode->getUpdateCallback();
std::vector<osg::ref_ptr<osgAnimation::StackedTransformElement> > transformElements;
osg::ref_ptr<osgAnimation::StackedTransformElement> pLastStaticTransformElement;

View File

@@ -241,7 +241,7 @@ public:
typedef std::map<domMaterial*, osg::ref_ptr<osg::StateSet> > domMaterialStateSetMap;
typedef std::map<std::string, osg::ref_ptr<osg::StateSet> > MaterialStateSetMap;
typedef std::multimap< daeElement*, domChannel*> daeElementDomChannelMap;
typedef std::map<domChannel*, osg::ref_ptr<osg::NodeCallback> > domChannelOsgAnimationUpdateCallbackMap;
typedef std::map<domChannel*, osg::ref_ptr<osg::Callback> > domChannelOsgAnimationUpdateCallbackMap;
typedef std::map<domNode*, osg::ref_ptr<osgAnimation::Bone> > domNodeOsgBoneMap;
typedef std::map<domNode*, osg::ref_ptr<osgAnimation::Skeleton> > domNodeOsgSkeletonMap;
typedef std::map<TextureParameters, osg::ref_ptr<osg::Texture2D> > TextureParametersMap;

View File

@@ -37,7 +37,7 @@ using namespace osgDAE;
void daeWriter::writeAnimations( osg::Node &node )
{
const std::string nodeNameUTF( _pluginOptions.namesUseCodepage ? osgDB::convertStringFromCurrentCodePageToUTF8(node.getName()) : node.getName() );
osg::NodeCallback* ncb = node.getUpdateCallback();
osg::Callback* ncb = node.getUpdateCallback();
if (ncb)
{
osgAnimation::AnimationManagerBase* am = dynamic_cast<osgAnimation::AnimationManagerBase*>(ncb);

View File

@@ -67,7 +67,7 @@ void daeWriter::apply( osg::MatrixTransform &node )
std::string nodeName = getNodeName(node,"matrixTransform");
currentNode->setId(nodeName.c_str());
osg::NodeCallback* ncb = node.getUpdateCallback();
osg::Callback* ncb = node.getUpdateCallback();
bool handled = false;
if (ncb)
{
@@ -124,7 +124,7 @@ void daeWriter::apply( osg::PositionAttitudeTransform &node )
const osg::Quat &q = node.getAttitude();
const osg::Vec3 &s = node.getScale();
osg::NodeCallback* ncb = node.getUpdateCallback();
osg::Callback* ncb = node.getUpdateCallback();
bool handled = false;
if (ncb)
{
@@ -287,7 +287,7 @@ void daeWriter::apply( osg::Transform &node )
osg::Matrix matrix;
node.computeLocalToWorldMatrix(matrix, NULL);
osg::NodeCallback* ncb = node.getUpdateCallback();
osg::Callback* ncb = node.getUpdateCallback();
bool handled = false;
if (ncb)
{
@@ -309,7 +309,7 @@ void daeWriter::apply( osg::Transform &node )
domMatrix *mat = daeSafeCast< domMatrix >(currentNode->add( COLLADA_ELEMENT_MATRIX ) );
nodeName += "_matrix";
mat->setSid(nodeName.c_str());
const osg::Matrix::value_type *mat_vals = matrix.ptr();
for ( int i = 0; i < 4; i++ )
{

View File

@@ -93,7 +93,7 @@ public:
virtual void apply(osg::Node& node)
{
osg::NodeCallback* ncb = node.getUpdateCallback();
osg::Callback* ncb = node.getUpdateCallback();
if (ncb)
{
osgAnimation::AnimationUpdateCallback<osg::NodeCallback>* ut = dynamic_cast<osgAnimation::AnimationUpdateCallback<osg::NodeCallback>*>(ncb);

View File

@@ -37,7 +37,6 @@
#include <osg/Group>
#include <osg/NodeVisitor>
#include <osg/NodeCallback>
#include <osg/ref_ptr>
#include "TXPArchive.h"