diff --git a/src/MEFISTO2/aptrte.cxx b/src/MEFISTO2/aptrte.cxx index 8768bd1cc..b2559e323 100755 --- a/src/MEFISTO2/aptrte.cxx +++ b/src/MEFISTO2/aptrte.cxx @@ -582,7 +582,7 @@ void aptrte( Z nutysu, R aretmx, mnarcf3 = new Z[mxarcf]; if( mnarcf3 == NULL ) { - cout << "aptrte: MC saturee mnarcf3=" << mnarcf3 << endl; + MESSAGE ( "aptrte: MC saturee mnarcf3=" << mnarcf3 ); goto ERREUR; } teamqt( nutysu, aretmx, airemx, diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 44d4259b2..637e105aa 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -70,7 +70,7 @@ int SMDS_Mesh::CheckMemory(const bool doNotRaise) throw (std::bad_alloc) else limit = int( limit * 1.5 ); #ifdef _DEBUG_ - cout << "SMDS_Mesh::CheckMemory() memory limit = " << limit << " MB" << endl; + MESSAGE ( "SMDS_Mesh::CheckMemory() memory limit = " << limit << " MB" ); #endif } @@ -86,7 +86,7 @@ int SMDS_Mesh::CheckMemory(const bool doNotRaise) throw (std::bad_alloc) if ( doNotRaise ) return 0; #ifdef _DEBUG_ - cout<<"SMDS_Mesh::CheckMemory() throws as free memory too low: " << freeMb <<" MB" << endl; + MESSAGE ("SMDS_Mesh::CheckMemory() throws as free memory too low: " << freeMb <<" MB" ); #endif throw std::bad_alloc(); #else diff --git a/src/SMESH/SMESH_Block.cxx b/src/SMESH/SMESH_Block.cxx index 59d48a978..bf85ab033 100644 --- a/src/SMESH/SMESH_Block.cxx +++ b/src/SMESH/SMESH_Block.cxx @@ -495,7 +495,7 @@ Standard_Boolean SMESH_Block::Values(const math_Vector& theXYZ, return true; } #ifdef DEBUG_PARAM_COMPUTE - cout << "PARAM GUESS: " << params.X() << " "<< params.Y() << " "<< params.X() << endl; + MESSAGE ( "PARAM GUESS: " << params.X() << " "<< params.Y() << " "<< params.X() ); myNbIterations++; // how many times call ShellPoint() #endif ShellPoint( params, P ); @@ -556,8 +556,7 @@ Standard_Boolean SMESH_Block::Values(const math_Vector& theXYZ, #endif } #ifdef DEBUG_PARAM_COMPUTE - cout << "F = " << theFxyz(1) << - " DRV: " << theDf(1,1) << " " << theDf(1,2) << " " << theDf(1,3) << endl; + MESSAGE ( "F = " << theFxyz(1) << " DRV: " << theDf(1,1) << " " << theDf(1,2) << " " << theDf(1,3) ); myNbIterations +=3; // how many times call ShellPoint() #endif @@ -613,9 +612,9 @@ bool SMESH_Block::computeParameters(const gp_Pnt& thePoint, } #ifdef DEBUG_PARAM_COMPUTE mySumDist += distance(); - cout << " ------ SOLUTION: ( "<< myParam.X() <<" "<< myParam.Y() <<" "<< myParam.Z() <<" )"< theNbVertexInWires.back() ) { #ifdef _DEBUG_ gp_Pnt p = BRep_Tool::Pnt( theFirstVertex ); - cout << " : Warning : vertex "<< theFirstVertex.TShape().operator->() - << " ( " << p.X() << " " << p.Y() << " " << p.Z() << " )" - << " not found in outer wire of face "<< theFace.TShape().operator->() - << " with vertices: " << endl; + MESSAGE ( " : Warning : vertex "<< theFirstVertex.TShape().operator->() + << " ( " << p.X() << " " << p.Y() << " " << p.Z() << " )" + << " not found in outer wire of face "<< theFace.TShape().operator->() + << " with vertices: " ); wExp.Init( *wlIt, theFace ); for ( int i = 0; wExp.More(); wExp.Next(), i++ ) { @@ -1035,8 +1034,8 @@ int SMESH_Block::GetOrderedEdges (const TopoDS_Face& theFace, edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() )); TopoDS_Vertex v = TopExp::FirstVertex( edge, true ); gp_Pnt p = BRep_Tool::Pnt( v ); - cout << i << " " << v.TShape().operator->() << " " - << p.X() << " " << p.Y() << " " << p.Z() << " " << endl; + MESSAGE_ADD ( i << " " << v.TShape().operator->() << " " + << p.X() << " " << p.Y() << " " << p.Z() << " " << std::endl ); } #endif break; // break infinite loop diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 6b94beafe..53ddc1557 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -7633,10 +7633,9 @@ SMESH_MeshEditor::FindMatchingNodes(set& theSide1, return SEW_TOPO_DIFF_SETS_OF_ELEMENTS; } #ifdef DEBUG_MATCHING_NODES - cout << " Link 1: " << link[0].first->GetID() <<" "<< link[0].second->GetID() - << " F 1: " << face[0]; - cout << "| Link 2: " << link[1].first->GetID() <<" "<< link[1].second->GetID() - << " F 2: " << face[1] << " | Bind: "<GetID() <<" "<< link[0].second->GetID() + << " F 1: " << face[0] << "| Link 2: " << link[1].first->GetID() <<" " + << link[1].second->GetID() << " F 2: " << face[1] << " | Bind: " ) ; #endif int nbN = nbNodes[0]; { @@ -7644,7 +7643,7 @@ SMESH_MeshEditor::FindMatchingNodes(set& theSide1, list::iterator n2 = notLinkNodes[1].begin(); for ( int i = 0 ; i < nbN - 2; ++i ) { #ifdef DEBUG_MATCHING_NODES - cout << (*n1)->GetID() << " to " << (*n2)->GetID() << endl; + MESSAGE ( (*n1)->GetID() << " to " << (*n2)->GetID() ); #endif nReplaceMap.insert( make_pair( *(n1++), *(n2++) )); } @@ -7666,8 +7665,8 @@ SMESH_MeshEditor::FindMatchingNodes(set& theSide1, else // new in set == encountered for the first time: add { #ifdef DEBUG_MATCHING_NODES - cout << "Add link 1: " << n1->GetID() << " " << n2->GetID() << " "; - cout << " | link 2: " << nReplaceMap[n1]->GetID() << " " << nReplaceMap[n2]->GetID() << " " << endl; + MESSAGE ( "Add link 1: " << n1->GetID() << " " << n2->GetID() << " " + << " | link 2: " << nReplaceMap[n1]->GetID() << " " << nReplaceMap[n2]->GetID() << " " ); #endif linkList[0].push_back ( NLink( n1, n2 )); linkList[1].push_back ( NLink( nReplaceMap[n1], nReplaceMap[n2] )); diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 5b74f1ded..6930c9269 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -337,8 +337,8 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F, ok = ( V == vert.Current() ); if ( !ok ) { #ifdef _DEBUG_ - cout << "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID - << " not in face " << GetMeshDS()->ShapeToIndex( F ) << endl; + MESSAGE ( "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID + << " not in face " << GetMeshDS()->ShapeToIndex( F ) ); #endif // get UV of a vertex closest to the node double dist = 1e100; diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 45a2831d9..21690dfee 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -2114,8 +2114,8 @@ double SMESH_Pattern::setFirstEdge (list< TopoDS_Edge > & theWire, int theFirstE bndBox.Get( minPar[0], minPar[1], maxPar[0], maxPar[1] ); eBndBox.Get( eMinPar[0], eMinPar[1], eMaxPar[0], eMaxPar[1] ); #ifdef DBG_SETFIRSTEDGE - cout << "EDGES: X: " << eMinPar[0] << " - " << eMaxPar[0] << " Y: " - << eMinPar[1] << " - " << eMaxPar[1] << endl; + MESSAGE ( "EDGES: X: " << eMinPar[0] << " - " << eMaxPar[0] << " Y: " + << eMinPar[1] << " - " << eMaxPar[1] ); #endif for ( int iC = 1, i = 0; i < 2; iC++, i++ ) // loop on 2 coordinates { @@ -2141,7 +2141,7 @@ double SMESH_Pattern::setFirstEdge (list< TopoDS_Edge > & theWire, int theFirstE for ( iE = 0 ; iE < nbEdges; iE++ ) { #ifdef DBG_SETFIRSTEDGE - cout << " VARIANT " << iE << endl; + MESSAGE ( " VARIANT " << iE ); #endif // evaluate the distance between UV computed by the 2 methods: // by isos intersection ( myXYZ ) and by edge p-curves ( myUV ) @@ -2155,13 +2155,13 @@ double SMESH_Pattern::setFirstEdge (list< TopoDS_Edge > & theWire, int theFirstE TPoint* p = (*pIt); dist += ( p->myUV - gp_XY( p->myXYZ.X(), p->myXYZ.Y() )).SquareModulus(); #ifdef DBG_SETFIRSTEDGE - cout << " ISO : ( " << p->myXYZ.X() << ", "<< p->myXYZ.Y() << " ) PCURVE : ( " << - p->myUV.X() << ", " << p->myUV.Y() << ") " << endl; + MESSAGE ( " ISO : ( " << p->myXYZ.X() << ", "<< p->myXYZ.Y() << " ) PCURVE : ( " << + p->myUV.X() << ", " << p->myUV.Y() << ") " ); #endif } } #ifdef DBG_SETFIRSTEDGE - cout << "dist -- " << dist << endl; + MESSAGE ( "dist -- " << dist ); #endif if ( dist < minDist ) { minDist = dist; @@ -4655,7 +4655,7 @@ void SMESH_Pattern::DumpPoints() const #ifdef _DEBUG_ vector< TPoint >::const_iterator pVecIt = myPoints.begin(); for ( int i = 0; pVecIt != myPoints.end(); pVecIt++, i++ ) - cout << i << ": " << *pVecIt; + MESSAGE_ADD ( std::endl << i << ": " << *pVecIt ); #endif } diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 017107a34..a5d5c3f9b 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1361,7 +1361,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) _computeError = algo->GetComputeError(); } catch ( std::bad_alloc& exc ) { - printf("std::bad_alloc thrown inside algo->Compute()\n"); + MESSAGE("std::bad_alloc thrown inside algo->Compute()"); if ( _computeError ) { _computeError->myName = COMPERR_MEMORY_PB; //_computeError->myComment = exc.what(); @@ -1370,7 +1370,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) throw exc; } catch ( Standard_OutOfMemory& exc ) { - printf("Standard_OutOfMemory thrown inside algo->Compute()\n"); + MESSAGE("Standard_OutOfMemory thrown inside algo->Compute()"); if ( _computeError ) { _computeError->myName = COMPERR_MEMORY_PB; //_computeError->myComment = exc.what(); @@ -1622,15 +1622,15 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo, const TopoDS_Shape& t text << " \"" << _computeError->myComment << "\""; #ifdef _DEBUG_ - cout << text << endl; + MESSAGE_BEGIN ( text ); // Show vertices location of a failed shape TopTools_IndexedMapOfShape vMap; TopExp::MapShapes( _subShape, TopAbs_VERTEX, vMap ); - cout << "Subshape vertices " << ( vMap.Extent()>10 ? "(first 10):" : ":") << endl; + MESSAGE_ADD ( "Subshape vertices " << ( vMap.Extent()>10 ? "(first 10):" : ":") ); for ( int iv = 1; iv <= vMap.Extent() && iv < 11; ++iv ) { gp_Pnt P( BRep_Tool::Pnt( TopoDS::Vertex( vMap( iv ) ))); - cout << "#" << _father->GetMeshDS()->ShapeToIndex( vMap( iv )) << " "; - cout << P.X() << " " << P.Y() << " " << P.Z() << " " << endl; + MESSAGE_ADD ( "#" << _father->GetMeshDS()->ShapeToIndex( vMap( iv )) << " " + << P.X() << " " << P.Y() << " " << P.Z() << " " ); } #else INFOS( text ); diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index dd44ec964..add923749 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -623,9 +623,11 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB, // just set client mesh pointer to server mesh pointer //SMESH_Mesh* aMesh = reinterpret_cast(theMesh->GetMeshPtr()); CORBA::LongLong pointeur = theMesh->GetMeshPtr(); - cerr <<"SMESH_Client::SMESH_Client pointeur " << pointeur << endl; + if( MYDEBUG ) + MESSAGE("SMESH_Client::SMESH_Client pointeur "< (pointeur); - cerr <<"SMESH_Client::SMESH_Client aMesh " << aMesh << endl; + if ( MYDEBUG ) + MESSAGE("SMESH_Client::SMESH_Client aMesh "<GetMeshDS()->IsEmbeddedMode()){ mySMESHDSMesh = aMesh->GetMeshDS(); mySMDSMesh = mySMESHDSMesh; diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 7860acbca..517c33a2c 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -877,7 +877,7 @@ void SMESHGUI_ComputeOp::startOperation() } catch (...) { #ifdef _DEBUG_ - cout << "Exception thrown during mesh visualization" << endl; + MESSAGE ( "Exception thrown during mesh visualization" ); #endif if ( SMDS_Mesh::CheckMemory(true) ) { // has memory to show warning? SMESH::OnVisuException(); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index d8144f320..68cc6bf5a 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -230,8 +230,8 @@ namespace SMESH { QObject::tr("SMESH_BUT_OK")); } catch (...) { // no more memory at all: last resort - cout<< "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <GetUnstructuredGrid()->GetActualMemorySize() / 1024; if ( freeMB > 0 && usedMB * 30 > freeMB ) { #ifdef _DEBUG_ - cout << "SMESHGUI_VTKUtils::GetVisualObj(), freeMB=" << freeMB - << ", usedMB=" << usedMB<< endl; + MESSAGE ( "SMESHGUI_VTKUtils::GetVisualObj(), freeMB=" << freeMB + << ", usedMB=" << usedMB ); #endif int continu = 0; if ( usedMB * 10 > freeMB ) @@ -453,7 +453,7 @@ namespace SMESH { } catch (...) { #ifdef _DEBUG_ - cout << "Exception in SMESHGUI_VTKUtils::RepaintCurrentView()" << endl; + MESSAGE ( "Exception in SMESHGUI_VTKUtils::RepaintCurrentView()" ); #endif OnVisuException(); } @@ -471,7 +471,7 @@ namespace SMESH { } catch (...) { #ifdef _DEBUG_ - cout << "Exception in SMESHGUI_VTKUtils::RepaintViewWindow(SVTK_ViewWindow)" << endl; + MESSAGE ( "Exception in SMESHGUI_VTKUtils::RepaintViewWindow(SVTK_ViewWindow)" ); #endif OnVisuException(); } @@ -488,7 +488,7 @@ namespace SMESH { } catch (...) { #ifdef _DEBUG_ - cout << "Exception in SMESHGUI_VTKUtils::RenderViewWindow(SVTK_ViewWindow)" << endl; + MESSAGE ( "Exception in SMESHGUI_VTKUtils::RenderViewWindow(SVTK_ViewWindow)" ); #endif OnVisuException(); } @@ -505,7 +505,7 @@ namespace SMESH { } catch (...) { #ifdef _DEBUG_ - cout << "Exception in SMESHGUI_VTKUtils::FitAll()" << endl; + MESSAGE ( "Exception in SMESHGUI_VTKUtils::FitAll()" ); #endif OnVisuException(); } @@ -611,7 +611,7 @@ namespace SMESH { } catch (...) { #ifdef _DEBUG_ - cout << "Exception in SMESHGUI_VTKUtils::DisplayActor()" << endl; + MESSAGE ( "Exception in SMESHGUI_VTKUtils::DisplayActor()" ); #endif OnVisuException(); } diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index e4e4deba9..a24d8dcbe 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -136,7 +136,7 @@ SMESH_2smeshpy::ConvertScript(const TCollection_AsciiString& theScript, // finish conversion theGen->Flush(); #ifdef DUMP_CONVERSION - cout << endl << " ######## RESULT ######## " << endl<< endl; + MESSAGE_BEGIN ( std::endl << " ######## RESULT ######## " << std::endl<< std::endl ); #endif // reorder commands after conversion list< Handle(_pyCommand) >::iterator cmd; @@ -153,7 +153,7 @@ SMESH_2smeshpy::ConvertScript(const TCollection_AsciiString& theScript, for ( cmd = theGen->GetCommands().begin(); cmd != theGen->GetCommands().end(); ++cmd ) { #ifdef DUMP_CONVERSION - cout << "## COM " << (*cmd)->GetOrderNb() << ": "<< (*cmd)->GetString() << endl; + MESSAGE_ADD ( "## COM " << (*cmd)->GetOrderNb() << ": "<< (*cmd)->GetString() << std::endl ); #endif if ( !(*cmd)->IsEmpty() ) { aScript += "\n"; @@ -208,7 +208,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Handle(_pyCommand) aCommand = myCommands.back(); #ifdef DUMP_CONVERSION - cout << "## COM " << myNbCommands << ": "<< aCommand->GetString() << endl; + MESSAGE ( "## COM " << myNbCommands << ": "<< aCommand->GetString() ); #endif _pyID objID = aCommand->GetObject(); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 40a5ed521..22f99a524 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -672,12 +672,11 @@ void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID, if ( isOut ) { #ifdef _DEBUG_ - cout << "FACE " << FaceID << " (" << u << "," << v << ") out of " - << " u( " << surf.FirstUParameter() - << "," << surf.LastUParameter() - << ") v( " << surf.FirstVParameter() - << "," << surf.LastVParameter() - << ")" << endl; + MESSAGE ( "FACE " << FaceID << " (" << u << "," << v << ") out of " + << " u( " << surf.FirstUParameter() + << "," << surf.LastUParameter() + << ") v( " << surf.FirstVParameter() + << "," << surf.LastVParameter() << ")" ); #endif THROW_SALOME_CORBA_EXCEPTION("Invalid UV", SALOME::BAD_PARAM); } diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index a5d5ae2ec..60f2057d8 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -2045,7 +2045,8 @@ SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() { CORBA::LongLong pointeur = CORBA::LongLong(_impl); - cerr << "CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() " << pointeur << endl; + if ( MYDEBUG ) + MESSAGE("CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() "<& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, #ifdef _DEBUG_ if ( normPar > 1 || normPar < 0) { dump("DEBUG"); - cout << "WRONG normPar: "<()<() - << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() << endl; + MESSAGE_ADD ( "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->() + << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() ); } - cout << "\tC2d: "; - if (myC2d[i].IsNull()) cout<<"NULL"<()<() ); + } + + MESSAGE_ADD ( "\tF: "<side[i]->NbEdges(); ++e ) - cout << myTool->GetMeshDS()->ShapeToIndex( quad->side[i]->Edge( e )) << " "; - cout << ")"; + MESSAGE ( myTool->GetMeshDS()->ShapeToIndex( quad->side[i]->Edge( e )) << " " ); + MESSAGE ( ")\n" ); } - cout << endl; + //cout << endl; #endif if ( !nbSides ) nbSides = nbEdgesInWire.front();