X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i_1.cxx;h=a667ba59fcb13a21528c624c0b2f42204b09992e;hp=565fa023b9dba96b1315eda8f794869858892e1e;hb=HEAD;hpb=01fd8ef50632672adfeaad86c15b5cbed84a356b diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 565fa023b..0d2ff3d6f 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -46,12 +46,6 @@ #include -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - using namespace std; //============================================================================= @@ -162,7 +156,7 @@ long SMESH_Gen_i::GetBallElementsGroupsTag() bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) { - if(MYDEBUG) MESSAGE("CanPublishInStudy - "<_is_nil() ) return true; - if(MYDEBUG) MESSAGE("CanPublishInStudy--CANT"); + MESSAGE("CanPublishInStudy--CANT"); return false; } @@ -282,10 +276,10 @@ GEOM::GEOM_Object_ptr SMESH_Gen_i::GetGeomObjectByEntry( const std::string& entr //======================================================================= SALOMEDS::SObject_ptr SMESH_Gen_i::publish(CORBA::Object_ptr theIOR, - SALOMEDS::SObject_ptr theFatherObject, - const int theTag, - const char* thePixMap, - const bool theSelectable) + SALOMEDS::SObject_ptr theFatherObject, + const int theTag, + const char* thePixMap, + const bool theSelectable) { SALOMEDS::Study_var theStudy = getStudyServant(); SALOMEDS::SObject_wrap SO = ObjectToSObject( theIOR ); @@ -501,7 +495,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr /*theSOb return aSO._retn(); if ( CORBA::is_nil( theIOR )) return aSO._retn(); - if(MYDEBUG) MESSAGE("PublishInStudy"); + MESSAGE("PublishInStudy"); // Publishing a mesh SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( theIOR ); @@ -528,26 +522,26 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr /*theSOb aMesh = aGroup->GetMesh(); aSO = PublishGroup( aMesh, aGroup, aShapeObject, theName ); } - if(MYDEBUG) MESSAGE("PublishInStudy_END"); + MESSAGE("PublishInStudy_END"); return aSO._retn(); } //======================================================================= //function : PublishComponent -//purpose : +//purpose : //======================================================================= SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent() { - if(MYDEBUG) MESSAGE("PublishComponent"); + MESSAGE("PublishComponent"); if ( !myIsEnablePublish ) return SALOMEDS::SComponent::_nil(); SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder(); SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder(); - std::string compDataType = ComponentDataType(); // SMESH module's data type + CORBA::String_var compDataType = ComponentDataType(); // SMESH module's data type std::string ior; { CORBA::String_var iorString = GetORB()->object_to_string( SMESH_Gen::_this() ); @@ -562,12 +556,13 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent() CORBA::String_var ior_i; bool ok = f_i->ComponentIOR(ior_i.out()); CORBA::String_var cdt(f_i->ComponentDataType()); - if ( ok && compDataType == cdt.in() && ior == ior_i.in()) { + if ( ok && strcmp( compDataType.in(), cdt.in() ) == 0 && ior == ior_i.in()) + { father = f_i; break; } } - + if ( !CORBA::is_nil( father ) ) { // check that the component is added to the use case browser if ( !useCaseBuilder->IsUseCaseNode( father ) ) { @@ -583,14 +578,14 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent() if ( CORBA::is_nil( aCat ) ) return father._retn(); - SALOME_ModuleCatalog::Acomponent_var aComp = aCat->GetComponent( compDataType.c_str() ); + SALOME_ModuleCatalog::Acomponent_var aComp = aCat->GetComponent( compDataType.in() ); if ( CORBA::is_nil( aComp ) ) return father._retn(); SALOMEDS::GenericAttribute_wrap anAttr; SALOMEDS::AttributePixMap_wrap aPixmap; - father = aStudyBuilder->NewComponent( compDataType.c_str() ); + father = aStudyBuilder->NewComponent( compDataType.in() ); aStudyBuilder->DefineComponentInstance( father, SMESH_Gen::_this() ); anAttr = aStudyBuilder->FindOrCreateAttribute( father, "AttributePixMap" ); aPixmap = anAttr; @@ -601,7 +596,7 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent() // (to support tree representation customization and drag-n-drop) useCaseBuilder->SetRootCurrent(); useCaseBuilder->Append( father ); // component object is added as the top level item - if(MYDEBUG) MESSAGE("PublishComponent--END"); + MESSAGE("PublishComponent--END"); return father._retn(); } @@ -618,7 +613,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh, return SALOMEDS::SObject::_nil(); if ( CORBA::is_nil( theMesh )) return SALOMEDS::SObject::_nil(); - if(MYDEBUG) MESSAGE("PublishMesh--IN"); + MESSAGE("PublishMesh--IN"); // find or publish a mesh @@ -689,7 +684,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh, } } - if(MYDEBUG) MESSAGE("PublishMesh_END"); + MESSAGE("PublishMesh_END"); return aMeshSO._retn(); } @@ -899,7 +894,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp, const char* theName) { - if(MYDEBUG) MESSAGE("PublishHypothesis"); + MESSAGE("PublishHypothesis"); if ( !myIsEnablePublish ) return SALOMEDS::SObject::_nil(); if (theHyp->_is_nil()) @@ -934,7 +929,7 @@ SMESH_Gen_i::PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp, SetName( aHypSO, theName, hypType.in() ); - if(MYDEBUG) MESSAGE("PublishHypothesis--END") + MESSAGE("PublishHypothesis--END"); return aHypSO._retn(); } @@ -1096,7 +1091,7 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShape) { - if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape") + MESSAGE("GetMeshOrSubmeshByShape"); SALOMEDS::SObject_wrap aMeshOrSubMesh; if (theMesh->_is_nil() || ( theShape->_is_nil() && theMesh->HasShapeToMesh())) return aMeshOrSubMesh._retn(); @@ -1120,7 +1115,7 @@ SMESH_Gen_i::GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh, aMeshOrSubMesh = ObjectToSObject( aSubMesh ); } } - if(MYDEBUG) MESSAGE("GetMeshOrSubmeshByShape--END") + MESSAGE("GetMeshOrSubmeshByShape--END"); return aMeshOrSubMesh._retn(); } @@ -1133,7 +1128,7 @@ bool SMESH_Gen_i::AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShape, SMESH::SMESH_Hypothesis_ptr theHyp) { - if(MYDEBUG) MESSAGE("AddHypothesisToShape") + MESSAGE("AddHypothesisToShape"); if (theMesh->_is_nil() || theHyp->_is_nil() || (theShape->_is_nil() && theMesh->HasShapeToMesh()) ) @@ -1174,7 +1169,7 @@ bool SMESH_Gen_i::AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh, addReference( AHR, theHyp ); - if(MYDEBUG) MESSAGE("AddHypothesisToShape--END") + MESSAGE("AddHypothesisToShape--END"); return true; }