From: mpa Date: Fri, 3 Feb 2017 13:19:33 +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=00605d35bd9d55aca3499700b9d0237531b5a1f5;p=plugins%2Fhexoticplugin.git Deleted Study parameter --- diff --git a/doc/salome/examples/hexoticdemo.py b/doc/salome/examples/hexoticdemo.py index f346bb8..f221c72 100644 --- a/doc/salome/examples/hexoticdemo.py +++ b/doc/salome/examples/hexoticdemo.py @@ -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 sphere diff --git a/doc/salome/examples/hexoticdemo_vl.py b/doc/salome/examples/hexoticdemo_vl.py index 2ae8e11..c28dc83 100644 --- a/doc/salome/examples/hexoticdemo_vl.py +++ b/doc/salome/examples/hexoticdemo_vl.py @@ -19,14 +19,13 @@ import salome salome.salome_init() -theStudy = salome.myStudy 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 geometry Box_1 = geompy.MakeBoxDXDYDZ(50, 50, 50) diff --git a/doc/salome/examples/hexoticsubdom1.py b/doc/salome/examples/hexoticsubdom1.py index 8781911..c570ec5 100644 --- a/doc/salome/examples/hexoticsubdom1.py +++ b/doc/salome/examples/hexoticsubdom1.py @@ -21,11 +21,11 @@ import salome salome.salome_init() 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 geometry: a box cut by a holed sphere diff --git a/doc/salome/examples/hexoticsubdom2.py b/doc/salome/examples/hexoticsubdom2.py index 500270a..1217806 100644 --- a/doc/salome/examples/hexoticsubdom2.py +++ b/doc/salome/examples/hexoticsubdom2.py @@ -21,11 +21,11 @@ import salome salome.salome_init() 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 geometry: a box cut by a holed sphere Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) diff --git a/doc/salome/examples/hexoticsubdom3.py b/doc/salome/examples/hexoticsubdom3.py index ef7cc20..0f6898e 100644 --- a/doc/salome/examples/hexoticsubdom3.py +++ b/doc/salome/examples/hexoticsubdom3.py @@ -21,11 +21,11 @@ import salome salome.salome_init() 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 geometry: a box cut by a holed sphere Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) diff --git a/doc/salome/examples/hexoticsubdom4.py b/doc/salome/examples/hexoticsubdom4.py index 8683d37..ee3bb5f 100644 --- a/doc/salome/examples/hexoticsubdom4.py +++ b/doc/salome/examples/hexoticsubdom4.py @@ -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 geometry: a box cut by a plane Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) diff --git a/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx b/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx index 9fee2cf..3eee367 100644 --- a/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx @@ -741,10 +741,8 @@ bool HexoticPluginGUI_HypothesisCreator::readSizeMapsFromWidgets( HexoticHypothe GEOM::GEOM_Object_var HexoticPluginGUI_HypothesisCreator::entryToObject( std::string entry) const { - SMESH_Gen_i* smeshGen_i = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::Study_var myStudy = smeshGen_i->GetStudy(); GEOM::GEOM_Object_var aGeomObj; - SALOMEDS::SObject_var aSObj = myStudy->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); diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx index f56c997..350cf09 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -108,13 +108,6 @@ HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, SMESH_Gen* gen) #endif _computeCanceled = false; - // Copy of what is done in BLSURFPLugin TODO : share the code - smeshGen_i = SMESH_Gen_i::GetSMESHGen(); - CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/Study"); - - myStudy = SALOMEDS::Study::_narrow(anObject);; - if ( !myStudy->_is_nil() ) - MESSAGE("myStudy not empty"); } //============================================================================= @@ -900,18 +893,17 @@ std::string HexoticPlugin_Hexotic::getHexoticCommand(const TCollection_AsciiStri TopoDS_Shape HexoticPlugin_Hexotic::entryToShape(std::string entry) { MESSAGE("HexoticPlugin_Hexotic::entryToShape "<_is_nil() ) - throw SALOME_Exception("MG-Hexa plugin can't work w/o publishing in the study"); + GEOM::GEOM_Object_var aGeomObj; TopoDS_Shape S = TopoDS_Shape(); - SALOMEDS::SObject_var aSObj = myStudy->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; } diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx index 0eef149..065d8ae 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx @@ -122,10 +122,6 @@ private: const BLSURFPlugin_Hypothesis* _blsurfHypo; #endif - - SALOMEDS::Study_var myStudy; - SMESH_Gen_i* smeshGen_i; - }; #endif