]> SALOME platform Git repositories - plugins/netgenplugin.git/commitdiff
Salome HOME
Deleted Study parameter mpa/23299
authormpa <mpa@opencascade.com>
Fri, 3 Feb 2017 13:22:00 +0000 (16:22 +0300)
committermpa <mpa@opencascade.com>
Fri, 3 Feb 2017 13:22:00 +0000 (16:22 +0300)
doc/salome/examples/netgendemo.py
src/GUI/NETGENPluginGUI_HypothesisCreator.cxx
src/NETGENPlugin/NETGENPlugin_Mesher.cxx

index 2cc73a0ed84bb26b8d04ec54e1b3da11b755e90a..c2f31b0d4b1b0615af12f7befa6873974241607d 100644 (file)
@@ -4,11 +4,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()
 
 # create a box
 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
index 2db7d1ed1775ce88dceba43cd7cde7122bdbd8b5..dd4aeda973c2d794e19170813e59f8c661da7bbd 100644 (file)
@@ -767,10 +767,9 @@ void NETGENPluginGUI_HypothesisCreator::onSetSizeFile()
 
 GeomSelectionTools* NETGENPluginGUI_HypothesisCreator::getGeomSelectionTools()
 {
-  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-  if (myGeomSelectionTools == NULL || myGeomSelectionTools->getMyStudy() != aStudy) {
+  if (myGeomSelectionTools == NULL) {
     delete myGeomSelectionTools;
-    myGeomSelectionTools = new GeomSelectionTools(aStudy);
+    myGeomSelectionTools = new GeomSelectionTools();
   }
   return myGeomSelectionTools;
 }
index 6082f9502095e3863ff4478336615aa53a2f829e..01f9c8cca04c3e5caaaeb63cb721d5cfa89712de 100644 (file)
@@ -287,27 +287,23 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
     mparams.meshsizefilename= hyp->GetMeshSizeFile().empty() ? 0 : hyp->GetMeshSizeFile().c_str();
 
     SMESH_Gen_i*              smeshGen_i = SMESH_Gen_i::GetSMESHGen();
-    CORBA::Object_var           anObject = smeshGen_i->GetNS()->Resolve("/Study");
-    SALOMEDS::Study_var          myStudy = SALOMEDS::Study::_narrow(anObject);
-    if ( !myStudy->_is_nil() )
+
+    const NETGENPlugin_Hypothesis::TLocalSize   localSizes = hyp->GetLocalSizesAndEntries();
+    NETGENPlugin_Hypothesis::TLocalSize::const_iterator it = localSizes.begin();
+    for ( ; it != localSizes.end() ; it++)
     {
-      const NETGENPlugin_Hypothesis::TLocalSize   localSizes = hyp->GetLocalSizesAndEntries();
-      NETGENPlugin_Hypothesis::TLocalSize::const_iterator it = localSizes.begin();
-      for ( ; it != localSizes.end() ; it++)
-      {
-        std::string entry = (*it).first;
-        double        val = (*it).second;
-        // --
-        GEOM::GEOM_Object_var aGeomObj;
-        SALOMEDS::SObject_var aSObj = myStudy->FindObjectID( entry.c_str() );
-        if ( !aSObj->_is_nil() ) {
-          CORBA::Object_var obj = aSObj->GetObject();
-          aGeomObj = GEOM::GEOM_Object::_narrow(obj);
-          aSObj->UnRegister();
-        }
-        TopoDS_Shape S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
-        ::SetLocalSize(S, val);
+      std::string entry = (*it).first;
+      double        val = (*it).second;
+      // --
+      GEOM::GEOM_Object_var aGeomObj;
+      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();
       }
+      TopoDS_Shape S = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+      ::SetLocalSize(S, val);
     }
   }
 }
@@ -1630,7 +1626,7 @@ void NETGENPlugin_Mesher::AddIntVerticesInSolids(const netgen::OCCGeometry&
   ofstream py(DUMP_TRIANGLES_SCRIPT);
   py << "import SMESH"<< endl
      << "from salome.smesh import smeshBuilder"<<endl
-     << "smesh = smeshBuilder.New(salome.myStudy)"<<endl
+     << "smesh = smeshBuilder.New()"<<endl
      << "m = smesh.Mesh(name='triangles')" << endl;
 #endif
   if ((int) nodeVec.size() < ngMesh.GetNP() )
@@ -3483,7 +3479,7 @@ void NETGENPlugin_Mesher::toPython( const netgen::Mesh* ngMesh )
 
   outfile << "import SMESH" << endl
           << "from salome.smesh import smeshBuilder" << endl
-          << "smesh = smeshBuilder.New(salome.myStudy)" << endl
+          << "smesh = smeshBuilder.New()" << endl
           << "mesh = smesh.Mesh()" << endl << endl;
 
   using namespace netgen;