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);
}
}
}
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() )
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;