From: mpa Date: Fri, 3 Feb 2017 13:22:00 +0000 (+0300) Subject: Deleted Study parameter X-Git-Tag: Before_python3_27062017^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmpa%2F23299;p=plugins%2Fnetgenplugin.git Deleted Study parameter --- diff --git a/doc/salome/examples/netgendemo.py b/doc/salome/examples/netgendemo.py index 2cc73a0..c2f31b0 100644 --- a/doc/salome/examples/netgendemo.py +++ b/doc/salome/examples/netgendemo.py @@ -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.) diff --git a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx index 2db7d1e..dd4aeda 100644 --- a/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/NETGENPluginGUI_HypothesisCreator.cxx @@ -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; } diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 6082f95..01f9c8c 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -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"<