From fc21fea5b47f3a1404997640bfc1cf533aeddfcb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 May 2010 16:07:09 +0000 Subject: [PATCH] Converted osg::notify to OSG_INFO etc. --- src/osgAnimation/ActionBlendIn.cpp | 2 +- src/osgAnimation/ActionBlendOut.cpp | 2 +- src/osgAnimation/ActionVisitor.cpp | 6 +++--- src/osgAnimation/LinkVisitor.cpp | 2 +- src/osgAnimation/MorphGeometry.cpp | 2 +- src/osgAnimation/RigGeometry.cpp | 8 ++++---- src/osgAnimation/RigTransformHardware.cpp | 24 +++++++++++----------- src/osgAnimation/RigTransformSoftware.cpp | 4 ++-- src/osgAnimation/Skeleton.cpp | 2 +- src/osgAnimation/StatsHandler.cpp | 4 ++-- src/osgAnimation/Timeline.cpp | 4 ++-- src/osgAnimation/UpdateBone.cpp | 2 +- src/osgAnimation/UpdateMaterial.cpp | 2 +- src/osgAnimation/UpdateMatrixTransform.cpp | 2 +- src/osgAnimation/VertexInfluence.cpp | 4 ++-- 15 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/osgAnimation/ActionBlendIn.cpp b/src/osgAnimation/ActionBlendIn.cpp index 74a532789..e8c9fc1b1 100644 --- a/src/osgAnimation/ActionBlendIn.cpp +++ b/src/osgAnimation/ActionBlendIn.cpp @@ -40,6 +40,6 @@ void ActionBlendIn::computeWeight(unsigned int frame) double ratio = ( (frame+1) * 1.0 / (getNumFrames()) ); double w = _weight * ratio; - osg::notify(osg::DEBUG_INFO) << getName() << " BlendIn frame " << frame << " weight " << w << std::endl; + OSG_DEBUG << getName() << " BlendIn frame " << frame << " weight " << w << std::endl; _animation->setWeight(w); } diff --git a/src/osgAnimation/ActionBlendOut.cpp b/src/osgAnimation/ActionBlendOut.cpp index beabcf632..8e03cc0d1 100644 --- a/src/osgAnimation/ActionBlendOut.cpp +++ b/src/osgAnimation/ActionBlendOut.cpp @@ -36,6 +36,6 @@ void ActionBlendOut::computeWeight(unsigned int frame) { double ratio = ( (frame+1) * 1.0 / (getNumFrames()) ); double w = _weight * (1.0-ratio); - osg::notify(osg::DEBUG_INFO) << getName() << " BlendOut frame " << frame << " weight " << w << std::endl; + OSG_DEBUG << getName() << " BlendOut frame " << frame << " weight " << w << std::endl; _animation->setWeight(w); } diff --git a/src/osgAnimation/ActionVisitor.cpp b/src/osgAnimation/ActionVisitor.cpp index 32f6d9002..7e6ea5094 100644 --- a/src/osgAnimation/ActionVisitor.cpp +++ b/src/osgAnimation/ActionVisitor.cpp @@ -98,16 +98,16 @@ void UpdateActionVisitor::apply(Action& action) bool result = action.evaluateFrame(frame, frameInAction, loopDone); if (!result) { - osg::notify(osg::DEBUG_INFO) << action.getName() << " Action frame " << frameInAction << " finished" << std::endl; + OSG_DEBUG << action.getName() << " Action frame " << frameInAction << " finished" << std::endl; return; } - osg::notify(osg::DEBUG_INFO) << action.getName() << " Action frame " << frame << " relative to loop " << frameInAction << " no loop " << loopDone<< std::endl; + OSG_DEBUG << action.getName() << " Action frame " << frame << " relative to loop " << frameInAction << " no loop " << loopDone<< std::endl; frame = frameInAction; Action::Callback* cb = action.getFrameCallback(frame); while (cb) { - osg::notify(osg::DEBUG_INFO) << action.getName() << " evaluate callback " << cb->getName() << " at " << frame << std::endl; + OSG_DEBUG << action.getName() << " evaluate callback " << cb->getName() << " at " << frame << std::endl; (*cb)(&action, this); cb = cb->getNestedCallback(); } diff --git a/src/osgAnimation/LinkVisitor.cpp b/src/osgAnimation/LinkVisitor.cpp index 1a3065dbe..99579fc17 100644 --- a/src/osgAnimation/LinkVisitor.cpp +++ b/src/osgAnimation/LinkVisitor.cpp @@ -41,7 +41,7 @@ void LinkVisitor::link(AnimationUpdateCallbackBase* cb) result += cb->link(_animations[i].get()); _nbLinkedTarget += result; } - osg::notify(osg::NOTICE) << "LinkVisitor links " << result << " for \"" << cb->getName() << '"' << std::endl; + OSG_NOTICE << "LinkVisitor links " << result << " for \"" << cb->getName() << '"' << std::endl; } void LinkVisitor::handle_stateset(osg::StateSet* stateset) diff --git a/src/osgAnimation/MorphGeometry.cpp b/src/osgAnimation/MorphGeometry.cpp index 0961520b1..093e099b2 100644 --- a/src/osgAnimation/MorphGeometry.cpp +++ b/src/osgAnimation/MorphGeometry.cpp @@ -271,7 +271,7 @@ bool UpdateMorph::link(osgAnimation::Channel* channel) } else { - osg::notify(osg::WARN) << "Channel " << channel->getName() << " does not contain a valid symbolic name for this class" << std::endl; + OSG_WARN << "Channel " << channel->getName() << " does not contain a valid symbolic name for this class" << std::endl; } return false; } diff --git a/src/osgAnimation/RigGeometry.cpp b/src/osgAnimation/RigGeometry.cpp index 39b4cc879..4d5319713 100644 --- a/src/osgAnimation/RigGeometry.cpp +++ b/src/osgAnimation/RigGeometry.cpp @@ -50,7 +50,7 @@ public: _boundingBox.expandBy(center + vec); _boundingBox.expandBy(center - vec); _computed = true; -// osg::notify(osg::NOTICE) << "build the bounding box for RigGeometry " << rig.getName() << " " << _boundingBox._min << " " << _boundingBox._max << std::endl; +// OSG_NOTICE << "build the bounding box for RigGeometry " << rig.getName() << " " << _boundingBox._min << " " << _boundingBox._max << std::endl; return _boundingBox; } protected: @@ -98,7 +98,7 @@ void RigGeometry::buildVertexInfluenceSet() { if (!_vertexInfluenceMap.valid()) { - osg::notify(osg::WARN) << "buildVertexInfluenceSet can't be called without VertexInfluence already set to the RigGeometry ( " << getName() << " ) " << std::endl; + OSG_WARN << "buildVertexInfluenceSet can't be called without VertexInfluence already set to the RigGeometry ( " << getName() << " ) " << std::endl; return; } _vertexInfluenceSet.clear(); @@ -109,14 +109,14 @@ void RigGeometry::buildVertexInfluenceSet() _vertexInfluenceSet.buildVertex2BoneList(); _vertexInfluenceSet.buildUniqVertexSetToBoneSetList(); - osg::notify(osg::NOTICE) << "uniq groups " << _vertexInfluenceSet.getUniqVertexSetToBoneSetList().size() << " for " << getName() << std::endl; + OSG_NOTICE << "uniq groups " << _vertexInfluenceSet.getUniqVertexSetToBoneSetList().size() << " for " << getName() << std::endl; } void RigGeometry::computeMatrixFromRootSkeleton() { if (!_root.valid()) { - osg::notify(osg::WARN) << "Warning " << className() <<"::computeMatrixFromRootSkeleton if you have this message it means you miss to call buildTransformer(Skeleton* root), or your RigGeometry (" << getName() <<") is not attached to a Skeleton subgraph" << std::endl; + OSG_WARN << "Warning " << className() <<"::computeMatrixFromRootSkeleton if you have this message it means you miss to call buildTransformer(Skeleton* root), or your RigGeometry (" << getName() <<") is not attached to a Skeleton subgraph" << std::endl; return; } osg::MatrixList mtxList = getParent(0)->getWorldMatrices(_root.get()); diff --git a/src/osgAnimation/RigTransformHardware.cpp b/src/osgAnimation/RigTransformHardware.cpp index 32fd39db4..98d374fcf 100644 --- a/src/osgAnimation/RigTransformHardware.cpp +++ b/src/osgAnimation/RigTransformHardware.cpp @@ -55,7 +55,7 @@ void RigTransformHardware::computeMatrixPaletteUniform(const osg::Matrix& transf osg::Matrix resultBoneMatrix = invBindMatrix * boneMatrix; osg::Matrix result = transformFromSkeletonToGeometry * resultBoneMatrix * invTransformFromSkeletonToGeometry; if (!_uniformMatrixPalette->setElement(i, result)) - osg::notify(osg::WARN) << "RigTransformHardware::computeUniformMatrixPalette can't set uniform at " << i << " elements" << std::endl; + OSG_WARN << "RigTransformHardware::computeUniformMatrixPalette can't set uniform at " << i << " elements" << std::endl; } } @@ -94,7 +94,7 @@ bool RigTransformHardware::createPalette(int nbVertexes, BoneMap boneMap, const { if (boneMap.find(bw.getBoneName()) == boneMap.end()) { - osg::notify(osg::INFO) << "RigTransformHardware::createPalette can't find bone " << bw.getBoneName() << " skip this influence" << std::endl; + OSG_INFO << "RigTransformHardware::createPalette can't find bone " << bw.getBoneName() << " skip this influence" << std::endl; continue; } boneNameCountMap[bw.getBoneName()] = 1; // for stats @@ -105,20 +105,20 @@ bool RigTransformHardware::createPalette(int nbVertexes, BoneMap boneMap, const } else { - osg::notify(osg::WARN) << "RigTransformHardware::createPalette Bone " << bw.getBoneName() << " has a weight " << bw.getWeight() << " for vertex " << vertexIndex << " this bone will not be in the palette" << std::endl; + OSG_WARN << "RigTransformHardware::createPalette Bone " << bw.getBoneName() << " has a weight " << bw.getWeight() << " for vertex " << vertexIndex << " this bone will not be in the palette" << std::endl; } } maxBonePerVertex = osg::maximum(maxBonePerVertex, bonesForThisVertex); } - osg::notify(osg::INFO) << "RigTransformHardware::createPalette maximum number of bone per vertex is " << maxBonePerVertex << std::endl; - osg::notify(osg::INFO) << "RigTransformHardware::createPalette matrix palette has " << boneNameCountMap.size() << " entries" << std::endl; + OSG_INFO << "RigTransformHardware::createPalette maximum number of bone per vertex is " << maxBonePerVertex << std::endl; + OSG_INFO << "RigTransformHardware::createPalette matrix palette has " << boneNameCountMap.size() << " entries" << std::endl; for (BoneNameCountMap::iterator it = boneNameCountMap.begin(); it != boneNameCountMap.end(); ++it) { - osg::notify(osg::INFO) << "RigTransformHardware::createPalette Bone " << it->first << " is used " << it->second << " times" << std::endl; + OSG_INFO << "RigTransformHardware::createPalette Bone " << it->first << " is used " << it->second << " times" << std::endl; } - osg::notify(osg::INFO) << "RigTransformHardware::createPalette will use " << boneNameCountMap.size() * 4 << " uniforms" << std::endl; + OSG_INFO << "RigTransformHardware::createPalette will use " << boneNameCountMap.size() * 4 << " uniforms" << std::endl; for (int i = 0 ; i < (int)vertexIndexWeight.size(); i++) @@ -199,13 +199,13 @@ bool RigTransformHardware::init(RigGeometry& geom) osg::Vec3Array* positionSrc = dynamic_cast(source.getVertexArray()); if (!positionSrc) { - osg::notify(osg::WARN) << "RigTransformHardware no vertex array in the geometry " << geom.getName() << std::endl; + OSG_WARN << "RigTransformHardware no vertex array in the geometry " << geom.getName() << std::endl; return false; } if (!geom.getSkeleton()) { - osg::notify(osg::WARN) << "RigTransformHardware no skeleton set in geometry " << geom.getName() << std::endl; + OSG_WARN << "RigTransformHardware no skeleton set in geometry " << geom.getName() << std::endl; return false; } @@ -227,7 +227,7 @@ bool RigTransformHardware::init(RigGeometry& geom) _shader = osg::Shader::readShaderFile(osg::Shader::VERTEX,"skinning.vert"); if (!_shader.valid()) { - osg::notify(osg::WARN) << "RigTransformHardware can't load VertexShader" << std::endl; + OSG_WARN << "RigTransformHardware can't load VertexShader" << std::endl; return false; } @@ -240,7 +240,7 @@ bool RigTransformHardware::init(RigGeometry& geom) ss << getMatrixPaletteUniform()->getNumElements(); str.replace(start, toreplace.size(), ss.str()); _shader->setShaderSource(str); - osg::notify(osg::INFO) << "Shader " << str << std::endl; + OSG_INFO << "Shader " << str << std::endl; } int attribIndex = 11; @@ -251,7 +251,7 @@ bool RigTransformHardware::init(RigGeometry& geom) ss << "boneWeight" << i; program->addBindAttribLocation(ss.str(), attribIndex + i); geom.setVertexAttribData(attribIndex + i, osg::Geometry::ArrayData(getVertexAttrib(i),osg::Geometry::BIND_PER_VERTEX)); - osg::notify(osg::INFO) << "set vertex attrib " << ss.str() << std::endl; + OSG_INFO << "set vertex attrib " << ss.str() << std::endl; } program->addShader(_shader.get()); diff --git a/src/osgAnimation/RigTransformSoftware.cpp b/src/osgAnimation/RigTransformSoftware.cpp index ab5566fd6..239f02452 100644 --- a/src/osgAnimation/RigTransformSoftware.cpp +++ b/src/osgAnimation/RigTransformSoftware.cpp @@ -51,7 +51,7 @@ void RigTransformSoftware::operator()(RigGeometry& geom) return; if (!geom.getSourceGeometry()) { - osg::notify(osg::WARN) << this << " RigTransformSoftware no source geometry found on RigGeometry" << std::endl; + OSG_WARN << this << " RigTransformSoftware no source geometry found on RigGeometry" << std::endl; return; } osg::Geometry& source = *geom.getSourceGeometry(); @@ -123,7 +123,7 @@ void RigTransformSoftware::initVertexSetFromBones(const BoneMap& map, const Vert BoneMap::const_iterator it = map.find(bname); if (it == map.end()) { - osg::notify(osg::WARN) << "RigTransformSoftware Bone " << bname << " not found, skip the influence group " <second.get(); diff --git a/src/osgAnimation/Skeleton.cpp b/src/osgAnimation/Skeleton.cpp index f08f17292..4cc3bf5bb 100644 --- a/src/osgAnimation/Skeleton.cpp +++ b/src/osgAnimation/Skeleton.cpp @@ -52,7 +52,7 @@ public: { if (foundNonBone) { - osg::notify(osg::WARN) << + OSG_WARN << "Warning: a Bone was found after a non-Bone child " "within a Skeleton. Children of a Bone must be ordered " "with all child Bones first for correct update order." << std::endl; diff --git a/src/osgAnimation/StatsHandler.cpp b/src/osgAnimation/StatsHandler.cpp index 60093b12c..3f7073b42 100644 --- a/src/osgAnimation/StatsHandler.cpp +++ b/src/osgAnimation/StatsHandler.cpp @@ -558,7 +558,7 @@ bool StatsHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdap FindTimelineStats finder; viewer->getSceneData()->accept(finder); if (!finder._timelines.empty()) { - osg::notify(osg::NOTICE)< StatsList; StatsList statsList; @@ -574,7 +574,7 @@ bool StatsHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdap if (itr==statsList.begin()) (*itr)->report(osg::notify(osg::NOTICE), i); else (*itr)->report(osg::notify(osg::NOTICE), i, " "); } - osg::notify(osg::NOTICE)<getName() << " already added this frame, declined" << std::endl; + OSG_INFO << "Timeline::addActionAt command " << action->getName() << " already added this frame, declined" << std::endl; return; } } if (isActive(action)) { - osg::notify(osg::INFO) << "Timeline::addActionAt command " << action->getName() << " already active, remove the old" << std::endl; + OSG_INFO << "Timeline::addActionAt command " << action->getName() << " already active, remove the old" << std::endl; removeAction(action); } diff --git a/src/osgAnimation/UpdateBone.cpp b/src/osgAnimation/UpdateBone.cpp index c3e7d67ce..26fb9d142 100644 --- a/src/osgAnimation/UpdateBone.cpp +++ b/src/osgAnimation/UpdateBone.cpp @@ -35,7 +35,7 @@ void UpdateBone::operator()(osg::Node* node, osg::NodeVisitor* nv) Bone* b = dynamic_cast(node); if (!b) { - osg::notify(osg::WARN) << "Warning: UpdateBone set on non-Bone object." << std::endl; + OSG_WARN << "Warning: UpdateBone set on non-Bone object." << std::endl; return; } diff --git a/src/osgAnimation/UpdateMaterial.cpp b/src/osgAnimation/UpdateMaterial.cpp index 4f2a8dd51..30bd9b1c4 100644 --- a/src/osgAnimation/UpdateMaterial.cpp +++ b/src/osgAnimation/UpdateMaterial.cpp @@ -57,7 +57,7 @@ bool UpdateMaterial::link(osgAnimation::Channel* channel) } else { - osg::notify(osg::WARN) << "Channel " << channel->getName() << " does not contain a valid symbolic name for this class " << className() << std::endl; + OSG_WARN << "Channel " << channel->getName() << " does not contain a valid symbolic name for this class " << className() << std::endl; } return false; } diff --git a/src/osgAnimation/UpdateMatrixTransform.cpp b/src/osgAnimation/UpdateMatrixTransform.cpp index 64a4bc99c..a462c2e61 100644 --- a/src/osgAnimation/UpdateMatrixTransform.cpp +++ b/src/osgAnimation/UpdateMatrixTransform.cpp @@ -61,7 +61,7 @@ bool UpdateMatrixTransform::link(osgAnimation::Channel* channel) } } - osg::notify(osg::INFO) << "UpdateMatrixTransform::link Channel " << channel->getName() << " does not contain a symbolic name that can be linked to a StackedTransformElement." << std::endl; + OSG_INFO << "UpdateMatrixTransform::link Channel " << channel->getName() << " does not contain a symbolic name that can be linked to a StackedTransformElement." << std::endl; return false; } diff --git a/src/osgAnimation/VertexInfluence.cpp b/src/osgAnimation/VertexInfluence.cpp index e605d4574..8778b747a 100644 --- a/src/osgAnimation/VertexInfluence.cpp +++ b/src/osgAnimation/VertexInfluence.cpp @@ -36,7 +36,7 @@ void VertexInfluenceSet::buildVertex2BoneList() int index = viw.first; float weight = viw.second; if (vi.getName().empty()) - osg::notify(osg::WARN) << "VertexInfluenceSet::buildVertex2BoneList warning vertex " << index << " is not assigned to a bone" << std::endl; + OSG_WARN << "VertexInfluenceSet::buildVertex2BoneList warning vertex " << index << " is not assigned to a bone" << std::endl; _vertex2Bones[index].push_back(BoneWeight(vi.getName(), weight)); } } @@ -51,7 +51,7 @@ void VertexInfluenceSet::buildVertex2BoneList() sum += bones[i].getWeight(); if (sum < 1e-4) { - osg::notify(osg::WARN) << "VertexInfluenceSet::buildVertex2BoneList warning the vertex " << it->first << " seems to have 0 weight, skip normalize for this vertex" << std::endl; + OSG_WARN << "VertexInfluenceSet::buildVertex2BoneList warning the vertex " << it->first << " seems to have 0 weight, skip normalize for this vertex" << std::endl; } else {