]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
Deleted Study parameter mpa/23299
authormpa <mpa@opencascade.com>
Fri, 3 Feb 2017 13:17:42 +0000 (16:17 +0300)
committermpa <mpa@opencascade.com>
Fri, 3 Feb 2017 13:17:42 +0000 (16:17 +0300)
doc/salome/examples/ghs3d_enfmesh.py
doc/salome/examples/ghs3d_enfvert.py
doc/salome/examples/ghs3ddemo.py
src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx
src/GHS3DPlugin/GHS3DPlugin_GHS3D.hxx
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx

index b6ca8ec69f3b25b0dda1aacb86e5d787963b0a37..ab074348216b7c2b2684c7c1ad6df91b8a32ff6e 100644 (file)
@@ -31,11 +31,11 @@ import salome
 salome.salome_init()
 import GEOM
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH, SALOMEDS
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 box = geompy.MakeBoxDXDYDZ(200, 200, 200)
 geompy.addToStudy( box, "box" )
index f8ba666a44ba9fb5f5d698f354dd6e3ed421bb14..75ed204e531e1673043d4cbd284c1ae097a693e8 100644 (file)
@@ -33,11 +33,11 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 import SMESH
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
index 41478121a8bf72c9e5b999a9155e6366c19621cd..f28de37b511c7380c0db28d33bce94b84242422e 100644 (file)
@@ -21,10 +21,10 @@ import salome
 salome.salome_init()
 
 from salome.geom import geomBuilder
-geompy = geomBuilder.New(salome.myStudy)
+geompy = geomBuilder.New()
 
 from salome.smesh import smeshBuilder
-smesh =  smeshBuilder.New(salome.myStudy)
+smesh =  smeshBuilder.New()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
index 07620bbdf25934fe51fe897d866998e0d93ff43c..daad21397b37f8bf56b1acfebc326f61289403b9 100644 (file)
@@ -144,13 +144,6 @@ GHS3DPlugin_GHS3D::GHS3DPlugin_GHS3D(int hypId, SMESH_Gen* gen)
   _compatibleHypothesis.push_back( GHS3DPlugin_Hypothesis::GetHypType());
   _compatibleHypothesis.push_back( StdMeshers_ViscousLayers::GetHypType() );
   _requireShape = false; // can work without shape
-
-  _smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-  CORBA::Object_var anObject = _smeshGen_i->GetNS()->Resolve("/Study");
-  _study = SALOMEDS::Study::_narrow(anObject);
-
-  if (!_study->_is_nil())
-    MESSAGE("Study not empty");
   
   _computeCanceled = false;
   _progressAdvance = 1e-4;
@@ -217,18 +210,17 @@ bool GHS3DPlugin_GHS3D::CheckHypothesis ( SMESH_Mesh&         aMesh,
 TopoDS_Shape GHS3DPlugin_GHS3D::entryToShape(std::string entry)
 {
   MESSAGE("GHS3DPlugin_GHS3D::entryToShape "<<entry );
-  if ( _study->_is_nil() )
-    throw SALOME_Exception("MG-Tetra plugin can't work w/o publishing in the study");
+
   GEOM::GEOM_Object_var aGeomObj;
   TopoDS_Shape S = TopoDS_Shape();
-  SALOMEDS::SObject_var aSObj = _study->FindObjectID( entry.c_str() );
+  SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( entry.c_str() );
   if (!aSObj->_is_nil() ) {
     CORBA::Object_var obj = aSObj->GetObject();
     aGeomObj = GEOM::GEOM_Object::_narrow(obj);
     aSObj->UnRegister();
   }
   if ( !aGeomObj->_is_nil() )
-    S = _smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+    S = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( aGeomObj.in() );
   return S;
 }
 
index def150367fc1f0c6303d23b7e0659362817fe8cd..a52924f627835c2bffb1df2b0a83194c98048008 100644 (file)
@@ -96,8 +96,6 @@ private:
   bool                _keepFiles;
   bool                _removeLogOnSuccess;
   bool                _logInStandardOutput;
-  SALOMEDS::Study_var _study;
-  SMESH_Gen_i*        _smeshGen_i;
 
   bool                _isLibUsed;
   double              _progressAdvance;
index 4ffc77c80b78b7e6e5c2f9634c1f5428172a1944..051b40347b22f295b1187c3d74a117f099bd05a1 100644 (file)
@@ -309,14 +309,13 @@ GHS3DPluginGUI_HypothesisCreator::~GHS3DPluginGUI_HypothesisCreator()
 }
 
 /**
- * \brief {Get or create the geom selection tool for active study}
+ * \brief {Get or create the geom selection tool for study}
  * */
 GeomSelectionTools* GHS3DPluginGUI_HypothesisCreator::getGeomSelectionTool()
 {
   GHS3DPluginGUI_HypothesisCreator* that = (GHS3DPluginGUI_HypothesisCreator*)this;
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-  if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) {
-    that->GeomToolSelected = new GeomSelectionTools(aStudy);
+  if (that->GeomToolSelected == NULL) {
+    that->GeomToolSelected = new GeomSelectionTools();
   }
   return that->GeomToolSelected;
 }
@@ -1153,7 +1152,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
   int elementType = myEnfMeshConstraint->currentIndex();
   
   
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+  _PTR(Study) aStudy = SMESH::getStudy();
   _PTR(SObject) aSObj; //SMESH::SMESH_IDSource::_nil;
   QString meshEntry = myEnfMeshWdg->GetValue();
   MESSAGE("myEnfMeshWdg->GetValue()" << meshEntry.toStdString());
@@ -1164,7 +1163,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
 //     myEnfMesh = myEnfMeshWdg->GetObject< SMESH::SMESH_IDSource >();
 //     std::string entry = myEnfMeshWdg->GetValue();
     aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
-    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
+    CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
     if (!CORBA::is_nil(anObj)) {
 //       SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
       addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
@@ -1177,7 +1176,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh()
     QStringListIterator meshEntriesIt (meshEntries);
     while (meshEntriesIt.hasNext()) {
       aSObj = aStudy->FindObjectID(meshEntriesIt.next().toStdString().c_str());
-      CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj,aStudy);
+      CORBA::Object_var anObj = SMESH::SObjectToObject(aSObj);
       if (!CORBA::is_nil(anObj)) {
 //         SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
         addEnforcedMesh( aSObj->GetName(), aSObj->GetID(), elementType, groupName);
@@ -1787,7 +1786,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
     
     TEnfMeshList::const_iterator itEnfMesh;
 
-    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+    _PTR(Study) aStudy = SMESH::getStudy();
 
     for(itEnfMesh = h_data.myEnforcedMeshes.begin() ; itEnfMesh != h_data.myEnforcedMeshes.end(); itEnfMesh++ ) {
       TEnfMesh* enfMesh = (*itEnfMesh);