Version: 6.3.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions

VISCOUS._ViscousListener Class Reference

Listener of events of 3D sub-meshes computed with viscous layers. More...

Inheritance diagram for VISCOUS._ViscousListener:
Inheritance graph
[legend]

Public Member Functions

virtual void ProcessEvent (const int event, const int eventType, SMESH_subMesh *subMesh, SMESH_subMeshEventListenerData *data, const SMESH_Hypothesis *hyp)
 Do something on a certain event.

Static Public Member Functions

static _MeshOfSolidGetSolidMesh (SMESH_Mesh *mesh, const TopoDS_Shape &solid, bool toCreate=false)
static void RemoveSolidMesh (SMESH_Mesh *mesh, const TopoDS_Shape &solid)

Private Member Functions

 _ViscousListener ()
bool IsDeletable () const

Static Private Member Functions

static SMESH_subMeshEventListenerGet ()

Detailed Description

Listener of events of 3D sub-meshes computed with viscous layers.

It is used to store data computed by _ViscousBuilder for a sub-mesh and to delete the data as soon as it has been used

Definition at line 161 of file StdMeshers_ViscousLayers.cxx.


Constructor & Destructor Documentation

VISCOUS._ViscousListener._ViscousListener ( ) [private]

Definition at line 163 of file StdMeshers_ViscousLayers.cxx.

: SMESH_subMeshEventListener(/*isDeletable=*/false) {}

Member Function Documentation

static SMESH_subMeshEventListener* VISCOUS._ViscousListener.Get ( ) [static, private]

Definition at line 164 of file StdMeshers_ViscousLayers.cxx.

{ static _ViscousListener l; return &l; }
static _MeshOfSolid* VISCOUS._ViscousListener.GetSolidMesh ( SMESH_Mesh mesh,
const TopoDS_Shape &  solid,
bool  toCreate = false 
) [static]

Definition at line 179 of file StdMeshers_ViscousLayers.cxx.

References SMESH_subMeshEventListenerData.mySubMeshes.

    {
      if ( !mesh ) return 0;
      SMESH_subMesh* sm = mesh->GetSubMesh(solid);
      _MeshOfSolid* data = (_MeshOfSolid*) sm->GetEventListenerData( Get() );
      if ( !data && toCreate )
      {
        data = new _MeshOfSolid(mesh);
        data->mySubMeshes.push_back( sm ); // to find SOLID by _MeshOfSolid
        sm->SetEventListener( Get(), data, sm );
      }
      return data;
    }
bool SMESH_subMeshEventListener.IsDeletable ( ) const [inherited]

Definition at line 52 of file SMESH_subMeshEventListener.hxx.

{ return myIsDeletable; }
virtual void VISCOUS._ViscousListener.ProcessEvent ( const int  event,
const int  eventType,
SMESH_subMesh subMesh,
SMESH_subMeshEventListenerData data,
const SMESH_Hypothesis hyp 
) [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 occures
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 subMesh 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 occures
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 from SMESH_subMeshEventListener.

Definition at line 166 of file StdMeshers_ViscousLayers.cxx.

References SMESH_subMesh.COMPUTE_EVENT.

    {
      if ( SMESH_subMesh::COMPUTE_EVENT == eventType )
      {
        // delete SMESH_ProxyMesh containing temporary faces
        subMesh->DeleteEventListener( this );
      }
    }
static void VISCOUS._ViscousListener.RemoveSolidMesh ( SMESH_Mesh mesh,
const TopoDS_Shape &  solid 
) [static]

Definition at line 195 of file StdMeshers_ViscousLayers.cxx.

    {
      mesh->GetSubMesh(solid)->DeleteEventListener( _ViscousListener::Get() );
    }
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS