X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_CompositeSegment_1D.cxx;h=6df82b480c8a6312a5e78ad5886d39995461610a;hb=2b3a86e7ca1e373692ae6b2ebb691ff412e0f634;hp=d8fd719af32cc52424c6bbfc1701cd2a530c9c12;hpb=50b08dce3d9a7fc60a11e481474c00889392b964;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx index d8fd719af..6df82b480 100644 --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx @@ -1,31 +1,28 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 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 +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // SMESH SMESH : implementaion of SMESH idl descriptions -// File : StdMeshers_Regular_1D.cxx -// Moved here from SMESH_Regular_1D.cxx -// Author : Paul RASCLE, EDF +// File : StdMeshers_CompositeSegment_1D.cxx // Module : SMESH -// $Header$ // #include "StdMeshers_CompositeSegment_1D.hxx" #include "StdMeshers_FaceSide.hxx" @@ -153,7 +150,9 @@ namespace { struct VertexNodesRestoringListener : public SMESH_subMeshEventListener { - VertexNodesRestoringListener():SMESH_subMeshEventListener(0) // won't be deleted by submesh + VertexNodesRestoringListener(): + SMESH_subMeshEventListener(0, // won't be deleted by submesh + "StdMeshers_CompositeSegment_1D::VertexNodesRestoringListener") {} /*! * \brief Restore nodes on internal vertices of a complex side @@ -169,17 +168,23 @@ namespace { EventListenerData* data, const SMESH_Hypothesis* /*hyp*/) { - bool hypRemoved = ( eventType == SMESH_subMesh::ALGO_EVENT && - subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK ); - if ( hypRemoved && data ) + if ( data && eventType == SMESH_subMesh::ALGO_EVENT ) { - list::iterator smIt = data->mySubMeshes.begin(); - for ( ; smIt != data->mySubMeshes.end(); ++smIt ) + bool hypRemoved; + if ( subMesh->GetAlgoState() != SMESH_subMesh::HYP_OK ) + hypRemoved = true; + else { + SMESH_Algo* algo = subMesh->GetAlgo(); + hypRemoved = ( string( algo->GetName() ) != StdMeshers_CompositeSegment_1D::AlgoName()); + } + if ( hypRemoved ) { - if ( SMESH_subMesh* sm = *smIt ) { - sm->SetIsAlwaysComputed( false ); - sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); - } + list::iterator smIt = data->mySubMeshes.begin(); + for ( ; smIt != data->mySubMeshes.end(); ++smIt ) + if ( SMESH_subMesh* sm = *smIt ) { + sm->SetIsAlwaysComputed( false ); + sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); + } } } // at study restoration: @@ -226,10 +231,19 @@ StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D(int hypId :StdMeshers_Regular_1D(hypId, studyId, gen) { MESSAGE("StdMeshers_CompositeSegment_1D::StdMeshers_CompositeSegment_1D"); - _name = "CompositeSegment_1D"; + _name = AlgoName(); _EventListener = new VertexNodesRestoringListener(); } +//======================================================================= +//function : AlgoName +//purpose : Returns algo type name +//======================================================================= + +std::string StdMeshers_CompositeSegment_1D::AlgoName() +{ + return "CompositeSegment_1D"; +} //============================================================================= /*! *