From: vsr Date: Fri, 4 Mar 2011 15:42:14 +0000 (+0000) Subject: SALOME::GenericObj : Destroy() -> UnRegister() X-Git-Tag: StartingPortingMED3~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ac724740a914d5008bc0038a4d3fa6397b6cb87f;p=modules%2Fsmesh.git SALOME::GenericObj : Destroy() -> UnRegister() --- diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 6e44e059d..ded63b793 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -843,7 +843,7 @@ SMESH_GroupObj::SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr theGroup, SMESH_GroupObj::~SMESH_GroupObj() { if ( MYDEBUG ) MESSAGE("~SMESH_GroupObj"); - myGroupServer->Destroy(); + myGroupServer->UnRegister(); } //================================================================================= @@ -973,7 +973,7 @@ SMESH_subMeshObj::SMESH_subMeshObj( SMESH::SMESH_subMesh_ptr theSubMesh, SMESH_subMeshObj::~SMESH_subMeshObj() { if ( MYDEBUG ) MESSAGE( "~SMESH_subMeshObj" ); - mySubMeshServer->Destroy(); + mySubMeshServer->UnRegister(); } //================================================================================= diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index e91fd5b23..64fe283ef 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -667,7 +667,7 @@ SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB, //================================================================================= SMESH_Client::~SMESH_Client() { - myMeshServer->Destroy(); + myMeshServer->UnRegister(); if(!mySMESHDSMesh) delete mySMDSMesh; } diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index e99e2b787..a0f68f2fa 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -280,7 +280,7 @@ // 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 - aMeshes[i]->Destroy(); + aMeshes[i]->UnRegister(); #endif } else { @@ -1582,8 +1582,8 @@ LightApp_Module( "SMESH" ) SMESHGUI::~SMESHGUI() { #ifdef WITHGENERICOBJ - SMESH::GetFilterManager()->Destroy(); - SMESH::GetMeasurements()->Destroy(); + SMESH::GetFilterManager()->UnRegister(); + SMESH::GetMeasurements()->UnRegister(); #endif SMESH::GetFilterManager() = SMESH::FilterManager::_nil(); SMESH::GetMeasurements() = SMESH::Measurements::_nil(); diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 4fceb54be..3f8b26fde 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -341,7 +341,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() // It is safe to decrement its refcount // so that it will be destroyed when the entry in study will be removed if (!CORBA::is_nil(aCompoundMesh)) - aCompoundMesh->Destroy(); + aCompoundMesh->UnRegister(); #endif return true; diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index f4b6950bf..f1a72bb64 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -338,7 +338,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() // 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 - newMesh->Destroy(); + newMesh->UnRegister(); #endif } catch (...) { } diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 6276d0677..e39b9cd0b 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -94,7 +94,7 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, SMESH::CreateHypothesis( hypType(), theHypName, isAlgo ); #ifdef WITHGENERICOBJ if (!CORBA::is_nil(anAlgo)) - anAlgo->Destroy(); + anAlgo->UnRegister(); #endif } else { @@ -103,7 +103,7 @@ void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo, editHypothesis( aHypothesis.in(), theHypName, theParent, obj, slot ); #ifdef WITHGENERICOBJ if (!CORBA::is_nil(aHypothesis)) - aHypothesis->Destroy(); + aHypothesis->UnRegister(); #endif } } @@ -302,7 +302,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) } SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 ); #ifdef WITHGENERICOBJ - myHypo->Destroy(); + myHypo->UnRegister(); #endif myHypo = SMESH::SMESH_Hypothesis::_nil(); myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil(); diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index 4ffc3f09e..eb8a49ba0 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -351,12 +351,12 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh() newGrp.out() ); if ( !mesh->_is_nil() ) { #ifdef WITHGENERICOBJ - mesh->Destroy(); + mesh->UnRegister(); #endif } if ( !newGrp->_is_nil() ) { #ifdef WITHGENERICOBJ - newGrp->Destroy(); + newGrp->UnRegister(); #endif } ok = true; diff --git a/src/SMESHGUI/SMESHGUI_Measurements.cxx b/src/SMESHGUI/SMESHGUI_Measurements.cxx index 95161c9db..63e451af1 100644 --- a/src/SMESHGUI/SMESHGUI_Measurements.cxx +++ b/src/SMESHGUI/SMESHGUI_Measurements.cxx @@ -564,7 +564,7 @@ void SMESHGUI_MinDistance::compute() int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 ); SMESH::Measurements_var measure = SMESHGUI::GetSMESHGen()->CreateMeasurements(); SMESH::Measure result = measure->MinDistance( s1.in(), s2.in() ); - measure->Destroy(); + measure->UnRegister(); myDX->setText( QString::number( result.minX, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); myDY->setText( QString::number( result.minY, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); myDZ->setText( QString::number( result.minZ, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); @@ -1043,7 +1043,7 @@ void SMESHGUI_BoundingBox::compute() int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 ); SMESH::Measurements_var measure = SMESHGUI::GetSMESHGen()->CreateMeasurements(); SMESH::Measure result = measure->BoundingBox( srcList.in() ); - measure->Destroy(); + measure->UnRegister(); myXmin->setText( QString::number( result.minX, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); myXmax->setText( QString::number( result.maxX, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); myDX->setText( QString::number( result.maxX-result.minX, precision > 0 ? 'f' : 'g', qAbs( precision ) ) ); diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 1e314d045..70334610e 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1062,7 +1062,7 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim, SMESH::CreateHypothesis(theTypeName, aHypName, false); #ifdef WITHGENERICOBJ if (!CORBA::is_nil(aHyp)) - aHyp->Destroy(); + aHyp->UnRegister(); #endif } else { // Get hypotheses creator client (GUI) @@ -1138,7 +1138,7 @@ void SMESHGUI_MeshOp::createHypothesis(const int theDim, SMESH::CreateHypothesis(theTypeName, aHypName, false); #ifdef WITHGENERICOBJ if (!CORBA::is_nil(aHyp)) - aHyp->Destroy(); + aHyp->UnRegister(); #endif } } @@ -1612,7 +1612,7 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess ) // It is safe to decrement its refcount // so that it will be destroyed when the entry in study will be removed if (aMeshSO) - aMeshVar->Destroy(); + aMeshVar->UnRegister(); #endif } return true; @@ -1875,7 +1875,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) SMESH::CreateHypothesis(aHypName, aHypName, true); #ifdef WITHGENERICOBJ if (!CORBA::is_nil(aHyp)) - aHyp->Destroy(); + aHyp->UnRegister(); #endif } else @@ -1893,7 +1893,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) SMESH::CreateHypothesis(aHypName, aHypName, true); #ifdef WITHGENERICOBJ if (!CORBA::is_nil(aHyp)) - aHyp->Destroy(); + aHyp->UnRegister(); #endif } } diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 7e2f2af84..46d8ba53c 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -453,7 +453,7 @@ bool SMESHGUI_RotationDlg::ClickOnApply() // 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 - mesh->Destroy(); + mesh->UnRegister(); #endif } break; diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index fc275baaa..f7b636e7d 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -504,7 +504,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() // 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 - mesh->Destroy(); + mesh->UnRegister(); #endif } break; diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 138235888..e0abb8cc1 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -540,7 +540,7 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() // 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 - mesh->Destroy(); + mesh->UnRegister(); #endif } break; diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 14a5866e0..601550ecb 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -526,7 +526,7 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() // 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 - mesh->Destroy(); + mesh->UnRegister(); #endif } } diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index f222d8db6..d798596f0 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -573,7 +573,7 @@ Functor_i::Functor_i(): Functor_i::~Functor_i() { - //TPythonDump()<Destroy(); + myNumericalFunctor->UnRegister(); } void Comparator_i::SetMargin( CORBA::Double theValue ) @@ -1636,7 +1636,7 @@ CORBA::Double Comparator_i::GetMargin() void Comparator_i::SetNumFunctor( NumericalFunctor_ptr theFunct ) { if ( myNumericalFunctor ) - myNumericalFunctor->Destroy(); + myNumericalFunctor->UnRegister(); myNumericalFunctor = DownCast(theFunct); @@ -1731,13 +1731,13 @@ LogicalNOT_i::LogicalNOT_i() LogicalNOT_i::~LogicalNOT_i() { if ( myPredicate ) - myPredicate->Destroy(); + myPredicate->UnRegister(); } void LogicalNOT_i::SetPredicate( Predicate_ptr thePredicate ) { if ( myPredicate ) - myPredicate->Destroy(); + myPredicate->UnRegister(); myPredicate = SMESH::GetPredicate(thePredicate); @@ -1771,10 +1771,10 @@ LogicalBinary_i::LogicalBinary_i() LogicalBinary_i::~LogicalBinary_i() { if ( myPredicate1 ) - myPredicate1->Destroy(); + myPredicate1->UnRegister(); if ( myPredicate2 ) - myPredicate2->Destroy(); + myPredicate2->UnRegister(); } void LogicalBinary_i::SetMesh( SMESH_Mesh_ptr theMesh ) @@ -1789,7 +1789,7 @@ void LogicalBinary_i::SetMesh( SMESH_Mesh_ptr theMesh ) void LogicalBinary_i::SetPredicate1( Predicate_ptr thePredicate ) { if ( myPredicate1 ) - myPredicate1->Destroy(); + myPredicate1->UnRegister(); myPredicate1 = SMESH::GetPredicate(thePredicate); @@ -1803,7 +1803,7 @@ void LogicalBinary_i::SetPredicate1( Predicate_ptr thePredicate ) void LogicalBinary_i::SetPredicate2( Predicate_ptr thePredicate ) { if ( myPredicate2 ) - myPredicate2->Destroy(); + myPredicate2->UnRegister(); myPredicate2 = SMESH::GetPredicate(thePredicate); @@ -1876,7 +1876,7 @@ FilterManager_i::FilterManager_i() FilterManager_i::~FilterManager_i() { - //TPythonDump()<Destroy(); + myPredicate->UnRegister(); if(!CORBA::is_nil(myMesh)) - myMesh->Destroy(); + myMesh->UnRegister(); - //TPythonDump()<Destroy(); + myPredicate->UnRegister(); myPredicate = SMESH::GetPredicate(thePredicate); @@ -2315,7 +2315,7 @@ SetMesh( SMESH_Mesh_ptr theMesh ) theMesh->Register(); if(!CORBA::is_nil(myMesh)) - myMesh->Destroy(); + myMesh->UnRegister(); myMesh = SMESH_Mesh::_duplicate( theMesh ); TPythonDump()<Destroy(); + myPredicate->UnRegister(); SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i(); FilterManager_ptr aFilterMgr = aFilter->_this(); @@ -3421,7 +3421,7 @@ FilterLibrary_i::FilterLibrary_i() FilterLibrary_i::~FilterLibrary_i() { delete myFileName; - //TPythonDump()<RemoveGroup( aGroup->GetLocalID() ); aGroup->myMeshServant = 0; - aGroup->Destroy(); + aGroup->UnRegister(); } } _mapGroups.clear(); @@ -144,7 +144,7 @@ SMESH_Mesh_i::~SMESH_Mesh_i() continue; SMESH_subMesh_i* aSubMesh = dynamic_cast(SMESH_Gen_i::GetServant(itSM->second).in()); if (aSubMesh) { - aSubMesh->Destroy(); + aSubMesh->UnRegister(); } } _mapSubMeshIor.clear(); @@ -156,7 +156,7 @@ SMESH_Mesh_i::~SMESH_Mesh_i() continue; SMESH_Hypothesis_i* aHypo = dynamic_cast(SMESH_Gen_i::GetServant(itH->second).in()); if (aHypo) { - aHypo->Destroy(); + aHypo->UnRegister(); } } _mapHypo.clear(); diff --git a/src/SMESH_SWIG/SMESH_BelongToGeom.py b/src/SMESH_SWIG/SMESH_BelongToGeom.py index af6c98420..0a3eeed03 100644 --- a/src/SMESH_SWIG/SMESH_BelongToGeom.py +++ b/src/SMESH_SWIG/SMESH_BelongToGeom.py @@ -40,7 +40,7 @@ def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theEl aBelongToGeom.SetElementType(theElemType) aFilter.SetPredicate(aBelongToGeom) - aFilterMgr.Destroy() + aFilterMgr.UnRegister() return aFilter.GetElementsId(theMesh) ## Current style diff --git a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py index c90a3bd89..12db16e55 100644 --- a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py +++ b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py @@ -36,7 +36,7 @@ def BuildGroupLyingOn(theMesh, theElemType, theName, theShape): aFilter.SetPredicate(aLyingOnGeom) anIds = aFilter.GetElementsId(theMesh) - aFilterMgr.Destroy() + aFilterMgr.UnRegister() aGroup = theMesh.CreateGroup(theElemType, theName) aGroup.Add(anIds) diff --git a/src/SMESH_SWIG/smeshDC.py b/src/SMESH_SWIG/smeshDC.py index a5dce4df8..d8e94dbfa 100644 --- a/src/SMESH_SWIG/smeshDC.py +++ b/src/SMESH_SWIG/smeshDC.py @@ -884,7 +884,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): aCriteria = [] aCriteria.append(aCriterion) aFilter.SetCriteria(aCriteria) - aFilterMgr.Destroy() + aFilterMgr.UnRegister() return aFilter ## Creates a numerical functor by its type @@ -1009,7 +1009,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): pass aMeasurements = self.CreateMeasurements() result = aMeasurements.MinDistance(src1, src2) - aMeasurements.Destroy() + aMeasurements.UnRegister() return result ## Get bounding box of the specified object(s) @@ -1046,7 +1046,7 @@ class smeshDC(SMESH._objref_SMESH_Gen): pass aMeasurements = self.CreateMeasurements() result = aMeasurements.BoundingBox(srclist) - aMeasurements.Destroy() + aMeasurements.UnRegister() return result import omniORB @@ -1807,7 +1807,7 @@ class Mesh: aCriteria.append(Criterion) aFilter.SetCriteria(aCriteria) group = self.MakeGroupByFilter(groupName, aFilter) - aFilterMgr.Destroy() + aFilterMgr.UnRegister() return group ## Creates a mesh group by the given criteria (list of criteria) @@ -1820,7 +1820,7 @@ class Mesh: aFilter = aFilterMgr.CreateFilter() aFilter.SetCriteria(theCriteria) group = self.MakeGroupByFilter(groupName, aFilter) - aFilterMgr.Destroy() + aFilterMgr.UnRegister() return group ## Creates a mesh group by the given filter @@ -1851,7 +1851,7 @@ class Mesh: aPredicate = aFilterMgr.CreateFreeEdges() aPredicate.SetMesh(self.mesh) aBorders = aPredicate.GetBorders() - aFilterMgr.Destroy() + aFilterMgr.UnRegister() return aBorders ## Removes a group @@ -2415,7 +2415,7 @@ class Mesh: aMeasurements = self.smeshpyD.CreateMeasurements() aMeasure = aMeasurements.MinDistance(id1, id2) - aMeasurements.Destroy() + aMeasurements.UnRegister() return aMeasure ## Get bounding box of the specified object(s) @@ -2464,7 +2464,7 @@ class Mesh: pass aMeasurements = self.smeshpyD.CreateMeasurements() aMeasure = aMeasurements.BoundingBox(srclist) - aMeasurements.Destroy() + aMeasurements.UnRegister() return aMeasure # Mesh edition (SMESH_MeshEditor functionality):