From a79a8d30f95e6985ac8d32e07fe5d632b0c59a85 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 May 2010 15:47:52 +0000 Subject: [PATCH] Convesion of osg::notify to OSG_INFO etc. --- src/osg/AlphaFunc.cpp | 2 +- src/osg/ArrayDispatchers.cpp | 16 +-- src/osg/BlendColor.cpp | 4 +- src/osg/BlendEquation.cpp | 12 +- src/osg/BlendFunc.cpp | 4 +- src/osg/BufferObject.cpp | 174 ++++++++++++------------ src/osg/Camera.cpp | 18 +-- src/osg/ClampColor.cpp | 4 +- src/osg/ClipPlane.cpp | 2 +- src/osg/ClusterCullingCallback.cpp | 10 +- src/osg/CullSettings.cpp | 10 +- src/osg/DisplaySettings.cpp | 2 +- src/osg/DrawPixels.cpp | 2 +- src/osg/Drawable.cpp | 128 +++++++++--------- src/osg/FragmentProgram.cpp | 18 +-- src/osg/FrameBufferObject.cpp | 12 +- src/osg/GL2Extensions.cpp | 4 +- src/osg/GLExtensions.cpp | 4 +- src/osg/Geode.cpp | 4 +- src/osg/Geometry.cpp | 46 +++---- src/osg/GraphicsContext.cpp | 64 ++++----- src/osg/Group.cpp | 6 +- src/osg/Image.cpp | 68 +++++----- src/osg/ImageSequence.cpp | 16 +-- src/osg/ImageUtils.cpp | 30 ++--- src/osg/KdTree.cpp | 80 +++++------ src/osg/Light.cpp | 24 ++-- src/osg/LightModel.cpp | 2 +- src/osg/LineStipple.cpp | 2 +- src/osg/LogicOp.cpp | 2 +- src/osg/Material.cpp | 42 +++--- src/osg/Math.cpp | 6 +- src/osg/Multisample.cpp | 4 +- src/osg/NodeTrackerCallback.cpp | 6 +- src/osg/OcclusionQueryNode.cpp | 38 +++--- src/osg/OperationThread.cpp | 44 +++--- src/osg/Point.cpp | 8 +- src/osg/PointSprite.cpp | 2 +- src/osg/PolygonMode.cpp | 4 +- src/osg/PolygonOffset.cpp | 4 +- src/osg/PolygonStipple.cpp | 2 +- src/osg/Program.cpp | 58 ++++---- src/osg/Quat.cpp | 2 +- src/osg/Sequence.cpp | 4 +- src/osg/ShadeModel.cpp | 2 +- src/osg/Shader.cpp | 29 ++-- src/osg/ShapeDrawable.cpp | 6 +- src/osg/State.cpp | 48 +++---- src/osg/StateAttribute.cpp | 10 +- src/osg/StateSet.cpp | 90 ++++++------- src/osg/Stats.cpp | 2 +- src/osg/StencilTwoSided.cpp | 2 +- src/osg/TexEnvCombine.cpp | 4 +- src/osg/TexGen.cpp | 8 +- src/osg/TexMat.cpp | 2 +- src/osg/Texture.cpp | 206 ++++++++++++++--------------- src/osg/Texture1D.cpp | 12 +- src/osg/Texture2D.cpp | 8 +- src/osg/Texture2DArray.cpp | 24 ++-- src/osg/Texture3D.cpp | 20 +-- src/osg/TextureCubeMap.cpp | 4 +- src/osg/TextureRectangle.cpp | 16 +-- src/osg/Timer.cpp | 8 +- src/osg/TransferFunction.cpp | 8 +- src/osg/Uniform.cpp | 33 +++-- src/osg/VertexProgram.cpp | 18 +-- src/osg/View.cpp | 6 +- 67 files changed, 775 insertions(+), 785 deletions(-) diff --git a/src/osg/AlphaFunc.cpp b/src/osg/AlphaFunc.cpp index 9d16dd67e..a7a91c96a 100644 --- a/src/osg/AlphaFunc.cpp +++ b/src/osg/AlphaFunc.cpp @@ -32,7 +32,7 @@ void AlphaFunc::apply(State&) const #ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE glAlphaFunc((GLenum)_comparisonFunc,_referenceValue); #else - osg::notify(osg::NOTICE)<<"Warning: AlphaFunc::apply(State&) - not supported."<getType(); AttributeDispatch* dispatcher = 0; - // osg::notify(osg::NOTICE)<<" array->getType()="<getType()="<isBlendColorSupported()) { - notify(WARN)<<"Warning: BlendColor::apply(..) failed, BlendColor is not support by OpenGL driver."<isBlendEquationSupported()) { - notify(WARN)<<"Warning: BlendEquation::apply(..) failed, BlendEquation is not support by OpenGL driver."<isSGIXMinMaxSupported()) { - notify(WARN)<<"Warning: BlendEquation::apply(..) failed, SGIX_blend_alpha_minmax extension is not supported by OpenGL driver." << std::endl; + OSG_WARN<<"Warning: BlendEquation::apply(..) failed, SGIX_blend_alpha_minmax extension is not supported by OpenGL driver." << std::endl; return; } if(_equationRGB == LOGIC_OP && !extensions->isLogicOpSupported()) { - notify(WARN)<<"Warning: BlendEquation::apply(..) failed, EXT_blend_logic_op extension is not supported by OpenGL driver." << std::endl; + OSG_WARN<<"Warning: BlendEquation::apply(..) failed, EXT_blend_logic_op extension is not supported by OpenGL driver." << std::endl; return; } @@ -76,7 +76,7 @@ void BlendEquation::apply(State& state) const extensions->glBlendEquationSeparate(static_cast(_equationRGB), static_cast(_equationAlpha)); else { - notify(WARN)<<"Warning: BlendEquation::apply(..) failed, EXT_blend_equation_separate extension is not supported by OpenGL driver." << std::endl; + OSG_WARN<<"Warning: BlendEquation::apply(..) failed, EXT_blend_equation_separate extension is not supported by OpenGL driver." << std::endl; return; } } @@ -148,7 +148,7 @@ void BlendEquation::Extensions::glBlendEquation(GLenum mode) const } else { - notify(WARN)<<"Error: glBlendEquation not supported by OpenGL driver"<isBlendFuncSeparateSupported()) { - notify(WARN)<<"Warning: BlendFunc::apply(..) failed, BlendFuncSeparate is not support by OpenGL driver, falling back to BlendFunc."<glGenBuffers(1, &_glObjectID); } - // OSG_NOTIFY(osg::NOTICE)<<"Constucting BufferObject "<getTotalDataSize(); entry.dataSource = bd; #if 0 - OSG_NOTIFY(osg::NOTICE)<<"entry"< _profile._size) { - OSG_NOTIFY(osg::INFO)<<"newTotalSize="<getModifiedCount(); if (vboMemory) @@ -224,7 +224,7 @@ void GLBufferObject::compileBuffer() void GLBufferObject::deleteGLObject() { - OSG_NOTIFY(osg::INFO)<<"GLBufferObject::deleteGLObject() "<<_glObjectID<glDeleteBuffers(1, &_glObjectID); @@ -310,31 +310,31 @@ void GLBufferObject::Extensions::setupGLExtensions(unsigned int contextID) void GLBufferObject::Extensions::glGenBuffers(GLsizei n, GLuint *buffers) const { if (_glGenBuffers) _glGenBuffers(n, buffers); - else notify(WARN)<<"Error: glGenBuffers not supported by OpenGL driver"<_next)->_previous != to) { - OSG_NOTIFY(osg::NOTICE)<<"GLBufferObjectSet::checkConsistency() : Error (to->_next)->_previous != to "<_next)->_previous != to "<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_frameLastUsed = _parent->getFrameNumber(); @@ -779,7 +779,7 @@ void GLBufferObjectSet::moveToBack(GLBufferObject* to) // if no tail exists then assign 'to' as tail and head if (_tail==0) { - OSG_NOTIFY(osg::NOTICE)<<"Error ***************** Should not get here !!!!!!!!!"<_next==0) { - OSG_NOTIFY(osg::NOTICE)<<"Error ***************** Should not get here either !!!!!!!!!"<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous !=0 || to->_next !=0) @@ -848,10 +848,10 @@ void GLBufferObjectSet::addToBack(GLBufferObject* to) _tail = to; } #if 0 - OSG_NOTIFY(osg::NOTICE)<<" a2B after _head = "<<_head<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<getContextID(); @@ -1188,7 +1188,7 @@ void BufferObject::releaseGLObjects(State* state) const { if (_glBufferObjects[i].valid()) { - // OSG_NOTIFY(osg::NOTICE)<<" GLBufferObject::releaseGLBufferObject("< glBufferObject = new GLBufferObject(contextID, 0, globj); @@ -1281,7 +1281,7 @@ void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj) GLBufferObjectSet* bufferObjectSet = bufferObjectManager->getGLBufferObjectSet(glBufferObject->getProfile()); if (!bufferObjectSet) { - OSG_NOTIFY(osg::NOTICE)<<"Warning::BufferObject::deleteBufferObject("<(&settings); if (camera) { - //OSG_NOTIFY(osg::NOTICE)<<"Inheriting slave Camera"<_clearColor; diff --git a/src/osg/ClampColor.cpp b/src/osg/ClampColor.cpp index 9f2269243..178ab4193 100644 --- a/src/osg/ClampColor.cpp +++ b/src/osg/ClampColor.cpp @@ -48,7 +48,7 @@ void ClampColor::apply(State& state) const if (!extensions->isClampColorSupported()) { - notify(WARN)<<"Warning: ClampColor::apply(..) failed, ClampColor is not support by OpenGL driver."<accept(cdf); -// osg::notify(osg::NOTICE)<<"ClusterCullingCallback::computeFrom() _controlPoint="<<_controlPoint<accept(cb); #if 0 - osg::notify(osg::NOTICE)<<"computeBound() "<= color samples. if (_samples < _colorSamples) { - notify(WARN) << "Coverage samples must be greater than or equal to color samples." + OSG_WARN << "Coverage samples must be greater than or equal to color samples." " Setting coverage samples equal to color samples." << std::endl; const_cast(this)->setSamples(_colorSamples); } @@ -458,12 +458,12 @@ FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment& attachment) } else { - osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment&) passed an empty osg::Image, image must be allocated first."<isSupported()) { _unsupported[contextID] = 1; - notify(WARN) << "Warning: EXT_framebuffer_object is not supported" << std::endl; + OSG_WARN << "Warning: EXT_framebuffer_object is not supported" << std::endl; return; } @@ -778,7 +778,7 @@ void FrameBufferObject::apply(State &state, BindTarget target) const ext->glGenFramebuffers(1, &fboID); if (fboID == 0) { - notify(WARN) << "Warning: FrameBufferObject: could not create the FBO" << std::endl; + OSG_WARN << "Warning: FrameBufferObject: could not create the FBO" << std::endl; return; } @@ -832,7 +832,7 @@ void FrameBufferObject::apply(State &state, BindTarget target) const } else { - notify(WARN) << + OSG_WARN << "Warning: FrameBufferObject: could not attach PACKED_DEPTH_STENCIL_BUFFER, " "EXT_packed_depth_stencil is not supported !" << std::endl; } diff --git a/src/osg/GL2Extensions.cpp b/src/osg/GL2Extensions.cpp index 9ec4b7e1d..f08b569fb 100644 --- a/src/osg/GL2Extensions.cpp +++ b/src/osg/GL2Extensions.cpp @@ -349,7 +349,7 @@ void GL2Extensions::setupGL2Extensions(unsigned int contextID) _glslLanguageVersion = 1.0f; } - OSG_NOTIFY(osg::INFO) + OSG_INFO << "glVersion=" << getGlVersion() << ", " << "isGlslSupported=" << (isGlslSupported() ? "YES" : "NO") << ", " << "glslLanguageVersion=" << getLanguageVersion() @@ -519,7 +519,7 @@ void GL2Extensions::Set(unsigned int contextID, GL2Extensions* extensions) static void NotSupported( const char* funcName ) { - OSG_NOTIFY(osg::WARN) + OSG_WARN <<"Error: "<_drawables.size()) { - notify(DEBUG_INFO)<<"Warning: Geode::removeDrawable(i,numDrawablesToRemove) has been passed an excessive number"<getOrCreateGLBufferObject(contextID); if (glBufferObject && glBufferObject->isDirty()) { - // osg::notify(osg::NOTICE)<<"Compile buffer "<compileBuffer(); } } @@ -1294,7 +1294,7 @@ void Geometry::accept(AttributeFunctor& af) } else if (_vertexAttribList.size()>0) { - osg::notify(osg::INFO)<<"Geometry::accept(AttributeFunctor& af): Using vertex attribute instead"<0) { - osg::notify(osg::INFO)<<"Geometry::accept(ConstAttributeFunctor& af): Using vertex attribute instead"<0) { - osg::notify(osg::INFO)<<"Using vertex attribute instead"<getNumElements(),static_cast(vertices->getDataPointer())); break; default: - notify(WARN)<<"Warning: Geometry::accept(PrimitiveFunctor&) cannot handle Vertex Array type"<getType()<getType()<(vertices->getDataPointer()); break; default: - notify(WARN)<<"Warning: Geometry::accept(PrimitiveFunctor&) cannot handle Vertex Array type"<getType()<getType()<0) { - osg::notify(osg::INFO)<<"Geometry::accept(PrimitiveIndexFunctor& functor): Using vertex attribute instead"<getNumElements(),static_cast(vertices->getDataPointer())); break; default: - notify(WARN)<<"Warning: Geometry::accept(PrimitiveIndexFunctor&) cannot handle Vertex Array type"<getType()<getType()<getNumIndices()="<getNumIndices()<<" totalNumberOfPrimitives="<getNumIndices()="<getNumIndices()<<" totalNumberOfPrimitives="< &wsref = windowingSystemInterfaceRef(); wsref = callback; - OSG_NOTIFY(osg::INFO)<<"GraphicsContext::setWindowingSystemInterface() "< &wsref = windowingSystemInterfaceRef(); - OSG_NOTIFY(osg::INFO)<<"GraphicsContext::getWindowingSystemInterface() "<referenceCount()<referenceCount()<second._numContexts = 1; - OSG_NOTIFY(osg::INFO)<<"GraphicsContext::createNewContextID() reusing contextID="<first< lock(s_contextIDMapMutex); - OSG_NOTIFY(osg::INFO)<<"GraphicsContext::incrementContextIDUsageCount("< lock(s_contextIDMapMutex); @@ -407,7 +407,7 @@ GraphicsContext* GraphicsContext::getOrCreateCompileContext(unsigned int context { OpenThreads::ScopedLock lock(s_contextIDMapMutex); s_contextIDMap[contextID]._compileContext = gc; - OSG_NOTIFY(osg::NOTICE)<<" succeeded GraphicsContext::createCompileContext."< lock(s_contextIDMapMutex); ContextIDMap::iterator itr = s_contextIDMap.find(contextID); if (itr != s_contextIDMap.end()) return itr->second._compileContext.get(); @@ -496,7 +496,7 @@ bool GraphicsContext::realize() void GraphicsContext::close(bool callCloseImplementation) { - OSG_NOTIFY(osg::INFO)<<"close("<getContextID()="<<_state->getContextID()<getContextID()="<<_state->getContextID()<getContextID()); - OSG_NOTIFY(osg::INFO)<<"Done delete of GL objects"<reset(); @@ -543,7 +543,7 @@ void GraphicsContext::close(bool callCloseImplementation) } else { - OSG_NOTIFY(osg::INFO)<<"makeCurrent did not succeed, could not do flush/deletion of OpenGL objects."<getContextID()); } @@ -661,7 +661,7 @@ void GraphicsContext::setGraphicsThread(GraphicsThread* gt) void GraphicsContext::add(Operation* operation) { - OSG_NOTIFY(osg::INFO)<<"Doing add"< lock(_operationsMutex); @@ -674,7 +674,7 @@ void GraphicsContext::add(Operation* operation) void GraphicsContext::remove(Operation* operation) { - OSG_NOTIFY(osg::INFO)<<"Doing remove operation"< lock(_operationsMutex); @@ -694,7 +694,7 @@ void GraphicsContext::remove(Operation* operation) void GraphicsContext::remove(const std::string& name) { - OSG_NOTIFY(osg::INFO)<<"Doing remove named operation"< lock(_operationsMutex); @@ -715,7 +715,7 @@ void GraphicsContext::remove(const std::string& name) void GraphicsContext::removeAllOperations() { - OSG_NOTIFY(osg::INFO)<<"Doing remove all operations"< lock(_operationsMutex); _operations.clear(); @@ -775,7 +775,7 @@ void GraphicsContext::runOperations() if (_currentOperation.valid()) { - // OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<getName()<<" "<_children.size()) { - notify(DEBUG_INFO)<<"Warning: Group::removeChild(i,numChildrenToRemove) has been passed an excessive number"<asTexture() : 0; - // osg::notify(osg::NOTICE)<<"ImageSequence::UpdateCallback::"<getNumImages(); ++i) @@ -239,7 +239,7 @@ GLenum Image::computePixelFormat(GLenum format) case(GL_INTENSITY8UI_EXT): case(GL_INTENSITY16UI_EXT): case(GL_INTENSITY32UI_EXT): - notify(WARN)<<"Image::computePixelFormat("<s(),t_offset+source->t(),r_offset+source->r(), source->getPixelFormat(),source->getDataType(), source->getPacking()); @@ -1005,14 +1005,14 @@ void Image::copySubImage(int s_offset, int t_offset, int r_offset, const osg::Im if (s_offset>=_s || t_offset>=_t || r_offset>=_r) { - notify(WARN)<<"Warning: offsets passed to Image::copySubImage(..) outside destination image, operation ignored."<getPixelFormat()) { - notify(WARN)<<"Warning: image with an incompatible pixel formats passed to Image::copySubImage(..), operation ignored."<1) { - notify(WARN) << "Error Image::flipVertical() do not succeed : flipping of mipmap 3d textures not yet supported."< lock(_mutex); - osg::notify(osg::INFO)<<"ImageSequence::setImage("<getFileName()<<")"<getFileName()<<")"<=_images.size()) _images.resize(pos+1); @@ -155,7 +155,7 @@ void ImageSequence::addImage(osg::Image* image) OpenThreads::ScopedLock lock(_mutex); - // osg::notify(osg::NOTICE)<<"merging image in order expected : "<getFileName()<getFileName()<getImageRequestHandler(); const osg::FrameStamp* fs = nv->getFrameStamp(); - // osg::notify(osg::NOTICE)<<"ImageSequence::update("< (dest_t + destImage->t())) { - osg::notify(osg::NOTICE)<<"copyImage("< (dest_r + destImage->r())) { - osg::notify(osg::NOTICE)<<"copyImage("<getPixelFormat() == destImage->getPixelFormat()) { - //osg::notify(osg::NOTICE)<<"copyImage("<getDataType() == destImage->getDataType() && !doRescale) { - //osg::notify(osg::NOTICE)<<" Compatible pixelFormat and dataType."<(geometry->getVertexArray()); @@ -116,7 +116,7 @@ bool BuildKdTree::build(KdTree::BuildOptions& options, osg::Geometry* geometry) unsigned int estimatedSize = (unsigned int)(2.0*float(vertices->size())/float(options._targetNumTrianglesPerLeaf)); #ifdef VERBOSE_OUTPUT - osg::notify(osg::NOTICE)<<"kdTree->_kdNodes.reserve()="<_kdNodes.reserve()="<(_opcode)); #else - osg::notify(osg::NOTICE)<<"Warning: LogicOp::apply(State&) - not supported."<glGetQueryObjectiv( tr->_id, GL_QUERY_RESULT, &(tr->_numPixels) ); if (tr->_numPixels < 0) - osg::notify( osg::WARN ) << "osgOQ: RQCB: " << + OSG_WARN << "osgOQ: RQCB: " << "glGetQueryObjectiv returned negative value (" << tr->_numPixels << ")." << std::endl; // Either retrieve last frame's results, or ignore it because the @@ -265,7 +265,7 @@ struct RetrieveQueriesCallback : public osg::Camera::DrawCallback } elapsedTime = timer.delta_s(start_tick,timer.tick()); - osg::notify( osg::INFO ) << "osgOQ: RQCB: " << "Retrieved " << count << + OSG_INFO << "osgOQ: RQCB: " << "Retrieved " << count << " queries in " << elapsedTime << " seconds." << std::endl; } @@ -303,7 +303,7 @@ struct ClearQueriesCallback : public osg::Camera::DrawCallback { if (!_rqcb) { - osg::notify( osg::FATAL ) << "osgOQ: CQCB: Invalid RQCB." << std::endl; + OSG_FATAL << "osgOQ: CQCB: Invalid RQCB." << std::endl; return; } _rqcb->reset(); @@ -384,7 +384,7 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const RetrieveQueriesCallback* >( cam->getPostDrawCallback() ); if (!rqcb) { - osg::notify( osg::FATAL ) << "osgOQ: QG: Invalid RQCB." << std::endl; + OSG_FATAL << "osgOQ: QG: Invalid RQCB." << std::endl; return; } rqcb->add( tr ); @@ -398,7 +398,7 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const tr->_init = true; } - osg::notify( osg::DEBUG_INFO ) << + OSG_DEBUG << "osgOQ: QG: Querying for: " << _oqnName << std::endl; ext->glBeginQuery( GL_SAMPLES_PASSED_ARB, tr->_id ); @@ -407,7 +407,7 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const tr->_active = true; - osg::notify( osg::DEBUG_INFO ) << + OSG_DEBUG << "osgOQ: QG. OQNName: " << _oqnName << ", Ctx: " << contextID << ", ID: " << tr->_id << std::endl; @@ -415,8 +415,9 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const { GLenum err; if ((err = glGetError()) != GL_NO_ERROR) - osg::notify( osg::FATAL ) << - "osgOQ: QG: OpenGL error: " << err << "." << std::endl; + { + OSG_FATAL << "osgOQ: QG: OpenGL error: " << err << "." << std::endl; + } } #endif @@ -573,8 +574,7 @@ OcclusionQueryNode::getPassed( const osg::Camera* camera, osg::NodeVisitor& nv ) if (_queryGeode->getDrawable( 0 ) == NULL) { - osg::notify( osg::FATAL ) << - "osgOQ: OcclusionQueryNode: No QueryGeometry." << std::endl; + OSG_FATAL << "osgOQ: OcclusionQueryNode: No QueryGeometry." << std::endl; // Something's broke. Return true so we at least render correctly. return true; } @@ -696,7 +696,7 @@ OcclusionQueryNode::setQueryStateSet( osg::StateSet* ss ) { if (!_queryGeode) { - osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; + OSG_WARN << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; return; } @@ -707,7 +707,7 @@ OcclusionQueryNode::getQueryStateSet() { if (!_queryGeode) { - osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; + OSG_WARN << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; return NULL; } return _queryGeode->getStateSet(); @@ -718,7 +718,7 @@ OcclusionQueryNode::getQueryStateSet() const { if (!_queryGeode) { - osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; + OSG_WARN << "osgOQ: OcclusionQueryNode:: Invalid query support node." << std::endl; return NULL; } return _queryGeode->getStateSet(); @@ -729,7 +729,7 @@ OcclusionQueryNode::setDebugStateSet( osg::StateSet* ss ) { if (!_debugGeode) { - osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; + OSG_WARN << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; return; } _debugGeode->setStateSet( ss ); @@ -740,7 +740,7 @@ OcclusionQueryNode::getDebugStateSet() { if (!_debugGeode.valid()) { - osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; + OSG_WARN << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; return NULL; } return _debugGeode->getStateSet(); @@ -750,7 +750,7 @@ OcclusionQueryNode::getDebugStateSet() const { if (!_debugGeode.valid()) { - osg::notify( osg::WARN ) << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; + OSG_WARN << "osgOQ: OcclusionQueryNode:: Invalid debug support node." << std::endl; return NULL; } return _debugGeode->getStateSet(); diff --git a/src/osg/OperationThread.cpp b/src/osg/OperationThread.cpp index 3180b9771..98276a1d6 100644 --- a/src/osg/OperationThread.cpp +++ b/src/osg/OperationThread.cpp @@ -76,22 +76,22 @@ ref_ptr OperationQueue::getNextOperation(bool blockIfEmpty) if (!currentOperation->getKeep()) { - // OSG_NOTIFY(osg::INFO)<<"removing "<getName()<getName()<set(false); } } else { - // OSG_NOTIFY(osg::INFO)<<"increment "<<_currentOperation->getName()<getName()< OperationQueue::getNextOperation(bool blockIfEmpty) void OperationQueue::add(Operation* operation) { - OSG_NOTIFY(osg::INFO)<<"Doing add"< lock(_operationsMutex); @@ -115,7 +115,7 @@ void OperationQueue::add(Operation* operation) void OperationQueue::remove(Operation* operation) { - OSG_NOTIFY(osg::INFO)<<"Doing remove operation"< lock(_operationsMutex); @@ -138,7 +138,7 @@ void OperationQueue::remove(Operation* operation) void OperationQueue::remove(const std::string& name) { - OSG_NOTIFY(osg::INFO)<<"Doing remove named operation"< lock(_operationsMutex); @@ -166,7 +166,7 @@ void OperationQueue::remove(const std::string& name) void OperationQueue::removeAllOperations() { - OSG_NOTIFY(osg::INFO)<<"Doing remove all operations"< lock(_operationsMutex); @@ -203,7 +203,7 @@ void OperationQueue::runOperations(Object* callingObject) ++_currentOperationIterator; } - // OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<getName()<<" "< lock(_threadMutex); if (_currentOperation.valid()) { - OSG_NOTIFY(osg::INFO)<<"releasing "<<_currentOperation.get()<release(); } } @@ -303,7 +303,7 @@ void OperationThread::setDone(bool done) int OperationThread::cancel() { - OSG_NOTIFY(osg::INFO)<<"Cancelling OperationThread "< lock(_threadMutex); @@ -344,12 +344,12 @@ int OperationThread::cancel() #endif // commenting out debug info as it was cashing crash on exit, presumable // due to OSG_NOTIFY or std::cout destructing earlier than this destructor. - OSG_NOTIFY(osg::DEBUG_INFO)<<" Waiting for OperationThread to cancel "< operation; ref_ptr operationQueue; @@ -407,7 +407,7 @@ void OperationThread::run() _currentOperation = operation; } - // OSG_NOTIFY(osg::INFO)<<"Doing op "<<_currentOperation->getName()<<" "<getName()<<" "<isPointSpriteCoordOriginSupported()) extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode); #else - osg::notify(osg::NOTICE)<<"Warning: PointSprite::apply(State&) - not supported."<getName() << "\"" - << " id=" << _glProgramHandle - << " contextID=" << _contextID - << std::endl; + OSG_INFO << "Linking osg::Program \"" << _program->getName() << "\"" + << " id=" << _glProgramHandle + << " contextID=" << _contextID + << std::endl; if (_extensions->isGeometryShader4Supported()) { @@ -489,7 +488,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) for( AttribBindingList::const_iterator itr = programBindlist.begin(); itr != programBindlist.end(); ++itr ) { - osg::notify(osg::NOTICE)<<"Program's vertex attrib binding "<second<<", "<first<second<<", "<first<glBindAttribLocation( _glProgramHandle, itr->second, reinterpret_cast(itr->first.c_str()) ); } @@ -501,7 +500,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) for( AttribBindingList::const_iterator itr = stateBindlist.begin(); itr != stateBindlist.end(); ++itr ) { - osg::notify(osg::NOTICE)<<"State's vertex attrib binding "<second<<", "<first<second<<", "<first<glBindAttribLocation( _glProgramHandle, itr->second, reinterpret_cast(itr->first.c_str()) ); } } @@ -521,12 +520,12 @@ void Program::PerContextProgram::linkProgram(osg::State& state) _isLinked = (linked == GL_TRUE); if( ! _isLinked ) { - osg::notify(osg::WARN) << "glLinkProgram \""<< _program->getName() << "\" FAILED" << std::endl; + OSG_WARN << "glLinkProgram \""<< _program->getName() << "\" FAILED" << std::endl; std::string infoLog; if( getInfoLog(infoLog) ) { - osg::notify(osg::WARN) << "Program \""<< _program->getName() << "\" " + OSG_WARN << "Program \""<< _program->getName() << "\" " "infolog:\n" << infoLog << std::endl; } @@ -537,7 +536,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) std::string infoLog; if( getInfoLog(infoLog) ) { - osg::notify(osg::INFO) << "Program \""<< _program->getName() << "\" "<< + OSG_INFO << "Program \""<< _program->getName() << "\" "<< "link succeded, infolog:\n" << infoLog << std::endl; } } @@ -564,12 +563,11 @@ void Program::PerContextProgram::linkProgram(osg::State& state) { _uniformInfoMap[reinterpret_cast(name)] = ActiveVarInfo(loc,type,size); - osg::notify(osg::INFO) - << "\tUniform \"" << name << "\"" - << " loc="<< loc - << " size="<< size - << " type=" << Uniform::getTypename((Uniform::Type)type) - << std::endl; + OSG_INFO << "\tUniform \"" << name << "\"" + << " loc="<< loc + << " size="<< size + << " type=" << Uniform::getTypename((Uniform::Type)type) + << std::endl; } } delete [] name; @@ -596,16 +594,15 @@ void Program::PerContextProgram::linkProgram(osg::State& state) { _attribInfoMap[reinterpret_cast(name)] = ActiveVarInfo(loc,type,size); - osg::notify(osg::INFO) - << "\tAttrib \"" << name << "\"" - << " loc=" << loc - << " size=" << size - << std::endl; + OSG_INFO << "\tAttrib \"" << name << "\"" + << " loc=" << loc + << " size=" << size + << std::endl; } } delete [] name; } - osg::notify(osg::INFO) << std::endl; + OSG_INFO << std::endl; } bool Program::PerContextProgram::validateProgram() @@ -616,17 +613,16 @@ bool Program::PerContextProgram::validateProgram() if( validated == GL_TRUE) return true; - osg::notify(osg::INFO) - << "glValidateProgram FAILED \"" << _program->getName() << "\"" - << " id=" << _glProgramHandle - << " contextID=" << _contextID - << std::endl; + OSG_INFO << "glValidateProgram FAILED \"" << _program->getName() << "\"" + << " id=" << _glProgramHandle + << " contextID=" << _contextID + << std::endl; std::string infoLog; if( getInfoLog(infoLog) ) - osg::notify(osg::INFO) << "infolog:\n" << infoLog << std::endl; + OSG_INFO << "infolog:\n" << infoLog << std::endl; - osg::notify(osg::INFO) << std::endl; + OSG_INFO << std::endl; return false; } diff --git a/src/osg/Quat.cpp b/src/osg/Quat.cpp index e9c5fec95..2a851079c 100644 --- a/src/osg/Quat.cpp +++ b/src/osg/Quat.cpp @@ -217,7 +217,7 @@ void Quat::makeRotate_original( const Vec3d& from, const Vec3d& to ) if ( fabs(cosangle - 1) < epsilon ) { - osg::notify(osg::INFO)<<"*** Quat::makeRotate(from,to) with near co-linear vectors, epsilon= "<getShaderSource().empty()) { - osg::notify(osg::WARN)<<"Warning: No shader binary formats supported by GLES driver, unable to compile shader."<=osg::INFO) { - osg::notify(osg::INFO) - << "\nCompiling " << _shader->getTypename() - << " source:\n" << sourceWithLineNumbers << std::endl; + OSG_INFO << "\nCompiling " << _shader->getTypename() + << " source:\n" << sourceWithLineNumbers << std::endl; } GLint compiled = GL_FALSE; @@ -508,13 +507,13 @@ void Shader::PerContextShader::compileShader(osg::State& state) _isCompiled = (compiled == GL_TRUE); if( ! _isCompiled ) { - osg::notify(osg::WARN) << _shader->getTypename() << " glCompileShader \"" + OSG_WARN << _shader->getTypename() << " glCompileShader \"" << _shader->getName() << "\" FAILED" << std::endl; std::string infoLog; if( getInfoLog(infoLog) ) { - osg::notify(osg::WARN) << _shader->getTypename() << " Shader \"" + OSG_WARN << _shader->getTypename() << " Shader \"" << _shader->getName() << "\" infolog:\n" << infoLog << std::endl; } } @@ -523,7 +522,7 @@ void Shader::PerContextShader::compileShader(osg::State& state) std::string infoLog; if( getInfoLog(infoLog) ) { - osg::notify(osg::INFO) << _shader->getTypename() << " Shader \"" + OSG_INFO << _shader->getTypename() << " Shader \"" << _shader->getName() << "\" infolog:\n" << infoLog << std::endl; } } diff --git a/src/osg/ShapeDrawable.cpp b/src/osg/ShapeDrawable.cpp index 663722393..e7d020bff 100644 --- a/src/osg/ShapeDrawable.cpp +++ b/src/osg/ShapeDrawable.cpp @@ -37,7 +37,7 @@ class DrawShapeVisitor : public ConstShapeVisitor #if 0 if (hints) { - notify(NOTICE)<<"Warning: TessellationHints ignored in present osg::ShapeDrawable implementation."<setMaxTexturePoolSize(size); - OSG_NOTIFY(osg::INFO)<<"osg::State::_maxTexturePoolSize="<<_maxTexturePoolSize<= _stateStateStack.size()) { - OSG_NOTIFY(osg::NOTICE)<<"Warning: State::removeStateSet("<= _vertexAttribArrayList.size()) _vertexAttribArrayList.resize(index+1); EnabledArrayPair& eap = _vertexAttribArrayList[index]; @@ -929,12 +929,12 @@ void State::setVertexAttribPointer( unsigned int index, if (!eap._enabled || eap._dirty) { eap._enabled = true; - // OSG_NOTIFY(osg::NOTICE)<<" _glEnableVertexAttribArray( "<65536) { - OSG_NOTIFY(osg::NOTICE)<<"Warning: State::drawQuads("< lock(getRefMutex()); _parents.push_back(object); @@ -44,7 +44,7 @@ void StateAttribute::removeParent(osg::StateSet* object) void StateAttribute::setUpdateCallback(StateAttributeCallback* uc) { - osg::notify(osg::INFO)<<"StateAttribute::Setting Update callbacks"<setNumChildrenRequiringUpdateTraversal((*itr)->getNumChildrenRequiringUpdateTraversal()+delta); } @@ -71,7 +71,7 @@ void StateAttribute::setUpdateCallback(StateAttributeCallback* uc) void StateAttribute::setEventCallback(StateAttributeCallback* ec) { - osg::notify(osg::INFO)<<"StateAttribute::Setting Event callbacks"< lock(getRefMutex()); _parents.push_back(object); @@ -787,17 +787,17 @@ void StateSet::setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue { if (getTextureGLModeSet().isTextureMode(mode)) { - notify(NOTICE)<<"Warning: texture mode '"<className()<<"'passed to setAttribute(attr,value), "<className()<<"'passed to setAttribute(attr,value), "<className()<<"' passed to setAttributeAndModes(attr,value), "<className()<<"' passed to setAttributeAndModes(attr,value), "<className()<<"' passed to setTextureAttribute(unit,attr,value), "<className()<<"' passed to setTextureAttribute(unit,attr,value), "<className()<<"' passed to setTextureAttributeAndModes(unit,attr,value), "<className()<<"' passed to setTextureAttributeAndModes(unit,attr,value), "<second.first->compileGLObjects(state); if (checkForGLErrors && state.checkGLErrors("StateSet::compileGLObejcts() compiling attribute")) { - osg::notify(osg::NOTICE)<<" GL Error when compiling "<second.first->className()<second.first->className()<second.first->compileGLObjects(state); if (checkForGLErrors && state.checkGLErrors("StateSet::compileGLObejcts() compiling texture attribute")) { - osg::notify(osg::NOTICE)<<" GL Error when compiling "<second.first->className()<second.first->className()<(*itr); if (drawable) @@ -1679,7 +1679,7 @@ void StateSet::setUpdateCallback(Callback* ac) void StateSet::runUpdateCallbacks(osg::NodeVisitor* nv) { - //osg::notify(osg::INFO)<<"Running StateSet callbacks"<_next)->_previous != to) { - osg::notify(osg::NOTICE)<<"Texture::TextureObjectSet::checkConsistency() : Error (to->_next)->_previous != to "<_next)->_previous != to "<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<id(); - // osg::notify(osg::NOTICE)<<" Deleting textureobject ptr="<get()<<" id="<id(); - // osg::notify(osg::NOTICE)<<" Deleting textureobject ptr="<get()<<" id="<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_frameLastUsed = _parent->getFrameNumber(); @@ -547,7 +547,7 @@ void Texture::TextureObjectSet::moveToBack(Texture::TextureObject* to) // if no tail exists then assign 'to' as tail and head if (_tail==0) { - osg::notify(osg::NOTICE)<<"Error ***************** Should not get here !!!!!!!!!"<_next==0) { - osg::notify(osg::NOTICE)<<"Error ***************** Should not get here either !!!!!!!!!"<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next<_previous !=0 || to->_next !=0) @@ -616,17 +616,17 @@ void Texture::TextureObjectSet::addToBack(Texture::TextureObject* to) _tail = to; } #if 0 - osg::notify(osg::NOTICE)<<" a2B after _head = "<<_head<_previous = "<_previous<_next = "<_next<_previous = "<_previous<_next = "<_next< lock(_mutex); @@ -641,8 +641,8 @@ void Texture::TextureObjectSet::orphan(Texture::TextureObject* to) _pendingOrphanedTextureObjects.push_back(to); #if 0 - osg::notify(osg::NOTICE)<<"TextureObjectSet::orphan("<isNonPowerOfTwoTextureSupported(_min_filter)="<isNonPowerOfTwoTextureSupported(_min_filter) <isNonPowerOfTwoTextureSupported(_min_filter)="<isNonPowerOfTwoTextureSupported(_min_filter) <tick(); - osg::notify(osg::NOTICE)<<"glTexImage2D pixelFormat = "<getPixelFormat()<data(); - // osg::notify(osg::NOTICE)<<"inwidth="<getFileName()"<getFileName()<getFileName()"<getFileName()<s() || inheight!=image->t(); if (needImageRescale) @@ -1586,12 +1586,12 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima if (image->isMipmap()) { - notify(WARN)<<"Warning:: Mipmapped osg::Image not a power of two, cannot apply to texture."<getFileName().empty()) notify(NOTICE) << "Scaling image '"<getFileName()<<"' from ("<s()<<","<t()<<") to ("<s()<<","<t()<<") to ("<getFileName().empty()) { OSG_NOTICE << "Scaling image '"<getFileName()<<"' from ("<s()<<","<t()<<") to ("<s()<<","<t()<<") to ("<getPacking()); @@ -1613,7 +1613,7 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima image->s(),image->t(),image->getDataType(),image->data(), inwidth,inheight,image->getDataType(),dataPtr); #else - osg::notify(osg::NOTICE)<<"Warning: gluScaleImage(..) not supported, cannot subload image."<(pbo->getOffset(image->getBufferIndex())); #ifdef DO_TIMING - osg::notify(osg::NOTICE)<<"after PBO "<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<>= 1; } #else - osg::notify(osg::NOTICE)<<"Warning:: gluBuild2DMipMaps(..) not supported."<delta_m(start_tick,osg::Timer::instance()->tick()); s_total_time += delta_time; - osg::notify(osg::NOTICE)<<"glTexImage2D "<tick(); - osg::notify(osg::NOTICE)<<"glTexSubImage2D pixelFormat = "<getPixelFormat()<getFileName().empty()) notify(NOTICE) << "Scaling image '"<getFileName()<<"' from ("<s()<<","<t()<<") to ("<s()<<","<t()<<") to ("<getFileName().empty()) { OSG_NOTICE << "Scaling image '"<getFileName()<<"' from ("<s()<<","<t()<<") to ("<s()<<","<t()<<") to ("<getPacking()); @@ -1860,7 +1860,7 @@ void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image* image->s(),image->t(),image->getDataType(),image->data(), inwidth,inheight,image->getDataType(),data); #else - osg::notify(osg::NOTICE)<<"Warning: gluScaleImage(..) not supported, cannot subload image."<(pbo->getOffset(image->getBufferIndex())); #ifdef DO_TIMING - osg::notify(osg::NOTICE)<<"after PBO "<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<(this)->dirtyTextureObject(); else @@ -2157,7 +2157,7 @@ Texture::Extensions::Extensions(unsigned int contextID) const char* version = (const char*) glGetString( GL_VERSION ); if (!version) { - osg::notify(osg::FATAL)<<"Error: In Texture::Extensions::setupGLExtensions(..) OpenGL version test failed, requires valid graphics context."<getPixelFormat(), (GLenum)image->getDataType(), image->data() ); #else - osg::notify(osg::NOTICE)<<"Warning: gluBuild1DMipmaps(..) not supported."<s(); #else - osg::notify(osg::NOTICE)<<"Warning: Texture1D::applyTexImage1D(State& state) not supported."<isAllocated()) { - //notify(NOTICE)<<"Reusing texture object"<(layer) >= _textureDepth) { // print warning and do nothing - notify(WARN)<<"Warning: Texture2DArray::setImage(..) failed, the given layer number is bigger then the size of the texture array."<isTexture2DArraySupported() || !extensions->isTexture3DSupported()) { - notify(WARN)<<"Warning: Texture2DArray::apply(..) failed, 2D texture arrays are not support by OpenGL driver."< extensions->maxLayerCount()) { // we give a warning and do nothing - notify(WARN)<<"Warning: Texture2DArray::applyTexImage2DArray_subload(..) the given layer number exceeds the maximum number of supported layers."<t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat ) { - notify(WARN)<<"Warning: Texture2DArray::applyTexImage2DArray_subload(..) given image do have wrong dimension or internal format."<isCompressedTexImage3DSupported()) { - // notify(WARN)<<"glCompressedTexImage3D "<isMipmap() ) { numMipmapLevels = 1; - notify(WARN)<<"Warning: Texture2DArray::applyTexImage2DArray_subload(..) mipmap layer not passed, and auto mipmap generation turned off or not available. Check texture's min/mag filters & hardware mipmap generation."<isTexture3DSupported()) { - notify(WARN)<<"Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL driver."<isCompressedTexImage3DSupported()) { - // notify(WARN)<<"glCompressedTexImage3D "<tick(); - osg::notify(osg::NOTICE)<<"TextureRectangle::apply pixelFormat = "<getPixelFormat()<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<getBufferObject()<<", "<getPixelBufferObject()<<" pbo="<getBufferObject()<<", "<getPixelBufferObject()<<" pbo="<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"< endPos) end_iPos = endPos; - //osg::notify(osg::NOTICE)<<"TransferFunction1D::assignToImage[lower_v="<0 ) { - osg::notify(osg::WARN) << "Warning: Uniform::setNumElements() cannot change Uniform numElements, size already fixed." << std::endl; + OSG_WARN << "Warning: Uniform::setNumElements() cannot change Uniform numElements, size already fixed." << std::endl; return; } @@ -155,7 +155,7 @@ bool Uniform::setArray( FloatArray* array ) // incoming array must match configuration of the Uniform if( getInternalArrayType(getType())!=GL_FLOAT || getInternalArrayNumElements()!=array->getNumElements() ) { - osg::notify(osg::WARN) << "Uniform::setArray : incompatible array" << std::endl; + OSG_WARN << "Uniform::setArray : incompatible array" << std::endl; return false; } @@ -173,7 +173,7 @@ bool Uniform::setArray( IntArray* array ) // incoming array must match configuration of the Uniform if( getInternalArrayType(getType())!=GL_INT || getInternalArrayNumElements()!=array->getNumElements() ) { - osg::notify(osg::WARN) << "Uniform::setArray : incompatible array" << std::endl; + OSG_WARN << "Uniform::setArray : incompatible array" << std::endl; return false; } @@ -191,7 +191,7 @@ bool Uniform::setArray( UIntArray* array ) // incoming array must match configuration of the Uniform if( getInternalArrayType(getType())!=GL_UNSIGNED_INT || getInternalArrayNumElements()!=array->getNumElements() ) { - osg::notify(osg::WARN) << "Uniform::setArray : incompatible array" << std::endl; + OSG_WARN << "Uniform::setArray : incompatible array" << std::endl; return false; } @@ -268,9 +268,8 @@ bool Uniform::isCompatibleType( Type t ) const if( t == getType() ) return true; if( getGlApiType(t) == getGlApiType(getType()) ) return true; - osg::notify(osg::WARN) - << "Cannot assign between Uniform types " << getTypename(t) - << " and " << getTypename(getType()) << std::endl; + OSG_WARN << "Cannot assign between Uniform types " << getTypename(t) + << " and " << getTypename(getType()) << std::endl; return false; } @@ -1393,7 +1392,7 @@ bool Uniform::getElement( unsigned int index, bool& b0, bool& b1, bool& b2, bool void Uniform::apply(const GL2Extensions* ext, GLint location) const { - // osg::notify(osg::NOTICE) << "uniform at "<setNumChildrenRequiringUpdateTraversal((*itr)->getNumChildrenRequiringUpdateTraversal()+delta); } } @@ -1494,7 +1493,7 @@ void Uniform::setUpdateCallback(Callback* uc) void Uniform::setEventCallback(Callback* ec) { - osg::notify(osg::INFO)<<"Uniform::Setting Event callbacks"<