Salome HOME
Deleted Study parameter
[plugins/netgenplugin.git] / src / NETGENPlugin / NETGENPlugin_Mesher.cxx
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;