From: imn Date: Fri, 14 Oct 2016 14:17:04 +0000 (+0300) Subject: 0023299: [CEA] Finalize multi-study removal X-Git-Tag: Before_python3_27062017^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3b6e65d4354246ee45b961a556c1362acf0b45f5;p=plugins%2Fhybridplugin.git 0023299: [CEA] Finalize multi-study removal - delete study id parameter --- diff --git a/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx b/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx index 5b50e17..820bd43 100644 --- a/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx @@ -861,7 +861,7 @@ void HYBRIDPluginGUI_HypothesisCreator::onSelectEnforcedVertex() { return; if (myEnfVertex->GetShapeType() == GEOM::VERTEX) { HYBRIDPluginGUI_HypothesisCreator* that = (HYBRIDPluginGUI_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; @@ -1362,7 +1362,7 @@ void HYBRIDPluginGUI_HypothesisCreator::onAddEnforcedVertex() 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; diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx index 02b9e78..2fffeed 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx @@ -103,8 +103,8 @@ static void removeFile( const TCollection_AsciiString& fileName ) */ //============================================================================= -HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID(int hypId, int studyId, SMESH_Gen* gen) - : SMESH_3D_Algo(hypId, studyId, gen) +HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID(int hypId, SMESH_Gen* gen) + : SMESH_3D_Algo(hypId, gen) { MESSAGE("HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID"); _name = Name(); @@ -114,18 +114,14 @@ HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID(int hypId, int studyId, SMESH_Gen* gen) _nbShape=0; _compatibleHypothesis.push_back( HYBRIDPlugin_Hypothesis::GetHypType()); //_compatibleHypothesis.push_back( StdMeshers_ViscousLayers::GetHypType() ); - _requireShape = false; // can work without shape_studyId + _requireShape = false; // can work without shape smeshGen_i = SMESH_Gen_i::GetSMESHGen(); - CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject); + CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study"); - MESSAGE("studyid = " << _studyId); - - myStudy = NULL; - myStudy = aStudyMgr->GetStudyByID(_studyId); + myStudy = SALOMEDS::Study::_narrow(anObject); if (!myStudy->_is_nil()) - MESSAGE("myStudy->StudyId() = " << myStudy->StudyId()); + MESSAGE("Study not empty"); _computeCanceled = false; } diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.hxx index face76b..17ea214 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.hxx @@ -43,7 +43,7 @@ class TopoDS_Shape; class HYBRIDPlugin_HYBRID: public SMESH_3D_Algo { public: - HYBRIDPlugin_HYBRID(int hypId, int studyId, SMESH_Gen* gen); + HYBRIDPlugin_HYBRID(int hypId, SMESH_Gen* gen); virtual ~HYBRIDPlugin_HYBRID(); virtual bool CheckHypothesis(SMESH_Mesh& aMesh, diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.cxx index 80cd00a..9cdd92d 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.cxx @@ -41,8 +41,7 @@ //============================================================================= HYBRIDPlugin_HYBRID_i::HYBRIDPlugin_HYBRID_i (PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl ) + ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), SMESH_Algo_i( thePOA ), @@ -50,8 +49,7 @@ HYBRIDPlugin_HYBRID_i::HYBRIDPlugin_HYBRID_i (PortableServer::POA_ptr thePOA, { MESSAGE( "HYBRIDPlugin_HYBRID_i::HYBRIDPlugin_HYBRID_i" ); myBaseImpl = new ::HYBRIDPlugin_HYBRID (theGenImpl->GetANewId(), - theStudyId, - theGenImpl ); + theGenImpl ); } //============================================================================= @@ -94,8 +92,8 @@ SMESH::SMESH_Mesh_ptr HYBRIDPlugin_HYBRID_i::importGMFMesh(const char* theGMFFil MESSAGE( "HYBRIDPlugin_HYBRID_i::importGMFMesh" ); SMESH_Gen_i* smeshGen = SMESH_Gen_i::GetSMESHGen(); SMESH::SMESH_Mesh_ptr theMesh = smeshGen->CreateEmptyMesh(); - smeshGen->RemoveLastFromPythonScript(smeshGen->GetCurrentStudy()->StudyId()); - SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(), theMesh); + smeshGen->RemoveLastFromPythonScript(); + SALOMEDS::SObject_ptr theSMesh = smeshGen->ObjectToSObject(theMesh); #ifdef WINNT #define SEP '\\' #else diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.hxx index e92859e..3caaa69 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.hxx @@ -44,7 +44,6 @@ class HYBRIDPlugin_HYBRID_i: public: // Constructor HYBRIDPlugin_HYBRID_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ); // Destructor virtual ~HYBRIDPlugin_HYBRID_i(); diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx index 9d929ab..673d635 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx @@ -38,8 +38,8 @@ //function : HYBRIDPlugin_Hypothesis //======================================================================= -HYBRIDPlugin_Hypothesis::HYBRIDPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen) - : SMESH_Hypothesis(hypId, studyId, gen), +HYBRIDPlugin_Hypothesis::HYBRIDPlugin_Hypothesis(int hypId, SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, gen), myToMeshHoles(DefaultMeshHoles()), myLayersOnAllWrap(DefaultLayersOnAllWrap()), myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()), diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx index 779eee5..baeca58 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx @@ -44,7 +44,7 @@ class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis: public SMESH_Hypothesis { public: - HYBRIDPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen); + HYBRIDPlugin_Hypothesis(int hypId, SMESH_Gen * gen); typedef std::map,double> THYBRIDEnforcedVertexCoordsValues; typedef std::map THYBRIDEnforcedVertexEntryValues; diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx index dbb26c5..2c8c30f 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx @@ -49,14 +49,12 @@ //function : HYBRIDPlugin_Hypothesis_i //======================================================================= HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl) + ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { MESSAGE( "HYBRIDPlugin_Hypothesis_i::HYBRIDPlugin_Hypothesis_i" ); myBaseImpl = new ::HYBRIDPlugin_Hypothesis (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } @@ -705,7 +703,6 @@ bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theV CORBA::Double x = 0, y = 0, z = 0; CORBA::Boolean isCompound = false; GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); if (theVertexEntry.empty()) { std::string aName; if (theVertex->GetShapeType() == GEOM::VERTEX) { @@ -716,7 +713,7 @@ bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theV isCompound = true; } aName += theVertex->GetEntry(); - SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -724,7 +721,7 @@ bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theV THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM ); if (theVertex->GetShapeType() == GEOM::VERTEX) { - GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations( smeshGen->GetCurrentStudy()->StudyId() ); + GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(); if (CORBA::is_nil(measureOp)) return false; @@ -751,7 +748,6 @@ bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object CORBA::Double x = 0, y = 0, z = 0; CORBA::Boolean isCompound = false; GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); if (theVertexEntry.empty()) { std::string aName; if (theVertex->GetShapeType() == GEOM::VERTEX) { @@ -762,7 +758,7 @@ bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object isCompound = true; } aName += theVertex->GetEntry(); - SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -770,7 +766,7 @@ bool HYBRIDPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object THROW_SALOME_CORBA_EXCEPTION( "Geom object is not published in study" ,SALOME::BAD_PARAM ); if (theVertex->GetShapeType() == GEOM::VERTEX) { - GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations( smeshGen->GetCurrentStudy()->StudyId() ); + GEOM::GEOM_IMeasureOperations_var measureOp = geomGen->GetIMeasureOperations(); if (CORBA::is_nil(measureOp)) return false; @@ -911,14 +907,13 @@ CORBA::Double HYBRIDPlugin_Hypothesis_i::GetEnforcedVertexGeom(GEOM::GEOM_Object std::string theVertexEntry = theVertex->GetStudyEntry(); if (theVertexEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); std::string aName; if (theVertex->GetShapeType() == GEOM::VERTEX) aName = "Vertex_"; if (theVertex->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theVertex->GetEntry(); - SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -1026,14 +1021,13 @@ bool HYBRIDPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr t std::string theVertexEntry = theVertex->GetStudyEntry(); if (theVertexEntry.empty()) { GEOM::GEOM_Gen_ptr geomGen = SMESH_Gen_i::GetGeomEngine(); - SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); std::string aName; if (theVertex->GetShapeType() == GEOM::VERTEX) aName = "Vertex_"; if (theVertex->GetShapeType() == GEOM::COMPOUND) aName = "Compound_"; aName += theVertex->GetEntry(); - SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(smeshGen->GetCurrentStudy(), NULL, theVertex, aName.c_str()); + SALOMEDS::SObject_ptr theSVertex = geomGen->PublishInStudy(NULL, theVertex, aName.c_str()); if (!theSVertex->_is_nil()) theVertexEntry = theSVertex->GetID(); } @@ -1235,7 +1229,7 @@ bool HYBRIDPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theS SMESH_Gen_i *smeshGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::SObject_ptr SObj = smeshGen->ObjectToSObject(smeshGen->GetCurrentStudy(),theSource); + SALOMEDS::SObject_ptr SObj = smeshGen->ObjectToSObject(theSource); SMESH_Mesh_i* theMesh_i = SMESH::DownCast( theSource); SMESH_Group_i* theGroup_i = SMESH::DownCast( theSource); diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx index 7c34352..1f1836f 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx @@ -45,7 +45,6 @@ class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis_i: public: // Constructor HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Destructor virtual ~HYBRIDPlugin_Hypothesis_i();