Converted osg::notify to OSG_INFO etc.

This commit is contained in:
Robert Osfield
2010-05-28 16:29:53 +00:00
parent fab6a14cb5
commit 0c212fefec
4 changed files with 48 additions and 48 deletions

View File

@@ -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 "<<fileName<<std::endl;
OSG_INFO << "Reading file "<<fileName<<std::endl;
const int LINE_SIZE = 1024;
char line[LINE_SIZE];
@@ -127,7 +127,7 @@ class ReaderWriter3DC : public osgDB::ReaderWriter
if (line[0]=='#')
{
// comment line
osg::notify(osg::INFO) <<"Comment: "<<line<<std::endl;
OSG_INFO <<"Comment: "<<line<<std::endl;
}
else if (strlen(line)>0)
{

View File

@@ -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:"<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsBool)="<<sizeof(Lib3dsBool)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsByte)="<<sizeof(Lib3dsByte)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsWord)="<<sizeof(Lib3dsWord)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsDword)="<<sizeof(Lib3dsDword)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsIntb)="<<sizeof(Lib3dsIntb)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsIntw)="<<sizeof(Lib3dsIntw)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsIntd)="<<sizeof(Lib3dsIntd)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsFloat)="<<sizeof(Lib3dsFloat)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsDouble)="<<sizeof(Lib3dsDouble)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsVector)="<<sizeof(Lib3dsVector)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsTexel)="<<sizeof(Lib3dsTexel)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsQuat)="<<sizeof(Lib3dsQuat)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsMatrix)="<<sizeof(Lib3dsMatrix)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsRgb)="<<sizeof(Lib3dsRgb)<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<" sizeof(Lib3dsRgba)="<<sizeof(Lib3dsRgba)<<std::endl;
OSG_NOTICE<<"3DS reader sizes:"<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsBool)="<<sizeof(Lib3dsBool)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsByte)="<<sizeof(Lib3dsByte)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsWord)="<<sizeof(Lib3dsWord)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsDword)="<<sizeof(Lib3dsDword)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsIntb)="<<sizeof(Lib3dsIntb)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsIntw)="<<sizeof(Lib3dsIntw)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsIntd)="<<sizeof(Lib3dsIntd)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsFloat)="<<sizeof(Lib3dsFloat)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsDouble)="<<sizeof(Lib3dsDouble)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsVector)="<<sizeof(Lib3dsVector)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsTexel)="<<sizeof(Lib3dsTexel)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsQuat)="<<sizeof(Lib3dsQuat)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsMatrix)="<<sizeof(Lib3dsMatrix)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsRgb)="<<sizeof(Lib3dsRgb)<<std::endl;
OSG_NOTICE<<" sizeof(Lib3dsRgba)="<<sizeof(Lib3dsRgba)<<std::endl;
#endif
}
@@ -428,8 +428,8 @@ osg::Node* ReaderWriter3DS::ReaderObject::processMesh(StateSetMap& drawStateMap,
}
if (materialFaceMap.empty() && defaultMaterialFaceList.empty())
{
OSG_NOTIFY(osg::NOTICE)<<"Warning : no triangles assigned to mesh '"<<mesh->name<<"'"<< std::endl;
//OSG_NOTIFY(osg::INFO) << "No material assigned to mesh '" << mesh->name << "'" << std::endl;
OSG_NOTICE<<"Warning : no triangles assigned to mesh '"<<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="<<texture->name<<", _directory="<<_directory<<std::endl;
OSG_INFO<<"texture->name="<<texture->name<<", _directory="<<_directory<<std::endl;
std::string fileName = osgDB::findFileInDirectory(texture->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="<<texture->name<<", _directory="<<_directory<<std::endl;
OSG_INFO<<"texture->name="<<texture->name<<", _directory="<<_directory<<std::endl;
}
if (fileName.empty())
@@ -980,30 +980,30 @@ osg::Texture2D* ReaderWriter3DS::ReaderObject::createTexture(Lib3dsTextureMap *
}
else
{
OSG_NOTIFY(osg::WARN) << "texture '"<<texture->name<<"' not found"<< std::endl;
OSG_WARN << "texture '"<<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) << " '"<<texture->name<<"'"<< std::endl;
OSG_NOTIFY(osg::DEBUG_INFO) << " texture flag "<<texture->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 << " '"<<texture->name<<"'"<< std::endl;
OSG_DEBUG << " texture flag "<<texture->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> osg_image = osgDB::readRefImageFile(fileName.c_str(), options); //Absolute Path
if (!osg_image.valid())
{
OSG_NOTIFY(osg::NOTICE) << "Warning: Cannot create texture "<<texture->name<< std::endl;
OSG_NOTICE << "Warning: Cannot create texture "<<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)
{

View File

@@ -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;

View File

@@ -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<const osg::Vec3dArray *>(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