From d051a8f47ee928892fd498eb0fef2b7ee5904951 Mon Sep 17 00:00:00 2001 From: Cirilo Bernardo Date: Tue, 23 Feb 2016 16:28:41 +1100 Subject: [PATCH] Changed IFSG* log reports from stderr/stdout to wxLogTrace --- 3d-viewer/3d_cache/sg/ifsg_api.cpp | 165 ++++++++++++++-------- 3d-viewer/3d_cache/sg/ifsg_appearance.cpp | 134 ++++++++++++------ 3d-viewer/3d_cache/sg/ifsg_colors.cpp | 61 +++++--- 3d-viewer/3d_cache/sg/ifsg_coordindex.cpp | 38 +++-- 3d-viewer/3d_cache/sg/ifsg_coords.cpp | 61 +++++--- 3d-viewer/3d_cache/sg/ifsg_faceset.cpp | 37 +++-- 3d-viewer/3d_cache/sg/ifsg_index.cpp | 21 ++- 3d-viewer/3d_cache/sg/ifsg_node.cpp | 81 +++++++---- 3d-viewer/3d_cache/sg/ifsg_normals.cpp | 61 +++++--- 3d-viewer/3d_cache/sg/ifsg_shape.cpp | 23 ++- 3d-viewer/3d_cache/sg/ifsg_transform.cpp | 67 ++++++--- include/plugins/3dapi/ifsg_defs.h | 1 + 12 files changed, 506 insertions(+), 244 deletions(-) diff --git a/3d-viewer/3d_cache/sg/ifsg_api.cpp b/3d-viewer/3d_cache/sg/ifsg_api.cpp index 3843d4a719..9e6d251570 100644 --- a/3d-viewer/3d_cache/sg/ifsg_api.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_api.cpp @@ -22,26 +22,17 @@ */ #include +#include #include -#include -#include #include -#include +#include #include "plugins/3dapi/ifsg_api.h" -#include "plugins/3dapi/sg_types.h" #include "plugins/3dapi/sg_version.h" #include "3d_cache/sg/sg_node.h" #include "3d_cache/sg/scenegraph.h" #include "3d_cache/sg/sg_appearance.h" -#include "3d_cache/sg/sg_colors.h" -#include "3d_cache/sg/sg_coordindex.h" -#include "3d_cache/sg/sg_coords.h" -#include "3d_cache/sg/sg_faceset.h" -#include "3d_cache/sg/sg_normals.h" #include "3d_cache/sg/sg_shape.h" #include "3d_cache/sg/sg_helpers.h" -#include "3d_info.h" -#include "plugins/3dapi/c3dmodel.h" #ifdef DEBUG @@ -126,8 +117,12 @@ bool S3D::WriteVRML( const char* filename, bool overwrite, SGNODE* aTopNode, if( NULL == aTopNode ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] NULL pointer passed for aTopNode\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] NULL pointer passed for aTopNode"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif return false; @@ -136,8 +131,12 @@ bool S3D::WriteVRML( const char* filename, bool overwrite, SGNODE* aTopNode, if( S3D::SGTYPE_TRANSFORM != aTopNode->GetNodeType() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] aTopNode is not a SCENEGRAPH object\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] aTopNode is not a SCENEGRAPH object"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif return false; @@ -150,9 +149,11 @@ bool S3D::WriteVRML( const char* filename, bool overwrite, SGNODE* aTopNode, if( !op.is_open() ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "failed to open file" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '" << filename << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '" << filename << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); return false; } @@ -174,9 +175,13 @@ bool S3D::WriteVRML( const char* filename, bool overwrite, SGNODE* aTopNode, op.close(); - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = _( "problems encountered writing file" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '" << filename << "'\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + wxString errmsg = _( "problems encountered writing file" ); + ostr << " * [INFO] " << errmsg.ToUTF8() << " '" << filename << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); return false; } @@ -187,8 +192,12 @@ void S3D::ResetNodeIndex( SGNODE* aNode ) if( NULL == aNode ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadNode; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadNode; + wxLogTrace( MASK_3D_SG, "%s", ostr.str().c_str() ); + } while( 0 ); #endif return; @@ -205,8 +214,12 @@ void S3D::RenameNodes( SGNODE* aNode ) if( NULL == aNode ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadNode; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadNode; + wxLogTrace( MASK_3D_SG, "%s", ostr.str().c_str() ); + } while( 0 ); #endif return; @@ -223,8 +236,12 @@ void S3D::DestroyNode( SGNODE* aNode ) if( NULL == aNode ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadNode; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadNode; + wxLogTrace( MASK_3D_SG, "%s", ostr.str().c_str() ); + } while( 0 ); #endif return; @@ -247,8 +264,12 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode, if( NULL == aNode ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadNode; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadNode; + wxLogTrace( MASK_3D_SG, "%s", ostr.str().c_str() ); + } while( 0 ); #endif return false; @@ -259,20 +280,25 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode, { if( !overwrite ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "file exists; not overwriting" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '"; - std::cerr << aFileName << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '"; + ostr << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + return false; } // make sure we make no attempt to write a directory if( !wxFileName::FileExists( aFileName ) ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "specified path is a directory" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '"; - std::cerr << aFileName << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '"; + ostr << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); return false; } } @@ -283,9 +309,11 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode, if( !output.is_open() ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "failed to open file" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '" << aFileName << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '" << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); return false; } @@ -302,9 +330,13 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode, if( !rval ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [INFO] problems encountered writing cache file '"; - std::cerr << aFileName << "'\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [INFO] problems encountered writing cache file '"; + ostr << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif // delete the defective file @@ -325,10 +357,14 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( !wxFileName::FileExists( aFileName ) ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "no such file" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '"; - std::cerr << aFileName << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '"; + ostr << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + + return NULL; } SGNODE* np = new SCENEGRAPH( NULL ); @@ -336,9 +372,14 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [INFO] failed to instantiate SCENEGRAPH\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [INFO] failed to instantiate SCENEGRAPH"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif + return NULL; } @@ -348,10 +389,12 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( !file.is_open() ) { delete np; - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "failed to open file" ); - std::cerr << " * [INFO] " << " '"; - std::cerr << aFileName << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '"; + ostr << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); return NULL; } @@ -366,9 +409,13 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( '(' != schar ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [INFO] corrupt data; missing left parenthesis at position "; - std::cerr << file.tellg() << "\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [INFO] corrupt data; missing left parenthesis at position "; + ostr << file.tellg(); + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif file.close(); @@ -402,9 +449,13 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( '(' != schar ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [INFO] corrupt data; missing left parenthesis at position "; - std::cerr << file.tellg() << "\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [INFO] corrupt data; missing left parenthesis at position "; + ostr << file.tellg(); + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif file.close(); @@ -434,10 +485,12 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( !rval ) { delete np; - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "problems encountered reading cache file" ); - std::cerr << " * [INFO] " << errmsg.ToUTF8() << " '"; - std::cerr << aFileName << "'\n"; + ostr << " * [INFO] " << errmsg.ToUTF8() << " '"; + ostr << aFileName << "'"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); return NULL; } diff --git a/3d-viewer/3d_cache/sg/ifsg_appearance.cpp b/3d-viewer/3d_cache/sg/ifsg_appearance.cpp index 444ee4073b..18f526e33e 100644 --- a/3d-viewer/3d_cache/sg/ifsg_appearance.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_appearance.cpp @@ -23,6 +23,8 @@ #include +#include +#include #include "plugins/3dapi/ifsg_appearance.h" #include "3d_cache/sg/sg_appearance.h" @@ -61,8 +63,12 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + do { + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); + } while( 0 ); #endif return; @@ -82,8 +88,10 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( IFSG_NODE& aParent ) #ifdef DEBUG if( ! pp ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); } #endif @@ -97,8 +105,10 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( IFSG_NODE& aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -143,10 +153,12 @@ bool IFSG_APPEARANCE::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGAPPEARANCE\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SGAPPEARANCE"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -167,8 +179,10 @@ bool IFSG_APPEARANCE::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -183,8 +197,10 @@ bool IFSG_APPEARANCE::SetEmissive( float aRVal, float aGVal, float aBVal ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject << "\n"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -199,8 +215,10 @@ bool IFSG_APPEARANCE::SetEmissive( const SGCOLOR* aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject << "\n"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -215,8 +233,10 @@ bool IFSG_APPEARANCE::SetEmissive( const SGCOLOR& aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -231,8 +251,10 @@ bool IFSG_APPEARANCE::SetDiffuse( float aRVal, float aGVal, float aBVal ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -247,8 +269,10 @@ bool IFSG_APPEARANCE::SetDiffuse( const SGCOLOR* aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -263,8 +287,10 @@ bool IFSG_APPEARANCE::SetDiffuse( const SGCOLOR& aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -279,8 +305,10 @@ bool IFSG_APPEARANCE::SetSpecular( float aRVal, float aGVal, float aBVal ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -295,8 +323,10 @@ bool IFSG_APPEARANCE::SetSpecular( const SGCOLOR* aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -311,8 +341,10 @@ bool IFSG_APPEARANCE::SetSpecular( const SGCOLOR& aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -327,8 +359,10 @@ bool IFSG_APPEARANCE::SetAmbient( float aRVal, float aGVal, float aBVal ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -343,8 +377,10 @@ bool IFSG_APPEARANCE::SetAmbient( const SGCOLOR* aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -359,8 +395,10 @@ bool IFSG_APPEARANCE::SetAmbient( const SGCOLOR& aRGBColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -375,8 +413,10 @@ bool IFSG_APPEARANCE::SetShininess( float aShininess ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -385,8 +425,10 @@ bool IFSG_APPEARANCE::SetShininess( float aShininess ) if( aShininess < 0 || aShininess > 1.0 ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] shininess out of range [0..1]\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] shininess out of range [0..1]"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -403,8 +445,10 @@ bool IFSG_APPEARANCE::SetTransparency( float aTransparency ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -413,8 +457,10 @@ bool IFSG_APPEARANCE::SetTransparency( float aTransparency ) if( aTransparency < 0 || aTransparency > 1.0 ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] shininess out of range [0..1]\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] transparency out of range [0..1]"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_colors.cpp b/3d-viewer/3d_cache/sg/ifsg_colors.cpp index 81483a258d..9c66e35268 100644 --- a/3d-viewer/3d_cache/sg/ifsg_colors.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_colors.cpp @@ -22,6 +22,9 @@ */ #include +#include +#include + #include "plugins/3dapi/ifsg_colors.h" #include "3d_cache/sg/sg_colors.h" @@ -59,8 +62,10 @@ IFSG_COLORS::IFSG_COLORS( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -80,8 +85,10 @@ IFSG_COLORS::IFSG_COLORS( IFSG_NODE& aParent ) #ifdef DEBUG if( ! pp ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); } #endif @@ -95,8 +102,10 @@ IFSG_COLORS::IFSG_COLORS( IFSG_NODE& aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -141,10 +150,12 @@ bool IFSG_COLORS::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGCOLORS\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SGCOLORS"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -165,8 +176,10 @@ bool IFSG_COLORS::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -181,8 +194,10 @@ bool IFSG_COLORS::GetColorList( size_t& aListSize, SGCOLOR*& aColorList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -197,8 +212,10 @@ bool IFSG_COLORS::SetColorList( size_t aListSize, const SGCOLOR* aColorList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -215,8 +232,10 @@ bool IFSG_COLORS::AddColor( double aRedValue, double aGreenValue, double aBlueVa if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -233,8 +252,10 @@ bool IFSG_COLORS::AddColor( const SGCOLOR& aColor ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp b/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp index 9adeaf840d..4d9c6596a1 100644 --- a/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp @@ -23,9 +23,11 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_coordindex.h" #include "3d_cache/sg/sg_coordindex.h" -#include "plugins/3dapi/sg_types.h" extern char BadObject[]; @@ -60,8 +62,10 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -80,8 +84,10 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( IFSG_NODE& aParent ) if( !pp ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -92,8 +98,10 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( IFSG_NODE& aParent ) if( !m_node->SetParent( pp ) ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -139,10 +147,12 @@ bool IFSG_COORDINDEX::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGCOORDINDEX\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SGCOORDINDEX"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -163,8 +173,10 @@ bool IFSG_COORDINDEX::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_coords.cpp b/3d-viewer/3d_cache/sg/ifsg_coords.cpp index fd832b7047..02be0637be 100644 --- a/3d-viewer/3d_cache/sg/ifsg_coords.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_coords.cpp @@ -22,6 +22,9 @@ */ #include +#include +#include + #include "plugins/3dapi/ifsg_coords.h" #include "3d_cache/sg/sg_coords.h" @@ -59,8 +62,10 @@ IFSG_COORDS::IFSG_COORDS( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -80,8 +85,10 @@ IFSG_COORDS::IFSG_COORDS( IFSG_NODE& aParent ) #ifdef DEBUG if( ! pp ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); } #endif @@ -95,8 +102,10 @@ IFSG_COORDS::IFSG_COORDS( IFSG_NODE& aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -141,10 +150,12 @@ bool IFSG_COORDS::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGCOORDS\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SGCOORDS"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -165,8 +176,10 @@ bool IFSG_COORDS::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -181,8 +194,10 @@ bool IFSG_COORDS::GetCoordsList( size_t& aListSize, SGPOINT*& aCoordsList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -197,8 +212,10 @@ bool IFSG_COORDS::SetCoordsList( size_t aListSize, const SGPOINT* aCoordsList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -215,8 +232,10 @@ bool IFSG_COORDS::AddCoord( double aXValue, double aYValue, double aZValue ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -233,8 +252,10 @@ bool IFSG_COORDS::AddCoord( const SGPOINT& aPoint ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_faceset.cpp b/3d-viewer/3d_cache/sg/ifsg_faceset.cpp index 3c2b3b7354..f59752521e 100644 --- a/3d-viewer/3d_cache/sg/ifsg_faceset.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_faceset.cpp @@ -23,6 +23,9 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_faceset.h" #include "3d_cache/sg/sg_faceset.h" @@ -60,8 +63,10 @@ IFSG_FACESET::IFSG_FACESET( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -81,8 +86,10 @@ IFSG_FACESET::IFSG_FACESET( IFSG_NODE& aParent ) #ifdef DEBUG if( ! pp ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); } #endif @@ -96,8 +103,10 @@ IFSG_FACESET::IFSG_FACESET( IFSG_NODE& aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -142,10 +151,12 @@ bool IFSG_FACESET::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGFACESET\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SGFACESET"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -166,8 +177,10 @@ bool IFSG_FACESET::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_index.cpp b/3d-viewer/3d_cache/sg/ifsg_index.cpp index 4bba5367c9..0bf7343926 100644 --- a/3d-viewer/3d_cache/sg/ifsg_index.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_index.cpp @@ -23,6 +23,9 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_index.h" #include "3d_cache/sg/sg_coordindex.h" @@ -44,8 +47,10 @@ bool IFSG_INDEX::GetIndices( size_t& nIndices, int*& aIndexList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -60,8 +65,10 @@ bool IFSG_INDEX::SetIndices( size_t nIndices, int* aIndexList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -78,8 +85,10 @@ bool IFSG_INDEX::AddIndex( int aIndex ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_node.cpp b/3d-viewer/3d_cache/sg/ifsg_node.cpp index ad21ef7093..2883a92297 100644 --- a/3d-viewer/3d_cache/sg/ifsg_node.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_node.cpp @@ -23,6 +23,9 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_node.h" #include "3d_cache/sg/sg_node.h" #include "plugins/3dapi/ifsg_api.h" @@ -71,8 +74,10 @@ S3D::SGTYPES IFSG_NODE::GetNodeType( void ) const if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return S3D::SGTYPE_END; @@ -87,8 +92,10 @@ SGNODE* IFSG_NODE::GetParent( void ) const if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return NULL; @@ -103,8 +110,10 @@ bool IFSG_NODE::SetParent( SGNODE* aParent ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -119,8 +128,10 @@ const char* IFSG_NODE::GetName( void ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return NULL; @@ -135,8 +146,10 @@ bool IFSG_NODE::SetName( const char *aName ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -152,8 +165,10 @@ const char * IFSG_NODE::GetNodeTypeName( S3D::SGTYPES aNodeType ) const if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return NULL; @@ -168,8 +183,10 @@ SGNODE* IFSG_NODE::FindNode( const char *aNodeName ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return NULL; @@ -184,8 +201,10 @@ bool IFSG_NODE::AddRefNode( SGNODE* aNode ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -200,8 +219,10 @@ bool IFSG_NODE::AddRefNode( IFSG_NODE& aNode ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -212,8 +233,10 @@ bool IFSG_NODE::AddRefNode( IFSG_NODE& aNode ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadOperand << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadOperand; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -228,8 +251,10 @@ bool IFSG_NODE::AddChildNode( SGNODE* aNode ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -244,8 +269,10 @@ bool IFSG_NODE::AddChildNode( IFSG_NODE& aNode ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -256,8 +283,10 @@ bool IFSG_NODE::AddChildNode( IFSG_NODE& aNode ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadOperand << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadOperand; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_normals.cpp b/3d-viewer/3d_cache/sg/ifsg_normals.cpp index d17d8a5989..619d592d14 100644 --- a/3d-viewer/3d_cache/sg/ifsg_normals.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_normals.cpp @@ -23,6 +23,9 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_normals.h" #include "3d_cache/sg/sg_normals.h" @@ -61,8 +64,10 @@ IFSG_NORMALS::IFSG_NORMALS( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -82,8 +87,10 @@ IFSG_NORMALS::IFSG_NORMALS( IFSG_NODE& aParent ) #ifdef DEBUG if( ! pp ) { - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); } #endif @@ -97,8 +104,10 @@ IFSG_NORMALS::IFSG_NORMALS( IFSG_NODE& aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -143,10 +152,12 @@ bool IFSG_NORMALS::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGNORMALS\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SGNORMALS"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -167,8 +178,10 @@ bool IFSG_NORMALS::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -183,8 +196,10 @@ bool IFSG_NORMALS::GetNormalList( size_t& aListSize, SGVECTOR*& aNormalList ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -199,8 +214,10 @@ bool IFSG_NORMALS::SetNormalList( size_t aListSize, const SGVECTOR* aNormalList if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -216,8 +233,10 @@ bool IFSG_NORMALS::AddNormal( double aXValue, double aYValue, double aZValue ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -233,8 +252,10 @@ bool IFSG_NORMALS::AddNormal( const SGVECTOR& aNormal ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_shape.cpp b/3d-viewer/3d_cache/sg/ifsg_shape.cpp index fa7b695d5f..26565e0fc1 100644 --- a/3d-viewer/3d_cache/sg/ifsg_shape.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_shape.cpp @@ -23,6 +23,9 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_shape.h" #include "3d_cache/sg/sg_shape.h" @@ -61,8 +64,10 @@ IFSG_SHAPE::IFSG_SHAPE( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG + std::ostringstream ostr; std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::cerr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -82,8 +87,10 @@ IFSG_SHAPE::IFSG_SHAPE( IFSG_NODE& aParent ) #ifdef DEBUG if( ! pp ) { + std::ostringstream ostr; std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::cerr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); } #endif @@ -97,8 +104,10 @@ IFSG_SHAPE::IFSG_SHAPE( IFSG_NODE& aParent ) m_node = NULL; #ifdef DEBUG + std::ostringstream ostr; std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::cerr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -143,10 +152,12 @@ bool IFSG_SHAPE::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG + std::ostringstream ostr; std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; std::cerr << " * [BUG] invalid SGNODE parent ("; std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SGSHAPE\n"; + std::cerr << ") to SGSHAPE"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -167,8 +178,10 @@ bool IFSG_SHAPE::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG + std::ostringstream ostr; std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::cerr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/3d-viewer/3d_cache/sg/ifsg_transform.cpp b/3d-viewer/3d_cache/sg/ifsg_transform.cpp index a9b0c040a9..7768ddac61 100644 --- a/3d-viewer/3d_cache/sg/ifsg_transform.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_transform.cpp @@ -23,6 +23,9 @@ #include +#include +#include + #include "plugins/3dapi/ifsg_transform.h" #include "3d_cache/sg/scenegraph.h" @@ -60,8 +63,10 @@ IFSG_TRANSFORM::IFSG_TRANSFORM( SGNODE* aParent ) m_node = NULL; #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << WrongParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << WrongParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return; @@ -106,10 +111,12 @@ bool IFSG_TRANSFORM::NewNode( SGNODE* aParent ) if( aParent != m_node->GetParent() ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] invalid SGNODE parent ("; - std::cerr << aParent->GetNodeTypeName( aParent->GetNodeType() ); - std::cerr << ") to SCENEGRAPH\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] invalid SGNODE parent ("; + ostr << aParent->GetNodeTypeName( aParent->GetNodeType() ); + ostr << ") to SCENEGRAPH"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif delete m_node; @@ -130,8 +137,10 @@ bool IFSG_TRANSFORM::NewNode( IFSG_NODE& aParent ) if( NULL == np ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadParent << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadParent; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -146,8 +155,10 @@ bool IFSG_TRANSFORM::SetRotation( const SGVECTOR& aRotationAxis, double aAngle ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -165,8 +176,10 @@ bool IFSG_TRANSFORM::SetScale( const SGPOINT& aScale ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -183,8 +196,10 @@ bool IFSG_TRANSFORM::SetScale( double aScale ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -193,8 +208,10 @@ bool IFSG_TRANSFORM::SetScale( double aScale ) if( aScale < 1e-8 && aScale > -1e-8 ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << " * [BUG] |scale| is < 1e-8 - this seems strange\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << " * [BUG] |scale| is < 1e-8 - this seems strange"; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -211,8 +228,10 @@ bool IFSG_TRANSFORM::SetTranslation( const SGPOINT& aTranslation ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -229,8 +248,10 @@ bool IFSG_TRANSFORM::SetScaleOrientation( const SGVECTOR& aScaleAxis, double aAn if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; @@ -248,8 +269,10 @@ bool IFSG_TRANSFORM::SetCenter( const SGPOINT& aCenter ) if( NULL == m_node ) { #ifdef DEBUG - std::cerr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - std::cerr << BadObject << "\n"; + std::ostringstream ostr; + ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; + ostr << BadObject; + wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() ); #endif return false; diff --git a/include/plugins/3dapi/ifsg_defs.h b/include/plugins/3dapi/ifsg_defs.h index 2887637f7d..0523bf158d 100644 --- a/include/plugins/3dapi/ifsg_defs.h +++ b/include/plugins/3dapi/ifsg_defs.h @@ -51,6 +51,7 @@ #if defined (COMPILE_SGLIB) #define SGLIB_API APIEXPORT + #define MASK_3D_SG "3D_SG" #else #define SGLIB_API APIIMPORT #endif