SMESH_subMesh Class Reference

#include <SMESH_subMesh.hxx>

Collaboration diagram for SMESH_subMesh:
Collaboration graph

Public Types

enum  compute_state { NOT_READY, READY_TO_COMPUTE, COMPUTE_OK, FAILED_TO_COMPUTE }
enum  algo_state { NO_ALGO, MISSING_HYP, HYP_OK }
enum  algo_event {
  ADD_HYP, ADD_ALGO, REMOVE_HYP, REMOVE_ALGO,
  ADD_FATHER_HYP, ADD_FATHER_ALGO, REMOVE_FATHER_HYP, REMOVE_FATHER_ALGO,
  MODIF_HYP
}
enum  compute_event {
  MODIF_ALGO_STATE, COMPUTE, CLEAN, SUBMESH_COMPUTED,
  SUBMESH_RESTORED, MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE
}
enum  event_type { ALGO_EVENT, COMPUTE_EVENT }

Public Member Functions

 SMESH_subMesh (int Id, SMESH_Mesh *father, SMESHDS_Mesh *meshDS, const TopoDS_Shape &aSubShape)
virtual ~SMESH_subMesh ()
int GetId () const
SMESH_MeshGetFather ()
SMESHDS_SubMeshGetSubMeshDS ()
SMESHDS_SubMeshCreateSubMeshDS ()
SMESH_subMeshGetFirstToCompute ()
const std::map< int,
SMESH_subMesh * > & 
DependsOn ()
SMESH_subMeshIteratorPtr getDependsOnIterator (const bool includeSelf, const bool complexShapeFirst)
 Return iterator on the submeshes this one depends on.
const TopoDS_ShapeGetSubShape () const
void SetEventListener (EventListener *listener, EventListenerData *data, SMESH_subMesh *where)
 Sets an event listener and its data to a submesh.
EventListenerDataGetEventListenerData (EventListener *listener) const
 Return an event listener data.
void DeleteEventListener (EventListener *listener)
 Unregister the listener and delete it and it's data.
SMESH_Hypothesis::Hypothesis_Status AlgoStateEngine (int event, SMESH_Hypothesis *anHyp)
SMESH_Hypothesis::Hypothesis_Status SubMeshesAlgoStateEngine (int event, SMESH_Hypothesis *anHyp)
int GetAlgoState () const
int GetComputeState () const
SMESH_ComputeErrorPtrGetComputeError ()
void DumpAlgoState (bool isMain)
bool ComputeStateEngine (int event)
bool Evaluate (MapShapeNbElems &aResMap)
bool IsConform (const SMESH_Algo *theAlgo)
bool CanAddHypothesis (const SMESH_Hypothesis *theHypothesis) const
bool IsApplicableHypotesis (const SMESH_Hypothesis *theHypothesis) const
SMESH_Hypothesis::Hypothesis_Status CheckConcurentHypothesis (const int theHypType)
bool IsEmpty () const
 Return true if no mesh entities is bound to the submesh.
bool IsMeshComputed () const
void SetIsAlwaysComputed (bool isAlCo)
 Allow algo->Compute() if a subshape of lower dim is meshed but none mesh entity is bound to it.
bool IsAlwaysComputed ()

Static Public Member Functions

static bool IsApplicableHypotesis (const SMESH_Hypothesis *theHypothesis, const TopAbs_ShapeEnum theShapeType)

Protected Member Functions

void SetEventListener (EventListener *listener, EventListenerData *data)
 Sets an event listener and its data to a submesh.
void NotifyListenersOnEvent (const int event, const event_type eventType, SMESH_Hypothesis *hyp=0)
 Notify stored event listeners on the occured event.
void DeleteOwnListeners ()
 Delete event listeners depending on algo of this submesh.
void InsertDependence (const TopoDS_Shape aSubShape)
bool SubMeshesComputed ()
bool SubMeshesReady ()
void RemoveSubMeshElementsAndNodes ()
void UpdateDependantsState (const compute_event theEvent)
void UpdateSubMeshState (const compute_state theState)
void ComputeSubMeshStateEngine (int event)
void CleanDependants ()
void CleanDependsOn ()
void SetAlgoState (int state)
TopoDS_Shape GetCollection (SMESH_Gen *theGen, SMESH_Algo *theAlgo, bool &theSubComputed)
 Return a shape containing all sub-shapes of the MainShape that can be meshed at once along with _subShape.
bool ApplyToCollection (SMESH_Algo *theAlgo, const TopoDS_Shape &theCollection)
 Apply theAlgo to all subshapes in theCollection.
bool CheckComputeError (SMESH_Algo *theAlgo, const TopoDS_Shape &theShape=TopoDS_Shape())
 Update compute_state by _computeError.
const SMESH_HypothesisGetSimilarAttached (const TopoDS_Shape &theShape, const SMESH_Hypothesis *theHyp, const int theHypType=0)
 Return a hypothesis attached to theShape.

Protected Attributes

std::map< EventListener
*, EventListenerData * > 
myEventListeners
 < event listeners to notify
std::list< std::pair
< SMESH_subMesh
*, EventListener * > > 
myOwnListeners
TopoDS_Shape _subShape
SMESHDS_SubMesh_subMeshDS
SMESH_Mesh_father
int _Id
std::map< int, SMESH_subMesh * > _mapDepend
bool _dependenceAnalysed
int _algoState
int _computeState
SMESH_ComputeErrorPtr _computeError
bool _alwaysComputed

Detailed Description

Definition at line 59 of file SMESH_subMesh.hxx.


Member Enumeration Documentation

Enumerator:
NOT_READY 
READY_TO_COMPUTE 
COMPUTE_OK 
FAILED_TO_COMPUTE 

Definition at line 87 of file SMESH_subMesh.hxx.

Enumerator:
NO_ALGO 
MISSING_HYP 
HYP_OK 

Definition at line 92 of file SMESH_subMesh.hxx.

Enumerator:
ADD_HYP 
ADD_ALGO 
REMOVE_HYP 
REMOVE_ALGO 
ADD_FATHER_HYP 
ADD_FATHER_ALGO 
REMOVE_FATHER_HYP 
REMOVE_FATHER_ALGO 
MODIF_HYP 

Definition at line 96 of file SMESH_subMesh.hxx.

Enumerator:
MODIF_ALGO_STATE 
COMPUTE 
CLEAN 
SUBMESH_COMPUTED 
SUBMESH_RESTORED 
MESH_ENTITY_REMOVED 
CHECK_COMPUTE_STATE 

Definition at line 104 of file SMESH_subMesh.hxx.

Enumerator:
ALGO_EVENT 
COMPUTE_EVENT 

Definition at line 110 of file SMESH_subMesh.hxx.


Constructor & Destructor Documentation

SMESH_subMesh.SMESH_subMesh ( int  Id,
SMESH_Mesh father,
SMESHDS_Mesh meshDS,
const TopoDS_Shape aSubShape 
)
virtual SMESH_subMesh.~SMESH_subMesh (  )  [virtual]

Member Function Documentation

int SMESH_subMesh.GetId (  )  const
SMESH_Mesh* SMESH_subMesh.GetFather (  ) 

Definition at line 68 of file SMESH_subMesh.hxx.

SMESHDS_SubMesh* SMESH_subMesh.GetSubMeshDS (  ) 
SMESHDS_SubMesh* SMESH_subMesh.CreateSubMeshDS (  ) 
SMESH_subMesh* SMESH_subMesh.GetFirstToCompute (  ) 
const std::map< int, SMESH_subMesh * >& SMESH_subMesh.DependsOn (  ) 
SMESH_subMeshIteratorPtr SMESH_subMesh.getDependsOnIterator ( const bool  includeSelf,
const bool  complexShapeFirst 
)

Return iterator on the submeshes this one depends on.

const TopoDS_Shape& SMESH_subMesh.GetSubShape (  )  const
void SMESH_subMesh.SetEventListener ( EventListener listener,
EventListenerData data,
SMESH_subMesh where 
)

Sets an event listener and its data to a submesh.

Parameters:
listener - the listener to store
data - the listener data to store
where - the submesh to store the listener and it's data

The method remembers the submesh it puts the listener in order to delete them when HYP_OK algo_state is lost After being set, event listener is notified on each event of submesh.

EventListenerData* SMESH_subMesh.GetEventListenerData ( EventListener listener  )  const

Return an event listener data.

Parameters:
listener - the listener whose data is
Return values:
EventListenerData* - found data, maybe NULL
void SMESH_subMesh.DeleteEventListener ( EventListener listener  ) 

Unregister the listener and delete it and it's data.

Parameters:
listener - the event listener to delete
void SMESH_subMesh.SetEventListener ( EventListener listener,
EventListenerData data 
) [protected]

Sets an event listener and its data to a submesh.

Parameters:
listener - the listener to store
data - the listener data to store

After being set, event listener is notified on each event of a submesh.

void SMESH_subMesh.NotifyListenersOnEvent ( const int  event,
const event_type  eventType,
SMESH_Hypothesis hyp = 0 
) [protected]

Notify stored event listeners on the occured event.

Parameters:
event - algo_event or compute_event itself
eventType - algo_event or compute_event
hyp - hypothesis, if eventType is algo_event
void SMESH_subMesh.DeleteOwnListeners (  )  [protected]

Delete event listeners depending on algo of this submesh.

SMESH_Hypothesis::Hypothesis_Status SMESH_subMesh.AlgoStateEngine ( int  event,
SMESH_Hypothesis anHyp 
)
SMESH_Hypothesis::Hypothesis_Status SMESH_subMesh.SubMeshesAlgoStateEngine ( int  event,
SMESH_Hypothesis anHyp 
)
int SMESH_subMesh.GetAlgoState (  )  const

Definition at line 187 of file SMESH_subMesh.hxx.

int SMESH_subMesh.GetComputeState (  )  const

Definition at line 188 of file SMESH_subMesh.hxx.

SMESH_ComputeErrorPtr& SMESH_subMesh.GetComputeError (  ) 

Definition at line 189 of file SMESH_subMesh.hxx.

void SMESH_subMesh.DumpAlgoState ( bool  isMain  ) 
bool SMESH_subMesh.ComputeStateEngine ( int  event  ) 
bool SMESH_subMesh.Evaluate ( MapShapeNbElems aResMap  ) 
bool SMESH_subMesh.IsConform ( const SMESH_Algo theAlgo  ) 
bool SMESH_subMesh.CanAddHypothesis ( const SMESH_Hypothesis theHypothesis  )  const
static bool SMESH_subMesh.IsApplicableHypotesis ( const SMESH_Hypothesis theHypothesis,
const TopAbs_ShapeEnum  theShapeType 
) [static]
bool SMESH_subMesh.IsApplicableHypotesis ( const SMESH_Hypothesis theHypothesis  )  const

Definition at line 207 of file SMESH_subMesh.hxx.

References IsApplicableHypotesis().

Referenced by IsApplicableHypotesis().

Here is the call graph for this function:

Here is the caller graph for this function:

SMESH_Hypothesis::Hypothesis_Status SMESH_subMesh.CheckConcurentHypothesis ( const int  theHypType  ) 
bool SMESH_subMesh.IsEmpty (  )  const

Return true if no mesh entities is bound to the submesh.

bool SMESH_subMesh.IsMeshComputed (  )  const
void SMESH_subMesh.SetIsAlwaysComputed ( bool  isAlCo  ) 

Allow algo->Compute() if a subshape of lower dim is meshed but none mesh entity is bound to it.

bool SMESH_subMesh.IsAlwaysComputed (  ) 

Definition at line 228 of file SMESH_subMesh.hxx.

void SMESH_subMesh.InsertDependence ( const TopoDS_Shape  aSubShape  )  [protected]
bool SMESH_subMesh.SubMeshesComputed (  )  [protected]
bool SMESH_subMesh.SubMeshesReady (  )  [protected]
void SMESH_subMesh.RemoveSubMeshElementsAndNodes (  )  [protected]
void SMESH_subMesh.UpdateDependantsState ( const compute_event  theEvent  )  [protected]
void SMESH_subMesh.UpdateSubMeshState ( const compute_state  theState  )  [protected]
void SMESH_subMesh.ComputeSubMeshStateEngine ( int  event  )  [protected]
void SMESH_subMesh.CleanDependants (  )  [protected]
void SMESH_subMesh.CleanDependsOn (  )  [protected]
void SMESH_subMesh.SetAlgoState ( int  state  )  [protected]
TopoDS_Shape SMESH_subMesh.GetCollection ( SMESH_Gen theGen,
SMESH_Algo theAlgo,
bool &  theSubComputed 
) [protected]

Return a shape containing all sub-shapes of the MainShape that can be meshed at once along with _subShape.

bool SMESH_subMesh.ApplyToCollection ( SMESH_Algo theAlgo,
const TopoDS_Shape theCollection 
) [protected]

Apply theAlgo to all subshapes in theCollection.

bool SMESH_subMesh.CheckComputeError ( SMESH_Algo theAlgo,
const TopoDS_Shape theShape = TopoDS_Shape() 
) [protected]

Update compute_state by _computeError.

Return values:
bool - false if there are errors
const SMESH_Hypothesis* SMESH_subMesh.GetSimilarAttached ( const TopoDS_Shape theShape,
const SMESH_Hypothesis theHyp,
const int  theHypType = 0 
) [protected]

Return a hypothesis attached to theShape.

If theHyp is provided, similar but not same hypotheses is returned; else an applicable ones having theHypType is returned


Field Documentation

< event listeners to notify

event listeners to delete when HYP_OK algo_state is lost

Definition at line 150 of file SMESH_subMesh.hxx.

std::list< std::pair< SMESH_subMesh*, EventListener* > > SMESH_subMesh.myOwnListeners [protected]

Definition at line 151 of file SMESH_subMesh.hxx.

Definition at line 281 of file SMESH_subMesh.hxx.

Definition at line 282 of file SMESH_subMesh.hxx.

Definition at line 283 of file SMESH_subMesh.hxx.

int SMESH_subMesh._Id [protected]

Definition at line 284 of file SMESH_subMesh.hxx.

std::map< int, SMESH_subMesh * > SMESH_subMesh._mapDepend [protected]

Definition at line 286 of file SMESH_subMesh.hxx.

Definition at line 287 of file SMESH_subMesh.hxx.

Definition at line 289 of file SMESH_subMesh.hxx.

Definition at line 290 of file SMESH_subMesh.hxx.

Definition at line 291 of file SMESH_subMesh.hxx.

Definition at line 296 of file SMESH_subMesh.hxx.


Generated on 12 Oct 2013 for SALOME - SMESH by  doxygen 1.6.1