From: imn Date: Fri, 14 Oct 2016 13:56:26 +0000 (+0300) Subject: 0023299: [CEA] Finalize multi-study removal X-Git-Tag: Before_python3_27062017^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6174650731fc6ef090484660205e9896d4c7cf55;p=plugins%2Fblsurfplugin.git 0023299: [CEA] Finalize multi-study removal - delete study id parameter --- diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 655aa9c..568f3dd 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -238,9 +238,8 @@ bool HasSizeMapOnVertex=false; */ //============================================================================= -BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, int studyId, - SMESH_Gen* gen) - : SMESH_2D_Algo(hypId, studyId, gen) +BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, SMESH_Gen* gen) + : SMESH_2D_Algo(hypId, gen) { MESSAGE("BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF"); @@ -254,15 +253,10 @@ BLSURFPlugin_BLSURF::BLSURFPlugin_BLSURF(int hypId, int studyId, _supportSubmeshes = true; smeshGen_i = SMESH_Gen_i::GetSMESHGen(); - CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject); - - MESSAGE("studyid = " << _studyId); - - myStudy = NULL; - myStudy = aStudyMgr->GetStudyByID(_studyId); + CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study"); + myStudy = SALOMEDS::Study::_narrow(anObject); if ( !myStudy->_is_nil() ) - MESSAGE("myStudy->StudyId() = " << myStudy->StudyId()); + MESSAGE("myStudy not empty"); /* Initialize the Python interpreter */ assert(Py_IsInitialized()); diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx index 1a98332..bd51354 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.hxx @@ -75,7 +75,7 @@ class TopoDS_Shape; class BLSURFPlugin_BLSURF: public SMESH_2D_Algo { public: - BLSURFPlugin_BLSURF(int hypId, int studyId, SMESH_Gen* gen); + BLSURFPlugin_BLSURF(int hypId, SMESH_Gen* gen); virtual ~BLSURFPlugin_BLSURF(); diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx index 249470a..b223515 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.cxx @@ -37,7 +37,6 @@ //============================================================================= BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), @@ -46,7 +45,6 @@ BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA, { MESSAGE( "BLSURFPlugin_BLSURF_i::BLSURFPlugin_BLSURF_i" ); myBaseImpl = new ::BLSURFPlugin_BLSURF( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx index 15a0a5f..3d382ee 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF_i.hxx @@ -41,7 +41,6 @@ class BLSURFPlugin_BLSURF_i: public: // Constructor BLSURFPlugin_BLSURF_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ); // Destructor virtual ~BLSURFPlugin_BLSURF_i(); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 5e8c8cd..cf5f574 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -49,8 +49,8 @@ namespace } //============================================================================= -BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen) : - SMESH_Hypothesis(hypId, studyId, gen), +BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen) : + SMESH_Hypothesis(hypId, gen), _physicalMesh(GetDefaultPhysicalMesh()), _geometricMesh(GetDefaultGeometricMesh()), _phySize(GetDefaultPhySize()), @@ -247,7 +247,7 @@ TopoDS_Shape BLSURFPlugin_Hypothesis::entryToShape(std::string entry) MESSAGE("BLSURFPlugin_Hypothesis::entryToShape "<GetCurrentStudy(); + SALOMEDS::Study_ptr myStudy = smeshGen_i->GetStudy(); TopoDS_Shape S = TopoDS_Shape(); SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() ); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index f6e40b4..1d8c200 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -43,7 +43,7 @@ class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis { public: - BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen); + BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen); enum Topology { FromCAD, diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index e5c3c0d..8939ad5 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -46,11 +46,11 @@ using namespace std; * Constructor */ //============================================================================= -BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId, +BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i(thePOA), SMESH_Hypothesis_i(thePOA) { MESSAGE( "BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i" ); - myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theStudyId, theGenImpl); + myBaseImpl = new ::BLSURFPlugin_Hypothesis(theGenImpl->GetANewId(), theGenImpl); } //============================================================================= @@ -2019,13 +2019,12 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace, theAttEntry = theAttractor->GetStudyEntry(); GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFaceEntry.empty()) { aName = "Face_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2042,7 +2041,7 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorGeom(GEOM::GEOM_Object_ptr theFace, if (theAttractor->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theAttractor->GetEntry(); - SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theAttractor, aName.c_str()); + SALOMEDS::SObject_wrap theSAtt = geomGen->PublishInStudy(NULL, theAttractor, aName.c_str()); if (!theSAtt->_is_nil()) theAttEntry = theSAtt->GetID(); } @@ -2064,13 +2063,12 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorGeom(GEOM::GEOM_Object_ptr theFace CORBA::String_var theAttrEntry = theAttractor->GetStudyEntry(); // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - // SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); // string aName; // if (theFaceEntry.empty()) { // aName = "Face_"; // aName += theFace->GetEntry(); - // SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + // SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); // if (!theSFace->_is_nil()) // theFaceEntry = theSFace->GetID(); // } @@ -2494,14 +2492,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2532,14 +2529,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr the if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2573,7 +2569,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF } // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId()); + // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(); // if (CORBA::is_nil(measureOp)) // return false; // @@ -2585,7 +2581,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF string theVertexEntry = theVertex->GetStudyEntry(); GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFaceEntry.empty()) { @@ -2594,7 +2589,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2607,7 +2602,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF if (theVertex->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theVertex->GetEntry(); - SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -2642,14 +2637,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2682,14 +2676,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Objec if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2726,7 +2719,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object string theVertexEntry = theVertex->GetStudyEntry(); GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFaceEntry.empty()) { @@ -2735,7 +2727,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2748,7 +2740,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object if (theVertex->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theVertex->GetEntry(); - SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -2783,14 +2775,13 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object // if (theFaceEntry.empty()) { // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); -// SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); // string aName; // if (theFace->GetShapeType() == GEOM::FACE) // aName = "Face_"; // if (theFace->GetShapeType() == GEOM::COMPOUND) // aName = "Compound_"; // aName += theFace->GetEntry(); -// SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); +// SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); // if (!theSFace->_is_nil()) // theFaceEntry = theSFace->GetID(); // } @@ -2822,14 +2813,13 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2858,14 +2848,13 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFac if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2895,7 +2884,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th } // GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(this->GetImpl()->GetStudyId()); + // GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(); // if (CORBA::is_nil(measureOp)) // return false; // @@ -2907,7 +2896,6 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th std::string theVertexEntry = theVertex->GetStudyEntry(); GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFaceEntry.empty()) { @@ -2916,7 +2904,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -2929,7 +2917,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th if (theVertex->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theVertex->GetEntry(); - SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_wrap theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -2957,14 +2945,13 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -3284,14 +3271,13 @@ void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Ob if (theFaceEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; if (theFace->GetShapeType() == GEOM::FACE) aName = "Face_"; if (theFace->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theFace->GetEntry(); - SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theFace, aName.c_str()); + SALOMEDS::SObject_wrap theSFace = geomGen->PublishInStudy(NULL, theFace, aName.c_str()); if (!theSFace->_is_nil()) theFaceEntry = theSFace->GetID(); } @@ -3441,7 +3427,6 @@ std::string BLSURFPlugin_Hypothesis_i::PublishIfNeeded(GEOM::GEOM_Object_ptr sha string shapeEntry = shape->GetStudyEntry(); GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); string aName; // Publish shape if needed @@ -3449,7 +3434,7 @@ std::string BLSURFPlugin_Hypothesis_i::PublishIfNeeded(GEOM::GEOM_Object_ptr sha if (shape->GetShapeType() == theShapeType) aName = prefix; aName += shape->GetEntry(); - SALOMEDS::SObject_wrap theSFace1 = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, shape, aName.c_str()); + SALOMEDS::SObject_wrap theSFace1 = geomGen->PublishInStudy(NULL, shape, aName.c_str()); if (!theSFace1->_is_nil()) shapeEntry = theSFace1->GetID(); } diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index eeb20c3..3e19cd4 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -41,7 +41,7 @@ class BLSURFPlugin_Hypothesis_i: public virtual POA_BLSURFPlugin::BLSURFPlugin_H public virtual SMESH_Hypothesis_i { public: // Constructor - BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, int theStudyId, ::SMESH_Gen* theGenImpl); + BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl); // Destructor virtual ~BLSURFPlugin_Hypothesis_i(); diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index e8c27d1..7d9341d 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -1283,7 +1283,7 @@ void BLSURFPluginGUI_HypothesisCreator::onSelectEnforcedVertex() { myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1); if (myEnfVertex->GetShapeType() == GEOM::VERTEX) { BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; - GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() ); + GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations(); if (CORBA::is_nil(measureOp)) return; @@ -1506,7 +1506,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { if ( CORBA::is_nil(getGeomEngine())) return; - GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() ); + GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations(); if (CORBA::is_nil(measureOp)) return; @@ -3385,7 +3385,7 @@ LightApp_SelectionMgr* BLSURFPluginGUI_HypothesisCreator::selectionMgr() CORBA::Object_var BLSURFPluginGUI_HypothesisCreator::entryToObject(QString entry) { SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::Study_var myStudy = smeshGen_i->GetCurrentStudy(); + SALOMEDS::Study_var myStudy = smeshGen_i->GetStudy(); CORBA::Object_var obj; SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.toStdString().c_str() ); if (!aSObj->_is_nil()) { diff --git a/tests/test_periodicity_reflexion_2D_precad.py b/tests/test_periodicity_reflexion_2D_precad.py index f8674fe..975258f 100644 --- a/tests/test_periodicity_reflexion_2D_precad.py +++ b/tests/test_periodicity_reflexion_2D_precad.py @@ -119,7 +119,7 @@ def checkProjection(gr, mesh_translated, tol=1e-7): checkProjection(gr_right, bottom_rotated) -#salome.myStudyManager.SaveAs("test.hdf", salome.myStudy, 0) +#salome.myStudy.SaveAs("test.hdf", 0) if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(True)