Fixes to Windows build in liu of the move to using just std::streams.

This commit is contained in:
Robert Osfield 2001-12-14 23:18:28 +00:00
parent b1f478e5d2
commit 478274ae7d
67 changed files with 533 additions and 528 deletions

View File

@ -18,7 +18,7 @@ inline void clampGEQUAL(T& value,const T minValue,const char* valueName)
{ {
if (value<minValue) if (value<minValue)
{ {
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
value = minValue; value = minValue;
} }
} }
@ -31,7 +31,7 @@ inline void clampLEQUAL(T& value,const T maxValue,const char* valueName)
{ {
if (value>maxValue) if (value>maxValue)
{ {
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
value = maxValue; value = maxValue;
} }
} }
@ -45,13 +45,13 @@ inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const c
{ {
if (value<minValue) if (value<minValue)
{ {
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
value = minValue; value = minValue;
} }
else else
if (value>maxValue) if (value>maxValue)
{ {
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
value = maxValue; value = maxValue;
} }
@ -65,7 +65,7 @@ inline void clampArrayElementGEQUAL(A& value,const unsigned int i,const T minVal
{ {
if (value[i]<minValue) if (value[i]<minValue)
{ {
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
value[i] = minValue; value[i] = minValue;
} }
} }
@ -78,7 +78,7 @@ inline void clampArrayElementLEQUAL(A& value,const unsigned int i,const T maxVal
{ {
if (value[i]>maxValue) if (value[i]>maxValue)
{ {
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
value = maxValue; value = maxValue;
} }
} }
@ -92,13 +92,13 @@ inline void clampArrayElementBetweenRange(A& value,const unsigned int i,const T
{ {
if (value[i]<minValue) if (value[i]<minValue)
{ {
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
value[i] = minValue; value[i] = minValue;
} }
else else
if (value[i]>maxValue) if (value[i]>maxValue)
{ {
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<<endl; notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
value[i] = maxValue; value[i] = maxValue;
} }

View File

@ -280,7 +280,7 @@ inline std::ostream& operator<< (std::ostream& os, const Matrix& m )
os << m(row,col) << " "; os << m(row,col) << " ";
os << std::endl; os << std::endl;
} }
os << "}" << endl; os << "}" << std::endl;
return os; return os;
} }

View File

@ -142,7 +142,7 @@ class SG_EXPORT Plane
calculateUpperLowerBBCorners(); calculateUpperLowerBBCorners();
} }
friend inline ostream& operator << (ostream& output, const Plane& pl); friend inline std::ostream& operator << (std::ostream& output, const Plane& pl);
protected: protected:
@ -156,7 +156,7 @@ class SG_EXPORT Plane
}; };
inline ostream& operator << (ostream& output, const Plane& pl) inline std::ostream& operator << (std::ostream& output, const Plane& pl)
{ {
output << pl._fv[0] << " " output << pl._fv[0] << " "
<< pl._fv[1] << " " << pl._fv[1] << " "

View File

@ -145,20 +145,20 @@ class SG_EXPORT Quat
return *this; // enable nesting return *this; // enable nesting
} }
/// Binary subtraction /// Binary subtraction
inline const Quat operator - (const Quat& rhs) const inline const Quat operator - (const Quat& rhs) const
{ {
return Quat( _fv - rhs._fv ); return Quat( _fv - rhs._fv );
} }
/// Unary subtraction /// Unary subtraction
inline Quat& operator -= (const Quat& rhs) inline Quat& operator -= (const Quat& rhs)
{ {
_fv-=rhs._fv; _fv-=rhs._fv;
return *this; // enable nesting return *this; // enable nesting
} }
/** Negation operator - returns the negative of the quaternion. /** Negation operator - returns the negative of the quaternion.
Basically just calls operator - () on the Vec4 */ Basically just calls operator - () on the Vec4 */
inline const Quat operator - () const inline const Quat operator - () const
{ {
@ -177,17 +177,17 @@ class SG_EXPORT Quat
return _fv.length2(); return _fv.length2();
} }
/// Conjugate /// Conjugate
inline const Quat conj () const inline const Quat conj () const
{ {
return Quat( -_fv[0], -_fv[1], -_fv[2], _fv[3] ); return Quat( -_fv[0], -_fv[1], -_fv[2], _fv[3] );
} }
/// Multiplicative inverse method: q^(-1) = q^*/(q.q^*) /// Multiplicative inverse method: q^(-1) = q^*/(q.q^*)
inline const Quat inverse () const inline const Quat inverse () const
{ {
return conj() / length2(); return conj() / length2();
} }
/* -------------------------------------------------------- /* --------------------------------------------------------
METHODS RELATED TO ROTATIONS METHODS RELATED TO ROTATIONS
@ -199,9 +199,9 @@ class SG_EXPORT Quat
Not inlined - see the Quat.cpp file for implementation Not inlined - see the Quat.cpp file for implementation
-------------------------------------------------------- */ -------------------------------------------------------- */
void makeRotate ( const float angle, void makeRotate ( const float angle,
const float x, const float y, const float z ); const float x, const float y, const float z );
void makeRotate ( const float angle, const Vec3& vec ); void makeRotate ( const float angle, const Vec3& vec );
/** Make a rotation Quat which will rotate vec1 to vec2. /** Make a rotation Quat which will rotate vec1 to vec2.
Generally take adot product to get the angle between these Generally take adot product to get the angle between these
@ -210,14 +210,14 @@ class SG_EXPORT Quat
are co-incident or opposite in direction.*/ are co-incident or opposite in direction.*/
void makeRotate( const Vec3& vec1, const Vec3& vec2 ); void makeRotate( const Vec3& vec1, const Vec3& vec2 );
/** Return the angle and vector components represented by the quaternion.*/ /** Return the angle and vector components represented by the quaternion.*/
void getRot ( float& angle, float& x, float& y, float& z ) const; void getRotate ( float& angle, float& x, float& y, float& z ) const;
/** Return the angle and vector represented by the quaternion.*/ /** Return the angle and vector represented by the quaternion.*/
void getRot ( float& angle, Vec3& vec ) const; void getRotate ( float& angle, Vec3& vec ) const;
/** Spherical Linear Interpolation. /** Spherical Linear Interpolation.
As t goes from 0 to 1, the Quat object goes from "from" to "to". */ As t goes from 0 to 1, the Quat object goes from "from" to "to". */
void slerp ( const float t, const Quat& from, const Quat& to); void slerp ( const float t, const Quat& from, const Quat& to);
/** Set quaternion to be equivalent to specified matrix.*/ /** Set quaternion to be equivalent to specified matrix.*/
void set( const osg::Matrix& m ); void set( const osg::Matrix& m );
@ -225,11 +225,11 @@ class SG_EXPORT Quat
/** Get the equivalent matrix for this quaternion.*/ /** Get the equivalent matrix for this quaternion.*/
void get( osg::Matrix& m ) const; void get( osg::Matrix& m ) const;
friend inline ostream& operator << (ostream& output, const Quat& vec); friend inline std::ostream& operator << (std::ostream& output, const Quat& vec);
}; // end of class prototype }; // end of class prototype
inline ostream& operator << (ostream& output, const Quat& vec) inline std::ostream& operator << (std::ostream& output, const Quat& vec)
{ {
output << vec._fv[0] << " " output << vec._fv[0] << " "
<< vec._fv[1] << " " << vec._fv[1] << " "

View File

@ -169,7 +169,7 @@ class Vec3
return( norm ); return( norm );
} }
friend inline ostream& operator << (ostream& output, const Vec3& vec); friend inline std::ostream& operator << (std::ostream& output, const Vec3& vec);
}; // end of class Vec3 }; // end of class Vec3

View File

@ -25,7 +25,7 @@ class OSGDB_EXPORT FieldReaderIterator
virtual FieldReaderIterator& operator = (const FieldReaderIterator& ic); virtual FieldReaderIterator& operator = (const FieldReaderIterator& ic);
void attach(istream* input); void attach(std::istream* input);
void detach(); void detach();
virtual bool eof() const; virtual bool eof() const;

View File

@ -66,8 +66,8 @@ class OSGDB_EXPORT Output : public std::ofstream
protected: protected:
// prevent copy construction and assignment. // prevent copy construction and assignment.
Output(const Output&) : ofstream() {} Output(const Output&);
Output& operator = (const Output&) { return *this; } Output& operator = (const Output&);
virtual void init(); virtual void init();
@ -88,14 +88,14 @@ class OSGDB_EXPORT Output : public std::ofstream
template<class T> template<class T>
bool writeArrayBlock(Output& fw,T* start,T* finish) bool writeArrayBlock(Output& fw,T* start,T* finish)
{ {
fw.indent() << "{" << endl; fw.indent() << "{" << std::endl;
fw.moveIn(); fw.moveIn();
int numIndicesThisLine = 0; int numIndicesThisLine = 0;
for(T* itr=start;itr!=finish;++itr) for(T* itr=start;itr!=finish;++itr)
{ {
if (numIndicesThisLine>=fw.getNumIndicesPerLine()) if (numIndicesThisLine>=fw.getNumIndicesPerLine())
{ {
fw << endl; fw << std::endl;
numIndicesThisLine = 0; numIndicesThisLine = 0;
} }
@ -107,9 +107,9 @@ bool writeArrayBlock(Output& fw,T* start,T* finish)
++numIndicesThisLine; ++numIndicesThisLine;
} }
fw << endl; fw << std::endl;
fw.moveOut(); fw.moveOut();
fw.indent() << "}" << endl; fw.indent() << "}" << std::endl;
return true; return true;
} }

View File

@ -78,7 +78,7 @@ class OSGGLUT_EXPORT Viewer : public osgUtil::GUIActionAdapter
double frameSeconds() { return _timer.delta_s(_lastFrameTick,_frameTick); } double frameSeconds() { return _timer.delta_s(_lastFrameTick,_frameTick); }
double frameRate() { return 1.0/frameSeconds(); } double frameRate() { return 1.0/frameSeconds(); }
void help(ostream& fout); void help(std::ostream& fout);
// handle multiple camera. // handle multiple camera.
unsigned int registerCameraManipulator(osgUtil::CameraManipulator* cm, unsigned int registerCameraManipulator(osgUtil::CameraManipulator* cm,

View File

@ -314,7 +314,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor
while (_currentReuseMatrixIndex<_reuseMatrixList.size() && while (_currentReuseMatrixIndex<_reuseMatrixList.size() &&
_reuseMatrixList[_currentReuseMatrixIndex]->referenceCount()>1) _reuseMatrixList[_currentReuseMatrixIndex]->referenceCount()>1)
{ {
osg::notify(osg::NOTICE)<<"Warning:createOrReuseMatrix() skipping multiply refrenced entry."<<endl; osg::notify(osg::NOTICE)<<"Warning:createOrReuseMatrix() skipping multiply refrenced entry."<< std::endl;
++_currentReuseMatrixIndex; ++_currentReuseMatrixIndex;
} }
@ -344,7 +344,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor
while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() && while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() &&
_reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()>1) _reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()>1)
{ {
osg::notify(osg::NOTICE)<<"Warning:createOrReuseRenderLeaf() skipping multiply refrenced entry."<<endl; osg::notify(osg::NOTICE)<<"Warning:createOrReuseRenderLeaf() skipping multiply refrenced entry."<< std::endl;
++_currentReuseRenderLeafIndex; ++_currentReuseRenderLeafIndex;
} }

View File

@ -168,7 +168,7 @@ bool GliderManipulator::calcMovement()
if (dt<0.0f) if (dt<0.0f)
{ {
notify(WARN) << "warning dt = "<<dt<<endl; notify(WARN) << "warning dt = "<<dt<< std::endl;
dt = 0.0f; dt = 0.0f;
} }

View File

@ -71,7 +71,7 @@ osg::Node* getNodeFromFiles(int argc,char **argv)
if (nodeList.size()==0) if (nodeList.size()==0)
{ {
osg::notify(osg::INFO) << "No data loaded."<<endl; osg::notify(osg::INFO) << "No data loaded."<< std::endl;
return 0; return 0;
} }
@ -102,20 +102,20 @@ int main( int argc, char **argv )
// if (argc<2) // if (argc<2)
// { // {
// osg::notify(osg::NOTICE)<<"usage:"<<endl; // osg::notify(osg::NOTICE)<<"usage:"<< std::endl;
// osg::notify(osg::NOTICE)<<" sgv [options] infile1 [infile2 ...]"<<endl; // osg::notify(osg::NOTICE)<<" sgv [options] infile1 [infile2 ...]"<< std::endl;
// osg::notify(osg::NOTICE)<<endl; // osg::notify(osg::NOTICE)<< std::endl;
// osg::notify(osg::NOTICE)<<"options:"<<endl; // osg::notify(osg::NOTICE)<<"options:"<< std::endl;
// osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<<endl; // osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<< std::endl;
// osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<<endl; // osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<< std::endl;
// osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<<endl; // osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<< std::endl;
// osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<<endl; // osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<< std::endl;
// osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<<endl; // osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<< std::endl;
// osg::notify(osg::NOTICE)<<" i.e. -e pfb"<<endl; // osg::notify(osg::NOTICE)<<" i.e. -e pfb"<< std::endl;
// osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<<endl; // osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<< std::endl;
// osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<<endl; // osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<< std::endl;
// osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<<endl; // osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<< std::endl;
// osg::notify(osg::NOTICE)<<endl; // osg::notify(osg::NOTICE)<< std::endl;
// //
// return 0; // return 0;
// } // }

View File

@ -16,23 +16,23 @@ static bool do_convert = false;
static void usage( const char *prog, const char *msg ) static void usage( const char *prog, const char *msg )
{ {
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE) << msg << endl; osg::notify(osg::NOTICE) << msg << std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"usage:"<<endl; osg::notify(osg::NOTICE)<<"usage:"<< std::endl;
osg::notify(osg::NOTICE)<<" " << prog << " [options] infile1 [infile2 ...] outfile"<<endl; osg::notify(osg::NOTICE)<<" " << prog << " [options] infile1 [infile2 ...] outfile"<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"options:"<<endl; osg::notify(osg::NOTICE)<<"options:"<< std::endl;
osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<<endl; osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<<endl; osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<< std::endl;
osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<<endl; osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<< std::endl;
osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<<endl; osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -e pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -e pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<<endl; osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<< std::endl;
osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<<endl; osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<< std::endl;
osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<<endl; osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<< std::endl;
osg::notify(osg::NOTICE)<<" -o orientation - Convert geometry from input files to output files."<<endl; osg::notify(osg::NOTICE)<<" -o orientation - Convert geometry from input files to output files."<< std::endl;
osg::notify(osg::NOTICE)<< osg::notify(osg::NOTICE)<<
" Format of orientation argument must be the following:\n" " Format of orientation argument must be the following:\n"
"\n" "\n"
@ -46,7 +46,7 @@ static void usage( const char *prog, const char *msg )
"\n" "\n"
" 0,1,0-0,0,1" " 0,1,0-0,0,1"
"\n" "\n"
<< endl; << std::endl;
osg::notify(osg::NOTICE)<<" -t translation - Convert spatial position of output files. Format of\n" osg::notify(osg::NOTICE)<<" -t translation - Convert spatial position of output files. Format of\n"
" translation argument must be the following :\n" " translation argument must be the following :\n"
"\n" "\n"
@ -54,7 +54,7 @@ static void usage( const char *prog, const char *msg )
"\n" "\n"
" where X, Y, and Z represent the coordinates of the\n" " where X, Y, and Z represent the coordinates of the\n"
" absolute position in world space\n" " absolute position in world space\n"
<< endl; << std::endl;
osg::notify(osg::NOTICE)<<" -s scale - Scale size of model. Scale argument must be the \n" osg::notify(osg::NOTICE)<<" -s scale - Scale size of model. Scale argument must be the \n"
" following :\n" " following :\n"
"\n" "\n"
@ -62,7 +62,7 @@ static void usage( const char *prog, const char *msg )
"\n" "\n"
" where SX, SY, and SZ represent the scale factors\n" " where SX, SY, and SZ represent the scale factors\n"
" Caution: Scaling will be done in destination orientation\n" " Caution: Scaling will be done in destination orientation\n"
<< endl; << std::endl;
} }
static bool static bool
@ -209,11 +209,11 @@ int main( int argc, char **argv )
if (root) if (root)
{ {
osgDB::writeNodeFile(*root,"converted.osg"); osgDB::writeNodeFile(*root,"converted.osg");
osg::notify(osg::NOTICE)<<"Data written to 'converted.osg'."<<endl; osg::notify(osg::NOTICE)<<"Data written to 'converted.osg'."<< std::endl;
} }
else else
{ {
osg::notify(osg::NOTICE)<<"Error no data loaded."<<endl; osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;
return 1; return 1;
} }
} }
@ -239,7 +239,7 @@ int main( int argc, char **argv )
if (group->getNumChildren()==0) if (group->getNumChildren()==0)
{ {
osg::notify(osg::NOTICE)<<"Error no data loaded."<<endl; osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;
return 1; return 1;
} }
else if (group->getNumChildren()==1) else if (group->getNumChildren()==1)

View File

@ -68,7 +68,7 @@ osg::Node* getNodeFromFiles(int argc,char **argv)
if (nodeList.size()==0) if (nodeList.size()==0)
{ {
osg::notify(osg::WARN) << "No data loaded."<<endl; osg::notify(osg::WARN) << "No data loaded."<< std::endl;
exit(0); exit(0);
} }
@ -105,20 +105,20 @@ int main( int argc, char **argv )
if (argc<2) if (argc<2)
{ {
osg::notify(osg::NOTICE)<<"usage:"<<endl; osg::notify(osg::NOTICE)<<"usage:"<< std::endl;
osg::notify(osg::NOTICE)<<" osgimpostor [options] infile1 [infile2 ...]"<<endl; osg::notify(osg::NOTICE)<<" osgimpostor [options] infile1 [infile2 ...]"<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"options:"<<endl; osg::notify(osg::NOTICE)<<"options:"<< std::endl;
osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<<endl; osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<<endl; osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<< std::endl;
osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<<endl; osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<< std::endl;
osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<<endl; osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -e pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -e pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<<endl; osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<< std::endl;
osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<<endl; osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<< std::endl;
osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<<endl; osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
return 0; return 0;
} }
@ -180,7 +180,7 @@ int main( int argc, char **argv )
osg::Timer_t after_load = timer.tick(); osg::Timer_t after_load = timer.tick();
cout << "Time for load = "<<timer.delta_s(before_load,after_load)<<" seconds"<<endl; std::cout << "Time for load = "<<timer.delta_s(before_load,after_load)<<" seconds"<< std::endl;
// initialize the viewer. // initialize the viewer.
osgGLUT::Viewer viewer; osgGLUT::Viewer viewer;

View File

@ -92,7 +92,7 @@ osg::Node* getNodeFromFiles(int argc,char **argv)
if (nodeList.size()==0) if (nodeList.size()==0)
{ {
osg::notify(osg::WARN) << "No data loaded."<<endl; osg::notify(osg::WARN) << "No data loaded."<< std::endl;
exit(0); exit(0);
} }
@ -175,21 +175,21 @@ osg::Drawable* createMirrorSurface(float xMin,float xMax,float yMin,float yMax,f
void write_usage() void write_usage()
{ {
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"usage:"<<endl; osg::notify(osg::NOTICE)<<"usage:"<< std::endl;
osg::notify(osg::NOTICE)<<" osgreflect [options] infile1 [infile2 ...]"<<endl; osg::notify(osg::NOTICE)<<" osgreflect [options] infile1 [infile2 ...]"<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"options:"<<endl; osg::notify(osg::NOTICE)<<"options:"<< std::endl;
osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<<endl; osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<<endl; osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<< std::endl;
osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<<endl; osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<< std::endl;
osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<<endl; osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -e pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -e pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<<endl; osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<< std::endl;
osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<<endl; osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<< std::endl;
osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<<endl; osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
} }
int main( int argc, char **argv ) int main( int argc, char **argv )

View File

@ -67,7 +67,7 @@ osg::Node* getNodeFromFiles(int argc,char **argv)
if (nodeList.size()==0) if (nodeList.size()==0)
{ {
osg::notify(osg::WARN) << "No data loaded."<<endl; osg::notify(osg::WARN) << "No data loaded."<< std::endl;
exit(0); exit(0);
} }
@ -104,20 +104,20 @@ int main( int argc, char **argv )
if (argc<2) if (argc<2)
{ {
osg::notify(osg::NOTICE)<<"usage:"<<endl; osg::notify(osg::NOTICE)<<"usage:"<< std::endl;
osg::notify(osg::NOTICE)<<" osgviews [options] infile1 [infile2 ...]"<<endl; osg::notify(osg::NOTICE)<<" osgviews [options] infile1 [infile2 ...]"<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"options:"<<endl; osg::notify(osg::NOTICE)<<"options:"<< std::endl;
osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<<endl; osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<<endl; osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<< std::endl;
osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<<endl; osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<< std::endl;
osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<<endl; osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -e pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -e pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<<endl; osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<< std::endl;
osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<<endl; osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<< std::endl;
osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<<endl; osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
return 0; return 0;
} }
@ -128,7 +128,7 @@ int main( int argc, char **argv )
osg::Node* rootnode = getNodeFromFiles( argc, argv); osg::Node* rootnode = getNodeFromFiles( argc, argv);
osg::Timer_t after_load = timer.tick(); osg::Timer_t after_load = timer.tick();
cout << "Time for load = "<<timer.delta_s(before_load,after_load)<<" seconds"<<endl; std::cout << "Time for load = "<<timer.delta_s(before_load,after_load)<<" seconds"<< std::endl;
// initialize the viewer. // initialize the viewer.
osgGLUT::Viewer viewer; osgGLUT::Viewer viewer;

View File

@ -71,7 +71,7 @@ osg::Node* getNodeFromFiles(int argc,char **argv)
if (nodeList.size()==0) if (nodeList.size()==0)
{ {
osg::notify(osg::WARN) << "No data loaded."<<endl; osg::notify(osg::WARN) << "No data loaded."<< std::endl;
exit(0); exit(0);
} }
@ -108,20 +108,20 @@ int main( int argc, char **argv )
if (argc<2) if (argc<2)
{ {
osg::notify(osg::NOTICE)<<"usage:"<<endl; osg::notify(osg::NOTICE)<<"usage:"<< std::endl;
osg::notify(osg::NOTICE)<<" sgv [options] infile1 [infile2 ...]"<<endl; osg::notify(osg::NOTICE)<<" sgv [options] infile1 [infile2 ...]"<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
osg::notify(osg::NOTICE)<<"options:"<<endl; osg::notify(osg::NOTICE)<<"options:"<< std::endl;
osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<<endl; osg::notify(osg::NOTICE)<<" -l libraryName - load plugin of name libraryName"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -l osgdb_pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<<endl; osg::notify(osg::NOTICE)<<" Useful for loading reader/writers which can load"<< std::endl;
osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<<endl; osg::notify(osg::NOTICE)<<" other file formats in addition to its extension."<< std::endl;
osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<<endl; osg::notify(osg::NOTICE)<<" -e extensionName - load reader/wrter plugin for file extension"<< std::endl;
osg::notify(osg::NOTICE)<<" i.e. -e pfb"<<endl; osg::notify(osg::NOTICE)<<" i.e. -e pfb"<< std::endl;
osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<<endl; osg::notify(osg::NOTICE)<<" Useful short hand for specifying full library name as"<< std::endl;
osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<<endl; osg::notify(osg::NOTICE)<<" done with -l above, as it automatically expands to the"<< std::endl;
osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<<endl; osg::notify(osg::NOTICE)<<" full library name appropriate for each platform."<< std::endl;
osg::notify(osg::NOTICE)<<endl; osg::notify(osg::NOTICE)<< std::endl;
return 0; return 0;
} }
@ -138,7 +138,7 @@ int main( int argc, char **argv )
osg::Node* rootnode = getNodeFromFiles( argc, argv); osg::Node* rootnode = getNodeFromFiles( argc, argv);
osg::Timer_t after_load = timer.tick(); osg::Timer_t after_load = timer.tick();
cout << "Time for load = "<<timer.delta_s(before_load,after_load)<<" seconds"<<endl; std::cout << "Time for load = "<<timer.delta_s(before_load,after_load)<<" seconds"<< std::endl;
// run optimization over the scene graph // run optimization over the scene graph

View File

@ -452,8 +452,8 @@ void Camera::attachTransform(const TransformMode mode, Matrix* matrix)
break; break;
default: default:
_attachedTransformMode = NO_ATTACHED_TRANSFORM; _attachedTransformMode = NO_ATTACHED_TRANSFORM;
notify(WARN)<<"Warning: invalid TransformMode pass to osg::Camera::attachTransform(..)"<<endl; notify(WARN)<<"Warning: invalid TransformMode pass to osg::Camera::attachTransform(..)"<<std::endl;
notify(WARN)<<" setting Camera to NO_ATTACHED_TRANSFORM."<<endl; notify(WARN)<<" setting Camera to NO_ATTACHED_TRANSFORM."<<std::endl;
break; break;
} }

View File

@ -44,7 +44,7 @@ void ClipPlane::setClipPlane(const double* plane)
} }
else else
{ {
notify(WARN)<<"Warning: ClipPlane::setClipPlane() passed NULL plane array, ignoring operation."<<endl; notify(WARN)<<"Warning: ClipPlane::setClipPlane() passed NULL plane array, ignoring operation."<<std::endl;
} }
} }

View File

@ -107,7 +107,7 @@ void Drawable::setUseDisplayList(const bool flag)
{ {
if (flag) if (flag)
{ {
notify(WARN)<<"Warning: attempt to setUseDisplayList(true) on a drawable with does not support display lists."<<endl; notify(WARN)<<"Warning: attempt to setUseDisplayList(true) on a drawable with does not support display lists."<<std::endl;
} }
else else
{ {

View File

@ -38,12 +38,12 @@ const bool osg::isGLExtensionSupported(const char *extension)
} }
if (*startOfWord!=0) s_extensionSet.insert(std::string(startOfWord)); if (*startOfWord!=0) s_extensionSet.insert(std::string(startOfWord));
osg::notify(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<endl; osg::notify(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl;
for(ExtensionSet::iterator itr=s_extensionSet.begin(); for(ExtensionSet::iterator itr=s_extensionSet.begin();
itr!=s_extensionSet.end(); itr!=s_extensionSet.end();
++itr) ++itr)
{ {
osg::notify(INFO)<<" "<<*itr<<endl; osg::notify(INFO)<<" "<<*itr<<std::endl;
} }
} }
@ -51,8 +51,8 @@ const bool osg::isGLExtensionSupported(const char *extension)
// true if extension found in extensionSet. // true if extension found in extensionSet.
bool result = s_extensionSet.find(extension)!=s_extensionSet.end(); bool result = s_extensionSet.find(extension)!=s_extensionSet.end();
if (result) osg::notify(INFO)<<"OpenGL extension '"<<extension<<"' is supported."<<endl; if (result) osg::notify(INFO)<<"OpenGL extension '"<<extension<<"' is supported."<<std::endl;
else osg::notify(INFO)<<"OpenGL extension '"<<extension<<"' is not supported."<<endl; else osg::notify(INFO)<<"OpenGL extension '"<<extension<<"' is not supported."<<std::endl;
return result; return result;
} }

View File

@ -194,7 +194,7 @@ void GeoSet::computeNumVerts() const
numverts += _primLengths[i]; numverts += _primLengths[i];
break; break;
default: default:
notify(WARN) << "Not supported primitive "<<(int)_primtype<<endl; notify(WARN) << "Not supported primitive "<<(int)_primtype<<std::endl;
break; break;
} }

View File

@ -108,7 +108,7 @@ void Image::scaleImage(const int s,const int t,const int /*r*/)
{ {
::free(newData); ::free(newData);
notify(WARN) << "Error Image::scaleImage() do not succeed : errorString = "<<gluErrorString((GLenum)status)<<endl; notify(WARN) << "Error Image::scaleImage() do not succeed : errorString = "<<gluErrorString((GLenum)status)<<std::endl;
} }
++_modifiedTag; ++_modifiedTag;
@ -128,8 +128,8 @@ void Image::ensureDimensionsArePowerOfTwo()
if (new_s!=_s || new_t!=_t) if (new_s!=_s || new_t!=_t)
{ {
if (!_fileName.empty()) notify(NOTICE) << "Scaling image '"<<_fileName<<"' from ("<<_s<<","<<_t<<") to ("<<new_s<<","<<new_t<<")"<<endl; if (!_fileName.empty()) notify(NOTICE) << "Scaling image '"<<_fileName<<"' from ("<<_s<<","<<_t<<") to ("<<new_s<<","<<new_t<<")"<<std::endl;
else notify(NOTICE) << "Scaling image from ("<<_s<<","<<_t<<") to ("<<new_s<<","<<new_t<<")"<<endl; else notify(NOTICE) << "Scaling image from ("<<_s<<","<<_t<<") to ("<<new_s<<","<<new_t<<")"<<std::endl;
scaleImage(new_s,new_t,_r); scaleImage(new_s,new_t,_r);
} }

View File

@ -117,11 +117,11 @@ const bool ImpostorSprite::computeBound() const
if (!_bbox.isValid()) if (!_bbox.isValid())
{ {
cout << "******* ImpostorSprite::computeBound() problem"<<endl; notify(WARN) << "******* ImpostorSprite::computeBound() problem"<<std::endl;
cout << "******* = "<<_coords[0]<<endl; notify(WARN) << "******* = "<<_coords[0]<<std::endl;
cout << "******* = "<<_coords[1]<<endl; notify(WARN) << "******* = "<<_coords[1]<<std::endl;
cout << "******* = "<<_coords[2]<<endl; notify(WARN) << "******* = "<<_coords[2]<<std::endl;
cout << "******* = "<<_coords[3]<<endl; notify(WARN) << "******* = "<<_coords[3]<<std::endl;
} }
return true; return true;

View File

@ -55,7 +55,7 @@ void Material::setAmbient( const Face face, const Vec4& ambient )
_ambientBack = _ambientFront; _ambientBack = _ambientFront;
break; break;
default: default:
notify(NOTICE)<<"Notice: invalid Face passed to Material::setAmbient()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::setAmbient()."<<std::endl;
} }
} }
@ -71,12 +71,12 @@ const Vec4& Material::getAmbient(const Face face) const
case(FRONT_AND_BACK): case(FRONT_AND_BACK):
if (!_ambientFrontAndBack) if (!_ambientFrontAndBack)
{ {
notify(NOTICE)<<"Notice: Material::getAmbient(FRONT_AND_BACK) called on material "<<endl; notify(NOTICE)<<"Notice: Material::getAmbient(FRONT_AND_BACK) called on material "<< std::endl;
notify(NOTICE)<<" with seperate FRONT and BACK ambient colors."<<endl; notify(NOTICE)<<" with seperate FRONT and BACK ambient colors."<< std::endl;
} }
return _ambientFront; return _ambientFront;
} }
notify(NOTICE)<<"Notice: invalid Face passed to Material::getAmbient()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::getAmbient()."<< std::endl;
return _ambientFront; return _ambientFront;
} }
@ -102,7 +102,7 @@ void Material::setDiffuse( const Face face, const Vec4& diffuse )
_diffuseBack = _diffuseFront; _diffuseBack = _diffuseFront;
break; break;
default: default:
notify(NOTICE)<<"Notice: invalid Face passed to Material::setDiffuse()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::setDiffuse()."<< std::endl;
break; break;
} }
} }
@ -119,12 +119,12 @@ const Vec4& Material::getDiffuse(const Face face) const
case(FRONT_AND_BACK): case(FRONT_AND_BACK):
if (!_diffuseFrontAndBack) if (!_diffuseFrontAndBack)
{ {
notify(NOTICE)<<"Notice: Material::getDiffuse(FRONT_AND_BACK) called on material "<<endl; notify(NOTICE)<<"Notice: Material::getDiffuse(FRONT_AND_BACK) called on material "<< std::endl;
notify(NOTICE)<<" with seperate FRONT and BACK diffuse colors."<<endl; notify(NOTICE)<<" with seperate FRONT and BACK diffuse colors."<< std::endl;
} }
return _diffuseFront; return _diffuseFront;
} }
notify(NOTICE)<<"Notice: invalid Face passed to Material::getDiffuse()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::getDiffuse()."<< std::endl;
return _diffuseFront; return _diffuseFront;
} }
@ -150,7 +150,7 @@ void Material::setSpecular( const Face face, const Vec4& specular )
_specularBack = _specularFront; _specularBack = _specularFront;
break; break;
default: default:
notify(NOTICE)<<"Notice: invalid Face passed to Material::setSpecular()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::setSpecular()."<< std::endl;
break; break;
} }
} }
@ -167,12 +167,12 @@ const Vec4& Material::getSpecular(const Face face) const
case(FRONT_AND_BACK): case(FRONT_AND_BACK):
if (!_specularFrontAndBack) if (!_specularFrontAndBack)
{ {
notify(NOTICE)<<"Notice: Material::getSpecular(FRONT_AND_BACK) called on material "<<endl; notify(NOTICE)<<"Notice: Material::getSpecular(FRONT_AND_BACK) called on material "<< std::endl;
notify(NOTICE)<<" with seperate FRONT and BACK specular colors."<<endl; notify(NOTICE)<<" with seperate FRONT and BACK specular colors."<< std::endl;
} }
return _specularFront; return _specularFront;
} }
notify(NOTICE)<<"Notice: invalid Face passed to Material::getSpecular()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::getSpecular()."<< std::endl;
return _specularFront; return _specularFront;
} }
@ -198,7 +198,7 @@ void Material::setEmission( const Face face, const Vec4& emission )
_emissionBack = _emissionFront; _emissionBack = _emissionFront;
break; break;
default: default:
notify(NOTICE)<<"Notice: invalid Face passed to Material::setEmission()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::setEmission()."<< std::endl;
break; break;
} }
} }
@ -215,12 +215,12 @@ const Vec4& Material::getEmission(const Face face) const
case(FRONT_AND_BACK): case(FRONT_AND_BACK):
if (!_emissionFrontAndBack) if (!_emissionFrontAndBack)
{ {
notify(NOTICE)<<"Notice: Material::getEmission(FRONT_AND_BACK) called on material "<<endl; notify(NOTICE)<<"Notice: Material::getEmission(FRONT_AND_BACK) called on material "<< std::endl;
notify(NOTICE)<<" with seperate FRONT and BACK emission colors."<<endl; notify(NOTICE)<<" with seperate FRONT and BACK emission colors."<< std::endl;
} }
return _emissionFront; return _emissionFront;
} }
notify(NOTICE)<<"Notice: invalid Face passed to Material::getEmission()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::getEmission()."<< std::endl;
return _emissionFront; return _emissionFront;
} }
@ -245,7 +245,7 @@ void Material::setShininess( const Face face, float shininess )
_shininessBack = shininess; _shininessBack = shininess;
break; break;
default: default:
notify(NOTICE)<<"Notice: invalid Face passed to Material::setShininess()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::setShininess()."<< std::endl;
break; break;
} }
} }
@ -262,12 +262,12 @@ const float Material::getShininess(const Face face) const
case(FRONT_AND_BACK): case(FRONT_AND_BACK):
if (!_shininessFrontAndBack) if (!_shininessFrontAndBack)
{ {
notify(NOTICE)<<"Notice: Material::getShininess(FRONT_AND_BACK) called on material "<<endl; notify(NOTICE)<<"Notice: Material::getShininess(FRONT_AND_BACK) called on material "<< std::endl;
notify(NOTICE)<<" with seperate FRONT and BACK shininess colors."<<endl; notify(NOTICE)<<" with seperate FRONT and BACK shininess colors."<< std::endl;
} }
return _shininessFront; return _shininessFront;
} }
notify(NOTICE)<<"Notice: invalid Face passed to Material::getShininess()."<<endl; notify(NOTICE)<<"Notice: invalid Face passed to Material::getShininess()."<< std::endl;
return _shininessFront; return _shininessFront;
} }

View File

@ -325,7 +325,7 @@ bool Matrix::invert( const Matrix& _m )
if ( fabs( pivot) <= 1e-20) if ( fabs( pivot) <= 1e-20)
{ {
notify(WARN) << "*** pivot = %f in mat_inv. ***"<<endl; notify(WARN) << "*** pivot = %f in mat_inv. ***"<<std::endl;
//abort( 0); //abort( 0);
return false; return false;
} }
@ -409,7 +409,7 @@ bool Matrix::invertAffine( const Matrix& _m )
if( (det_1 == 0.0) || (fabs(det_1/(pos-neg)) < PRECISION_LIMIT )) { if( (det_1 == 0.0) || (fabs(det_1/(pos-neg)) < PRECISION_LIMIT )) {
// _m has no inverse // _m has no inverse
notify(WARN) << "Matrix::invert(): Matrix has no inverse." << endl; notify(WARN) << "Matrix::invert(): Matrix has no inverse." << std::endl;
return false; return false;
} }

View File

@ -2,7 +2,7 @@
#include <string> #include <string>
osg::NotifySeverity osg::g_NotifyLevel = osg::NOTICE; osg::NotifySeverity osg::g_NotifyLevel = osg::NOTICE;
ofstream *osg::g_NotifyNulStream; std::ofstream *osg::g_NotifyNulStream;
bool osg::g_NotifyInit = false; bool osg::g_NotifyInit = false;
void osg::setNotifyLevel(osg::NotifySeverity severity) void osg::setNotifyLevel(osg::NotifySeverity severity)
@ -27,9 +27,9 @@ bool osg::initNotifyLevel()
// set up global notify null stream for inline notify // set up global notify null stream for inline notify
#ifdef WIN32 #ifdef WIN32
g_NotifyNulStream = new ofstream ("nul"); g_NotifyNulStream = new std::ofstream ("nul");
#else #else
g_NotifyNulStream = new ofstream ("/dev/null"); g_NotifyNulStream = new std::ofstream ("/dev/null");
#endif #endif
// g_NotifyLevel // g_NotifyLevel

View File

@ -49,7 +49,7 @@ const PolygonMode::Mode PolygonMode::getMode(const Face face) const
case(FRONT_AND_BACK): case(FRONT_AND_BACK):
return _modeFront; return _modeFront;
} }
notify(WARN)<<"Warning : invalid Face passed to PolygonMode::getMode(Face face)"<<endl; notify(WARN)<<"Warning : invalid Face passed to PolygonMode::getMode(Face face)"<<std::endl;
return _modeFront; return _modeFront;
} }

View File

@ -95,7 +95,7 @@ void Quat::makeRotate( const Vec3& from, const Vec3& to )
// Get the angle of rotation and axis of this Quat object. // Get the angle of rotation and axis of this Quat object.
// Won't give very meaningful results if the Quat is not associated // Won't give very meaningful results if the Quat is not associated
// with a rotation! // with a rotation!
void Quat::getRot( float& angle, Vec3& vec ) const void Quat::getRotate( float& angle, Vec3& vec ) const
{ {
float sinhalfangle = sqrt( _fv[0]*_fv[0] + _fv[1]*_fv[1] + _fv[2]*_fv[2] ); float sinhalfangle = sqrt( _fv[0]*_fv[0] + _fv[1]*_fv[1] + _fv[2]*_fv[2] );
/// float coshalfangle = _fv[3]; /// float coshalfangle = _fv[3];
@ -112,7 +112,7 @@ void Quat::getRot( float& angle, Vec3& vec ) const
} }
void Quat::getRot( float& angle, float& x, float& y, float& z ) const void Quat::getRotate( float& angle, float& x, float& y, float& z ) const
{ {
float sinhalfangle = sqrt( _fv[0]*_fv[0] + _fv[1]*_fv[1] + _fv[2]*_fv[2] ); float sinhalfangle = sqrt( _fv[0]*_fv[0] + _fv[1]*_fv[1] + _fv[2]*_fv[2] );

View File

@ -26,7 +26,7 @@ void TexGen::setPlane(const Coord which, const Vec4& plane)
case T : _plane_t = plane; break; case T : _plane_t = plane; break;
case R : _plane_r = plane; break; case R : _plane_r = plane; break;
case Q : _plane_q = plane; break; case Q : _plane_q = plane; break;
default : notify(WARN)<<"Error: invalid 'which' passed TexGen::setPlane("<<(unsigned int)which<<","<<plane<<")"<<endl; break; default : notify(WARN)<<"Error: invalid 'which' passed TexGen::setPlane("<<(unsigned int)which<<","<<plane<<")"<<std::endl; break;
} }
} }
@ -39,7 +39,7 @@ const Vec4& TexGen::getPlane(const Coord which) const
case T : return _plane_t; case T : return _plane_t;
case R : return _plane_r; case R : return _plane_r;
case Q : return _plane_q; case Q : return _plane_q;
default : notify(WARN)<<"Error: invalid 'which' passed TexGen::getPlane(which)"<<endl; return _plane_r; default : notify(WARN)<<"Error: invalid 'which' passed TexGen::getPlane(which)"<<std::endl; return _plane_r;
} }
} }

View File

@ -117,7 +117,7 @@ void Texture::setWrap(const WrapParameter which, const WrapMode wrap)
case WRAP_S : _wrap_s = wrap; break; case WRAP_S : _wrap_s = wrap; break;
case WRAP_T : _wrap_t = wrap; break; case WRAP_T : _wrap_t = wrap; break;
case WRAP_R : _wrap_r = wrap; break; case WRAP_R : _wrap_r = wrap; break;
default : notify(WARN)<<"Error: invalid 'which' passed Texture::setWrap("<<(unsigned int)which<<","<<(unsigned int)wrap<<")"<<endl; break; default : notify(WARN)<<"Error: invalid 'which' passed Texture::setWrap("<<(unsigned int)which<<","<<(unsigned int)wrap<<")"<<std::endl; break;
} }
} }
@ -129,7 +129,7 @@ const Texture::WrapMode Texture::getWrap(const WrapParameter which) const
case WRAP_S : return _wrap_s; case WRAP_S : return _wrap_s;
case WRAP_T : return _wrap_t; case WRAP_T : return _wrap_t;
case WRAP_R : return _wrap_r; case WRAP_R : return _wrap_r;
default : notify(WARN)<<"Error: invalid 'which' passed Texture::getWrap(which)"<<endl; return _wrap_s; default : notify(WARN)<<"Error: invalid 'which' passed Texture::getWrap(which)"<<std::endl; return _wrap_s;
} }
} }
@ -140,7 +140,7 @@ void Texture::setFilter(const FilterParameter which, const FilterMode filter)
{ {
case MIN_FILTER : _min_filter = filter; break; case MIN_FILTER : _min_filter = filter; break;
case MAG_FILTER : _mag_filter = filter; break; case MAG_FILTER : _mag_filter = filter; break;
default : notify(WARN)<<"Error: invalid 'which' passed Texture::setFilter("<<(unsigned int)which<<","<<(unsigned int)filter<<")"<<endl; break; default : notify(WARN)<<"Error: invalid 'which' passed Texture::setFilter("<<(unsigned int)which<<","<<(unsigned int)filter<<")"<<std::endl; break;
} }
} }
@ -151,7 +151,7 @@ const Texture::FilterMode Texture::getFilter(const FilterParameter which) const
{ {
case MIN_FILTER : return _min_filter; case MIN_FILTER : return _min_filter;
case MAG_FILTER : return _mag_filter; case MAG_FILTER : return _mag_filter;
default : notify(WARN)<<"Error: invalid 'which' passed Texture::getFilter(which)"<<endl; return _min_filter; default : notify(WARN)<<"Error: invalid 'which' passed Texture::getFilter(which)"<< std::endl; return _min_filter;
} }
} }
@ -539,7 +539,7 @@ void Texture::copyTexImage2D(State& state, int x, int y, int width, int height )
_textureWidth = width; _textureWidth = width;
_textureHeight = height; _textureHeight = height;
// cout<<"copyTexImage2D x="<<x<<" y="<<y<<" w="<<width<<" h="<<height<<endl; // cout<<"copyTexImage2D x="<<x<<" y="<<y<<" w="<<width<<" h="<<height<< std::endl;
// inform state that this texture is the current one bound. // inform state that this texture is the current one bound.
state.have_applied(this); state.have_applied(this);

View File

@ -42,12 +42,12 @@ DynamicLibrary* DynamicLibrary::loadLibrary(const std::string& libraryName)
#ifdef WIN32 #ifdef WIN32
HANDLE handle = LoadLibrary( fullLibraryName ); HANDLE handle = LoadLibrary( fullLibraryName );
if (handle) return new DynamicLibrary(libraryName,handle); if (handle) return new DynamicLibrary(libraryName,handle);
notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<endl; notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<std::endl;
#elif !defined(macintosh) #elif !defined(macintosh)
HANDLE handle = dlopen( fullLibraryName, RTLD_LAZY ); HANDLE handle = dlopen( fullLibraryName, RTLD_LAZY );
if (handle) return new DynamicLibrary(libraryName,handle); if (handle) return new DynamicLibrary(libraryName,handle);
notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<endl; notify(WARN) << "DynamicLibrary::failed loading "<<fullLibraryName<<std::endl;
notify(WARN) << "DynamicLibrary::error "<<dlerror()<<endl; notify(WARN) << "DynamicLibrary::error "<<dlerror()<<std::endl;
#endif #endif
return NULL; return NULL;
} }

View File

@ -76,7 +76,7 @@ void FieldReader::_copy(const FieldReader& ic)
} }
void FieldReader::attach(istream* input) void FieldReader::attach(std::istream* input)
{ {
_fin = input; _fin = input;

View File

@ -96,7 +96,7 @@ void FieldReaderIterator::_copy(const FieldReaderIterator& ic)
} }
void FieldReaderIterator::attach(istream* input) void FieldReaderIterator::attach(std::istream* input)
{ {
_reader.attach(input); _reader.attach(input);
} }

View File

@ -74,12 +74,12 @@ void osgDB::initFilePath( void )
char *ptr; char *ptr;
if( (ptr = getenv( "OSGFILEPATH" )) ) if( (ptr = getenv( "OSGFILEPATH" )) )
{ {
notify(DEBUG_INFO) << "osgDB::Init("<<ptr<<")"<<endl; notify(DEBUG_INFO) << "osgDB::Init("<<ptr<<")"<<std::endl;
setFilePath( ptr ); setFilePath( ptr );
} }
else else
{ {
notify(DEBUG_INFO) << "osgDB::Init(NULL)"<<endl; notify(DEBUG_INFO) << "osgDB::Init(NULL)"<<std::endl;
} }
s_filePathInitialized = true; s_filePathInitialized = true;
} }
@ -89,7 +89,7 @@ void osgDB::setFilePath( const char *_path )
{ {
char buff[1024]; char buff[1024];
notify(DEBUG_INFO) << "In osgDB::setFilePath("<<_path<<")"<<endl; notify(DEBUG_INFO) << "In osgDB::setFilePath("<<_path<<")"<<std::endl;
buff[0] = 0; buff[0] = 0;
@ -145,8 +145,8 @@ char *osgDB::findFileInPath( const char *_file, const char * filePath )
::free(tptr); ::free(tptr);
if (path) notify( DEBUG_INFO ) << "FindFileInPath() : returning " << path << endl; if (path) notify( DEBUG_INFO ) << "FindFileInPath() : returning " << path << std::endl;
else notify( DEBUG_INFO ) << "FindFileInPath() : returning NULL" << endl; else notify( DEBUG_INFO ) << "FindFileInPath() : returning NULL" << std::endl;
return path; return path;
#endif #endif
@ -263,7 +263,7 @@ char *osgDB::findDSO( const char *name )
if ((ptr = getenv( "PATH" ))) if ((ptr = getenv( "PATH" )))
{ {
notify(DEBUG_INFO) << "PATH = "<<ptr<<endl; notify(DEBUG_INFO) << "PATH = "<<ptr<<std::endl;
strcat( path, PathDelimitor ); strcat( path, PathDelimitor );
strcat( path, ptr ); strcat( path, ptr );
} }

View File

@ -6,6 +6,7 @@
#include <stdio.h> #include <stdio.h>
using namespace std;
using namespace osgDB; using namespace osgDB;
Output::Output() Output::Output()
@ -19,6 +20,10 @@ Output::Output(const char* name) : ofstream(name)
_filename = name; _filename = name;
} }
Output::Output(const Output&) : ofstream() {}
Output& Output::operator = (const Output&) { return *this; }
Output::~Output() Output::~Output()
{ {
} }
@ -104,13 +109,13 @@ const std::string Output::getFileNameForOutput(const std::string& filename) cons
case(FULL_PATH): case(FULL_PATH):
{ {
// need to think about how best to implement this first... // need to think about how best to implement this first...
osg::notify(osg::WARN)<<"Warning: Output::getFileNameForOutput() does not support FULL_PATH yet."<<endl; osg::notify(osg::WARN)<<"Warning: Output::getFileNameForOutput() does not support FULL_PATH yet."<< std::endl;
return filename; return filename;
} }
case(RELATIVE_PATH): case(RELATIVE_PATH):
{ {
// need to think about how best to implement this as well... // need to think about how best to implement this as well...
osg::notify(osg::WARN)<<"Warning: Output::getFileNameForOutput() does not support RELATIVE_PATH yet."<<endl; osg::notify(osg::WARN)<<"Warning: Output::getFileNameForOutput() does not support RELATIVE_PATH yet."<< std::endl;
return filename; return filename;
} }
case(FILENAME_ONLY): case(FILENAME_ONLY):

View File

@ -13,7 +13,7 @@ Object* osgDB::readObjectFile(const std::string& filename)
{ {
ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename); ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename);
if (rr.validObject()) return rr.takeObject(); if (rr.validObject()) return rr.takeObject();
if (rr.error()) notify(WARN) << rr.message() << endl; if (rr.error()) notify(WARN) << rr.message() << std::endl;
return NULL; return NULL;
} }
@ -22,7 +22,7 @@ Image* osgDB::readImageFile(const std::string& filename)
{ {
ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename); ReaderWriter::ReadResult rr = Registry::instance()->readImage(filename);
if (rr.validImage()) return rr.takeImage(); if (rr.validImage()) return rr.takeImage();
if (rr.error()) notify(WARN) << rr.message() << endl; if (rr.error()) notify(WARN) << rr.message() << std::endl;
return NULL; return NULL;
} }
@ -31,6 +31,6 @@ Node* osgDB::readNodeFile(const std::string& filename)
{ {
ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename); ReaderWriter::ReadResult rr = Registry::instance()->readNode(filename);
if (rr.validNode()) return rr.takeNode(); if (rr.validNode()) return rr.takeNode();
if (rr.error()) notify(WARN) << rr.message() << endl; if (rr.error()) notify(WARN) << rr.message() << std::endl;
return NULL; return NULL;
} }

View File

@ -35,7 +35,7 @@ class RegistryPtr
// definition of the Registry // definition of the Registry
Registry::Registry() Registry::Registry()
{ {
notify(INFO) << "Constructing osg::Registry"<<endl; notify(INFO) << "Constructing osg::Registry"<<std::endl;
_createNodeFromImage = true; _createNodeFromImage = true;
_openingLibrary = false; _openingLibrary = false;
@ -73,16 +73,16 @@ void Registry::addDotOsgWrapper(DotOsgWrapper* wrapper)
{ {
if (wrapper==0L) return; if (wrapper==0L) return;
if (_openingLibrary) notify(INFO) << "Opening Library : "<<endl; if (_openingLibrary) notify(INFO) << "Opening Library : "<< std::endl;
notify(INFO) << "osg::Registry::addDotOsgWrapper("<<wrapper->getName()<<")"<<endl; notify(INFO) << "osg::Registry::addDotOsgWrapper("<<wrapper->getName()<<")"<< std::endl;
const DotOsgWrapper::Associates& assoc = wrapper->getAssociates(); const DotOsgWrapper::Associates& assoc = wrapper->getAssociates();
for(DotOsgWrapper::Associates::const_iterator itr=assoc.begin(); for(DotOsgWrapper::Associates::const_iterator itr=assoc.begin();
itr!=assoc.end(); itr!=assoc.end();
++itr) ++itr)
{ {
notify(INFO) << " ("<<*itr<<")"<<endl; notify(INFO) << " ("<<*itr<<")"<< std::endl;
} }
const std::string& name = wrapper->getName(); const std::string& name = wrapper->getName();
@ -111,7 +111,7 @@ void Registry::removeDotOsgWrapper(DotOsgWrapper* wrapper)
{ {
if (wrapper==0L) return; if (wrapper==0L) return;
//// notify(INFO) << "osg::Registry::removeReaderWriter();"<<endl; //// notify(INFO) << "osg::Registry::removeReaderWriter();"<< std::endl;
EraseMacro(_objectWrapperMap,wrapper); EraseMacro(_objectWrapperMap,wrapper);
EraseMacro(_classNameWrapperMap,wrapper); EraseMacro(_classNameWrapperMap,wrapper);
@ -127,9 +127,9 @@ void Registry::addReaderWriter(ReaderWriter* rw)
{ {
if (rw==0L) return; if (rw==0L) return;
if (_openingLibrary) notify(INFO) << "Opening Library : "<<endl; if (_openingLibrary) notify(INFO) << "Opening Library : "<< std::endl;
notify(INFO) << "osg::Registry::addReaderWriter("<<rw->className()<<")"<<endl; notify(INFO) << "osg::Registry::addReaderWriter("<<rw->className()<<")"<< std::endl;
_rwList.push_back(rw); _rwList.push_back(rw);
@ -140,7 +140,7 @@ void Registry::removeReaderWriter(ReaderWriter* rw)
{ {
if (rw==0L) return; if (rw==0L) return;
// notify(INFO) << "osg::Registry::removeReaderWriter();"<<endl; // notify(INFO) << "osg::Registry::removeReaderWriter();"<< std::endl;
ReaderWriterList::iterator rwitr = std::find(_rwList.begin(),_rwList.end(),rw); ReaderWriterList::iterator rwitr = std::find(_rwList.begin(),_rwList.end(),rw);
if (rwitr!=_rwList.end()) if (rwitr!=_rwList.end())
@ -260,7 +260,7 @@ osg::Object* Registry::readObjectOfType(const osg::Object& compObj,Input& fr)
const osg::Object* proto = wrapper->getPrototype(); const osg::Object* proto = wrapper->getPrototype();
if (proto==NULL) if (proto==NULL)
{ {
osg::notify(osg::WARN)<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<<endl; osg::notify(osg::WARN)<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<< std::endl;
return NULL; return NULL;
} }
@ -333,7 +333,7 @@ osg::Object* Registry::readObject(DotOsgWrapperMap& dowMap,Input& fr)
const osg::Object* proto = wrapper->getPrototype(); const osg::Object* proto = wrapper->getPrototype();
if (proto==NULL) if (proto==NULL)
{ {
osg::notify(osg::WARN)<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<<endl; osg::notify(osg::WARN)<<"Token "<<fr[0].getStr()<<" read, but has no prototype, cannot load."<< std::endl;
return NULL; return NULL;
} }
@ -497,7 +497,7 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
std::string uniqueID; std::string uniqueID;
if (fw.getUniqueIDForObject(&obj,uniqueID)) if (fw.getUniqueIDForObject(&obj,uniqueID))
{ {
fw.indent() << "Use " << uniqueID << endl; fw.indent() << "Use " << uniqueID << std::endl;
return true; return true;
} }
} }
@ -511,7 +511,7 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
DotOsgWrapper* wrapper = itr->second.get(); DotOsgWrapper* wrapper = itr->second.get();
const DotOsgWrapper::Associates& assoc = wrapper->getAssociates(); const DotOsgWrapper::Associates& assoc = wrapper->getAssociates();
fw.indent() << wrapper->getName() << " {"<<endl; fw.indent() << wrapper->getName() << " {"<< std::endl;
fw.moveIn(); fw.moveIn();
@ -521,7 +521,7 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
std::string uniqueID; std::string uniqueID;
fw.createUniqueIDForObject(&obj,uniqueID); fw.createUniqueIDForObject(&obj,uniqueID);
fw.registerUniqueIDForObject(&obj,uniqueID); fw.registerUniqueIDForObject(&obj,uniqueID);
fw.indent() << "UniqueID " << uniqueID << endl; fw.indent() << "UniqueID " << uniqueID << std::endl;
} }
// read the local data by iterating through the associate // read the local data by iterating through the associate
@ -542,7 +542,7 @@ bool Registry::writeObject(const osg::Object& obj,Output& fw)
} }
fw.moveOut(); fw.moveOut();
fw.indent() << "}"<<endl; fw.indent() << "}"<< std::endl;
return true; return true;
} }
@ -778,7 +778,7 @@ ReaderWriter::ReadResult Registry::readNode(const std::string& fileName)
// now look for a plug-in to load the file. // now look for a plug-in to load the file.
std::string libraryName = createLibraryNameForFile(fileName); std::string libraryName = createLibraryNameForFile(fileName);
notify(INFO) << "Now checking for plug-in "<<libraryName<<endl; notify(INFO) << "Now checking for plug-in "<<libraryName<< std::endl;
if (loadLibrary(libraryName)) if (loadLibrary(libraryName))
{ {
for(ReaderWriterList::iterator itr=_rwList.begin(); for(ReaderWriterList::iterator itr=_rwList.begin();

View File

@ -15,7 +15,7 @@ using namespace osgDB;
bool osgDB::writeObjectFile(const Object& object,const std::string& filename) bool osgDB::writeObjectFile(const Object& object,const std::string& filename)
{ {
ReaderWriter::WriteResult wr = Registry::instance()->writeObject(object,filename); ReaderWriter::WriteResult wr = Registry::instance()->writeObject(object,filename);
if (wr.error()) notify(WARN) << wr.message() << endl; if (wr.error()) notify(WARN) << wr.message() << std::endl;
return wr.success(); return wr.success();
} }
@ -23,7 +23,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename)
bool osgDB::writeImageFile(const Image& image,const std::string& filename) bool osgDB::writeImageFile(const Image& image,const std::string& filename)
{ {
ReaderWriter::WriteResult wr = Registry::instance()->writeImage(image,filename); ReaderWriter::WriteResult wr = Registry::instance()->writeImage(image,filename);
if (wr.error()) notify(WARN) << wr.message() << endl; if (wr.error()) notify(WARN) << wr.message() << std::endl;
return wr.success(); return wr.success();
} }
@ -31,6 +31,6 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename)
bool osgDB::writeNodeFile(const Node& node,const std::string& filename) bool osgDB::writeNodeFile(const Node& node,const std::string& filename)
{ {
ReaderWriter::WriteResult wr = Registry::instance()->writeNode(node,filename); ReaderWriter::WriteResult wr = Registry::instance()->writeNode(node,filename);
if (wr.error()) notify(WARN) << wr.message() << endl; if (wr.error()) notify(WARN) << wr.message() << std::endl;
return wr.success(); return wr.success();
} }

View File

@ -114,10 +114,10 @@ Viewer::Viewer()
_saveFileName = "saved_model.osg"; _saveFileName = "saved_model.osg";
osg::notify(osg::INFO)<<"Scene Graph Viewer (sgv)"<<endl; osg::notify(osg::INFO)<<"Scene Graph Viewer (sgv)"<< std::endl;
// osg::notify(osg::INFO)<<" '"<<osgGetLibraryName()<<"' Version "<<osgGetVersion()<<endl; // osg::notify(osg::INFO)<<" '"<<osgGetLibraryName()<<"' Version "<<osgGetVersion()<< std::endl;
// osg::notify(osg::INFO)<<" '"<<osgUtilGetLibraryName()<<"' Version "<<osgUtilGetVersion()<<endl; // osg::notify(osg::INFO)<<" '"<<osgUtilGetLibraryName()<<"' Version "<<osgUtilGetVersion()<< std::endl;
_initialTick = _timer.tick(); _initialTick = _timer.tick();
_frameTick = _initialTick; _frameTick = _initialTick;
@ -143,11 +143,11 @@ Viewer::~Viewer()
bool Viewer::open() bool Viewer::open()
{ {
if ( _is_open ) { if ( _is_open ) {
osg::notify(osg::NOTICE)<<"osgGLUT::Viewer::open() called with window already open."<<endl; osg::notify(osg::NOTICE)<<"osgGLUT::Viewer::open() called with window already open."<< std::endl;
return false; return false;
} }
if ( getNumViewports() <= 0 ) { if ( getNumViewports() <= 0 ) {
osg::notify(osg::FATAL)<<"osgGLUT::Viewer::open() called with no Viewports registered."<<endl; osg::notify(osg::FATAL)<<"osgGLUT::Viewer::open() called with no Viewports registered."<< std::endl;
return false; return false;
} }
@ -160,8 +160,8 @@ bool Viewer::open()
{ {
if (itr->_cameraManipList.empty()) if (itr->_cameraManipList.empty())
{ {
osg::notify(osg::NOTICE)<<"osgGLUT::Viewer::open() called without any camara manipulators registered for a viewport,"<<endl; osg::notify(osg::NOTICE)<<"osgGLUT::Viewer::open() called without any camara manipulators registered for a viewport,"<< std::endl;
osg::notify(osg::NOTICE)<<"automatically registering trackball,flight and drive manipulators."<<endl; osg::notify(osg::NOTICE)<<"automatically registering trackball,flight and drive manipulators."<< std::endl;
registerCameraManipulator(new osgUtil::TrackballManipulator, index); registerCameraManipulator(new osgUtil::TrackballManipulator, index);
registerCameraManipulator(new osgUtil::FlightManipulator, index); registerCameraManipulator(new osgUtil::FlightManipulator, index);
registerCameraManipulator(new osgUtil::DriveManipulator, index); registerCameraManipulator(new osgUtil::DriveManipulator, index);
@ -196,7 +196,7 @@ bool Viewer::open()
if (itr->_cameraManipulator->handle(*ea,*this)) if (itr->_cameraManipulator->handle(*ea,*this))
{ {
// osg::notify(osg::INFO) << "Handled reshape "<<endl; // osg::notify(osg::INFO) << "Handled reshape "<< std::endl;
} }
if (sceneView->getStereoMode()==osgUtil::SceneView::QUAD_BUFFER_STEREO) needQuadBufferStereo = true; if (sceneView->getStereoMode()==osgUtil::SceneView::QUAD_BUFFER_STEREO) needQuadBufferStereo = true;
@ -252,15 +252,15 @@ bool Viewer::open()
displayMode |= GLUT_MULTISAMPLE; displayMode |= GLUT_MULTISAMPLE;
osg::notify(osg::INFO) <<"osgGLUT::Viewer::open() requesting displayMode = "<<displayMode<<endl; osg::notify(osg::INFO) <<"osgGLUT::Viewer::open() requesting displayMode = "<<displayMode<< std::endl;
if (displayMode & GLUT_DOUBLE) osg::notify(osg::INFO)<<" requesting GLUT_DOUBLE."<<endl; if (displayMode & GLUT_DOUBLE) osg::notify(osg::INFO)<<" requesting GLUT_DOUBLE."<< std::endl;
if (displayMode & GLUT_SINGLE) osg::notify(osg::INFO)<<" requesting GLUT_SINGLE."<<endl; if (displayMode & GLUT_SINGLE) osg::notify(osg::INFO)<<" requesting GLUT_SINGLE."<< std::endl;
if (displayMode & GLUT_RGB) osg::notify(osg::INFO)<<" requesting GLUT_RGB."<<endl; if (displayMode & GLUT_RGB) osg::notify(osg::INFO)<<" requesting GLUT_RGB."<< std::endl;
if (displayMode & GLUT_DEPTH) osg::notify(osg::INFO)<<" requesting GLUT_DEPTH."<<endl; if (displayMode & GLUT_DEPTH) osg::notify(osg::INFO)<<" requesting GLUT_DEPTH."<< std::endl;
if (displayMode & GLUT_ALPHA) osg::notify(osg::INFO)<<" requesting GLUT_ALPHA."<<endl; if (displayMode & GLUT_ALPHA) osg::notify(osg::INFO)<<" requesting GLUT_ALPHA."<< std::endl;
if (displayMode & GLUT_STENCIL) osg::notify(osg::INFO)<<" requesting GLUT_STENCIL."<<endl; if (displayMode & GLUT_STENCIL) osg::notify(osg::INFO)<<" requesting GLUT_STENCIL."<< std::endl;
if (displayMode & GLUT_MULTISAMPLE) osg::notify(osg::INFO)<<" requesting GLUT_MULTISAMPLE."<<endl; if (displayMode & GLUT_MULTISAMPLE) osg::notify(osg::INFO)<<" requesting GLUT_MULTISAMPLE."<< std::endl;
if (displayMode & GLUT_STEREO) osg::notify(osg::INFO)<<" requesting GLUT_STEREO."<<endl; if (displayMode & GLUT_STEREO) osg::notify(osg::INFO)<<" requesting GLUT_STEREO."<< std::endl;
glutInitDisplayMode( displayMode); glutInitDisplayMode( displayMode);
@ -329,7 +329,7 @@ void Viewer::requestWarpPointer(int x,int y)
{ {
// glutWarpPointer core dumps if invoked before a GLUT window is open // glutWarpPointer core dumps if invoked before a GLUT window is open
if ( !_is_open ) { if ( !_is_open ) {
osg::notify(osg::INFO)<<"osgGLUT::Viewer::requestWarpPointer() called with window closed; ignored."<<endl; osg::notify(osg::INFO)<<"osgGLUT::Viewer::requestWarpPointer() called with window closed; ignored."<< std::endl;
return; return;
} }
glutWarpPointer(x,y); glutWarpPointer(x,y);
@ -347,7 +347,7 @@ float Viewer::app(unsigned int viewport)
if (_viewportList[viewport]._cameraManipulator->handle(*ea,*this)) if (_viewportList[viewport]._cameraManipulator->handle(*ea,*this))
{ {
// osg::notify(osg::INFO) << "Handled update frame"<<endl; // osg::notify(osg::INFO) << "Handled update frame"<< std::endl;
} }
// do app traversal. // do app traversal.
@ -536,11 +536,11 @@ void Viewer::showStats(const unsigned int viewport)
sprintf(clin,"Frame %.1f ms.", timeFrame); sprintf(clin,"Frame %.1f ms.", timeFrame);
displaytext((int)(.75*tmax),(int)(0.98f*vh),clin); displaytext((int)(.75*tmax),(int)(0.98f*vh),clin);
/* osg::notify(osg::NOTICE) << "Time of App "<<timeApp<<"ms "<<endl; /* osg::notify(osg::NOTICE) << "Time of App "<<timeApp<<"ms "<< std::endl;
osg::notify(osg::NOTICE) << "Time of Cull "<<timeCull<<"ms "<<endl; osg::notify(osg::NOTICE) << "Time of Cull "<<timeCull<<"ms "<< std::endl;
osg::notify(osg::NOTICE) << "Time of Draw "<<timeDraw<<"ms "<<endl; osg::notify(osg::NOTICE) << "Time of Draw "<<timeDraw<<"ms "<< std::endl;
osg::notify(osg::NOTICE) << "Frame time "<<frameTime<<endl; osg::notify(osg::NOTICE) << "Frame time "<<frameTime<< std::endl;
osg::notify(osg::NOTICE) << "frameRate() = "<<frameRate()<<endl;*/ osg::notify(osg::NOTICE) << "frameRate() = "<<frameRate()<< std::endl;*/
glLineWidth(2.0f); glLineWidth(2.0f);
glBegin(GL_LINE_LOOP ); glBegin(GL_LINE_LOOP );
@ -622,7 +622,7 @@ void Viewer::showStats(const unsigned int viewport)
for (int i=0; i<nbinsUsed; i++) { for (int i=0; i<nbinsUsed; i++) {
primStats[i].setType(Statistics::STAT_PRIMSPERBIN); // cuts out vertices & triangles to save space on screen primStats[i].setType(Statistics::STAT_PRIMSPERBIN); // cuts out vertices & triangles to save space on screen
ntop+=writePrims((int)(0.96f*vh-ntop),primStats[i]); ntop+=writePrims((int)(0.96f*vh-ntop),primStats[i]);
osg::notify(osg::INFO) << "ntop "<< ntop<<endl; osg::notify(osg::INFO) << "ntop "<< ntop<< std::endl;
} }
maxbins=(primStats[0].getBins()>maxbins)?primStats[0].getBins():maxbins; maxbins=(primStats[0].getBins()>maxbins)?primStats[0].getBins():maxbins;
delete [] primStats; // free up delete [] primStats; // free up
@ -725,7 +725,7 @@ void Viewer::display()
} }
glutSwapBuffers(); // moved after draw of stats & glFinish() to get accurate timing (excluding stat draw!) glutSwapBuffers(); // moved after draw of stats & glFinish() to get accurate timing (excluding stat draw!)
// cout << "Time elapsed "<<_timer.delta_s(_initialTick,_timer.tick())<<endl; // cout << "Time elapsed "<<_timer.delta_s(_initialTick,_timer.tick())<< std::endl;
if (_printStats>1) glFinish(); if (_printStats>1) glFinish();
@ -758,7 +758,7 @@ void Viewer::reshape(GLint w, GLint h)
if (itr->_cameraManipulator->handle(*ea,*this)) if (itr->_cameraManipulator->handle(*ea,*this))
{ {
// osg::notify(osg::INFO) << "Handled reshape "<<endl; // osg::notify(osg::INFO) << "Handled reshape "<< std::endl;
} }
} }
} }
@ -780,7 +780,7 @@ void Viewer::mouseMotion(int x, int y)
if (_viewportList[_focusedViewport]._cameraManipulator->handle(*ea,*this)) if (_viewportList[_focusedViewport]._cameraManipulator->handle(*ea,*this))
{ {
// osg::notify(osg::INFO) << "Handled mouseMotion "<<ea->_buttonMask<<" x="<<ea->_mx<<" y="<<ea->_my<<endl; // osg::notify(osg::INFO) << "Handled mouseMotion "<<ea->_buttonMask<<" x="<<ea->_mx<<" y="<<ea->_my<< std::endl;
} }
mx = x; mx = x;
@ -804,7 +804,7 @@ void Viewer::mousePassiveMotion(int x, int y)
if (_viewportList[_focusedViewport]._cameraManipulator->handle(*ea,*this)) if (_viewportList[_focusedViewport]._cameraManipulator->handle(*ea,*this))
{ {
// osg::notify(osg::INFO) << "Handled mousePassiveMotion "<<ea->_buttonMask<<" x="<<ea->_mx<<" y="<<ea->_my<<endl; // osg::notify(osg::INFO) << "Handled mousePassiveMotion "<<ea->_buttonMask<<" x="<<ea->_mx<<" y="<<ea->_my<< std::endl;
} }
} }
@ -828,7 +828,7 @@ void Viewer::mouse(int button, int state, int x, int y)
if (_viewportList[_focusedViewport]._cameraManipulator->handle(*ea,*this)) if (_viewportList[_focusedViewport]._cameraManipulator->handle(*ea,*this))
{ {
// osg::notify(osg::INFO) << "Handled mouse "<<ea->_buttonMask<<" x="<<ea->_mx<<" y="<<ea->_my<<endl; // osg::notify(osg::INFO) << "Handled mouse "<<ea->_buttonMask<<" x="<<ea->_mx<<" y="<<ea->_my<< std::endl;
} }
} }
@ -900,7 +900,7 @@ void Viewer::keyboard(unsigned char key, int x, int y)
// OpenGL display lists. // OpenGL display lists.
osgUtil::DisplayListVisitor dlv(osgUtil::DisplayListVisitor::SWITCH_ON_DISPLAY_LISTS); osgUtil::DisplayListVisitor dlv(osgUtil::DisplayListVisitor::SWITCH_ON_DISPLAY_LISTS);
sceneView->getSceneData()->accept(dlv); sceneView->getSceneData()->accept(dlv);
osg::notify(osg::NOTICE) << "Switched on use of OpenGL Display Lists."<<endl; osg::notify(osg::NOTICE) << "Switched on use of OpenGL Display Lists."<< std::endl;
} }
else else
{ {
@ -908,7 +908,7 @@ void Viewer::keyboard(unsigned char key, int x, int y)
// OpenGL display lists. // OpenGL display lists.
osgUtil::DisplayListVisitor dlv(osgUtil::DisplayListVisitor::SWITCH_OFF_DISPLAY_LISTS); osgUtil::DisplayListVisitor dlv(osgUtil::DisplayListVisitor::SWITCH_OFF_DISPLAY_LISTS);
sceneView->getSceneData()->accept(dlv); sceneView->getSceneData()->accept(dlv);
osg::notify(osg::NOTICE) << "Switched off use of OpenGL Display Lists."<<endl; osg::notify(osg::NOTICE) << "Switched off use of OpenGL Display Lists."<< std::endl;
} }
break; break;
@ -941,20 +941,20 @@ void Viewer::keyboard(unsigned char key, int x, int y)
case 'S' : case 'S' :
{ {
osg::notify(osg::NOTICE) << "Smoothing scene..."<<endl; osg::notify(osg::NOTICE) << "Smoothing scene..."<< std::endl;
osgUtil::SmoothingVisitor sv; osgUtil::SmoothingVisitor sv;
sceneView->getSceneData()->accept(sv); sceneView->getSceneData()->accept(sv);
osg::notify(osg::NOTICE) << "Smoothed scene."<<endl; osg::notify(osg::NOTICE) << "Smoothed scene."<< std::endl;
} }
break; break;
case 'R' : case 'R' :
{ {
osg::notify(osg::NOTICE) << "Tri Striping scene..."<<endl; osg::notify(osg::NOTICE) << "Tri Striping scene..."<< std::endl;
osgUtil::TriStripVisitor tsv; osgUtil::TriStripVisitor tsv;
sceneView->getSceneData()->accept(tsv); sceneView->getSceneData()->accept(tsv);
osg::notify(osg::NOTICE) << "Tri Striping scene scene."<<endl; osg::notify(osg::NOTICE) << "Tri Striping scene scene."<< std::endl;
} }
break; break;
@ -1037,7 +1037,7 @@ void Viewer::keyboard(unsigned char key, int x, int y)
case 'o' : case 'o' :
if (sceneView->getSceneData() && osgDB::writeNodeFile(*sceneView->getSceneData(), _saveFileName)) if (sceneView->getSceneData() && osgDB::writeNodeFile(*sceneView->getSceneData(), _saveFileName))
{ {
osg::notify(osg::NOTICE) << "Saved scene to '"<<_saveFileName<<"'"<<endl; osg::notify(osg::NOTICE) << "Saved scene to '"<<_saveFileName<<"'"<< std::endl;
} }
break; break;
@ -1048,11 +1048,11 @@ void Viewer::keyboard(unsigned char key, int x, int y)
(_viewFrustumCullingActive ? osgUtil::CullViewState::VIEW_FRUSTUM_CULLING : osgUtil::CullViewState::NO_CULLING))); (_viewFrustumCullingActive ? osgUtil::CullViewState::VIEW_FRUSTUM_CULLING : osgUtil::CullViewState::NO_CULLING)));
if (_smallFeatureCullingActive) if (_smallFeatureCullingActive)
{ {
osg::notify(osg::NOTICE) << "Small feature culling switched on "<<endl; osg::notify(osg::NOTICE) << "Small feature culling switched on "<< std::endl;
} }
else else
{ {
osg::notify(osg::NOTICE) << "Small feature culling switched off "<<endl; osg::notify(osg::NOTICE) << "Small feature culling switched off "<< std::endl;
} }
break; break;
@ -1060,11 +1060,11 @@ void Viewer::keyboard(unsigned char key, int x, int y)
_viewFrustumCullingActive = !_viewFrustumCullingActive; _viewFrustumCullingActive = !_viewFrustumCullingActive;
if (_viewFrustumCullingActive) if (_viewFrustumCullingActive)
{ {
osg::notify(osg::NOTICE) << "View frustum culling switched on "<<endl; osg::notify(osg::NOTICE) << "View frustum culling switched on "<< std::endl;
} }
else else
{ {
osg::notify(osg::NOTICE) << "View frustum culling switched off "<<endl; osg::notify(osg::NOTICE) << "View frustum culling switched off "<< std::endl;
} }
sceneView->getCullVisitor()->setCullingMode((osgUtil::CullViewState::CullingMode) sceneView->getCullVisitor()->setCullingMode((osgUtil::CullViewState::CullingMode)
((_smallFeatureCullingActive ? osgUtil::CullViewState::SMALL_FEATURE_CULLING : osgUtil::CullViewState::NO_CULLING) | ((_smallFeatureCullingActive ? osgUtil::CullViewState::SMALL_FEATURE_CULLING : osgUtil::CullViewState::NO_CULLING) |
@ -1075,11 +1075,11 @@ void Viewer::keyboard(unsigned char key, int x, int y)
sceneView->setPrioritizeTextures(!sceneView->getPrioritizeTextures()); sceneView->setPrioritizeTextures(!sceneView->getPrioritizeTextures());
if (sceneView->getPrioritizeTextures()) if (sceneView->getPrioritizeTextures())
{ {
osg::notify(osg::NOTICE) << "Prioritize textures switched on "<<endl; osg::notify(osg::NOTICE) << "Prioritize textures switched on "<< std::endl;
} }
else else
{ {
osg::notify(osg::NOTICE) << "Prioritize textures switched off "<<endl; osg::notify(osg::NOTICE) << "Prioritize textures switched off "<< std::endl;
} }
break; break;
@ -1091,18 +1091,18 @@ void Viewer::keyboard(unsigned char key, int x, int y)
case 'i' : case 'i' :
case 'r' : case 'r' :
{ {
osg::notify(osg::NOTICE) << "***** Intersecting **************"<< endl; osg::notify(osg::NOTICE) << "***** Intersecting **************"<< std::endl;
osg::Vec3 near_point,far_point; osg::Vec3 near_point,far_point;
if (!sceneView->projectWindowXYIntoObject(x,wh-y,near_point,far_point)) if (!sceneView->projectWindowXYIntoObject(x,wh-y,near_point,far_point))
{ {
osg::notify(osg::NOTICE) << "Failed to calculate intersection ray."<<endl; osg::notify(osg::NOTICE) << "Failed to calculate intersection ray."<< std::endl;
return; return;
} }
osg::ref_ptr<osg::LineSegment> LineSegment = new osg::LineSegment; osg::ref_ptr<osg::LineSegment> LineSegment = new osg::LineSegment;
LineSegment->set(near_point,far_point); LineSegment->set(near_point,far_point);
osg::notify(osg::NOTICE) << "start("<<LineSegment->start()<<") end("<<LineSegment->end()<<")"<<endl; osg::notify(osg::NOTICE) << "start("<<LineSegment->start()<<") end("<<LineSegment->end()<<")"<< std::endl;
osgUtil::IntersectVisitor iv; osgUtil::IntersectVisitor iv;
iv.addLineSegment(LineSegment.get()); iv.addLineSegment(LineSegment.get());
@ -1113,7 +1113,7 @@ void Viewer::keyboard(unsigned char key, int x, int y)
float endTime = clockSeconds(); float endTime = clockSeconds();
osg::notify(osg::NOTICE) << "Time for interesection = "<<(endTime-startTime)*1000<<"ms"<<endl; osg::notify(osg::NOTICE) << "Time for interesection = "<<(endTime-startTime)*1000<<"ms"<< std::endl;
if (iv.hits()) if (iv.hits())
{ {
@ -1125,28 +1125,28 @@ void Viewer::keyboard(unsigned char key, int x, int y)
osg::Vec3 ip = hitr->_intersectPoint; osg::Vec3 ip = hitr->_intersectPoint;
osg::Vec3 in = hitr->_intersectNormal; osg::Vec3 in = hitr->_intersectNormal;
osg::Geode* geode = hitr->_geode; osg::Geode* geode = hitr->_geode;
osg::notify(osg::NOTICE) << " Itersection Point ("<<ip<<") Normal ("<<in<<")"<<endl; osg::notify(osg::NOTICE) << " Itersection Point ("<<ip<<") Normal ("<<in<<")"<< std::endl;
if (hitr->_matrix) if (hitr->_matrix)
{ {
osg::Vec3 ipEye = ip*(*(hitr->_matrix)); osg::Vec3 ipEye = ip*(*(hitr->_matrix));
osg::Vec3 inEye = (in+ip)*(*(hitr->_matrix))-ipEye; osg::Vec3 inEye = (in+ip)*(*(hitr->_matrix))-ipEye;
inEye.normalize(); inEye.normalize();
if (geode) osg::notify(osg::NOTICE) << "Geode '"<<geode->getName()<<endl; if (geode) osg::notify(osg::NOTICE) << "Geode '"<<geode->getName()<< std::endl;
osg::notify(osg::NOTICE) << " Eye Itersection Point ("<<ipEye<<") Normal ("<<inEye<<")"<<endl; osg::notify(osg::NOTICE) << " Eye Itersection Point ("<<ipEye<<") Normal ("<<inEye<<")"<< std::endl;
} }
if (key=='r' && geode) if (key=='r' && geode)
{ {
// remove geoset.. // remove geoset..
osg::GeoSet* gset = hitr->_geoset; osg::GeoSet* gset = hitr->_geoset;
osg::notify(osg::NOTICE) << " geoset ("<<gset<<") "<<geode->removeDrawable(gset)<<")"<<endl; osg::notify(osg::NOTICE) << " geoset ("<<gset<<") "<<geode->removeDrawable(gset)<<")"<< std::endl;
} }
} }
} }
osg::notify(osg::NOTICE) << endl << endl; osg::notify(osg::NOTICE) << std::endl << std::endl;
} }
break; break;
@ -1157,79 +1157,79 @@ void Viewer::keyboard(unsigned char key, int x, int y)
} }
void Viewer::help(ostream& fout) void Viewer::help(std::ostream& fout)
{ {
fout <<endl fout << std::endl
<<"Scene Graph Viewer (sgv) keyboard bindings:"<<endl <<"Scene Graph Viewer (sgv) keyboard bindings:"<< std::endl
<<endl << std::endl
<<"1 Select the trackball camera manipulator."<<endl <<"1 Select the trackball camera manipulator."<< std::endl
<<" Left mouse button - rotate,"<<endl <<" Left mouse button - rotate,"<< std::endl
<<" Middle (or Left & Right) mouse button - pan,"<<endl <<" Middle (or Left & Right) mouse button - pan,"<< std::endl
<<" Right mouse button - zoom."<<endl <<" Right mouse button - zoom."<< std::endl
<<"2 Select the flight camera manipulator."<<endl <<"2 Select the flight camera manipulator."<< std::endl
<<" Left mouse button - speed up,"<<endl <<" Left mouse button - speed up,"<< std::endl
<<" Middle (or Left & Right) mouse button - stop,"<<endl <<" Middle (or Left & Right) mouse button - stop,"<< std::endl
<<" Right mouse button - slow down, reverse."<<endl <<" Right mouse button - slow down, reverse."<< std::endl
<<" Move mouse left to roll left, right to roll right."<<endl <<" Move mouse left to roll left, right to roll right."<< std::endl
<<" Move mouse back (down) to pitch nose up, forward to pitch down."<<endl <<" Move mouse back (down) to pitch nose up, forward to pitch down."<< std::endl
<<" In mode Q, the default, selected by pressing 'q'"<<endl <<" In mode Q, the default, selected by pressing 'q'"<< std::endl
<<" The flight path is yawed automatically into the turn to"<<endl <<" The flight path is yawed automatically into the turn to"<< std::endl
<<" produce a similar effect as flying an aircaft."<<endl <<" produce a similar effect as flying an aircaft."<< std::endl
<<" In mode A, selected by pressing 'a'"<<endl <<" In mode A, selected by pressing 'a'"<< std::endl
<<" The flight path is not yawed automatically into the turn,"<<endl <<" The flight path is not yawed automatically into the turn,"<< std::endl
<<" producing a similar effect as space/marine flight."<<endl <<" producing a similar effect as space/marine flight."<< std::endl
<<"3 Select the drive camera manipulator."<<endl <<"3 Select the drive camera manipulator."<< std::endl
<<" In mode Q, the default, selected by pressing 'q'"<<endl <<" In mode Q, the default, selected by pressing 'q'"<< std::endl
<<" Move mouse left to turn left, right to turn right."<<endl <<" Move mouse left to turn left, right to turn right."<< std::endl
<<" Move mouse back (down) to reverse, forward to drive forward."<<endl <<" Move mouse back (down) to reverse, forward to drive forward."<< std::endl
<<" In mode A, selected by pressing 'a'"<<endl <<" In mode A, selected by pressing 'a'"<< std::endl
<<" Move mouse left to turn left, right to turn right."<<endl <<" Move mouse left to turn left, right to turn right."<< std::endl
<<" Left mouse button - speed up,"<<endl <<" Left mouse button - speed up,"<< std::endl
<<" Middle (or Left & Right) mouse button - stop,"<<endl <<" Middle (or Left & Right) mouse button - stop,"<< std::endl
<<" Right mouse button - slow down, reverse."<<endl <<" Right mouse button - slow down, reverse."<< std::endl
<<endl << std::endl
<<"+ Half the frame delay which speeds up the frame rate on Linux and Windows."<<endl <<"+ Half the frame delay which speeds up the frame rate on Linux and Windows."<< std::endl
<<"- Double the frame delay and therefore reduce the frame rate on Linux"<<endl <<"- Double the frame delay and therefore reduce the frame rate on Linux"<< std::endl
<<" and Windows."<<endl <<" and Windows."<< std::endl
<<endl << std::endl
<<"/ Divide the Level-Of-Detail (LOD) bias by 1.5, to encourage the"<<endl <<"/ Divide the Level-Of-Detail (LOD) bias by 1.5, to encourage the"<< std::endl
<<" selection of more complex LOD children."<<endl <<" selection of more complex LOD children."<< std::endl
<<"* Multiple the Level-of-Detail (LOD) bias by 1.5, to encourage the"<<endl <<"* Multiple the Level-of-Detail (LOD) bias by 1.5, to encourage the"<< std::endl
<<" selection of less complex LOD children."<<endl <<" selection of less complex LOD children."<< std::endl
<<endl << std::endl
<<"c Toggle Small Feature Culling on or off."<<endl <<"c Toggle Small Feature Culling on or off."<< std::endl
<<"C Toggle View Frustum Culling on or off."<<endl <<"C Toggle View Frustum Culling on or off."<< std::endl
<<"d Toggle use of OpenGL's display lists."<<endl <<"d Toggle use of OpenGL's display lists."<< std::endl
<<"b Toggle OpenGL's backface culling."<<endl <<"b Toggle OpenGL's backface culling."<< std::endl
<<"t Toggle OpenGL texturing on or off."<<endl <<"t Toggle OpenGL texturing on or off."<< std::endl
<<"T Toggle OpenGL two-sided lighting on or off."<<endl <<"T Toggle OpenGL two-sided lighting on or off."<< std::endl
<<"l Toggle OpenGL lighting on or off."<<endl <<"l Toggle OpenGL lighting on or off."<< std::endl
<<"L Toggle SceneView lighting mode between HEADLIGHT, SKY_LIGHT"<<endl <<"L Toggle SceneView lighting mode between HEADLIGHT, SKY_LIGHT"<< std::endl
<<" and NO_SCENEVIEW_LIGHT."<<endl <<" and NO_SCENEVIEW_LIGHT."<< std::endl
<<"s Toggle OpenGL shade model between flat and smooth shading."<<endl <<"s Toggle OpenGL shade model between flat and smooth shading."<< std::endl
<<"S Apply osgUtil::SmoothingVisitor to the scene."<<endl <<"S Apply osgUtil::SmoothingVisitor to the scene."<< std::endl
<<"w Toggle OpenGL polygon mode between solid, wireframe and points modes."<<endl <<"w Toggle OpenGL polygon mode between solid, wireframe and points modes."<< std::endl
<<endl << std::endl
<<"i Calculate and report the intersections with the scene under the"<<endl <<"i Calculate and report the intersections with the scene under the"<< std::endl
<<" current mouse x and mouse y position."<<endl <<" current mouse x and mouse y position."<< std::endl
<<endl << std::endl
<<"r Calculate and report the intersections with the scene under the"<<endl <<"r Calculate and report the intersections with the scene under the"<< std::endl
<<" current mouse x and mouse y position and delete the nearest"<<endl <<" current mouse x and mouse y position and delete the nearest"<< std::endl
<<" interesected geoset."<<endl <<" interesected geoset."<< std::endl
<<endl << std::endl
<<"7 Set the background color to black."<<endl <<"7 Set the background color to black."<< std::endl
<<"8 Set the background color to blue."<<endl <<"8 Set the background color to blue."<< std::endl
<<"9 Set the background color to white."<<endl <<"9 Set the background color to white."<< std::endl
<<endl << std::endl
<<"p Print frame rate statistics on each frame."<<endl <<"p Print frame rate statistics on each frame."<< std::endl
<<"o Output the loaded scene to 'saved_model.osg'."<<endl <<"o Output the loaded scene to 'saved_model.osg'."<< std::endl
<<"?/h Print out sgv's keyboard bindings."<<endl <<"?/h Print out sgv's keyboard bindings."<< std::endl
<<"f Toggle between fullscreen and the previous window size. Note, GLUT"<<endl <<"f Toggle between fullscreen and the previous window size. Note, GLUT"<< std::endl
<<" fullscreen works properly on Windows and Irix, but on Linux"<<endl <<" fullscreen works properly on Windows and Irix, but on Linux"<< std::endl
<<" it just maximizes the window and leaves the window's borders."<<endl <<" it just maximizes the window and leaves the window's borders."<< std::endl
<<"Space Reset scene to the default view."<<endl <<"Space Reset scene to the default view."<< std::endl
<<"Esc Exit sgv."<<endl; <<"Esc Exit sgv."<< std::endl;
} }
@ -1257,7 +1257,7 @@ osg::Timer_t Viewer::updateFrameTick()
bool Viewer::run() bool Viewer::run()
{ {
if (!_is_open) { if (!_is_open) {
osg::notify(osg::NOTICE)<<"osgGLUT::Viewer::run() called without window open. Opening window."<<endl; osg::notify(osg::NOTICE)<<"osgGLUT::Viewer::run() called without window open. Opening window."<< std::endl;
if ( !open() ) if ( !open() )
return false; return false;
} }
@ -1309,9 +1309,9 @@ void Viewer::addViewport(osg::Node* rootnode,
void Viewer::init(osg::Node* rootnode) void Viewer::init(osg::Node* rootnode)
{ {
osg::notify(osg::WARN)<<"Warning - call to Viewer::init(osg::Node*) which is a deprecated method."<<endl; osg::notify(osg::WARN)<<"Warning - call to Viewer::init(osg::Node*) which is a deprecated method."<< std::endl;
osg::notify(osg::WARN)<<" This should be replaced with Viewer::addViewport(osg::Node*)."<<endl; osg::notify(osg::WARN)<<" This should be replaced with Viewer::addViewport(osg::Node*)."<< std::endl;
osg::notify(osg::WARN)<<" Automatically mapping init to addViewport."<<endl; osg::notify(osg::WARN)<<" Automatically mapping init to addViewport."<< std::endl;
addViewport(rootnode); addViewport(rootnode);
} }

View File

@ -48,7 +48,7 @@ GLUTWindow::~GLUTWindow()
bool GLUTWindow::open() bool GLUTWindow::open()
{ {
if ( _is_open ) { if ( _is_open ) {
osg::notify(osg::NOTICE)<<"osgGLUT::GLUTWindow::open() called with window already open."<<endl; osg::notify(osg::NOTICE)<<"osgGLUT::GLUTWindow::open() called with window already open."<< std::endl;
return false; return false;
} }
@ -176,7 +176,7 @@ void GLUTWindow::keyboard(unsigned char key, int x, int y)
bool GLUTWindow::run() bool GLUTWindow::run()
{ {
if (!_is_open) { if (!_is_open) {
osg::notify(osg::NOTICE)<<"osgGLUT::GLUTWindow::run() called without window open. Opening window."<<endl; osg::notify(osg::NOTICE)<<"osgGLUT::GLUTWindow::run() called without window open. Opening window."<< std::endl;
if ( !open() ) if ( !open() )
return false; return false;
} }

View File

@ -117,12 +117,12 @@ bool FltFile::readFile(const std::string& fileName)
if (!fin.open(newFileName)) return NULL; if (!fin.open(newFileName)) return NULL;
} }
osg::notify(osg::INFO) << "Loading " << fileName << " ... " << endl; osg::notify(osg::INFO) << "Loading " << fileName << " ... " << std::endl;
Record* pRec = fin.readCreateRecord(this); Record* pRec = fin.readCreateRecord(this);
if (pRec == NULL) if (pRec == NULL)
{ {
osg::notify(osg::WARN) << "File not found " << fileName << endl; osg::notify(osg::WARN) << "File not found " << fileName << std::endl;
return false; return false;
} }
@ -161,7 +161,7 @@ void FltFile::readExternals()
MaterialPool* pMaterialPool = NULL; MaterialPool* pMaterialPool = NULL;
std::string filename(pSExternal->szPath); std::string filename(pSExternal->szPath);
osg::notify(osg::INFO) << "External=" << filename << endl; osg::notify(osg::INFO) << "External=" << filename << std::endl;
if (rec.getFlightVersion() > 13) if (rec.getFlightVersion() > 13)
{ {

View File

@ -169,7 +169,7 @@ Record* Input::readCreateRecord(FltFile* pFltFile)
if (pProto == NULL) if (pProto == NULL)
{ {
// Should not be possible to end up here! // Should not be possible to end up here!
osg::notify(osg::INFO) << "UnknownRecord not in registry!" << endl; osg::notify(osg::INFO) << "UnknownRecord not in registry!" << std::endl;
::free(pData); ::free(pData);
return NULL; return NULL;
} }
@ -178,7 +178,7 @@ Record* Input::readCreateRecord(FltFile* pFltFile)
Record* pRec = pProto->cloneRecord(pData); Record* pRec = pProto->cloneRecord(pData);
if (pRec == NULL) if (pRec == NULL)
{ {
osg::notify(osg::INFO) << "Can't clone record!" << endl; osg::notify(osg::INFO) << "Can't clone record!" << std::endl;
::free(pData); ::free(pData);
return NULL; return NULL;
} }
@ -189,7 +189,7 @@ Record* Input::readCreateRecord(FltFile* pFltFile)
osg::notify(osg::ALWAYS) << "class=" << pRec->className(); osg::notify(osg::ALWAYS) << "class=" << pRec->className();
osg::notify(osg::ALWAYS) << " op=" << pRec->getOpcode(); osg::notify(osg::ALWAYS) << " op=" << pRec->getOpcode();
osg::notify(osg::ALWAYS) << " name=" << pRec->getName(); osg::notify(osg::ALWAYS) << " name=" << pRec->getName();
osg::notify(osg::ALWAYS) << " offset=" << offset() << endl; osg::notify(osg::ALWAYS) << " offset=" << offset() << std::endl;
#endif #endif
if (isLittleEndianMachine()) // From Intel with love :-( if (isLittleEndianMachine()) // From Intel with love :-(

View File

@ -702,7 +702,7 @@ class ReaderWriterATTR : public osgDB::ReaderWriter
StateSet* stateset = attr.createOsgStateSet(); StateSet* stateset = attr.createOsgStateSet();
notify(INFO) << "texture attribute read ok" << endl; notify(INFO) << "texture attribute read ok" << std::endl;
return stateset; return stateset;
} }

View File

@ -72,7 +72,7 @@ void Record::ascend(RecordVisitor& rv)
} }
*/ */
ostream& operator << (ostream& output, const Record& rec) std::ostream& operator << (std::ostream& output, const Record& rec)
{ {
output << rec.className() output << rec.className()
<< " op=" << rec.getOpcode() << " op=" << rec.getOpcode()
@ -177,7 +177,7 @@ bool PrimNodeRecord::readLevel(Input& fr)
if (!pRec->isPrimaryNode()) if (!pRec->isPrimaryNode())
{ {
osg::notify(osg::WARN) << "Non primary record found as child. op=" osg::notify(osg::WARN) << "Non primary record found as child. op="
<< pRec->getOpcode() << endl; << pRec->getOpcode() << std::endl;
return false; return false;
} }

View File

@ -34,7 +34,7 @@ void VertexPaletteRecord::endian()
} }
ostream& operator << (ostream& output, const VertexPaletteRecord& rec) std::ostream& operator << (std::ostream& output, const VertexPaletteRecord& rec)
{ {
output << rec.className(); output << rec.className();
return output; // to enable cascading return output; // to enable cascading
@ -72,7 +72,7 @@ void VertexRecord::endian()
} }
ostream& operator << (ostream& output, const VertexRecord& rec) std::ostream& operator << (std::ostream& output, const VertexRecord& rec)
{ {
output << rec.className() << " " output << rec.className() << " "
<< rec.getData()->swFlags << " " << rec.getData()->swFlags << " "
@ -114,7 +114,7 @@ void NormalVertexRecord::endian()
} }
ostream& operator << (ostream& output, const NormalVertexRecord& rec) std::ostream& operator << (std::ostream& output, const NormalVertexRecord& rec)
{ {
output << rec.className() << " " output << rec.className() << " "
<< rec.getData()->swFlags << " " << rec.getData()->swFlags << " "
@ -156,7 +156,7 @@ void TextureVertexRecord::endian()
} }
ostream& operator << (ostream& output, const TextureVertexRecord& rec) std::ostream& operator << (std::ostream& output, const TextureVertexRecord& rec)
{ {
output << rec.className() << " " output << rec.className() << " "
<< rec.getData()->swFlags << " " << rec.getData()->swFlags << " "
@ -199,7 +199,7 @@ void NormalTextureVertexRecord::endian()
} }
ostream& operator << (ostream& output, const NormalTextureVertexRecord& rec) std::ostream& operator << (std::ostream& output, const NormalTextureVertexRecord& rec)
{ {
output << rec.className() << " " output << rec.className() << " "
<< rec.getData()->swFlags << " " << rec.getData()->swFlags << " "

View File

@ -85,7 +85,7 @@ class VertexRecord : public AncillaryRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); } virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv); // virtual void traverse(RecordVisitor& rv);
virtual SVertex* getData() const { return (SVertex*)_pData; } virtual SVertex* getData() const { return (SVertex*)_pData; }
friend ostream& operator << (ostream& output, const VertexRecord& rec); friend std::ostream& operator << (std::ostream& output, const VertexRecord& rec);
protected: protected:
virtual ~VertexRecord(); virtual ~VertexRecord();
@ -129,7 +129,7 @@ class NormalVertexRecord : public AncillaryRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); } virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv); // virtual void traverse(RecordVisitor& rv);
virtual SNormalVertex* getData() const { return (SNormalVertex*)_pData; } virtual SNormalVertex* getData() const { return (SNormalVertex*)_pData; }
friend ostream& operator << (ostream& output, const NormalVertexRecord& rec); friend std::ostream& operator << (std::ostream& output, const NormalVertexRecord& rec);
protected: protected:
virtual ~NormalVertexRecord(); virtual ~NormalVertexRecord();
@ -172,7 +172,7 @@ class TextureVertexRecord : public AncillaryRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); } virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv); // virtual void traverse(RecordVisitor& rv);
virtual STextureVertex* getData() const { return (STextureVertex*)_pData; } virtual STextureVertex* getData() const { return (STextureVertex*)_pData; }
friend ostream& operator << (ostream& output, const TextureVertexRecord& rec); friend std::ostream& operator << (std::ostream& output, const TextureVertexRecord& rec);
protected: protected:
virtual ~TextureVertexRecord(); virtual ~TextureVertexRecord();
@ -216,7 +216,7 @@ class NormalTextureVertexRecord : public AncillaryRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); } virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv); // virtual void traverse(RecordVisitor& rv);
virtual SNormalTextureVertex* getData() const { return (SNormalTextureVertex*)_pData; } virtual SNormalTextureVertex* getData() const { return (SNormalTextureVertex*)_pData; }
friend ostream& operator << (ostream& output, const NormalTextureVertexRecord& rec); friend std::ostream& operator << (std::ostream& output, const NormalTextureVertexRecord& rec);
protected: protected:
virtual ~NormalTextureVertexRecord(); virtual ~NormalTextureVertexRecord();

View File

@ -202,7 +202,7 @@ osg::Node* ConvertFromFLT::visitHeader(osg::Group* osgParent, HeaderRecord* rec)
// Version // Version
_diOpenFlightVersion = pSHeader->diFormatRevLev; _diOpenFlightVersion = pSHeader->diFormatRevLev;
osg::notify(osg::INFO) << "Version " << _diOpenFlightVersion << endl; osg::notify(osg::INFO) << "Version " << _diOpenFlightVersion << std::endl;
// Unit scale // Unit scale
switch (pSHeader->swVertexCoordUnit) switch (pSHeader->swVertexCoordUnit)

View File

@ -91,7 +91,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriter3DS::readNode(const std::string& fil
if (materialFaceMap.empty()) if (materialFaceMap.empty())
{ {
osg::notify(osg::NOTICE)<<"Warning : no triangles assigned to mesh '"<<mesh->name<<"'"<<endl; osg::notify(osg::NOTICE)<<"Warning : no triangles assigned to mesh '"<<mesh->name<<"'"<< std::endl;
} }
else else
{ {
@ -164,28 +164,28 @@ osg::Texture* ReaderWriter3DS::createTexture(Lib3dsTextureMap *texture,const ch
std::string fileName = osgDB::findFileInDirectory(texture->name,_directory,true); std::string fileName = osgDB::findFileInDirectory(texture->name,_directory,true);
if (fileName.empty()) if (fileName.empty())
{ {
osg::notify(osg::WARN) << "texture '"<<texture->name<<"' not found"<<endl; osg::notify(osg::WARN) << "texture '"<<texture->name<<"' not found"<< std::endl;
return NULL; return NULL;
} }
if (label) osg::notify(osg::DEBUG_INFO) << label; if (label) osg::notify(osg::DEBUG_INFO) << label;
else osg::notify(osg::DEBUG_INFO) << "texture name"; else osg::notify(osg::DEBUG_INFO) << "texture name";
osg::notify(osg::DEBUG_INFO) << " '"<<texture->name<<"'"<<endl; osg::notify(osg::DEBUG_INFO) << " '"<<texture->name<<"'"<< std::endl;
osg::notify(osg::DEBUG_INFO) << " texture flag "<<texture->flags<<endl; osg::notify(osg::DEBUG_INFO) << " texture flag "<<texture->flags<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_DECALE "<<((texture->flags)&LIB3DS_DECALE)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_DECALE "<<((texture->flags)&LIB3DS_DECALE)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_MIRROR "<<((texture->flags)&LIB3DS_MIRROR)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_MIRROR "<<((texture->flags)&LIB3DS_MIRROR)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_NEGATE "<<((texture->flags)&LIB3DS_NEGATE)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_NEGATE "<<((texture->flags)&LIB3DS_NEGATE)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_NO_TILE "<<((texture->flags)&LIB3DS_NO_TILE)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_NO_TILE "<<((texture->flags)&LIB3DS_NO_TILE)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_SUMMED_AREA "<<((texture->flags)&LIB3DS_SUMMED_AREA)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_SUMMED_AREA "<<((texture->flags)&LIB3DS_SUMMED_AREA)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_ALPHA_SOURCE "<<((texture->flags)&LIB3DS_ALPHA_SOURCE)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_ALPHA_SOURCE "<<((texture->flags)&LIB3DS_ALPHA_SOURCE)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_TINT "<<((texture->flags)&LIB3DS_TINT)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_TINT "<<((texture->flags)&LIB3DS_TINT)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_IGNORE_ALPHA "<<((texture->flags)&LIB3DS_IGNORE_ALPHA)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_IGNORE_ALPHA "<<((texture->flags)&LIB3DS_IGNORE_ALPHA)<< std::endl;
osg::notify(osg::DEBUG_INFO) << " LIB3DS_RGB_TINT "<<((texture->flags)&LIB3DS_RGB_TINT)<<endl; osg::notify(osg::DEBUG_INFO) << " LIB3DS_RGB_TINT "<<((texture->flags)&LIB3DS_RGB_TINT)<< std::endl;
osg::Image* osg_image = osgDB::readImageFile(fileName.c_str()); osg::Image* osg_image = osgDB::readImageFile(fileName.c_str());
if (osg_image==NULL) if (osg_image==NULL)
{ {
osg::notify(osg::NOTICE) << "Warning: Cannot create texture "<<texture->name<<endl; osg::notify(osg::NOTICE) << "Warning: Cannot create texture "<<texture->name<< std::endl;
return NULL; return NULL;
} }
@ -335,7 +335,7 @@ osg::GeoSet* ReaderWriter3DS::createGeoSet(Lib3dsMesh *m,FaceList& faceList)
} }
else else
{ {
osg::notify(osg::WARN)<<"Warning: in 3ds loader m->texels ("<<m->texels<<") != m->points ("<<m->points<<")"<<endl; osg::notify(osg::WARN)<<"Warning: in 3ds loader m->texels ("<<m->texels<<") != m->points ("<<m->points<<")"<< std::endl;
} }
} }

View File

@ -60,9 +60,9 @@ osgDB::ReaderWriter::ReadResult ReaderWriterLWO::readNode(const std::string& fil
if (!lw) if (!lw)
return ReadResult::FILE_NOT_HANDLED; return ReadResult::FILE_NOT_HANDLED;
osg::notify(osg::INFO) << "faces " << lw->face_cnt << endl; osg::notify(osg::INFO) << "faces " << lw->face_cnt << std::endl;
osg::notify(osg::INFO) << "materials " << lw->material_cnt << endl; osg::notify(osg::INFO) << "materials " << lw->material_cnt << std::endl;
osg::notify(osg::INFO) << "vertices " << lw->vertex_cnt << endl; osg::notify(osg::INFO) << "vertices " << lw->vertex_cnt << std::endl;
// shared coordinates // shared coordinates
typedef std::map<int,osgUtil::Tesselator::IndexVec> MaterialTriangles; typedef std::map<int,osgUtil::Tesselator::IndexVec> MaterialTriangles;

View File

@ -69,17 +69,17 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil
std::string directory = osgDB::getFilePath(fileName); std::string directory = osgDB::getFilePath(fileName);
osg::notify(osg::INFO) << "vertices " << obj->numvertices << endl; osg::notify(osg::INFO) << "vertices " << obj->numvertices << std::endl;
osg::notify(osg::INFO) << "normals " << obj->numnormals << endl; osg::notify(osg::INFO) << "normals " << obj->numnormals << std::endl;
osg::notify(osg::INFO) << "texcoords " << obj->numtexcoords << endl; osg::notify(osg::INFO) << "texcoords " << obj->numtexcoords << std::endl;
osg::notify(osg::INFO) << "face normals " << obj->numfacetnorms << endl; osg::notify(osg::INFO) << "face normals " << obj->numfacetnorms << std::endl;
osg::notify(osg::INFO) << "tris " << obj->numtriangles << endl; osg::notify(osg::INFO) << "tris " << obj->numtriangles << std::endl;
osg::notify(osg::INFO) << "materials " << obj->nummaterials << endl; osg::notify(osg::INFO) << "materials " << obj->nummaterials << std::endl;
osg::notify(osg::INFO) << "groups " << obj->numgroups << endl; osg::notify(osg::INFO) << "groups " << obj->numgroups << std::endl;
if (obj->numnormals==0) if (obj->numnormals==0)
{ {
osg::notify(osg::NOTICE) << "No normals in .obj file, automatically calculating normals..."<<endl; osg::notify(osg::NOTICE) << "No normals in .obj file, automatically calculating normals..."<< std::endl;
glmFacetNormals(obj); glmFacetNormals(obj);
glmVertexNormals(obj,90.0f); glmVertexNormals(obj,90.0f);
} }
@ -94,7 +94,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil
osg_mtl = new osg::StateSet*[obj->nummaterials]; osg_mtl = new osg::StateSet*[obj->nummaterials];
for (i = 0; i < obj->nummaterials; i++) { for (i = 0; i < obj->nummaterials; i++) {
GLMmaterial* omtl = &(obj->materials[i]); GLMmaterial* omtl = &(obj->materials[i]);
osg::notify(osg::DEBUG_INFO) << "mtl: " << omtl->name << endl; osg::notify(osg::DEBUG_INFO) << "mtl: " << omtl->name << std::endl;
osg::StateSet* stateset = new osg::StateSet; osg::StateSet* stateset = new osg::StateSet;
osg_mtl[i] = stateset; osg_mtl[i] = stateset;
@ -139,12 +139,12 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil
} }
else else
{ {
osg::notify(osg::NOTICE) << "Warning: Cannot create texture "<<omtl->textureName<<endl; osg::notify(osg::NOTICE) << "Warning: Cannot create texture "<<omtl->textureName<< std::endl;
} }
} }
else else
{ {
osg::notify(osg::WARN) << "texture '"<<omtl->textureName<<"' not found"<<endl; osg::notify(osg::WARN) << "texture '"<<omtl->textureName<<"' not found"<< std::endl;
} }
} }
} }
@ -396,7 +396,7 @@ osg::Drawable* ReaderWriterOBJ::makeDrawable(GLMmodel* obj,
gset->setStateSet(mtl[grp->material]); gset->setStateSet(mtl[grp->material]);
} }
else else
osg::notify(osg::INFO) << "Group " << grp->name << " has no material" << endl; osg::notify(osg::INFO) << "Group " << grp->name << " has no material" << std::endl;
return gset; return gset;
} }

View File

@ -54,8 +54,8 @@ bool AlphaFunc_writeLocalData(const Object& obj,Output& fw)
{ {
const AlphaFunc& alphaFunc = static_cast<const AlphaFunc&>(obj); const AlphaFunc& alphaFunc = static_cast<const AlphaFunc&>(obj);
fw.indent() << "comparisonFunc " << AlphaFunc_getFuncStr(alphaFunc.getFunction()) << endl; fw.indent() << "comparisonFunc " << AlphaFunc_getFuncStr(alphaFunc.getFunction()) << std::endl;
fw.indent() << "referenceValue " << alphaFunc.getReferenceValue() << endl; fw.indent() << "referenceValue " << alphaFunc.getReferenceValue() << std::endl;
return true; return true;
} }

View File

@ -111,15 +111,15 @@ bool Billboard_writeLocalData(const Object& obj, Output& fw)
switch(billboard.getMode()) switch(billboard.getMode())
{ {
case(Billboard::AXIAL_ROT): fw.indent() << "Mode AXIAL_ROT"<<endl; break; case(Billboard::AXIAL_ROT): fw.indent() << "Mode AXIAL_ROT"<<std::endl; break;
case(Billboard::POINT_ROT_EYE): fw.indent() << "Mode POINT_ROT_EYE"<<endl; break; case(Billboard::POINT_ROT_EYE): fw.indent() << "Mode POINT_ROT_EYE"<<std::endl; break;
case(Billboard::POINT_ROT_WORLD): fw.indent() << "Mode POINT_ROT_WORLD"<<endl; break; case(Billboard::POINT_ROT_WORLD): fw.indent() << "Mode POINT_ROT_WORLD"<<std::endl; break;
} }
const Vec3& axis = billboard.getAxis(); const Vec3& axis = billboard.getAxis();
fw.indent() << "Axis " << axis[0] << " "<<axis[1]<<" "<<axis[2]<<endl; fw.indent() << "Axis " << axis[0] << " "<<axis[1]<<" "<<axis[2]<<std::endl;
fw.indent() << "Positions {"<<endl; fw.indent() << "Positions {"<<std::endl;
fw.moveIn(); fw.moveIn();
Billboard::PositionList positionList = billboard.getPositionList(); Billboard::PositionList positionList = billboard.getPositionList();
@ -127,10 +127,10 @@ bool Billboard_writeLocalData(const Object& obj, Output& fw)
piter != positionList.end(); piter != positionList.end();
++piter) ++piter)
{ {
fw.indent() << (*piter)[0] << " "<<(*piter)[1]<<" "<<(*piter)[2]<<endl; fw.indent() << (*piter)[0] << " "<<(*piter)[1]<<" "<<(*piter)[2]<<std::endl;
} }
fw.moveOut(); fw.moveOut();
fw.indent() << "}"<<endl; fw.indent() << "}"<<std::endl;
return true; return true;
} }

View File

@ -64,11 +64,11 @@ bool ClipPlane_writeLocalData(const Object& obj,Output& fw)
{ {
const ClipPlane& clipplane = static_cast<const ClipPlane&>(obj); const ClipPlane& clipplane = static_cast<const ClipPlane&>(obj);
fw.indent() << "clipPlaneNum " << clipplane.getClipPlaneNum() <<endl; fw.indent() << "clipPlaneNum " << clipplane.getClipPlaneNum() <<std::endl;
double plane[4]; double plane[4];
clipplane.getClipPlane(plane); clipplane.getClipPlane(plane);
fw.indent() << "plane " << plane[0] << ' ' << plane[1] << ' ' << plane[2] << ' ' << plane[3] << endl; fw.indent() << "plane " << plane[0] << ' ' << plane[1] << ' ' << plane[2] << ' ' << plane[3] << std::endl;
return true; return true;
} }

View File

@ -71,10 +71,10 @@ bool ColorMask_writeLocalData(const Object& obj,Output& fw)
{ {
const ColorMask& colormask = static_cast<const ColorMask&>(obj); const ColorMask& colormask = static_cast<const ColorMask&>(obj);
fw.indent() << "redMask " << ColorMask_getModeStr(colormask.getRedMask()) << endl; fw.indent() << "redMask " << ColorMask_getModeStr(colormask.getRedMask()) <<std::endl;
fw.indent() << "greenMask " << ColorMask_getModeStr(colormask.getGreenMask()) << endl; fw.indent() << "greenMask " << ColorMask_getModeStr(colormask.getGreenMask()) <<std::endl;
fw.indent() << "blueMask " << ColorMask_getModeStr(colormask.getBlueMask()) << endl; fw.indent() << "blueMask " << ColorMask_getModeStr(colormask.getBlueMask()) <<std::endl;
fw.indent() << "alphaMask " << ColorMask_getModeStr(colormask.getAlphaMask()) << endl; fw.indent() << "alphaMask " << ColorMask_getModeStr(colormask.getAlphaMask()) <<std::endl;
return true; return true;
} }

View File

@ -61,9 +61,9 @@ bool CullFace_writeLocalData(const Object& obj, Output& fw)
switch(cullface.getMode()) switch(cullface.getMode())
{ {
case(CullFace::FRONT): fw.indent() << "mode FRONT" << endl; break; case(CullFace::FRONT): fw.indent() << "mode FRONT" <<std::endl; break;
case(CullFace::BACK): fw.indent() << "mode BACK" << endl; break; case(CullFace::BACK): fw.indent() << "mode BACK" <<std::endl; break;
case(CullFace::FRONT_AND_BACK): fw.indent() << "mode FRONT_AND_BACK" << endl; break; case(CullFace::FRONT_AND_BACK): fw.indent() << "mode FRONT_AND_BACK" <<std::endl; break;
} }
return true; return true;
} }

View File

@ -72,13 +72,13 @@ bool Depth_writeLocalData(const Object& obj,Output& fw)
{ {
const Depth& depth = static_cast<const Depth&>(obj); const Depth& depth = static_cast<const Depth&>(obj);
fw.indent() << "function " << Depth_getFuncStr(depth.getFunction()) << endl; fw.indent() << "function " << Depth_getFuncStr(depth.getFunction()) << std::endl;
fw.indent() << "writeMask "; fw.indent() << "writeMask ";
if (depth.getWriteMask()) fw << "TRUE" << endl; if (depth.getWriteMask()) fw << "TRUE" << std::endl;
else fw << "TRUE" << endl; else fw << "TRUE" << std::endl;
fw.indent() << "range " << depth.getZNear() << " " << depth.getZFar() << endl; fw.indent() << "range " << depth.getZNear() << " " << depth.getZFar() << std::endl;
return true; return true;
} }

View File

@ -82,13 +82,13 @@ bool Drawable_writeLocalData(const Object& obj, Output& fw)
if (!drawable.getSupportsDisplayList()) if (!drawable.getSupportsDisplayList())
{ {
fw.indent()<<"supportsDisplayList "; fw.indent()<<"supportsDisplayList ";
if (drawable.getSupportsDisplayList()) fw << "TRUE" <<endl; if (drawable.getSupportsDisplayList()) fw << "TRUE" << std::endl;
else fw << "FALSE" <<endl; else fw << "FALSE" << std::endl;
} }
fw.indent()<<"useDisplayList "; fw.indent()<<"useDisplayList ";
if (drawable.getUseDisplayList()) fw << "TRUE" <<endl; if (drawable.getUseDisplayList()) fw << "TRUE" << std::endl;
else fw << "FALSE" <<endl; else fw << "FALSE" << std::endl;
return true; return true;
} }

View File

@ -67,14 +67,14 @@ bool EarthSky_writeLocalData(const Object& obj, Output& fw)
fw.indent() << "requiresClear "; fw.indent() << "requiresClear ";
if (es.getRequiresClear()) if (es.getRequiresClear())
{ {
fw<<"TRUE"<<endl; fw<<"TRUE"<< std::endl;
} }
else else
{ {
fw<<"FALSE"<<endl; fw<<"FALSE"<< std::endl;
} }
fw.indent() << "clearColor "<<es.getClearColor()<<endl; fw.indent() << "clearColor "<<es.getClearColor()<< std::endl;
return true; return true;
} }

View File

@ -84,11 +84,11 @@ bool Fog_writeLocalData(const Object& obj,Output& fw)
{ {
const Fog& fog = static_cast<const Fog&>(obj); const Fog& fog = static_cast<const Fog&>(obj);
fw.indent() << "mode " << Fog_getModeStr(fog.getMode()) << endl; fw.indent() << "mode " << Fog_getModeStr(fog.getMode()) << std::endl;
fw.indent() << "density " << fog.getDensity() << endl; fw.indent() << "density " << fog.getDensity() << std::endl;
fw.indent() << "start " << fog.getStart() << endl; fw.indent() << "start " << fog.getStart() << std::endl;
fw.indent() << "end " << fog.getEnd() << endl; fw.indent() << "end " << fog.getEnd() << std::endl;
fw.indent() << "color " << fog.getColor() << endl; fw.indent() << "color " << fog.getColor() << std::endl;
return true; return true;
} }

View File

@ -53,8 +53,8 @@ bool FrontFace_writeLocalData(const Object& obj, Output& fw)
switch(frontface.getMode()) switch(frontface.getMode())
{ {
case(FrontFace::CLOCKWISE): fw.indent() << "mode CLOCKWISE" << endl; break; case(FrontFace::CLOCKWISE): fw.indent() << "mode CLOCKWISE" << std::endl; break;
case(FrontFace::COUNTER_CLOCKWISE): fw.indent() << "mode COUNTER_CLOCKWISE" << endl; break; case(FrontFace::COUNTER_CLOCKWISE): fw.indent() << "mode COUNTER_CLOCKWISE" << std::endl; break;
} }
return true; return true;
} }

View File

@ -661,57 +661,57 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
switch(geoset.getPrimType()) switch(geoset.getPrimType())
{ {
case (GeoSet::TRIANGLE_STRIP): case (GeoSet::TRIANGLE_STRIP):
fw.indent()<<"tstrips "<< geoset.getNumPrims() << endl; fw.indent()<<"tstrips "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
break; break;
case (GeoSet::FLAT_TRIANGLE_STRIP): case (GeoSet::FLAT_TRIANGLE_STRIP):
fw.indent()<<"flat_tstrips "<< geoset.getNumPrims() << endl; fw.indent()<<"flat_tstrips "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
break; break;
case (GeoSet::POLYGON): case (GeoSet::POLYGON):
fw.indent()<<"polys "<< geoset.getNumPrims() << endl; fw.indent()<<"polys "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
break; break;
case (GeoSet::QUAD_STRIP): case (GeoSet::QUAD_STRIP):
fw.indent()<<"quadstrip "<< geoset.getNumPrims() << endl; fw.indent()<<"quadstrip "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
break; break;
case (GeoSet::LINE_LOOP): case (GeoSet::LINE_LOOP):
fw.indent()<<"lineloops "<< geoset.getNumPrims() << endl; fw.indent()<<"lineloops "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
break; break;
case (GeoSet::LINE_STRIP): case (GeoSet::LINE_STRIP):
fw.indent()<<"linestrip "<< geoset.getNumPrims() << endl; fw.indent()<<"linestrip "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = false; writeOutPrimitiveLengths = false;
break; break;
case (GeoSet::FLAT_LINE_STRIP): case (GeoSet::FLAT_LINE_STRIP):
fw.indent()<<"flat_linestrip "<< geoset.getNumPrims() << endl; fw.indent()<<"flat_linestrip "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = false; writeOutPrimitiveLengths = false;
break; break;
case (GeoSet::TRIANGLE_FAN): case (GeoSet::TRIANGLE_FAN):
fw.indent()<<"tfans "<< geoset.getNumPrims() << endl; fw.indent()<<"tfans "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
case (GeoSet::FLAT_TRIANGLE_FAN): case (GeoSet::FLAT_TRIANGLE_FAN):
fw.indent()<<"flat_tfans "<< geoset.getNumPrims() << endl; fw.indent()<<"flat_tfans "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = true; writeOutPrimitiveLengths = true;
break; break;
case (GeoSet::LINES): case (GeoSet::LINES):
fw.indent()<<"lines "<< geoset.getNumPrims() << endl; fw.indent()<<"lines "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = false; writeOutPrimitiveLengths = false;
break; break;
case (GeoSet::TRIANGLES): case (GeoSet::TRIANGLES):
fw.indent()<<"triangles "<< geoset.getNumPrims() << endl; fw.indent()<<"triangles "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = false; writeOutPrimitiveLengths = false;
break; break;
case (GeoSet::QUADS): case (GeoSet::QUADS):
fw.indent()<<"quads "<< geoset.getNumPrims() << endl; fw.indent()<<"quads "<< geoset.getNumPrims() << std::endl;
writeOutPrimitiveLengths = false; writeOutPrimitiveLengths = false;
break; break;
case (GeoSet::POINTS) : case (GeoSet::POINTS) :
fw.indent()<<"points "<< geoset.getNumPrims() << endl; fw.indent()<<"points "<< geoset.getNumPrims() << std::endl;
break; break;
default: default:
notify(WARN) << "GeoSet::writeLocalData() - unhandled primitive type = "<<(int)geoset.getPrimType()<<endl; notify(WARN) << "GeoSet::writeLocalData() - unhandled primitive type = "<<(int)geoset.getPrimType()<< std::endl;
} }
if (writeOutPrimitiveLengths) if (writeOutPrimitiveLengths)
{ {
@ -724,16 +724,16 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
if (geoset.getCoords()) if (geoset.getCoords())
{ {
// write out _coords. // write out _coords.
fw.indent() << "Coords " << geoset.getNumCoords()<<endl; fw.indent() << "Coords " << geoset.getNumCoords()<< std::endl;
fw.indent() << "{"<<endl; fw.indent() << "{"<< std::endl;
fw.moveIn(); fw.moveIn();
const Vec3* coords = geoset.getCoords(); const Vec3* coords = geoset.getCoords();
for(i=0;i<geoset.getNumCoords();++i) for(i=0;i<geoset.getNumCoords();++i)
{ {
fw.indent() << coords[i][0] << ' ' << coords[i][1] << ' ' << coords[i][2] << endl; fw.indent() << coords[i][0] << ' ' << coords[i][1] << ' ' << coords[i][2] << std::endl;
} }
fw.moveOut(); fw.moveOut();
fw.indent()<<"}"<<endl; fw.indent()<<"}"<< std::endl;
} }
if (geoset.getCoordIndices()._size) if (geoset.getCoordIndices()._size)
@ -744,25 +744,25 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
if (geoset.getNormals()) if (geoset.getNormals())
{ {
// write out _normals. // write out _normals.
fw.indent() << "Normal_Binding "<<GeoSet_getBindingTypeStr(geoset.getNormalBinding())<<endl; fw.indent() << "Normal_Binding "<<GeoSet_getBindingTypeStr(geoset.getNormalBinding())<< std::endl;
fw.indent() << "Normals " << geoset.getNumNormals()<<endl; fw.indent() << "Normals " << geoset.getNumNormals()<< std::endl;
fw.indent() << "{"<<endl; fw.indent() << "{"<< std::endl;
fw.moveIn(); fw.moveIn();
const Vec3* norms = geoset.getNormals(); const Vec3* norms = geoset.getNormals();
for(i=0;i<geoset.getNumNormals();++i) for(i=0;i<geoset.getNumNormals();++i)
{ {
fw.indent() << norms[i][0] << ' ' << norms[i][1] << ' ' << norms[i][2] << endl; fw.indent() << norms[i][0] << ' ' << norms[i][1] << ' ' << norms[i][2] << std::endl;
} }
fw.moveOut(); fw.moveOut();
fw.indent()<<"}"<<endl; fw.indent()<<"}"<< std::endl;
} }
if (geoset.getNormalIndices()._size) if (geoset.getNormalIndices()._size)
{ {
if (geoset.getNormalIndices()==geoset.getCoordIndices()) if (geoset.getNormalIndices()==geoset.getCoordIndices())
{ {
fw.indent() << "NIndex Use_CIndex"<<endl; fw.indent() << "NIndex Use_CIndex"<< std::endl;
} }
else else
{ {
@ -774,24 +774,24 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
if (geoset.getColors()) if (geoset.getColors())
{ {
// write out _colors. // write out _colors.
fw.indent() << "Color_Binding "<<GeoSet_getBindingTypeStr(geoset.getColorBinding())<<endl; fw.indent() << "Color_Binding "<<GeoSet_getBindingTypeStr(geoset.getColorBinding())<< std::endl;
fw.indent() << "Colors " << geoset.getNumColors()<<endl; fw.indent() << "Colors " << geoset.getNumColors()<< std::endl;
fw.indent() << "{"<<endl; fw.indent() << "{"<< std::endl;
fw.moveIn(); fw.moveIn();
const Vec4* colors = geoset.getColors(); const Vec4* colors = geoset.getColors();
for(i=0;i<geoset.getNumColors();++i) for(i=0;i<geoset.getNumColors();++i)
{ {
fw.indent() << colors[i][0] << ' ' << colors[i][1] << ' ' << colors[i][2] << ' ' << colors[i][3] << endl; fw.indent() << colors[i][0] << ' ' << colors[i][1] << ' ' << colors[i][2] << ' ' << colors[i][3] << std::endl;
} }
fw.moveOut(); fw.moveOut();
fw.indent()<<"}"<<endl; fw.indent()<<"}"<< std::endl;
} }
if (geoset.getColorIndices()._size) if (geoset.getColorIndices()._size)
{ {
if (geoset.getColorIndices()==geoset.getCoordIndices()) if (geoset.getColorIndices()==geoset.getCoordIndices())
{ {
fw.indent() << "ColIndex Use_CIndex"<<endl; fw.indent() << "ColIndex Use_CIndex"<< std::endl;
} }
else else
{ {
@ -802,24 +802,24 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
if (geoset.getTextureCoords()) if (geoset.getTextureCoords())
{ {
// write out _tcoords. // write out _tcoords.
fw.indent() << "Texture_Binding "<<GeoSet_getBindingTypeStr(geoset.getTextureBinding())<<endl; fw.indent() << "Texture_Binding "<<GeoSet_getBindingTypeStr(geoset.getTextureBinding())<< std::endl;
fw.indent() << "TCoords " << geoset.getNumTextureCoords()<<endl; fw.indent() << "TCoords " << geoset.getNumTextureCoords()<< std::endl;
fw.indent() << "{"<<endl; fw.indent() << "{"<< std::endl;
fw.moveIn(); fw.moveIn();
const Vec2* tcoords = geoset.getTextureCoords(); const Vec2* tcoords = geoset.getTextureCoords();
for(i=0;i<geoset.getNumTextureCoords();++i) for(i=0;i<geoset.getNumTextureCoords();++i)
{ {
fw.indent() << tcoords[i][0] << ' ' << tcoords[i][1] << endl; fw.indent() << tcoords[i][0] << ' ' << tcoords[i][1] << std::endl;
} }
fw.moveOut(); fw.moveOut();
fw.indent()<<"}"<<endl; fw.indent()<<"}"<< std::endl;
} }
if (geoset.getTextureIndices()._size) if (geoset.getTextureIndices()._size)
{ {
if (geoset.getTextureIndices()==geoset.getCoordIndices()) if (geoset.getTextureIndices()==geoset.getCoordIndices())
{ {
fw.indent() << "TIndex Use_CIndex"<<endl; fw.indent() << "TIndex Use_CIndex"<< std::endl;
} }
else else
{ {
@ -854,8 +854,8 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
default: fw << "IA_OFF"; break; default: fw << "IA_OFF"; break;
} }
fw << " " << geoset.getNumInterleavedCoords()<<endl; fw << " " << geoset.getNumInterleavedCoords()<< std::endl;
fw.indent() << "{"<<endl; fw.indent() << "{"<< std::endl;
fw.moveIn(); fw.moveIn();
const unsigned char* itrRowData = (const unsigned char*)geoset.getInterleavedArray(); const unsigned char* itrRowData = (const unsigned char*)geoset.getInterleavedArray();
@ -878,11 +878,11 @@ bool GeoSet_writeLocalData(const Object& obj, Output& fw)
} }
itrRowComp++; itrRowComp++;
} }
fw << endl; fw << std::endl ;
} }
fw.moveOut(); fw.moveOut();
fw.indent()<<"}"<<endl; fw.indent()<<"}"<< std::endl;
} }
@ -1007,13 +1007,13 @@ bool GeoSet_writeIndexData(Output& fw, const char* IndexName,const GeoSet::Index
if (ip._is_ushort) if (ip._is_ushort)
{ {
// write our CoordIndex // write our CoordIndex
fw.indent() << IndexName << " ushort " << ip._size<<endl; fw.indent() << IndexName << " ushort " << ip._size<< std::endl;
writeArrayBlock(fw,ip._ptr._ushort,ip._ptr._ushort+ip._size); writeArrayBlock(fw,ip._ptr._ushort,ip._ptr._ushort+ip._size);
} }
else else
{ {
// write our CoordIndex // write our CoordIndex
fw.indent() << IndexName << " uint " << ip._size<<endl; fw.indent() << IndexName << " uint " << ip._size<< std::endl;
writeArrayBlock(fw,ip._ptr._uint,ip._ptr._uint+ip._size); writeArrayBlock(fw,ip._ptr._uint,ip._ptr._uint+ip._size);
} }
return true; return true;

View File

@ -51,7 +51,7 @@ bool Geode_writeLocalData(const osg::Object& obj, Output& fw)
{ {
const Geode& geode = static_cast<const Geode&>(obj); const Geode& geode = static_cast<const Geode&>(obj);
fw.indent() << "num_drawables " << geode.getNumDrawables() << endl; fw.indent() << "num_drawables " << geode.getNumDrawables() << std::endl;
for(int i=0;i<geode.getNumDrawables();++i) for(int i=0;i<geode.getNumDrawables();++i)
{ {

View File

@ -51,7 +51,7 @@ bool Group_writeLocalData(const Object& obj, Output& fw)
{ {
const Group& group = static_cast<const Group&>(obj); const Group& group = static_cast<const Group&>(obj);
fw.indent() << "num_children " << group.getNumChildren() << endl; fw.indent() << "num_children " << group.getNumChildren() << std::endl;
for(int i=0;i<group.getNumChildren();++i) for(int i=0;i<group.getNumChildren();++i)
{ {
fw.writeObject(*group.getChild(i)); fw.writeObject(*group.getChild(i));

View File

@ -45,7 +45,7 @@ bool Impostor_writeLocalData(const Object& obj, Output& fw)
{ {
const Impostor& impostor = static_cast<const Impostor&>(obj); const Impostor& impostor = static_cast<const Impostor&>(obj);
fw.indent() << "ImpostorThreshold "<< impostor.getImpostorThreshold() <<endl; fw.indent() << "ImpostorThreshold "<< impostor.getImpostorThreshold() << std::endl;
return true; return true;
} }

View File

@ -85,17 +85,17 @@ bool LOD_writeLocalData(const Object& obj, Output& fw)
{ {
const LOD& lod = static_cast<const LOD&>(obj); const LOD& lod = static_cast<const LOD&>(obj);
fw.indent() << "Center "<< lod.getCenter() <<endl; fw.indent() << "Center "<< lod.getCenter() << std::endl;
fw.indent() << "Ranges {"<<endl; fw.indent() << "Ranges {"<< std::endl;
fw.moveIn(); fw.moveIn();
for(int i=0; i<lod.getNumRanges();++i) for(int i=0; i<lod.getNumRanges();++i)
{ {
fw.indent() << lod.getRange(i) <<endl; fw.indent() << lod.getRange(i) << std::endl;
} }
fw.moveOut(); fw.moveOut();
fw.indent() << "}"<<endl; fw.indent() << "}"<< std::endl;
return true; return true;
} }

View File

@ -97,20 +97,20 @@ bool Light_writeLocalData(const Object& obj,Output& fw)
const Light& light = static_cast<const Light&>(obj); const Light& light = static_cast<const Light&>(obj);
// Vec4's // Vec4's
fw.indent() << "ambient " << light.getAmbient() << endl; fw.indent() << "ambient " << light.getAmbient() << std::endl;
fw.indent() << "diffuse " << light.getDiffuse() << endl; fw.indent() << "diffuse " << light.getDiffuse() << std::endl;
fw.indent() << "specular " << light.getSpecular() << endl; fw.indent() << "specular " << light.getSpecular() << std::endl;
fw.indent() << "position " << light.getPosition() << endl; fw.indent() << "position " << light.getPosition() << std::endl;
// Vec3's // Vec3's
fw.indent() << "direction " << light.getDirection() << endl; fw.indent() << "direction " << light.getDirection() << std::endl;
// float's // float's
fw.indent() << "constant_attenuation " << light.getConstantAttenuation() << endl; fw.indent() << "constant_attenuation " << light.getConstantAttenuation() << std::endl;
fw.indent() << "linear_attenuation " << light.getLinearAttenuation () << endl; fw.indent() << "linear_attenuation " << light.getLinearAttenuation () << std::endl;
fw.indent() << "quadratic_attenuation " << light.getQuadraticAttenuation() << endl; fw.indent() << "quadratic_attenuation " << light.getQuadraticAttenuation() << std::endl;
fw.indent() << "spot_exponent " << light.getSpotExponent() << endl; fw.indent() << "spot_exponent " << light.getSpotExponent() << std::endl;
fw.indent() << "spot_cutoff " << light.getSpotCutoff() << endl; fw.indent() << "spot_cutoff " << light.getSpotCutoff() << std::endl;
return true; return true;
} }

View File

@ -191,62 +191,62 @@ bool Material_writeLocalData(const Object& obj, Output& fw)
switch(material.getColorMode()) switch(material.getColorMode())
{ {
case(Material::AMBIENT): fw.indent() << "ColorMode AMBIENT" << endl; break; case(Material::AMBIENT): fw.indent() << "ColorMode AMBIENT" << std::endl; break;
case(Material::DIFFUSE): fw.indent() << "ColorMode DIFFUSE" << endl; break; case(Material::DIFFUSE): fw.indent() << "ColorMode DIFFUSE" << std::endl; break;
case(Material::SPECULAR): fw.indent() << "ColorMode SPECULAR" << endl; break; case(Material::SPECULAR): fw.indent() << "ColorMode SPECULAR" << std::endl; break;
case(Material::EMISSION): fw.indent() << "ColorMode EMISSION" << endl; break; case(Material::EMISSION): fw.indent() << "ColorMode EMISSION" << std::endl; break;
case(Material::AMBIENT_AND_DIFFUSE): fw.indent() << "ColorMode AMBIENT_AND_DIFFUSE" << endl; break; case(Material::AMBIENT_AND_DIFFUSE): fw.indent() << "ColorMode AMBIENT_AND_DIFFUSE" << std::endl; break;
case(Material::OFF): fw.indent() << "ColorMode OFF" << endl; break; case(Material::OFF): fw.indent() << "ColorMode OFF" << std::endl; break;
} }
if (material.getAmbientFrontAndBack()) if (material.getAmbientFrontAndBack())
{ {
fw.indent() << "ambientColor " << material.getAmbient(Material::FRONT) << endl; fw.indent() << "ambientColor " << material.getAmbient(Material::FRONT) << std::endl;
} }
else else
{ {
fw.indent() << "ambientColor FRONT " << material.getAmbient(Material::FRONT) << endl; fw.indent() << "ambientColor FRONT " << material.getAmbient(Material::FRONT) << std::endl;
fw.indent() << "ambientColor BACK " << material.getAmbient(Material::BACK) << endl; fw.indent() << "ambientColor BACK " << material.getAmbient(Material::BACK) << std::endl;
} }
if (material.getDiffuseFrontAndBack()) if (material.getDiffuseFrontAndBack())
{ {
fw.indent() << "diffuseColor " << material.getDiffuse(Material::FRONT) << endl; fw.indent() << "diffuseColor " << material.getDiffuse(Material::FRONT) << std::endl;
} }
else else
{ {
fw.indent() << "diffuseColor FRONT " << material.getDiffuse(Material::FRONT) << endl; fw.indent() << "diffuseColor FRONT " << material.getDiffuse(Material::FRONT) << std::endl;
fw.indent() << "diffuseColor BACK " << material.getDiffuse(Material::BACK) << endl; fw.indent() << "diffuseColor BACK " << material.getDiffuse(Material::BACK) << std::endl;
} }
if (material.getSpecularFrontAndBack()) if (material.getSpecularFrontAndBack())
{ {
fw.indent() << "specularColor " << material.getSpecular(Material::FRONT) << endl; fw.indent() << "specularColor " << material.getSpecular(Material::FRONT) << std::endl;
} }
else else
{ {
fw.indent() << "specularColor FRONT " << material.getSpecular(Material::FRONT) << endl; fw.indent() << "specularColor FRONT " << material.getSpecular(Material::FRONT) << std::endl;
fw.indent() << "specularColor BACK " << material.getSpecular(Material::BACK) << endl; fw.indent() << "specularColor BACK " << material.getSpecular(Material::BACK) << std::endl;
} }
if (material.getEmissionFrontAndBack()) if (material.getEmissionFrontAndBack())
{ {
fw.indent() << "emissionColor " << material.getEmission(Material::FRONT) << endl; fw.indent() << "emissionColor " << material.getEmission(Material::FRONT) << std::endl;
} }
else else
{ {
fw.indent() << "emissionColor FRONT " << material.getEmission(Material::FRONT) << endl; fw.indent() << "emissionColor FRONT " << material.getEmission(Material::FRONT) << std::endl;
fw.indent() << "emissionColor BACK " << material.getEmission(Material::BACK) << endl; fw.indent() << "emissionColor BACK " << material.getEmission(Material::BACK) << std::endl;
} }
if (material.getShininessFrontAndBack()) if (material.getShininessFrontAndBack())
{ {
fw.indent() << "shininess " << material.getShininess(Material::FRONT) << endl; fw.indent() << "shininess " << material.getShininess(Material::FRONT) << std::endl;
} }
else else
{ {
fw.indent() << "shininess FRONT " << material.getShininess(Material::FRONT) << endl; fw.indent() << "shininess FRONT " << material.getShininess(Material::FRONT) << std::endl;
fw.indent() << "shininess BACK " << material.getShininess(Material::BACK) << endl; fw.indent() << "shininess BACK " << material.getShininess(Material::BACK) << std::endl;
} }
return true; return true;