Removed include <iostream> where possible, replacing with istream or ostream and changing

std::cout/cerr to osg::notify().
This commit is contained in:
Robert Osfield 2004-03-03 13:27:21 +00:00
parent f3bee81e7a
commit 4aa7afedf3
33 changed files with 705 additions and 704 deletions

View File

@ -39,12 +39,12 @@ public:
osg::Geometry* geom = geoset->convertToGeometry(); osg::Geometry* geom = geoset->convertToGeometry();
if (geom) if (geom)
{ {
std::cout<<"Successfully converted GeoSet to Geometry"<<std::endl; osg::notify(osg::NOTICE)<<"Successfully converted GeoSet to Geometry"<<std::endl;
geode.replaceDrawable(geoset,geom); geode.replaceDrawable(geoset,geom);
} }
else else
{ {
std::cout<<"*** Failed to convert GeoSet to Geometry"<<std::endl; osg::notify(osg::NOTICE)<<"*** Failed to convert GeoSet to Geometry"<<std::endl;
} }
} }

View File

@ -13,6 +13,8 @@
#include <osgUtil/Optimizer> #include <osgUtil/Optimizer>
#include <iostream>
osg::Geode* createTile(const osg::Vec3& lb, const osg::Vec3& rb, osg::Geode* createTile(const osg::Vec3& lb, const osg::Vec3& rb,
const osg::Vec3& lt, const osg::Vec3& rt, const osg::Vec3& lt, const osg::Vec3& rt,
const std::string& imageFile) const std::string& imageFile)

View File

@ -4,6 +4,7 @@
#include <osg/Matrix> #include <osg/Matrix>
#include <iostream>
void testFrustum(double left,double right,double bottom,double top,double zNear,double zFar) void testFrustum(double left,double right,double bottom,double top,double zNear,double zFar)
{ {

View File

@ -20,6 +20,7 @@
#include <osg/NodeCallback> #include <osg/NodeCallback>
#include <map> #include <map>
#include <istream>
#include <float.h> #include <float.h>
namespace osg { namespace osg {

View File

@ -18,7 +18,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <iostream> #include <ostream>
namespace osg { namespace osg {

View File

@ -18,7 +18,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <iostream> #include <ostream>
namespace osg { namespace osg {

View File

@ -16,10 +16,6 @@
#include <math.h> #include <math.h>
#if defined(__GNUC__) && defined(WIN32)
# include <iostream>
#endif
// for OSX users : // for OSX users :
// comment in if you want backwards compatibility with 10.1.x versions // comment in if you want backwards compatibility with 10.1.x versions
// otherwise you'll have problems with missing floorf and __isnan*() // otherwise you'll have problems with missing floorf and __isnan*()

View File

@ -21,7 +21,7 @@
#include <string.h> #include <string.h>
#include <iostream> #include <ostream>
#include <algorithm> #include <algorithm>
namespace osg { namespace osg {

View File

@ -21,7 +21,7 @@
#include <string.h> #include <string.h>
#include <iostream> #include <ostream>
#include <algorithm> #include <algorithm>
namespace osg { namespace osg {

View File

@ -16,7 +16,7 @@
#include <osg/Export> #include <osg/Export>
#include <iostream> #include <ostream>
#include <fstream> #include <fstream>
#include <memory> #include <memory>

View File

@ -16,7 +16,7 @@
#include <osg/Vec3> #include <osg/Vec3>
#include <iostream> #include <ostream>
namespace osg { namespace osg {

View File

@ -18,12 +18,13 @@
#include <osg/Referenced> #include <osg/Referenced>
#include <osg/ref_ptr> #include <osg/ref_ptr>
#include <osg/Timer> #include <osg/Timer>
#include <osg/Notify>
#include <string> #include <string>
#include <vector> #include <vector>
#include <list> #include <list>
#include <fstream> #include <fstream>
#include <iostream> #include <ostream>
namespace osgUtx{ namespace osgUtx{
@ -92,7 +93,7 @@ private:
class SG_EXPORT TraceStream{ class SG_EXPORT TraceStream{
public: public:
TraceStream(std::ostream& o=std::cout, TraceLevel tl=Results); TraceStream(std::ostream& o=osg::notify(osg::NOTICE), TraceLevel tl=Results);
~TraceStream(); ~TraceStream();
void setTraceLevel(TraceLevel tl); void setTraceLevel(TraceLevel tl);
@ -539,7 +540,7 @@ struct TestSuiteAutoRegistrationAgent
TestSuite *regSuite = osgUtx::TestGraph::instance().suite( path, 0, true ); TestSuite *regSuite = osgUtx::TestGraph::instance().suite( path, 0, true );
if(!regSuite){ if(!regSuite){
std::cerr<<"Warning, unable to register test suite named \""<<tsuite->name()<<"\" at " osg::notify(osg::WARN)<<"Warning, unable to register test suite named \""<<tsuite->name()<<"\" at "
<<path<<", falling back to root suite."<<std::endl; <<path<<", falling back to root suite."<<std::endl;
regSuite = osgUtx::TestGraph::instance().root(); regSuite = osgUtx::TestGraph::instance().root();
} }

View File

@ -16,7 +16,7 @@
#include <osg/Math> #include <osg/Math>
#include <iostream> #include <ostream>
namespace osg { namespace osg {

View File

@ -16,7 +16,7 @@
#include <osg/Math> #include <osg/Math>
#include <iostream> #include <ostream>
namespace osg { namespace osg {

View File

@ -16,7 +16,7 @@
#include <osg/Vec3> #include <osg/Vec3>
#include <iostream> #include <ostream>
namespace osg { namespace osg {

View File

@ -19,7 +19,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <iostream> #include <istream>
namespace osgDB { namespace osgDB {

View File

@ -25,20 +25,8 @@ CullingSet::~CullingSet()
{ {
} }
void PrintNodePath(const NodePath& nodePath)
{
for(NodePath::const_iterator itr=nodePath.begin();
itr!=nodePath.end();
++itr)
{
std::cout<<*itr<<" ";
}
}
void CullingSet::disableAndPushOccludersCurrentMask(NodePath& nodePath) void CullingSet::disableAndPushOccludersCurrentMask(NodePath& nodePath)
{ {
//std::cout<<" trying to disable occluder ";PrintNodePath(nodePath);std::cout<<std::endl;
for(OccluderList::iterator itr=_occluderList.begin(); for(OccluderList::iterator itr=_occluderList.begin();
itr!=_occluderList.end(); itr!=_occluderList.end();
++itr) ++itr)

View File

@ -401,8 +401,6 @@ void Image::readImageFromCurrentTexture(unsigned int contextID)
allocateImage(width,height,1,internalformat,internalformat); allocateImage(width,height,1,internalformat,internalformat);
std::cout << "width="<<width<<" height="<<height<<" internalFormat="<<internalformat<<" _internalFormat="<<_internalTextureFormat<<std::endl;
extensions->glGetCompressedTexImage(GL_TEXTURE_2D, 0, _data); extensions->glGetCompressedTexImage(GL_TEXTURE_2D, 0, _data);
_internalTextureFormat = internalformat; _internalTextureFormat = internalformat;

View File

@ -12,6 +12,7 @@
*/ */
#include <osg/Notify> #include <osg/Notify>
#include <string> #include <string>
#include <iostream>
using namespace std; using namespace std;

View File

@ -64,7 +64,6 @@ void PagedLOD::traverse(NodeVisitor& nv)
{ {
if (updateTimeStamp) _perRangeDataList[i]._timeStamp=timeStamp; if (updateTimeStamp) _perRangeDataList[i]._timeStamp=timeStamp;
//std::cout<<"PagedLOD::traverse() - Selecting child "<<i<<std::endl;
_children[i]->accept(nv); _children[i]->accept(nv);
lastChildTraversed = (int)i; lastChildTraversed = (int)i;
} }
@ -79,11 +78,9 @@ void PagedLOD::traverse(NodeVisitor& nv)
{ {
unsigned int numChildren = _children.size(); unsigned int numChildren = _children.size();
//std::cout<<"PagedLOD::traverse() - falling back "<<std::endl;
// select the last valid child. // select the last valid child.
if (numChildren>0 && ((int)numChildren-1)!=lastChildTraversed) if (numChildren>0 && ((int)numChildren-1)!=lastChildTraversed)
{ {
//std::cout<<" to child "<<numChildren-1<<std::endl;
if (updateTimeStamp) _perRangeDataList[numChildren-1]._timeStamp=timeStamp; if (updateTimeStamp) _perRangeDataList[numChildren-1]._timeStamp=timeStamp;
_children[numChildren-1]->accept(nv); _children[numChildren-1]->accept(nv);
} }
@ -97,7 +94,6 @@ void PagedLOD::traverse(NodeVisitor& nv)
// modify the priority according to the child's priority offset and scale. // modify the priority according to the child's priority offset and scale.
priority = _perRangeDataList[numChildren]._priorityOffset + priority * _perRangeDataList[numChildren]._priorityScale; priority = _perRangeDataList[numChildren]._priorityOffset + priority * _perRangeDataList[numChildren]._priorityScale;
//std::cout<<" requesting child "<<_fileNameList[numChildren]<<" priotity = "<<priority<<std::endl;
nv.getDatabaseRequestHandler()->requestNodeFile(_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp()); nv.getDatabaseRequestHandler()->requestNodeFile(_perRangeDataList[numChildren]._filename,this,priority,nv.getFrameStamp());
} }
@ -131,25 +127,21 @@ bool PagedLOD::computeBound() const
void PagedLOD::childRemoved(unsigned int pos, unsigned int numChildrenToRemove) void PagedLOD::childRemoved(unsigned int pos, unsigned int numChildrenToRemove)
{ {
LOD::childRemoved(pos, numChildrenToRemove); LOD::childRemoved(pos, numChildrenToRemove);
//std::cout<<"PagedLOD::childRemoved("<<pos<<","<<numChildrenToRemove<<")"<<std::endl;
} }
void PagedLOD::childInserted(unsigned int pos) void PagedLOD::childInserted(unsigned int pos)
{ {
LOD::childInserted(pos); LOD::childInserted(pos);
//std::cout<<"PagedLOD::childInserted("<<pos<<")"<<std::endl;
} }
void PagedLOD::rangeRemoved(unsigned int pos, unsigned int numChildrenToRemove) void PagedLOD::rangeRemoved(unsigned int pos, unsigned int numChildrenToRemove)
{ {
LOD::rangeRemoved(pos, numChildrenToRemove); LOD::rangeRemoved(pos, numChildrenToRemove);
std::cout<<"PagedLOD::rangeRemoved("<<pos<<","<<numChildrenToRemove<<")"<<std::endl;
} }
void PagedLOD::rangeInserted(unsigned int pos) void PagedLOD::rangeInserted(unsigned int pos)
{ {
LOD::rangeInserted(pos); LOD::rangeInserted(pos);
std::cout<<"PagedLOD::rangeInserted("<<pos<<")"<<std::endl;
expandPerRangeDataTo(pos); expandPerRangeDataTo(pos);
} }
@ -209,6 +201,7 @@ void PagedLOD::removeExpiredChildren(double expiryTime,NodeList& removedChildren
{ {
if (!_perRangeDataList[_children.size()-1]._filename.empty() && _perRangeDataList[_children.size()-1]._timeStamp<expiryTime) if (!_perRangeDataList[_children.size()-1]._filename.empty() && _perRangeDataList[_children.size()-1]._timeStamp<expiryTime)
{ {
//removedChildren.push_back(_children[_children.size()-1].get());
Group::removeChild(_children[_children.size()-1].get()); Group::removeChild(_children[_children.size()-1].get());
} }
} }

View File

@ -827,9 +827,9 @@ void DrawShapeVisitor::apply(const Capsule& capsule)
glPopMatrix(); glPopMatrix();
} }
void DrawShapeVisitor::apply(const InfinitePlane& plane) void DrawShapeVisitor::apply(const InfinitePlane&)
{ {
std::cout << "draw a Plane ("<<plane<<") "<<std::endl; notify(NOTICE)<<"Warning: DrawShapeVisitor::apply(const InfinitePlane& plane) not yet implementated. "<<std::endl;
} }
void DrawShapeVisitor::apply(const TriangleMesh& mesh) void DrawShapeVisitor::apply(const TriangleMesh& mesh)
@ -1661,9 +1661,9 @@ void PrimitiveShapeVisitor::apply(const Capsule& /*capsule*/)
#endif #endif
} }
void PrimitiveShapeVisitor::apply(const InfinitePlane& plane) void PrimitiveShapeVisitor::apply(const InfinitePlane&)
{ {
std::cout << "Primitive a Plane ("<<plane<<") "<<std::endl; notify(NOTICE)<<"Warning: PrimitiveShapeVisitor::apply(const InfinitePlane& plane) not yet implementated. "<<std::endl;
} }
void PrimitiveShapeVisitor::apply(const TriangleMesh& mesh) void PrimitiveShapeVisitor::apply(const TriangleMesh& mesh)

View File

@ -385,7 +385,7 @@ bool TestSuite::accept( Test::Visitor& v )
bool QualifiedTestPrinter::visit( TestCase* pTest ) bool QualifiedTestPrinter::visit( TestCase* pTest )
{ {
std::cout << currentPath() + pTest->name() << std::endl; osg::notify(osg::NOTICE) << currentPath() + pTest->name() << std::endl;
return true; return true;
} }

View File

@ -38,6 +38,9 @@ int UniformValue::getLocation( Extensions *ext, const GLhandleARB progObj ) cons
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifdef sgi
template <>
#endif
void UniformValue_int::apply( Extensions *ext, const GLhandleARB progObj ) const void UniformValue_int::apply( Extensions *ext, const GLhandleARB progObj ) const
{ {
int loc = getLocation( ext, progObj ); int loc = getLocation( ext, progObj );
@ -47,6 +50,9 @@ void UniformValue_int::apply( Extensions *ext, const GLhandleARB progObj ) const
} }
} }
#ifdef sgi
template <>
#endif
void UniformValue_float::apply( Extensions *ext, const GLhandleARB progObj ) const void UniformValue_float::apply( Extensions *ext, const GLhandleARB progObj ) const
{ {
int loc = getLocation( ext, progObj ); int loc = getLocation( ext, progObj );
@ -56,6 +62,9 @@ void UniformValue_float::apply( Extensions *ext, const GLhandleARB progObj ) con
} }
} }
#ifdef sgi
template <>
#endif
void UniformValue_Vec2::apply( Extensions *ext, const GLhandleARB progObj ) const void UniformValue_Vec2::apply( Extensions *ext, const GLhandleARB progObj ) const
{ {
int loc = getLocation( ext, progObj ); int loc = getLocation( ext, progObj );
@ -65,6 +74,9 @@ void UniformValue_Vec2::apply( Extensions *ext, const GLhandleARB progObj ) cons
} }
} }
#ifdef sgi
template <>
#endif
void UniformValue_Vec3::apply( Extensions *ext, const GLhandleARB progObj ) const void UniformValue_Vec3::apply( Extensions *ext, const GLhandleARB progObj ) const
{ {
int loc = getLocation( ext, progObj ); int loc = getLocation( ext, progObj );
@ -74,6 +86,9 @@ void UniformValue_Vec3::apply( Extensions *ext, const GLhandleARB progObj ) cons
} }
} }
#ifdef sgi
template <>
#endif
void UniformValue_Vec4::apply( Extensions *ext, const GLhandleARB progObj ) const void UniformValue_Vec4::apply( Extensions *ext, const GLhandleARB progObj ) const
{ {
int loc = getLocation( ext, progObj ); int loc = getLocation( ext, progObj );

View File

@ -45,15 +45,12 @@ class ReaderWriter3DC : public osgDB::ReaderWriter
if (line[0]=='#') if (line[0]=='#')
{ {
// comment line // comment line
std::cout <<"Comment: "<<line<<std::endl; osg::notify(osg::INFO) <<"Comment: "<<line<<std::endl;
} }
else else
{ {
++num; ++num;
} }
//std::cout << "["<<std::endl;
//std::cout <<line<<std::endl;
//std::cout <<"]"<<std::endl;
} }

View File

@ -134,7 +134,7 @@ class ReaderWriterAC : public osgDB::ReaderWriter
// else if(dynamic_cast<const osg::Geode*>(&node)) // else if(dynamic_cast<const osg::Geode*>(&node))
// const_cast<ac3d::Geode*>(static_cast<const ac3d::Geode*>(&node))->Process(fout); // const_cast<ac3d::Geode*>(static_cast<const ac3d::Geode*>(&node))->Process(fout);
else else
std::cout<<"File must start with a geode "<<std::endl; osg::notify(osg::WARN)<<"File must start with a geode "<<std::endl;
fout.flush(); fout.flush();
return WriteResult::FILE_SAVED; return WriteResult::FILE_SAVED;
} }

View File

@ -60,7 +60,7 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(unsigned int charcode)
FT_Error error = FT_Load_Char( _face, charcode, FT_LOAD_RENDER|FT_LOAD_NO_BITMAP ); FT_Error error = FT_Load_Char( _face, charcode, FT_LOAD_RENDER|FT_LOAD_NO_BITMAP );
if (error) if (error)
{ {
std::cout << "FT_Load_Char(...) error "<<error<<std::endl; osg::notify(osg::WARN) << "FT_Load_Char(...) error "<<error<<std::endl;
return 0; return 0;
} }

View File

@ -12,14 +12,14 @@
*/ */
#include "FreeTypeLibrary.h" #include "FreeTypeLibrary.h"
#include <osg/Notify>
FreeTypeLibrary::FreeTypeLibrary() FreeTypeLibrary::FreeTypeLibrary()
{ {
FT_Error error = FT_Init_FreeType( &_ftlibrary ); FT_Error error = FT_Init_FreeType( &_ftlibrary );
if (error) if (error)
{ {
std::cout<<"Warning: an error occured during FT_Init_FreeType(..) initialisation .. "<<std::endl; osg::notify(osg::WARN)<<"Warning: an error occured during FT_Init_FreeType(..) initialisation .. "<<std::endl;
} }
} }
@ -58,14 +58,14 @@ osgText::Font* FreeTypeLibrary::getFont(const std::string& fontfile,unsigned int
FT_Error error = FT_New_Face( _ftlibrary, fontfile.c_str(), index, &face ); FT_Error error = FT_New_Face( _ftlibrary, fontfile.c_str(), index, &face );
if (error == FT_Err_Unknown_File_Format) if (error == FT_Err_Unknown_File_Format)
{ {
std::cout<<" .... the font file could be opened and read, but it appears"<<std::endl; osg::notify(osg::WARN)<<" .... the font file could be opened and read, but it appears"<<std::endl;
std::cout<<" .... that its font format is unsupported"<<std::endl; osg::notify(osg::WARN)<<" .... that its font format is unsupported"<<std::endl;
return 0; return 0;
} }
else if (error) else if (error)
{ {
std::cout<<" .... another error code means that the font file could notd"<<std::endl; osg::notify(osg::WARN)<<" .... another error code means that the font file could notd"<<std::endl;
std::cout<<" .... be opened, read or simply that it is broken..d"<<std::endl; osg::notify(osg::WARN)<<" .... be opened, read or simply that it is broken..d"<<std::endl;
return 0; return 0;
} }

View File

@ -1892,7 +1892,7 @@ class ReaderWriterGEO : public osgDB::ReaderWriter
case DB_DSK_STRING_CONTENT_ACTION: case DB_DSK_STRING_CONTENT_ACTION:
default: { default: {
osg::Group *gp=new Group; osg::Group *gp=new Group;
std::cout << "Unhandled item " << gr->getType() << osg::notify(osg::WARN) << "Unhandled item " << gr->getType() <<
"address " << (*itr) << std::endl; "address " << (*itr) << std::endl;
holder=gp; holder=gp;
} }

View File

@ -32,6 +32,7 @@
#include <set> #include <set>
#include <map> #include <map>
#include <iostream>
using namespace std; using namespace std;
using namespace osg; using namespace osg;
@ -41,7 +42,9 @@ class PrintVisitor : public NodeVisitor
public: public:
PrintVisitor():NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN) PrintVisitor(std::ostream& out):
NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN),
_out(out)
{ {
_indent = 0; _indent = 0;
_step = 4; _step = 4;
@ -51,29 +54,32 @@ class PrintVisitor : public NodeVisitor
inline void moveOut() { _indent -= _step; } inline void moveOut() { _indent -= _step; }
inline void writeIndent() inline void writeIndent()
{ {
for(int i=0;i<_indent;++i) std::cout << " "; for(int i=0;i<_indent;++i) _out << " ";
} }
virtual void apply(Node& node) virtual void apply(Node& node)
{ {
moveIn(); moveIn();
writeIndent(); std::cout << node.className() << " name=" << node.getName() << std::endl; writeIndent(); _out << node.className() <<std::endl;
traverse(node); traverse(node);
moveOut(); moveOut();
} }
virtual void apply(Geode& node) { apply((Node&)node); } virtual void apply(Geode& node) { apply((Node&)node); }
virtual void apply(Billboard& node) { apply((Geode&)node); } virtual void apply(Billboard& node) { apply((Geode&)node); }
virtual void apply(LightSource& node) { apply((Node&)node); } virtual void apply(LightSource& node) { apply((Group&)node); }
virtual void apply(ClipNode& node) { apply((Group&)node); }
virtual void apply(Group& node) { apply((Node&)node); } virtual void apply(Group& node) { apply((Node&)node); }
virtual void apply(Transform& node) { apply((Group&)node); } virtual void apply(Transform& node) { apply((Group&)node); }
virtual void apply(Projection& node) { apply((Group&)node); }
virtual void apply(Switch& node) { apply((Group&)node); } virtual void apply(Switch& node) { apply((Group&)node); }
virtual void apply(LOD& node) { apply((Group&)node); } virtual void apply(LOD& node) { apply((Group&)node); }
virtual void apply(Impostor& node) { apply((LOD&)node); } virtual void apply(Impostor& node) { apply((LOD&)node); }
protected: protected:
std::ostream& _out;
int _indent; int _indent;
int _step; int _step;
}; };
@ -124,7 +130,7 @@ ReaderWriter3DS::ReaderWriter3DS()
These print methods for 3ds hacking These print methods for 3ds hacking
*/ */
void pad(int level) { void pad(int level) {
for(int i=0;i<level;i++) cout<<" "; for(int i=0;i<level;i++) std::cout<<" ";
} }
void print(Lib3dsMesh *mesh,int level); void print(Lib3dsMesh *mesh,int level);
void print(Lib3dsUserData *user,int level); void print(Lib3dsUserData *user,int level);

View File

@ -241,7 +241,7 @@ public:
unsigned int n; unsigned int n;
if( (fscanf( fp, "%d", &n )) != 1 ) if( (fscanf( fp, "%d", &n )) != 1 )
{ {
std::cerr << "Error... Camera requires an integer argument\n"; osg::notify(osg::WARN) << "Error... Camera requires an integer argument\n";
break; break;
} }
if( screen != n ) if( screen != n )

View File

@ -674,7 +674,6 @@ void* lightRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
{ {
for(unsigned int i = 0; i < nvert; i++) for(unsigned int i = 0; i < nvert; i++)
{ {
std::cout<<"LightPoint node"<<std::endl;
trpg3dPoint pt; trpg3dPoint pt;
light.GetVertex(i, pt); light.GetVertex(i, pt);
osg::Matrix matrix; osg::Matrix matrix;
@ -771,7 +770,7 @@ void* labelRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
// Text // Text
std::ostringstream os; std::ostringstream os;
int nl; unsigned int nl;
std::string lb = *labelText; std::string lb = *labelText;
while ( (nl=lb.find_first_of('\\')) != std::string::npos) while ( (nl=lb.find_first_of('\\')) != std::string::npos)
{ {
@ -1388,7 +1387,7 @@ void* geomRead::Parse(trpgToken /*tok*/,trpgReadBuffer &buf)
} }
else else
{ {
std::cout<<"Detected potential memory leak in TXPParerse.cpp"<<std::endl; osg::notify(osg::WARN)<<"Detected potential memory leak in TXPParerse.cpp"<<std::endl;
} }

View File

@ -691,7 +691,7 @@ void Font::Glyph::subload() const
{ {
osg::notify(osg::WARN)<<"after Font::Glyph::subload() : detected OpenGL error '"<<gluErrorString(errorNo)<<"'"<<std::endl; osg::notify(osg::WARN)<<"after Font::Glyph::subload() : detected OpenGL error '"<<gluErrorString(errorNo)<<"'"<<std::endl;
std::cout << "\tglTexSubImage2D(0x"<<hex<<GL_TEXTURE_2D<<dec<<" ,"<<0<<"\t"<<std::endl<< osg::notify(osg::WARN)<< "\tglTexSubImage2D(0x"<<hex<<GL_TEXTURE_2D<<dec<<" ,"<<0<<"\t"<<std::endl<<
"\t "<<_texturePosX<<" ,"<<_texturePosY<<std::endl<< "\t "<<_texturePosX<<" ,"<<_texturePosY<<std::endl<<
"\t "<<s()<<" ,"<<t()<<std::endl<<hex<< "\t "<<s()<<" ,"<<t()<<std::endl<<hex<<
"\t 0x"<<(GLenum)getPixelFormat()<<std::endl<< "\t 0x"<<(GLenum)getPixelFormat()<<std::endl<<

View File

@ -47,7 +47,9 @@ class PrintVisitor : public NodeVisitor
public: public:
PrintVisitor():NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN) PrintVisitor(std::ostream& out):
NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN),
_out(out)
{ {
_indent = 0; _indent = 0;
_step = 4; _step = 4;
@ -57,13 +59,13 @@ class PrintVisitor : public NodeVisitor
inline void moveOut() { _indent -= _step; } inline void moveOut() { _indent -= _step; }
inline void writeIndent() inline void writeIndent()
{ {
for(int i=0;i<_indent;++i) std::cout << " "; for(int i=0;i<_indent;++i) _out << " ";
} }
virtual void apply(Node& node) virtual void apply(Node& node)
{ {
moveIn(); moveIn();
writeIndent(); std::cout << node.className() <<std::endl; writeIndent(); _out << node.className() <<std::endl;
traverse(node); traverse(node);
moveOut(); moveOut();
} }
@ -82,6 +84,7 @@ class PrintVisitor : public NodeVisitor
protected: protected:
std::ostream& _out;
int _indent; int _indent;
int _step; int _step;
}; };