X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers_I%2FStdMeshers_LayerDistribution_i.cxx;h=d8bb021801de5bdee13585d8c2b7e53b3632aec9;hb=f0354b9d849838668be5de74ee19014b1290e3e9;hp=8a9db16a7fdb9a68f74cb29348729f6185336dfa;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx index 8a9db16a7..d8bb02180 100644 --- a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 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 @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -45,12 +45,11 @@ using namespace std; //============================================================================= StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA, - int theStudyId, - ::SMESH_Gen* theGenImpl ) - : SALOME::GenericObj_i( thePOA ), + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), SMESH_Hypothesis_i( thePOA ) { - MESSAGE( "StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i" ); myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(), theStudyId, theGenImpl ); @@ -66,19 +65,20 @@ StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer:: StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i() { - MESSAGE( "StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i" ); + if ( !myHyp->_is_nil() ) + myHyp->UnRegister(); } //============================================================================= /*! * StdMeshers_LayerDistribution_i::SetLayerDistribution * - + */ //============================================================================= void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesis_ptr hyp1D) - throw ( SALOME::SALOME_Exception ) + throw ( SALOME::SALOME_Exception ) { ASSERT( myBaseImpl ); try { @@ -86,6 +86,7 @@ void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesi bool isNewHyp = ( hyp_i->GetImpl() != this->GetImpl()->GetLayerDistribution() ); this->GetImpl()->SetLayerDistribution( hyp_i->GetImpl() ); myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp1D ); + myHyp->Register(); // Remove SO of 1D hypothesis if it was published if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { @@ -142,12 +143,13 @@ SMESH::SMESH_Hypothesis_ptr StdMeshers_LayerDistribution_i::GetLayerDistribution //================================================================================ /*! * \brief Verify whether hypothesis supports given entity type - * \param type - dimension (see SMESH::Dimension enumeration) - * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise * * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) */ //================================================================================ + CORBA::Boolean StdMeshers_LayerDistribution_i::IsDimSupported( SMESH::Dimension type ) { return type == SMESH::DIM_3D; @@ -156,7 +158,7 @@ CORBA::Boolean StdMeshers_LayerDistribution_i::IsDimSupported( SMESH::Dimension //================================================================================ /*! * \brief Write parameters in a string - * \retval char* - resulting string + * \retval char* - resulting string */ //================================================================================ @@ -182,7 +184,7 @@ char* StdMeshers_LayerDistribution_i::SaveTo() //================================================================================ /*! * \brief Retrieve parameters from the string - * \param theStream - the input string + * \param theStream - the input string */ //================================================================================