From 9cc5a6ab79532546b070d302f297237914b923fc Mon Sep 17 00:00:00 2001 From: imn Date: Fri, 14 Oct 2016 17:01:39 +0300 Subject: [PATCH 1/4] 0023299: [CEA] Finalize multi-study removal - delete study id parameter --- src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx | 4 ++-- src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx | 4 ++-- src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.cxx | 4 +--- src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx | 4 +--- src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.cxx | 3 +-- src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx | 2 -- src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_Mesher.cxx | 5 ++--- src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx | 4 ++-- src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx | 4 ++-- src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx | 2 -- src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx | 3 +-- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx | 4 +--- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx | 2 -- src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx | 5 ++--- src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx | 6 ++---- src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx | 3 +-- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx | 3 +-- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx | 2 -- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx | 1 - src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx | 3 +-- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx | 2 +- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx | 4 +--- src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx | 1 - 37 files changed, 31 insertions(+), 65 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx index fe4c2ee..5ec88e3 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.cxx @@ -40,9 +40,9 @@ using namespace std; * */ //============================================================================= -NETGENPlugin_Hypothesis::NETGENPlugin_Hypothesis (int hypId, int studyId, +NETGENPlugin_Hypothesis::NETGENPlugin_Hypothesis (int hypId, SMESH_Gen * gen) - : SMESH_Hypothesis(hypId, studyId, gen), + : SMESH_Hypothesis(hypId, gen), _maxSize (GetDefaultMaxSize()), _minSize (0), _growthRate (GetDefaultGrowthRate()), diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx index 7d6da32..21129dc 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx @@ -45,7 +45,7 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis: public SMESH_Hypothesis { public: - NETGENPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen); + NETGENPlugin_Hypothesis(int hypId, SMESH_Gen * gen); void SetMaxSize(double theSize); double GetMaxSize() const { return _maxSize; } diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx index 056c592..6dfa5ac 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.cxx @@ -37,9 +37,9 @@ using namespace std; * */ //============================================================================= -NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId, int studyId, +NETGENPlugin_Hypothesis_2D::NETGENPlugin_Hypothesis_2D (int hypId, SMESH_Gen * gen) - : NETGENPlugin_Hypothesis(hypId, studyId, gen)/*, + : NETGENPlugin_Hypothesis(hypId, gen)/*, _quadAllowed (GetDefaultQuadAllowed())*/ { _name = "NETGEN_Parameters_2D"; diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx index b73a3ba..a249442 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx @@ -43,7 +43,7 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypot { public: - NETGENPlugin_Hypothesis_2D(int hypId, int studyId, SMESH_Gen * gen); + NETGENPlugin_Hypothesis_2D(int hypId, SMESH_Gen * gen); // void SetQuadAllowed(bool theVal); // bool GetQuadAllowed() const { return _quadAllowed; } diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.cxx index 98f2dc4..15fa3dc 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.cxx @@ -38,15 +38,13 @@ //============================================================================= NETGENPlugin_Hypothesis_2D_ONLY_i:: NETGENPlugin_Hypothesis_2D_ONLY_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), - NETGENPlugin_Hypothesis_2D_i( thePOA, theStudyId, theGenImpl ) + NETGENPlugin_Hypothesis_2D_i( thePOA, theGenImpl ) { MESSAGE( "NETGENPlugin_Hypothesis_2D_ONLY_i::NETGENPlugin_Hypothesis_2D_ONLY_i" ); myBaseImpl = new ::NETGENPlugin_Hypothesis_2D (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.hxx index 54dd6ea..de8d441 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_ONLY_i.hxx @@ -46,7 +46,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D_ONLY_i: public: // Constructor NETGENPlugin_Hypothesis_2D_ONLY_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Destructor virtual ~NETGENPlugin_Hypothesis_2D_ONLY_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx index e889033..58683c6 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.cxx @@ -45,16 +45,14 @@ using namespace std; //============================================================================= NETGENPlugin_Hypothesis_2D_i:: NETGENPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), - NETGENPlugin_Hypothesis_i( thePOA, theStudyId, theGenImpl ) + NETGENPlugin_Hypothesis_i( thePOA, theGenImpl ) { if (myBaseImpl) delete (::NETGENPlugin_Hypothesis*)myBaseImpl; myBaseImpl = new ::NETGENPlugin_Hypothesis_2D (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx index 55b1c3f..6d0fabe 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D_i.hxx @@ -49,7 +49,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D_i: public: // Constructor NETGENPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Destructor virtual ~NETGENPlugin_Hypothesis_2D_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.cxx index f9fe240..0fe377a 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.cxx @@ -40,11 +40,10 @@ using namespace std; //============================================================================= NETGENPlugin_Hypothesis_3D_i:: NETGENPlugin_Hypothesis_3D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), - NETGENPlugin_Hypothesis_i( thePOA, theStudyId, theGenImpl ) + NETGENPlugin_Hypothesis_i( thePOA, theGenImpl ) { MESSAGE( "NETGENPlugin_Hypothesis_3D_i::NETGENPlugin_Hypothesis_3D_i" ); } diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.hxx index fcfbc5f..016f6f6 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_3D_i.hxx @@ -46,7 +46,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_3D_i: public: // Constructor NETGENPlugin_Hypothesis_3D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Get type name of hypothesis diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx index d60d666..3b585de 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.cxx @@ -59,14 +59,12 @@ bool NETGENPlugin_Hypothesis_i::isToSetParameter(double curValue, //============================================================================= NETGENPlugin_Hypothesis_i:: NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), mySetMethodFlags(0) { myBaseImpl = new ::NETGENPlugin_Hypothesis (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx index 12ffa7b..1ca6ee2 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_i.hxx @@ -50,7 +50,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i: public: // Constructor NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Destructor virtual ~NETGENPlugin_Hypothesis_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 5d5c401..e58bea5 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -287,9 +287,8 @@ 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("/myStudyManager"); - SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject); - SALOMEDS::Study_var myStudy = aStudyMgr->GetStudyByID(hyp->GetStudyId()); + 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(); diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx index cc5bb18..ae31807 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.cxx @@ -54,9 +54,9 @@ using namespace std; */ //============================================================================= -NETGENPlugin_NETGEN_2D::NETGENPlugin_NETGEN_2D(int hypId, int studyId, +NETGENPlugin_NETGEN_2D::NETGENPlugin_NETGEN_2D(int hypId, SMESH_Gen* gen) - : SMESH_2D_Algo(hypId, studyId, gen) + : SMESH_2D_Algo(hypId, gen) { _name = "NETGEN_2D"; _shapeType = (1 << TopAbs_FACE); // 1 bit /shape type diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx index aee85dd..7eb2359 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx @@ -40,7 +40,7 @@ class NETGENPlugin_Mesher; class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo { public: - NETGENPlugin_NETGEN_2D(int hypId, int studyId, SMESH_Gen* gen); + NETGENPlugin_NETGEN_2D(int hypId, SMESH_Gen* gen); virtual ~NETGENPlugin_NETGEN_2D(); virtual bool CheckHypothesis(SMESH_Mesh& aMesh, diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx index 284ea6c..4797cc7 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.cxx @@ -53,9 +53,9 @@ using namespace std; */ //============================================================================= -NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, +NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, SMESH_Gen* gen) - : SMESH_3D_Algo(hypId, studyId, gen) + : SMESH_3D_Algo(hypId, gen) { MESSAGE("NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D"); _name = "NETGEN_2D3D"; diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx index 23ca46f..e95e3b7 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx @@ -39,7 +39,7 @@ class NETGENPlugin_Mesher; class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo { public: - NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, SMESH_Gen* gen); + NETGENPlugin_NETGEN_2D3D(int hypId, SMESH_Gen* gen); virtual ~NETGENPlugin_NETGEN_2D3D(); virtual bool CheckHypothesis(SMESH_Mesh& aMesh, diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx index b95c0f4..e74baa1 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.cxx @@ -43,7 +43,6 @@ using namespace std; //============================================================================= NETGENPlugin_NETGEN_2D3D_i::NETGENPlugin_NETGEN_2D3D_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), @@ -52,7 +51,6 @@ NETGENPlugin_NETGEN_2D3D_i::NETGENPlugin_NETGEN_2D3D_i( PortableServer::POA_ptr { MESSAGE( "NETGENPlugin_NETGEN_2D3D_i::NETGENPlugin_NETGEN_2D3D_i" ); myBaseImpl = new ::NETGENPlugin_NETGEN_2D3D( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx index 0e193cc..f16a048 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D_i.hxx @@ -47,7 +47,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D_i: public: // Constructor NETGENPlugin_NETGEN_2D3D_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ); // Destructor virtual ~NETGENPlugin_NETGEN_2D3D_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx index 16baad4..74aaf0a 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx @@ -83,9 +83,8 @@ using namespace nglib; //============================================================================= NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY(int hypId, - int studyId, SMESH_Gen* gen) - : SMESH_2D_Algo(hypId, studyId, gen) + : SMESH_2D_Algo(hypId, gen) { _name = "NETGEN_2D_ONLY"; diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx index 1144faf..3ab8c92 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx @@ -42,7 +42,7 @@ class NETGENPlugin_Hypothesis_2D; class NETGENPlugin_NETGEN_2D_ONLY: public SMESH_2D_Algo { public: - NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId, SMESH_Gen* gen); + NETGENPlugin_NETGEN_2D_ONLY(int hypId, SMESH_Gen* gen); virtual ~NETGENPlugin_NETGEN_2D_ONLY(); virtual bool CheckHypothesis(SMESH_Mesh& aMesh, diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx index 008a99c..e0c5481 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx @@ -36,8 +36,7 @@ //============================================================================= NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl ) + ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), SMESH_Algo_i( thePOA ), @@ -45,7 +44,6 @@ NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::PO { MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i" ); myBaseImpl = new ::NETGENPlugin_NETGEN_2D_ONLY( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx index ef6a3e9..905e585 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx @@ -41,7 +41,6 @@ class NETGENPlugin_NETGEN_2D_ONLY_i: public: // Constructor NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ); // Destructor virtual ~NETGENPlugin_NETGEN_2D_ONLY_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx index 96d1f07..437cf3e 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.cxx @@ -43,7 +43,6 @@ using namespace std; //============================================================================= NETGENPlugin_NETGEN_2D_i::NETGENPlugin_NETGEN_2D_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), @@ -51,7 +50,6 @@ NETGENPlugin_NETGEN_2D_i::NETGENPlugin_NETGEN_2D_i( PortableServer::POA_ptr theP SMESH_2D_Algo_i( thePOA ) { myBaseImpl = new ::NETGENPlugin_NETGEN_2D( theGenImpl->GetANewId(), - theStudyId, theGenImpl ); } diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx index 695ff80..bfebf5f 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_i.hxx @@ -47,7 +47,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D_i: public: // Constructor NETGENPlugin_NETGEN_2D_i( PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl ); // Destructor virtual ~NETGENPlugin_NETGEN_2D_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx index 8fe43bb..eeeb1b6 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.cxx @@ -93,9 +93,8 @@ using namespace std; */ //============================================================================= -NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId, - SMESH_Gen* gen) - : SMESH_3D_Algo(hypId, studyId, gen) +NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, SMESH_Gen* gen) + : SMESH_3D_Algo(hypId, gen) { _name = "NETGEN_3D"; _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx index 679a29b..f3d17af 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx @@ -44,7 +44,7 @@ class NETGENPlugin_Hypothesis; class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo { public: - NETGENPlugin_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen); + NETGENPlugin_NETGEN_3D(int hypId, SMESH_Gen* gen); virtual ~NETGENPlugin_NETGEN_3D(); virtual bool CheckHypothesis(SMESH_Mesh& aMesh, diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx index 0b53170..a90943d 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.cxx @@ -44,16 +44,14 @@ using namespace std; //============================================================================= NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl ) + ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), SMESH_Algo_i( thePOA ), SMESH_3D_Algo_i( thePOA ) { myBaseImpl = new ::NETGENPlugin_NETGEN_3D( theGenImpl->GetANewId(), - theStudyId, - theGenImpl ); + theGenImpl ); } //============================================================================= diff --git a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx index 8952f12..af3df0f 100644 --- a/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_NETGEN_3D_i.hxx @@ -48,8 +48,7 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D_i: public: // Constructor NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl ); + ::SMESH_Gen* theGenImpl ); // Destructor virtual ~NETGENPlugin_NETGEN_3D_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx index b13aa79..19a64e8 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.cxx @@ -43,9 +43,8 @@ using namespace std; */ //============================================================================= NETGENPlugin_SimpleHypothesis_2D::NETGENPlugin_SimpleHypothesis_2D (int hypId, - int studyId, SMESH_Gen * gen) - : SMESH_Hypothesis(hypId, studyId, gen), + : SMESH_Hypothesis(hypId, gen), _nbSegments ((int)NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge()), _segmentLength(0), _area (0.), diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx index 28ceb30..43c0f36 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D.hxx @@ -40,7 +40,7 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D: public SMESH_Hypothe { public: - NETGENPlugin_SimpleHypothesis_2D(int hypId, int studyId, SMESH_Gen * gen); + NETGENPlugin_SimpleHypothesis_2D(int hypId, SMESH_Gen * gen); /*! * Sets value diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx index f54481a..ba2f4b8 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.cxx @@ -45,14 +45,12 @@ using namespace std; //============================================================================= NETGENPlugin_SimpleHypothesis_2D_i:: NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i" ); myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_2D (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx index 06ba90d..50bbc5f 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_2D_i.hxx @@ -45,7 +45,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D_i: public: // Constructor NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Destructor virtual ~NETGENPlugin_SimpleHypothesis_2D_i(); diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx index 376a5ad..0a64db4 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.cxx @@ -45,9 +45,8 @@ using namespace std; */ //============================================================================= NETGENPlugin_SimpleHypothesis_3D::NETGENPlugin_SimpleHypothesis_3D (int hypId, - int studyId, SMESH_Gen * gen) - : NETGENPlugin_SimpleHypothesis_2D(hypId, studyId, gen), + : NETGENPlugin_SimpleHypothesis_2D(hypId, gen), _volume(0) { _name = "NETGEN_SimpleParameters_3D"; diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx index 1494652..34d0713 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D.hxx @@ -40,7 +40,7 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D: public NETGENPlugin_ { public: - NETGENPlugin_SimpleHypothesis_3D(int hypId, int studyId, SMESH_Gen * gen); + NETGENPlugin_SimpleHypothesis_3D(int hypId, SMESH_Gen * gen); void LengthFromFaces(); diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx index 6d804a1..05dc66b 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.cxx @@ -43,17 +43,15 @@ using namespace std; //============================================================================= NETGENPlugin_SimpleHypothesis_3D_i:: NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl) : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ), - NETGENPlugin_SimpleHypothesis_2D_i( thePOA,theStudyId,theGenImpl ) + NETGENPlugin_SimpleHypothesis_2D_i( thePOA,theGenImpl ) { MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i" ); if ( myBaseImpl ) delete myBaseImpl; myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_3D (theGenImpl->GetANewId(), - theStudyId, theGenImpl); } diff --git a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx index 940a807..4cf259b 100644 --- a/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx +++ b/src/NETGENPlugin/NETGENPlugin_SimpleHypothesis_3D_i.hxx @@ -44,7 +44,6 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D_i: public: // Constructor NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA, - int theStudyId, ::SMESH_Gen* theGenImpl); // Destructor virtual ~NETGENPlugin_SimpleHypothesis_3D_i(); From a1c5622601d8cd2efd17d78ece05a88e9bb32169 Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 18 Jan 2017 16:17:01 +0300 Subject: [PATCH 2/4] Delete deprecated code --- src/NETGENPlugin/NETGENPlugin_Mesher.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index e58bea5..6082f95 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -4089,10 +4089,10 @@ void NETGENPlugin_NetgenLibWrapper::removeOutputFile() } string tmpDir = SALOMEDS_Tool::GetDirFromPath ( _outputFileName ); string aFileName = SALOMEDS_Tool::GetNameFromPath( _outputFileName ) + ".out"; - SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames; - aFiles->length(1); - aFiles[0] = aFileName.c_str(); + SALOMEDS_Tool::ListOfFiles aFiles; + aFiles.reserve(1); + aFiles.push_back(aFileName.c_str()); - SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles.in(), true ); + SALOMEDS_Tool::RemoveTemporaryFiles( tmpDir.c_str(), aFiles, true ); } } From 65987d083d9ef9c3deccf4b87d24fee7f71fc889 Mon Sep 17 00:00:00 2001 From: mpa Date: Fri, 3 Feb 2017 16:22:00 +0300 Subject: [PATCH 3/4] Deleted Study parameter --- doc/salome/examples/netgendemo.py | 4 +- src/GUI/NETGENPluginGUI_HypothesisCreator.cxx | 5 +-- src/NETGENPlugin/NETGENPlugin_Mesher.cxx | 38 +++++++++---------- 3 files changed, 21 insertions(+), 26 deletions(-) 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"< Date: Wed, 29 Mar 2017 17:50:12 +0200 Subject: [PATCH 4/4] Porting to Python 3 (1st draft) --- src/NETGENPlugin/NETGENPluginBuilder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NETGENPlugin/NETGENPluginBuilder.py b/src/NETGENPlugin/NETGENPluginBuilder.py index d5f9460..932500d 100644 --- a/src/NETGENPlugin/NETGENPluginBuilder.py +++ b/src/NETGENPlugin/NETGENPluginBuilder.py @@ -105,7 +105,7 @@ class NETGEN_Algorithm(Mesh_Algorithm): # if it is @c 0 (default), the algorithm is assigned to the main shape def __init__(self, mesh, geom=0): Mesh_Algorithm.__init__(self) - if noNETGENPlugin: print "Warning: NETGENPlugin module unavailable" + if noNETGENPlugin: print("Warning: NETGENPlugin module unavailable") self.Create(mesh, geom, self.algoType, LIBRARY) self.params = None pass