Version: 8.3.0
SMESH_subMeshEventListener Class Reference

A base for objects reacting on submesh events. More...

#include <SMESH_subMeshEventListener.hxx>

Inheritance diagram for SMESH_subMeshEventListener:

Public Member Functions

 SMESH_subMeshEventListener (bool isDeletable, const char *name)
 
virtual ~SMESH_subMeshEventListener ()
 
bool IsDeletable () const
 
const char * GetName () const
 
virtual void BeforeDelete (SMESH_subMesh *subMesh, SMESH_subMeshEventListenerData *data)
 
virtual void ProcessEvent (const int event, const int eventType, SMESH_subMesh *subMesh, SMESH_subMeshEventListenerData *data, const SMESH_Hypothesis *hyp=0)
 Do something on a certain event. More...
 

Private Attributes

bool myIsDeletable
 if true, it will be deleted by SMESH_subMesh More...
 
std::set< SMESH_subMesh * > myBusySM
 to avoid infinite recursion via events More...
 
const char * myName
 identifier More...
 

Friends

class SMESH_subMesh
 

Detailed Description

A base for objects reacting on submesh events.

Constructor & Destructor Documentation

SMESH_subMeshEventListener::SMESH_subMeshEventListener ( bool  isDeletable,
const char *  name 
)
virtual SMESH_subMeshEventListener::~SMESH_subMeshEventListener ( )
virtual

Member Function Documentation

virtual void SMESH_subMeshEventListener::BeforeDelete ( SMESH_subMesh subMesh,
SMESH_subMeshEventListenerData data 
)
virtual
const char* SMESH_subMeshEventListener::GetName ( ) const
bool SMESH_subMeshEventListener::IsDeletable ( ) const
void SMESH_subMeshEventListener::ProcessEvent ( const int  event,
const int  eventType,
SMESH_subMesh subMesh,
SMESH_subMeshEventListenerData data,
const SMESH_Hypothesis hyp = 0 
)
virtual

Do something on a certain event.

Parameters
event- algo_event or compute_event itself (of SMESH_subMesh)
eventType- ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
subMesh- the submesh where the event occurs
data- listener data stored in the subMesh
hyp- hypothesis, if eventType is algo_event

The base implementation (see SMESH_subMesh.cxx) translates CLEAN event to the subMeshes stored in the listener data. Also it sends SUBMESH_COMPUTED event in case of successful COMPUTE event.

Parameters
event- algo_event or compute_event itself
eventType- algo_event or compute_event
subMesh- the submesh where the event occurs
data- listener data stored in the subMesh
hyp- hypothesis, if eventType is algo_event

The base implementation translates CLEAN event to the subMesh stored in listener data. Also it sends SUBMESH_COMPUTED event in case of successful COMPUTE event.

Reimplemented in MeshEditor_I::TSearchersDeleter, VISCOUS_3D::_ViscousListener, VISCOUS_3D::_ShrinkShapeListener, and VISCOUS_2D::_ProxyMeshHolder.

References SMESH_subMesh::CLEAN, SMESH_subMesh::COMPUTE, SMESH_subMesh::COMPUTE_EVENT, SMESH_subMesh::COMPUTE_OK, SMESH_subMesh::COMPUTE_SUBMESH, SMESH_subMeshEventListenerData::mySubMeshes, and SMESH_subMesh::SUBMESH_COMPUTED.

Referenced by VISCOUS_3D::_ShrinkShapeListener::ProcessEvent().

Friends And Related Function Documentation

friend class SMESH_subMesh
friend

Field Documentation

std::set<SMESH_subMesh*> SMESH_subMeshEventListener::myBusySM
mutableprivate

to avoid infinite recursion via events

bool SMESH_subMeshEventListener::myIsDeletable
private

if true, it will be deleted by SMESH_subMesh

const char* SMESH_subMeshEventListener::myName
private

identifier