Add "const char* name" argument to consrtucctor of SMESH_subMeshEventListener

This commit is contained in:
eap 2012-01-18 12:07:14 +00:00
parent 8a81427a0c
commit fbae18cd7f
10 changed files with 37 additions and 16 deletions

View File

@ -47,8 +47,16 @@ 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) {}
#ifdef _DEBUG_
const char* myName; //!< identifier used for debug
#endif
public:
SMESH_subMeshEventListener(bool isDeletable, const char* name) :myIsDeletable(isDeletable)
#ifdef _DEBUG_
,myName(name)
#endif
{}
bool IsDeletable() const { return myIsDeletable; }
/*!
* \brief Do something on a certain event

View File

@ -169,7 +169,8 @@ namespace {
SMESH_Mesh* myMesh;
string myMeshPartIOR;
//!< Constructor
TSearchersDeleter(): SMESH_subMeshEventListener( false ), // won't be deleted by submesh
TSearchersDeleter(): SMESH_subMeshEventListener( false, // won't be deleted by submesh
"SMESH_MeshEditor_i::TSearchersDeleter"),
myMesh(0) {}
//!< Delete theNodeSearcher
static void Delete()

View File

@ -1714,15 +1714,16 @@ namespace
{
/*!
* \brief Event listener setting/unsetting _alwaysComputed flag to
* submeshes of inferior levels to avoid their computing
* submeshes of inferior levels to prevent their computing
*/
struct _EventListener : public SMESH_subMeshEventListener
{
string _algoName;
_EventListener(const string& algoName):
SMESH_subMeshEventListener(/*isDeletable=*/true), _algoName(algoName) {}
SMESH_subMeshEventListener(/*isDeletable=*/true,"StdMeshers_Cartesian_3D::_EventListener"),
_algoName(algoName)
{}
// --------------------------------------------------------------------------------
// setting/unsetting _alwaysComputed flag to submeshes of inferior levels
//

View File

@ -150,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

View File

@ -246,7 +246,8 @@ namespace // INTERNAL STUFF
typedef map< SMESH_Mesh*, list< _ImportData > > TMesh2ImpData;
TMesh2ImpData _tgtMesh2ImportData;
_Listener():SMESH_subMeshEventListener(/*isDeletable=*/false){}
_Listener():SMESH_subMeshEventListener(/*isDeletable=*/false,
"StdMeshers_Import_1D::_Listener") {}
public:
// return poiter to a static listener

View File

@ -849,7 +849,8 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1()
// assure that mesh on the top face will be cleaned when it is cleaned
// on the bottom face
SMESH_subMesh* volSM = pMesh->GetSubMesh( myTool->GetSubShape() );
volSM->SetEventListener( new SMESH_subMeshEventListener(true),
volSM->SetEventListener( new SMESH_subMeshEventListener(true, // deletable by SMESH_subMesh
"StdMeshers_Penta_3D"),
SMESH_subMeshEventListenerData::MakeData( aSubMesh1 ),
aSubMesh0 ); // translate CLEAN event of aSubMesh0 to aSubMesh1
}

View File

@ -2069,8 +2069,8 @@ namespace {
struct HypModifWaiter: SMESH_subMeshEventListener
{
HypModifWaiter():SMESH_subMeshEventListener(0){} // won't be deleted by submesh
HypModifWaiter():SMESH_subMeshEventListener(false,// won't be deleted by submesh
"StdMeshers_ProjectionUtils::HypModifWaiter") {}
void ProcessEvent(const int event, const int eventType, SMESH_subMesh* subMesh,
EventListenerData*, const SMESH_Hypothesis*)
{
@ -2102,7 +2102,8 @@ namespace {
//================================================================================
SMESH_subMeshEventListener* GetSrcSubMeshListener() {
static SMESH_subMeshEventListener srcListener(0); // won't be deleted by submesh
static SMESH_subMeshEventListener srcListener(false, // won't be deleted by submesh
"StdMeshers_ProjectionUtils::SrcSubMeshListener");
return &srcListener;
}
}

View File

@ -449,7 +449,8 @@ namespace {
//================================================================================
PropagationMgr::PropagationMgr()
: SMESH_subMeshEventListener( false ) // won't be deleted by submesh
: SMESH_subMeshEventListener( false, // won't be deleted by submesh
"StdMeshers_Propagation::PropagationMgr")
{}
//================================================================================
/*!

View File

@ -146,7 +146,8 @@ namespace
*/
class TEdgeMarker : public SMESH_subMeshEventListener
{
TEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false) {}
TEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false,
"StdMeshers_RadialQuadrangle_1D2D::TEdgeMarker") {}
public:
//!< Return static listener
static SMESH_subMeshEventListener* getListener()

View File

@ -122,7 +122,9 @@ namespace VISCOUS
*/
class _SrinkShapeListener : SMESH_subMeshEventListener
{
_SrinkShapeListener(): SMESH_subMeshEventListener(/*isDeletable=*/false) {}
_SrinkShapeListener()
: SMESH_subMeshEventListener(/*isDeletable=*/false,
"StdMeshers_ViscousLayers::_SrinkShapeListener") {}
static SMESH_subMeshEventListener* Get() { static _SrinkShapeListener l; return &l; }
public:
virtual void ProcessEvent(const int event,
@ -162,7 +164,9 @@ namespace VISCOUS
*/
class _ViscousListener : SMESH_subMeshEventListener
{
_ViscousListener(): SMESH_subMeshEventListener(/*isDeletable=*/false) {}
_ViscousListener():
SMESH_subMeshEventListener(/*isDeletable=*/false,
"StdMeshers_ViscousLayers::_ViscousListener") {}
static SMESH_subMeshEventListener* Get() { static _ViscousListener l; return &l; }
public:
virtual void ProcessEvent(const int event,