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,
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
}
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
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 );
#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
}
#ifdef DEBUG_PARAM_COMPUTE
mySumDist += distance();
- cout << " ------ SOLUTION: ( "<< myParam.X() <<" "<< myParam.Y() <<" "<< myParam.Z() <<" )"<<endl
- << " ------ DIST : " << distance() << "\t Tol=" << myTolerance << "\t Nb LOOPS=" << nbLoops << endl
- << " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist << endl;
+ MESSAGE ( " ------ SOLUTION: ( "<< myParam.X() <<" "<< myParam.Y() <<" "<< myParam.Z() <<" )"<<endl
+ << " ------ DIST : " << distance() << "\t Tol=" << myTolerance << "\t Nb LOOPS=" << nbLoops << endl
+ << " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist );
#endif
theParams = myParam;
}
#ifdef DEBUG_PARAM_COMPUTE
- cout << " #### POINT " <<thePoint.X()<<" "<<thePoint.Y()<<" "<<thePoint.Z()<<" ####"<< endl;
+ MESSAGE ( " #### POINT " <<thePoint.X()<<" "<<thePoint.Y()<<" "<<thePoint.Z()<<" ####" );
#endif
if ( myTolerance < 0 ) myTolerance = 1e-6;
return computeParameters( thePoint, theParams, solution );
}
#ifdef DEBUG_PARAM_COMPUTE
- cout << "PARAMS: ( " << params.X() <<" "<< params.Y() <<" "<< params.Z() <<" )"<< endl;
- cout << "DIST: " << sqrt( sqDist ) << endl;
+ MESSAGE ( "PARAMS: ( " << params.X() <<" "<< params.Y() <<" "<< params.Z() <<" )" );
+ MESSAGE ( "DIST: " << sqrt( sqDist ) );
#endif
if ( sqDist < sqDistance ) { // get better
#ifdef DEBUG_PARAM_COMPUTE
myNbIterations += nbLoops*4; // how many times ShellPoint called
mySumDist += sqrt( sqDistance );
- cout << " ------ SOLUTION: ( "<<solution.X()<<" "<<solution.Y()<<" "<<solution.Z()<<" )"<<endl
- << " ------ DIST : " << sqrt( sqDistance ) << "\t Tol=" << myTolerance << "\t Nb LOOPS=" << nbLoops << endl
- << " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist << endl;
+ MESSAGE ( " ------ SOLUTION: ( "<<solution.X()<<" "<<solution.Y()<<" "<<solution.Z()<<" )"<< std::endl
+ << " ------ DIST : " << sqrt( sqDistance ) << "\t Tol=" << myTolerance << "\t Nb LOOPS=" << nbLoops << std::endl
+ << " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist );
#endif
theParams = solution;
if ( iE++ > 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++ )
{
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
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: "<<endl ;
+ MESSAGE ( " Link 1: " << link[0].first->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];
{
list<const SMDS_MeshNode*>::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++) ));
}
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] ));
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;
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
{
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 )
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;
#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
}
_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();
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();
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 );
// just set client mesh pointer to server mesh pointer
//SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*>(theMesh->GetMeshPtr());
CORBA::LongLong pointeur = theMesh->GetMeshPtr();
- cerr <<"SMESH_Client::SMESH_Client pointeur " << pointeur << endl;
+ if( MYDEBUG )
+ MESSAGE("SMESH_Client::SMESH_Client pointeur "<<pointeur);
SMESH_Mesh* aMesh = reinterpret_cast<SMESH_Mesh*> (pointeur);
- cerr <<"SMESH_Client::SMESH_Client aMesh " << aMesh << endl;
+ if ( MYDEBUG )
+ MESSAGE("SMESH_Client::SMESH_Client aMesh "<<aMesh);
if(aMesh->GetMeshDS()->IsEmbeddedMode()){
mySMESHDSMesh = aMesh->GetMeshDS();
mySMDSMesh = mySMESHDSMesh;
}
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();
QObject::tr("SMESH_BUT_OK"));
} catch (...) {
// no more memory at all: last resort
- cout<< "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<endl;
- cout<< "Try to remove all visual data..." <<endl;
+ MESSAGE_BEGIN ( "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<
+ std::endl << "Try to remove all visual data..." );
if (theVISU_MemoryReserve) {
delete theVISU_MemoryReserve;
theVISU_MemoryReserve = 0;
SUIT_MessageBox::warn1 (SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_VISU_PROBLEM_CLEAR"),
QObject::tr("SMESH_BUT_OK"));
- cout<< "...done" << endl;
+ MESSAGE_END ( "...done" );
}
}
//================================================================================
}
catch (...) {
#ifdef _DEBUG_
- cout << "Exception in SMESHGUI_VTKUtils::GetVisualObj()" << endl;
+ MESSAGE ( "Exception in SMESHGUI_VTKUtils::GetVisualObj()" );
#endif
RemoveVisualObjectWithActors( theEntry ); // remove this object
OnVisuException();
int usedMB = aVisualObj->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 )
}
catch (...) {
#ifdef _DEBUG_
- cout << "Exception in SMESHGUI_VTKUtils::RepaintCurrentView()" << endl;
+ MESSAGE ( "Exception in SMESHGUI_VTKUtils::RepaintCurrentView()" );
#endif
OnVisuException();
}
}
catch (...) {
#ifdef _DEBUG_
- cout << "Exception in SMESHGUI_VTKUtils::RepaintViewWindow(SVTK_ViewWindow)" << endl;
+ MESSAGE ( "Exception in SMESHGUI_VTKUtils::RepaintViewWindow(SVTK_ViewWindow)" );
#endif
OnVisuException();
}
}
catch (...) {
#ifdef _DEBUG_
- cout << "Exception in SMESHGUI_VTKUtils::RenderViewWindow(SVTK_ViewWindow)" << endl;
+ MESSAGE ( "Exception in SMESHGUI_VTKUtils::RenderViewWindow(SVTK_ViewWindow)" );
#endif
OnVisuException();
}
}
catch (...) {
#ifdef _DEBUG_
- cout << "Exception in SMESHGUI_VTKUtils::FitAll()" << endl;
+ MESSAGE ( "Exception in SMESHGUI_VTKUtils::FitAll()" );
#endif
OnVisuException();
}
}
catch (...) {
#ifdef _DEBUG_
- cout << "Exception in SMESHGUI_VTKUtils::DisplayActor()" << endl;
+ MESSAGE ( "Exception in SMESHGUI_VTKUtils::DisplayActor()" );
#endif
OnVisuException();
}
// 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;
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";
Handle(_pyCommand) aCommand = myCommands.back();
#ifdef DUMP_CONVERSION
- cout << "## COM " << myNbCommands << ": "<< aCommand->GetString() << endl;
+ MESSAGE ( "## COM " << myNbCommands << ": "<< aCommand->GetString() );
#endif
_pyID objID = aCommand->GetObject();
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);
}
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() "<<pointeur);
return pointeur;
}
#ifdef _DEBUG_
if ( normPar > 1 || normPar < 0) {
dump("DEBUG");
- cout << "WRONG normPar: "<<normPar<< " prevNormPar="<<prevNormPar
- << " u="<<u << " myFirst[i]="<<myFirst[i]<< " myLast[i]="<<myLast[i]
- << " paramSize="<<paramSize<<endl;
+ MESSAGE ( "WRONG normPar: "<<normPar<< " prevNormPar="<<prevNormPar
+ << " u="<<u << " myFirst[i]="<<myFirst[i]<< " myLast[i]="<<myLast[i]
+ << " paramSize="<<paramSize );
}
#endif
u2node.insert( make_pair( normPar, node ));
#ifdef _DEBUG_
if ( EdgeIndex >= myEdge.size() ) {
dump("DEBUG");
- cout << "WRONg EdgeIndex " << 1+EdgeIndex
- << " myNormPar.size()="<<myNormPar.size()
- << " myNormPar["<< EdgeIndex<<"]="<< myNormPar[ EdgeIndex ]
- << " uvPt.normParam="<<uvPt.normParam <<endl;
+ MESSAGE ( "WRONg EdgeIndex " << 1+EdgeIndex
+ << " myNormPar.size()="<<myNormPar.size()
+ << " myNormPar["<< EdgeIndex<<"]="<< myNormPar[ EdgeIndex ]
+ << " uvPt.normParam="<<uvPt.normParam );
}
#endif
paramSize = myNormPar[ EdgeIndex ] - prevNormPar;
void StdMeshers_FaceSide::dump(const char* msg) const
{
#ifdef _DEBUG_
- cout << endl;
- if (msg) cout << msg <<endl;
- cout<<"NB EDGES: "<< myEdge.size() <<endl;
- cout << "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() <<endl;
+ if (msg) MESSAGE ( std::endl << msg );
+ MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() );
+ MESSAGE_ADD ( "nbPoints: "<<myNbPonits<<" vecSize: " << myPoints.size()<<" "<<myFalsePoints.size() );
for ( int i=0; i<myEdge.size(); ++i)
{
- cout << "\t"<<i+1<<endl;
- cout << "\tEDGE: ";
- if (myEdge[i].IsNull())
- cout<<"NULL"<<endl;
+ MESSAGE_ADD ( "\t"<<i+1 );
+ MESSAGE_ADD ( "\tEDGE: " );
+ if (myEdge[i].IsNull()) {
+ MESSAGE_ADD ( "NULL" );
+ }
else {
TopAbs::Print(myEdge[i].Orientation(),cout)<<" "<<myEdge[i].TShape().operator->()<<endl;
- cout << "\tV1: " << TopExp::FirstVertex( myEdge[i], 1).TShape().operator->()
- << " 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->() );
+ }
+ MESSAGE_ADD ( "\tC2d: ");
+
+ if (myC2d[i].IsNull()) {
+ MESSAGE_ADD ( "NULL" );
+ }
+ else {
+ MESSAGE_ADD ( myC2d[i].operator->() );
}
- cout << "\tC2d: ";
- if (myC2d[i].IsNull()) cout<<"NULL"<<endl;
- else cout << myC2d[i].operator->()<<endl;
- cout << "\tF: "<<myFirst[i]<< " L: "<< myLast[i]<<endl;
- cout << "\tnormPar: "<<myNormPar[i]<<endl;
+
+ MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
+ MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
}
#endif
}
}
if (nbSides != 4) {
#ifdef _DEBUG_
- cout << endl << "StdMeshers_Quadrangle_2D. Edge IDs of " << nbSides << " sides:";
+ MESSAGE ( "StdMeshers_Quadrangle_2D. Edge IDs of " << nbSides << " sides:\n" );
for ( int i = 0; i < nbSides; ++i ) {
- cout << " ( ";
+ MESSAGE ( " ( " );
for ( int e = 0; e < quad->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();