From 0c212fefec0cced3b203433774304db77d04d766 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 May 2010 16:29:53 +0000 Subject: [PATCH] Converted osg::notify to OSG_INFO etc. --- src/osgPlugins/3dc/ReaderWriter3DC.cpp | 4 +- src/osgPlugins/3ds/ReaderWriter3DS.cpp | 76 ++++++++++---------- src/osgPlugins/3ds/WriterCompareTriangle.cpp | 2 +- src/osgPlugins/3ds/WriterNodeVisitor.cpp | 14 ++-- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/osgPlugins/3dc/ReaderWriter3DC.cpp b/src/osgPlugins/3dc/ReaderWriter3DC.cpp index 6639ee9b1..6eb812bab 100644 --- a/src/osgPlugins/3dc/ReaderWriter3DC.cpp +++ b/src/osgPlugins/3dc/ReaderWriter3DC.cpp @@ -100,7 +100,7 @@ class ReaderWriter3DC : public osgDB::ReaderWriter std::string fileName = osgDB::findDataFile( file, options ); if (fileName.empty()) return ReadResult::FILE_NOT_FOUND; - osg::notify(osg::INFO) << "Reading file "<0) { diff --git a/src/osgPlugins/3ds/ReaderWriter3DS.cpp b/src/osgPlugins/3ds/ReaderWriter3DS.cpp index 5a5f7de2d..a89f343e2 100644 --- a/src/osgPlugins/3ds/ReaderWriter3DS.cpp +++ b/src/osgPlugins/3ds/ReaderWriter3DS.cpp @@ -227,22 +227,22 @@ ReaderWriter3DS::ReaderWriter3DS() supportsOption("restoreMatrixTransformsNoMeshes", "(Read option) Makes an exception to the behaviour when 'noMatrixTransforms' is not set for mesh instances. When a mesh instance has a transform on it, the reader creates a MatrixTransform above the Geode. If you don't want the hierarchy to be modified, then you can use this option to merge the transform into vertices."); #if 0 - OSG_NOTIFY(osg::NOTICE)<<"3DS reader sizes:"<name<<"'"<< std::endl; - //OSG_NOTIFY(osg::INFO) << "No material assigned to mesh '" << mesh->name << "'" << std::endl; + OSG_NOTICE<<"Warning : no triangles assigned to mesh '"<name<<"'"<< std::endl; + //OSG_INFO << "No material assigned to mesh '" << mesh->name << "'" << std::endl; return NULL; } else @@ -768,7 +768,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriter3DS::constructFrom3dsFile(Lib3dsFile // Loading and re-exporting these files from 3DS produces a file with correct node structure, so perhaps these are not 100% conformant? if (f->nodes == NULL) { - OSG_NOTIFY(osg::WARN)<<"Warning: in 3ds loader: file has no nodes, traversing by meshes instead"<< std::endl; + OSG_WARN<<"Warning: in 3ds loader: file has no nodes, traversing by meshes instead"<< std::endl; traverse_nodes=true; } @@ -802,7 +802,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriter3DS::constructFrom3dsFile(Lib3dsFile if (osg::getNotifyLevel()>=osg::INFO) { - OSG_NOTIFY(osg::NOTICE) << "Final OSG node structure looks like this:"<< endl; + OSG_NOTICE << "Final OSG node structure looks like this:"<< endl; PrintVisitor pv(osg::notify(osg::NOTICE)); group->accept(pv); } @@ -961,14 +961,14 @@ osg::Texture2D* ReaderWriter3DS::ReaderObject::createTexture(Lib3dsTextureMap * { if (texture && *(texture->name)) { - OSG_NOTIFY(osg::INFO)<<"texture->name="<name<<", _directory="<<_directory<name="<name<<", _directory="<<_directory<name,_directory,osgDB::CASE_INSENSITIVE); if (fileName.empty()) { // file not found in .3ds file's directory, so we'll look in the datafile path list. fileName = osgDB::findDataFile(texture->name,options, osgDB::CASE_INSENSITIVE); - OSG_NOTIFY(osg::INFO)<<"texture->name="<name<<", _directory="<<_directory<name="<name<<", _directory="<<_directory<name<<"' not found"<< std::endl; + OSG_WARN << "texture '"<name<<"' not found"<< std::endl; return NULL; } } - if (label) { OSG_NOTIFY(osg::DEBUG_INFO) << label; } - else { OSG_NOTIFY(osg::DEBUG_INFO) << "texture name"; } + if (label) { OSG_DEBUG << label; } + else { OSG_DEBUG << "texture name"; } - OSG_NOTIFY(osg::DEBUG_INFO) << " '"<name<<"'"<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " texture flag "<flags<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_DECALE "<<((texture->flags)&LIB3DS_TEXTURE_DECALE)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_MIRROR "<<((texture->flags)&LIB3DS_TEXTURE_MIRROR)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_NEGATE "<<((texture->flags)&LIB3DS_TEXTURE_NEGATE)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_NO_TILE "<<((texture->flags)&LIB3DS_TEXTURE_NO_TILE)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_SUMMED_AREA "<<((texture->flags)&LIB3DS_TEXTURE_SUMMED_AREA)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_ALPHA_SOURCE "<<((texture->flags)&LIB3DS_TEXTURE_ALPHA_SOURCE)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_TINT "<<((texture->flags)&LIB3DS_TEXTURE_TINT)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_IGNORE_ALPHA "<<((texture->flags)&LIB3DS_TEXTURE_IGNORE_ALPHA)<< std::endl; - OSG_NOTIFY(osg::DEBUG_INFO) << " LIB3DS_TEXTURE_RGB_TINT "<<((texture->flags)&LIB3DS_TEXTURE_RGB_TINT)<< std::endl; + OSG_DEBUG << " '"<name<<"'"<< std::endl; + OSG_DEBUG << " texture flag "<flags<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_DECALE "<<((texture->flags)&LIB3DS_TEXTURE_DECALE)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_MIRROR "<<((texture->flags)&LIB3DS_TEXTURE_MIRROR)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_NEGATE "<<((texture->flags)&LIB3DS_TEXTURE_NEGATE)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_NO_TILE "<<((texture->flags)&LIB3DS_TEXTURE_NO_TILE)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_SUMMED_AREA "<<((texture->flags)&LIB3DS_TEXTURE_SUMMED_AREA)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_ALPHA_SOURCE "<<((texture->flags)&LIB3DS_TEXTURE_ALPHA_SOURCE)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_TINT "<<((texture->flags)&LIB3DS_TEXTURE_TINT)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_IGNORE_ALPHA "<<((texture->flags)&LIB3DS_TEXTURE_IGNORE_ALPHA)<< std::endl; + OSG_DEBUG << " LIB3DS_TEXTURE_RGB_TINT "<<((texture->flags)&LIB3DS_TEXTURE_RGB_TINT)<< std::endl; osg::ref_ptr osg_image = osgDB::readRefImageFile(fileName.c_str(), options); //Absolute Path if (!osg_image.valid()) { - OSG_NOTIFY(osg::NOTICE) << "Warning: Cannot create texture "<name<< std::endl; + OSG_NOTICE << "Warning: Cannot create texture "<name<< std::endl; return NULL; } if (osg_image->getFileName().empty()) // it should be done in OSG with osgDB::readRefImageFile(fileName.c_str()); @@ -1160,7 +1160,7 @@ osgDB::ReaderWriter::WriteResult ReaderWriter3DS::writeNode(const osg::Node& nod osgDB::ReaderWriter::WriteResult ReaderWriter3DS::writeNode(const osg::Node& node,std::ostream& fout,const Options* options) const { - //OSG_NOTIFY(osg::WARN) << "!!WARNING!! 3DS write support is incomplete" << std::endl; + //OSG_WARN << "!!WARNING!! 3DS write support is incomplete" << std::endl; std::string optFileName; if (options) { diff --git a/src/osgPlugins/3ds/WriterCompareTriangle.cpp b/src/osgPlugins/3ds/WriterCompareTriangle.cpp index d2ffcb4c0..9028a75db 100644 --- a/src/osgPlugins/3ds/WriterCompareTriangle.cpp +++ b/src/osgPlugins/3ds/WriterCompareTriangle.cpp @@ -51,7 +51,7 @@ void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sc setMaxMin (nbVerticesX, nbVerticesY, nbVerticesZ); // This function prevent from cutting the scene in too many blocs - OSG_NOTIFY(osg::INFO) + OSG_INFO << "Cutting x by " << nbVerticesX << std::endl << "Cutting y by " << nbVerticesY << std::endl << "Cutting z by " << nbVerticesZ << std::endl; diff --git a/src/osgPlugins/3ds/WriterNodeVisitor.cpp b/src/osgPlugins/3ds/WriterNodeVisitor.cpp index 867d1b48f..75946897b 100644 --- a/src/osgPlugins/3ds/WriterNodeVisitor.cpp +++ b/src/osgPlugins/3ds/WriterNodeVisitor.cpp @@ -362,7 +362,7 @@ void PrimitiveIndexWriter::drawArrays(GLenum mode,GLint first,GLsizei count) case(GL_LINE_LOOP): //break; default: - OSG_NOTIFY(osg::WARN) << "3DS WriterNodeVisitor: can't handle mode " << mode << std::endl; + OSG_WARN << "3DS WriterNodeVisitor: can't handle mode " << mode << std::endl; break; } } @@ -409,13 +409,13 @@ WriterNodeVisitor::Material::Material(WriterNodeVisitor & writerNodeVisitor, osg if (mode == osg::CullFace::BACK) double_sided = false; else if (mode == osg::CullFace::FRONT) { - OSG_NOTIFY(osg::WARN) << "3DS Writer: Reversed face (culled FRONT) not supported yet." << std::endl; + OSG_WARN << "3DS Writer: Reversed face (culled FRONT) not supported yet." << std::endl; double_sided = false; } else { assert(mode == osg::CullFace::FRONT_AND_BACK); - OSG_NOTIFY(osg::WARN) << "3DS Writer: Invisible face (culled FRONT_AND_BACK) not supported yet." << std::endl; + OSG_WARN << "3DS Writer: Invisible face (culled FRONT_AND_BACK) not supported yet." << std::endl; double_sided = false; } } @@ -742,7 +742,7 @@ WriterNodeVisitor::buildMesh(osg::Geode & geo, bool texcoords, Lib3dsMesh * mesh) { - OSG_NOTIFY(osg::DEBUG_INFO) << "Building Mesh" << std::endl; + OSG_DEBUG << "Building Mesh" << std::endl; assert(mesh); // Write points @@ -763,7 +763,7 @@ WriterNodeVisitor::buildMesh(osg::Geode & geo, else if (basevecs->getType() == osg::Array::Vec3dArrayType) { // Handle double presision vertices by converting them to float with a warning - OSG_NOTIFY(osg::NOTICE) << "3DS format only supports single precision vertices. Converting double precision to single." << std::endl; + OSG_NOTICE << "3DS format only supports single precision vertices. Converting double precision to single." << std::endl; const osg::Vec3dArray & vecs= *static_cast(basevecs); copyOsgVectorToLib3dsVector(mesh->vertices[it->second], vecs[it->first.first]*mat); } @@ -842,7 +842,7 @@ WriterNodeVisitor::buildFaces(osg::Geode & geo, // Test if the mesh will be split and needs sorting if (nbVerticesRemaining >= MAX_VERTICES || nbTrianglesRemaining >= MAX_FACES) { - OSG_NOTIFY(osg::INFO) << "Sorting elements..." << std::endl; + OSG_INFO << "Sorting elements..." << std::endl; WriterCompareTriangle cmp(geo, nbVerticesRemaining); std::sort(listTriangles.begin(), listTriangles.end(), cmp); } @@ -972,7 +972,7 @@ void WriterNodeVisitor::apply( osg::Billboard &node ) unsigned int count = node.getNumDrawables(); ListTriangle listTriangles; bool texcoords = false; - OSG_NOTIFY(osg::NOTICE) << "Warning: 3DS writer is incomplete for Billboards (rotation not implemented)." << std::endl; + OSG_NOTICE << "Warning: 3DS writer is incomplete for Billboards (rotation not implemented)." << std::endl; #if DISABLE_3DS_ANIMATION osg::Matrix m( osg::computeLocalToWorld(getNodePath()) ); #endif