mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 10:40:36 +05:00
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
prevent from an infinite recursion via the event listener
This commit is contained in:
parent
4466dfe1ce
commit
78d0067647
@ -2068,8 +2068,6 @@ EventListenerData* SMESH_subMesh::GetEventListenerData(EventListener* listener)
|
||||
* \brief Notify stored event listeners on the occured event
|
||||
* \param event - algo_event or compute_event itself
|
||||
* \param eventType - algo_event or compute_event
|
||||
* \param subMesh - the submesh where the event occures
|
||||
* \param data - listener data stored in the subMesh
|
||||
* \param hyp - hypothesis, if eventType is algo_event
|
||||
*/
|
||||
//================================================================================
|
||||
@ -2080,7 +2078,11 @@ void SMESH_subMesh::NotifyListenersOnEvent( const int event,
|
||||
{
|
||||
map< EventListener*, EventListenerData* >::iterator l_d = myEventListeners.begin();
|
||||
for ( ; l_d != myEventListeners.end(); ++l_d )
|
||||
if ( (*l_d).first->myBusySM.insert( this ).second )
|
||||
{
|
||||
l_d->first->ProcessEvent( event, eventType, this, l_d->second, hyp );
|
||||
l_d->first->myBusySM.erase( this );
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
@ -20,7 +20,6 @@
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
|
||||
// SMESH SMESH : implementaion of SMESH idl descriptions
|
||||
// File : SMESH_subMeshEventListener.hxx
|
||||
// Created : Mon Nov 13 10:45:49 2006
|
||||
// Author : Edward AGAPOV (eap)
|
||||
@ -31,6 +30,7 @@
|
||||
#include "SMESH_SMESH.hxx"
|
||||
|
||||
#include <list>
|
||||
#include <set>
|
||||
|
||||
class SMESH_subMesh;
|
||||
class SMESH_Hypothesis;
|
||||
@ -42,8 +42,11 @@ struct SMESH_subMeshEventListenerData;
|
||||
*/
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
class SMESH_EXPORT SMESH_subMeshEventListener {
|
||||
class SMESH_EXPORT SMESH_subMeshEventListener
|
||||
{
|
||||
bool myIsDeletable; //!< if true, it will be deleted by SMESH_subMesh
|
||||
mutable std::set<SMESH_subMesh*> myBusySM; //!< to avoid infinite recursion via events
|
||||
friend class SMESH_subMesh;
|
||||
public:
|
||||
SMESH_subMeshEventListener(bool isDeletable):myIsDeletable(isDeletable) {}
|
||||
bool IsDeletable() const { return myIsDeletable; }
|
||||
@ -55,9 +58,9 @@ public:
|
||||
* \param data - listener data stored in the subMesh
|
||||
* \param hyp - hypothesis, if eventType is algo_event
|
||||
*
|
||||
* The base implementation translates CLEAN event to the subMesh stored
|
||||
* in the listener data. Also it sends SUBMESH_COMPUTED event in case of
|
||||
* successful COMPUTE event.
|
||||
* The base implementation (see SMESH_subMesh.cxx) translates CLEAN event
|
||||
* to the subMesh stored in the listener data. Also it sends SUBMESH_COMPUTED
|
||||
* event in case of successful COMPUTE event.
|
||||
*/
|
||||
virtual void ProcessEvent(const int event,
|
||||
const int eventType,
|
||||
@ -80,6 +83,7 @@ struct SMESH_subMeshEventListenerData
|
||||
// on the one storing this data
|
||||
public:
|
||||
SMESH_subMeshEventListenerData(bool isDeletable):myIsDeletable(isDeletable) {}
|
||||
virtual ~SMESH_subMeshEventListenerData() {}
|
||||
bool IsDeletable() const { return myIsDeletable; }
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user