]> SALOME platform Git repositories - plugins/hybridplugin.git/commitdiff
Salome HOME
0023299: [CEA] Finalize multi-study removal mpa/23299
authorimn <imn@opencascade.com>
Fri, 14 Oct 2016 14:17:04 +0000 (17:17 +0300)
committerimn <imn@opencascade.com>
Fri, 14 Oct 2016 14:17:04 +0000 (17:17 +0300)
- delete study id parameter

src/GUI/HYBRIDPluginGUI_HypothesisCreator.cxx
src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx
src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.hxx
src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.cxx
src/HYBRIDPlugin/HYBRIDPlugin_HYBRID_i.hxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.cxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis.hxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.cxx
src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx

index 5b50e170870d65503cc957b5db4c251b0f222403..820bd432b5813b2d0ffa04c606b718c7ad5ffc63 100644 (file)
@@ -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;
 
index 02b9e78c3d4c2065d70a7e6c228c1608c6c16e77..2fffeed12e5a2457186998cfac0052f1cad02f69 100644 (file)
@@ -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;
 }
index face76b2f6d3662aaa533d586b9cda8083be9046..17ea214558e0e33a44cef3b988bb6a7b1a965efb 100644 (file)
@@ -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,
index 80cd00a5404ecd5873939a40f9edccd233c36eb8..9cdd92ddbaee09326d98271832ba61c27b5ae5f3 100644 (file)
@@ -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
index e92859e2986aa1b653505f171e3538f6324f5bf2..3caaa69a83dd2fd38d66b18cfcd9527900819c20 100644 (file)
@@ -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();
index 9d929ab33b78dc39695015c20642c236bb43f3f4..673d63597e564b4e744cd6560c1ac40d110a753f 100644 (file)
@@ -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()),
index 779eee5d5c830cdebd32bb0e2c168faff5bac292..baeca583eae5bc0f1c35b6c6f98612ed672f9e89 100644 (file)
@@ -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<std::vector<double>,double> THYBRIDEnforcedVertexCoordsValues;
   typedef std::map<std::string,double> THYBRIDEnforcedVertexEntryValues;
index dbb26c50a845ae3739c86fd3a13b8e5a7fffa47e..2c8c30f5c3d8b2bcd4c57c987ecfc8b203973883 100644 (file)
 //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<SMESH_Mesh_i*>( theSource);
   SMESH_Group_i* theGroup_i = SMESH::DownCast<SMESH_Group_i*>( theSource);
index 7c343525f79d822428949b03a697ac319c2097b9..1f1836f2a0b04bb68b20a1c9885ee4a0de38cf91 100644 (file)
@@ -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();