X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_MeshOp.cxx;h=42207481c258926c3acfb252f3aa914321ed9d73;hb=997c16d89decd85389b313bc11f071b3e47f7fc4;hp=9d9aa1c0ccc2c9516e4e7ab4b0551bc3062ebffb;hpb=9a54694a0ab1e5cbc558a35c4606ceea4f7af2ef;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 9d9aa1c0c..42207481c 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -75,10 +75,6 @@ #include #include CORBA_CLIENT_HEADER(SMESH_Gen) -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - //================================================================================ /*! * \brief Constructor @@ -1103,14 +1099,10 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim, // Call hypothesis creation server method (without GUI) SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(theTypeName, aHypName, false); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif - } else { + aHyp.out(); + } + else { // Get hypotheses creator client (GUI) - // BUG 0020378 - //SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName); SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName); // Create hypothesis @@ -1179,10 +1171,7 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim, else { SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(theTypeName, aHypName, false); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif + aHyp.out(); } } @@ -1653,13 +1642,6 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList ) if ( !anAlgoVar->_is_nil() ) SMESH::AddHypothesisOnMesh( aMeshVar, anAlgoVar ); } -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - if (aMeshSO) - aMeshVar->UnRegister(); -#endif } return true; } @@ -1918,32 +1900,25 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) if (aHypData) { QString aClientLibName = aHypData->ClientLibName; - if (aClientLibName == "") + if ( aClientLibName.isEmpty() ) { // Call hypothesis creation server method (without GUI) SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(aHypName, aHypName, true); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif + aHyp.out(); } else { // Get hypotheses creator client (GUI) - // BUG 0020378 SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName); // Create algorithm if (aCreator) - aCreator->create(true, aHypName, myDlg, 0, QString::null ); + aCreator->create( true, aHypName, myDlg, 0, QString::null ); else { SMESH::SMESH_Hypothesis_var aHyp = SMESH::CreateHypothesis(aHypName, aHypName, true); -#ifdef WITHGENERICOBJ - if (!CORBA::is_nil(aHyp)) - aHyp->UnRegister(); -#endif + aHyp.out(); } } QStringList tmpList;