Version: 9.16.0
SMESH_subMesh Class Reference

#include <SMESH_subMesh.hxx>

Data Structures

struct  OwnListenerData
 

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 , COMPUTE_SUBMESH , COMPUTE_NOGEOM ,
  COMPUTE_CANCELED , CLEAN , SUBMESH_COMPUTED , SUBMESH_RESTORED ,
  SUBMESH_LOADED , 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)
 default constructor: More...
 
virtual ~SMESH_subMesh ()
 
int GetId () const
 
SMESH_MeshGetFather ()
 
SMESHDS_SubMeshGetSubMeshDS ()
 
const SMESHDS_SubMeshGetSubMeshDS () const
 
SMESHDS_SubMeshCreateSubMeshDS ()
 
SMESH_subMeshGetFirstToCompute ()
 
SMESH_AlgoGetAlgo () const
 Returns a current algorithm. More...
 
SMESH_AlgoCopyAlgo () const
 
const std::map< int, SMESH_subMesh * > & DependsOn ()
 Returns all sub-meshes this one depend on. More...
 
bool DependsOn (const SMESH_subMesh *other) const
 Return true if this sub-mesh depends on other. More...
 
bool DependsOn (const int shapeID) const
 Return true if this sub-mesh depends on a shape. More...
 
SMESH_subMeshIteratorPtr getDependsOnIterator (const bool includeSelf, const bool complexShapeFirst=false) const
 Return iterator on the sub-meshes this one depends on. More...
 
const std::vector< SMESH_subMesh * > & GetAncestors () const
 Returns ancestor sub-meshes. More...
 
void ClearAncestors ()
 Clears the vector of ancestor sub-meshes. More...
 
const TopoDS_Shape & GetSubShape () const
 Return a shape of this sub-mesh. More...
 
void SetEventListener (EventListener *listener, EventListenerData *data, SMESH_subMesh *where)
 Set an event listener and its data to a submesh. More...
 
void AddOwnListener (EventListener *listener)
 Adds event listener to a submesh. More...
 
EventListenerDataGetEventListenerData (EventListener *listener, const bool myOwn=false) const
 Return an event listener data. More...
 
EventListenerDataGetEventListenerData (const std::string &listenerName, const bool myOwn=false) const
 Return an event listener data. More...
 
void DeleteEventListener (EventListener *listener)
 Unregister the listener and delete it and it's data. More...
 
SMESH_Hypothesis::Hypothesis_Status AlgoStateEngine (algo_event event, SMESH_Hypothesis *anHyp)
 Treats modification of hypotheses definition. More...
 
SMESH_Hypothesis::Hypothesis_Status SubMeshesAlgoStateEngine (algo_event event, SMESH_Hypothesis *anHyp, bool exitOnFatal=false)
 Send an event to sub-meshes. More...
 
algo_state GetAlgoState () const
 
compute_state GetComputeState () const
 
SMESH_ComputeErrorPtrGetComputeError ()
 
void DumpAlgoState (bool isMain)
 
bool ComputeStateEngine (compute_event event)
 
void ComputeSubMeshStateEngine (compute_event event, const bool includeSelf=false)
 
bool Evaluate (MapShapeNbElems &aResMap)
 
bool IsConform (const SMESH_Algo *theAlgo)
 
bool CanAddHypothesis (const SMESH_Hypothesis *theHypothesis) const
 
bool IsApplicableHypothesis (const SMESH_Hypothesis *theHypothesis) const
 
SMESH_Hypothesis::Hypothesis_Status CheckConcurrentHypothesis (SMESH_Hypothesis *theHypothesis)
 
bool IsEmpty () const
 Return true if no mesh entities is bound to the submesh. More...
 
bool IsMeshComputed () const
 
bool IsComputedPartially () const
 Check if any upper level sub-shape is not computed. More...
 
void SetAllowedSubShapes (const TopTools_IndexedMapOfShape *subShapes)
 Set sub-shapes that are allowed to compute at once by a multidimensional algo. More...
 
void SetIsAlwaysComputed (bool isAlCo)
 Allow algo->Compute() if a subshape of lower dim is meshed but none mesh entity is bound to it. More...
 
bool IsAlwaysComputed () const
 
bool SubMeshesComputed (bool *isFailedToCompute=0) const
 Return true if all sub-meshes have been meshed. More...
 
int GetComputeCost () const
 Return cost of computing this sub-mesh. More...
 
bool FindIntersection (const SMESH_subMesh *theOther, std::set< const SMESH_subMesh * > &theSetOfCommon) const
 Find common submeshes (based on shared subshapes with other. More...
 

Static Public Member Functions

static bool IsApplicableHypothesis (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. More...
 
void notifyListenersOnEvent (const int event, const event_type eventType, SMESH_Hypothesis *hyp=0)
 Notify stored event listeners on the occurred event. More...
 
void deleteOwnListeners ()
 Delete event listeners depending on algo of this submesh. More...
 
void loadDependentMeshes ()
 loads dependent meshes on SUBMESH_LOADED event More...
 
void insertDependence (const TopoDS_Shape aShape, TopAbs_ShapeEnum aSubType, TopAbs_ShapeEnum avoidType=TopAbs_SHAPE)
 Add sub-meshes on sub-shapes of a given type into the dependence map. More...
 
void removeSubMeshElementsAndNodes ()
 
void updateDependantsState (const compute_event theEvent)
 
void updateSubMeshState (const compute_state theState)
 
void cleanDependants ()
 
void cleanDependsOn (SMESH_Algo *algoRequiringCleaning=0)
 Remove elements from sub-meshes. More...
 
void setAlgoState (algo_state state)
 
TopoDS_Shape getCollection (SMESH_Gen *theGen, SMESH_Algo *theAlgo, bool &theSubComputed, bool &theSubFailed, std::vector< SMESH_subMesh * > &theSubs)
 Return a shape containing all sub-shapes of the MainShape that can be meshed at once along with _subShape. More...
 
bool checkComputeError (SMESH_Algo *theAlgo, const bool theComputeOK, const TopoDS_Shape &theShape=TopoDS_Shape())
 Update compute_state by _computeError. More...
 
const SMESH_HypothesisgetSimilarAttached (const TopoDS_Shape &theShape, const SMESH_Hypothesis *theHyp, const int theHypType=0)
 Return a hypothesis attached to theShape. More...
 
int computeCost () const
 Return cost of computing this sub-mesh. More...
 

Protected Attributes

std::map< EventListener *, EventListenerData * > _eventListeners
 < event listeners to notify More...
 
std::list< OwnListenerData_ownListeners
 
TopoDS_Shape _subShape
 
SMESHDS_SubMesh_subMeshDS
 
SMESH_Mesh_father
 
int _Id
 
std::map< int, SMESH_subMesh * > _mapDepend
 
bool _dependenceAnalysed
 
std::vector< SMESH_subMesh * > _ancestors
 
SMESH_Algo_algo
 
TopoDS_Shape _algoShape
 
algo_state _algoState
 
compute_state _computeState
 
SMESH_ComputeErrorPtr _computeError
 
int _computeCost
 
int _realComputeCost
 
bool _alwaysComputed
 
const TopTools_IndexedMapOfShape * _allowedSubShapes
 

Member Enumeration Documentation

◆ algo_event

Enumerator
ADD_HYP 
ADD_ALGO 
REMOVE_HYP 
REMOVE_ALGO 
ADD_FATHER_HYP 
ADD_FATHER_ALGO 
REMOVE_FATHER_HYP 
REMOVE_FATHER_ALGO 
MODIF_HYP 

◆ algo_state

Enumerator
NO_ALGO 
MISSING_HYP 
HYP_OK 

◆ compute_event

Enumerator
MODIF_ALGO_STATE 
COMPUTE 
COMPUTE_SUBMESH 
COMPUTE_NOGEOM 
COMPUTE_CANCELED 
CLEAN 
SUBMESH_COMPUTED 
SUBMESH_RESTORED 
SUBMESH_LOADED 
MESH_ENTITY_REMOVED 
CHECK_COMPUTE_STATE 

◆ compute_state

Enumerator
NOT_READY 
READY_TO_COMPUTE 
COMPUTE_OK 
FAILED_TO_COMPUTE 

◆ event_type

Enumerator
ALGO_EVENT 
COMPUTE_EVENT 

Constructor & Destructor Documentation

◆ SMESH_subMesh()

SMESH_subMesh::SMESH_subMesh ( int  Id,
SMESH_Mesh father,
SMESHDS_Mesh meshDS,
const TopoDS_Shape &  aSubShape 
)

◆ ~SMESH_subMesh()

SMESH_subMesh::~SMESH_subMesh ( )
virtual

References deleteOwnListeners().

Member Function Documentation

◆ AddOwnListener()

void SMESH_subMesh::AddOwnListener ( EventListener listener)

Adds event listener to a submesh.

Parameters
listener- the listener to store

It remembers the listener in order to clean it when submesh is deleted

References _ownListeners.

◆ AlgoStateEngine()

SMESH_Hypothesis::Hypothesis_Status SMESH_subMesh::AlgoStateEngine ( algo_event  event,
SMESH_Hypothesis anHyp 
)

Treats modification of hypotheses definition.

Parameters
[in]event- what happens
[in]anHyp- a hypothesis
Returns
SMESH_Hypothesis::Hypothesis_Status - a treatment result.

Optional description of a problematic situation (if any) can be retrieved via GetComputeError().

References _algo, _algoState, _computeError, _computeState, _father, _Id, _mapDepend, _realComputeCost, _subShape, ADD_ALGO, ADD_FATHER_ALGO, ADD_FATHER_HYP, ADD_HYP, SMESHDS_Mesh::AddHypothesis(), ALGO_EVENT, SMESH_HypoFilter::And(), SMESH_HypoFilter::AndNot(), CanAddHypothesis(), CHECK_COMPUTE_STATE, SMESH_Algo::CheckHypothesis(), CLEAN, cleanDependsOn(), computeCost(), ComputeStateEngine(), ComputeSubMeshStateEngine(), deleteOwnListeners(), GetAlgo(), SMESH_Gen::GetAlgo(), GetAncestors(), SMESH_Algo::GetComputeError(), SMESH_Hypothesis::GetDim(), SMESH_Mesh::GetGen(), SMESH_Mesh::GetHypothesis(), SMESH_Mesh::GetMeshDS(), SMESHDS_Hypothesis::GetName(), getSimilarAttached(), SMESHDS_Hypothesis::GetType(), SMESH_Mesh::HasShapeToMesh(), SMESH_HypoFilter::HasType(), SMESH_Hypothesis::HYP_ALREADY_EXIST, SMESH_Hypothesis::HYP_BAD_DIM, SMESH_Hypothesis::HYP_HIDDEN_ALGO, SMESH_Hypothesis::HYP_HIDING_ALGO, SMESH_Hypothesis::HYP_INCOMPATIBLE, SMESH_Hypothesis::HYP_NEED_SHAPE, SMESH_Hypothesis::HYP_NOTCONFORM, SMESH_Hypothesis::HYP_OK, HYP_OK, SMESH_HypoFilter::Init(), SMESH_Algo::InitComputeError(), SMESH_HypoFilter::Is(), SMESH_HypoFilter::IsAlgo(), IsApplicableHypothesis(), SMESH_HypoFilter::IsApplicableTo(), SMESH_Hypothesis::IsAuxiliary(), IsConform(), SMESH_Mesh::IsNotConformAllowed(), SMESH_Hypothesis::IsStatusFatal(), SMESH_MesherHelper::IsSubShape(), SMESH_Mesh::IsUsedHypothesis(), MESSAGE, MISSING_HYP, MODIF_ALGO_STATE, MODIF_HYP, SMESH_Algo::NeedDiscreteBoundary(), SMESH_Algo::NeedShape(), NO_ALGO, notifyListenersOnEvent(), SMESH_HypoFilter::Or(), READY_TO_COMPUTE, REMOVE_ALGO, REMOVE_FATHER_ALGO, REMOVE_FATHER_HYP, REMOVE_HYP, SMESHDS_Mesh::RemoveHypothesis(), setAlgoState(), SMESH_Algo::SetEventListener(), SetIsAlwaysComputed(), and SMESH_Algo::SupportSubmeshes().

Referenced by SMESH_Mesh::AddHypothesis(), SMESH_Mesh::RemoveHypothesis(), and SubMeshesAlgoStateEngine().

◆ CanAddHypothesis()

bool SMESH_subMesh::CanAddHypothesis ( const SMESH_Hypothesis theHypothesis) const

◆ checkComputeError()

bool SMESH_subMesh::checkComputeError ( SMESH_Algo theAlgo,
const bool  theComputeOK,
const TopoDS_Shape &  theShape = TopoDS_Shape() 
)
protected

Update compute_state by _computeError.

Update compute_state by _computeError and send proper events to dependent submeshes.

Return values
bool- false if there are errors
bool- true if _computeError is NOT set

References _computeError, _computeState, _father, _Id, _subShape, checkComputeError(), COMPERR_NO_MESH_ON_SHAPE, COMPUTE_OK, Edge, FAILED_TO_COMPUTE, getDependsOnIterator(), SMESHDS_Hypothesis::GetName(), SMESH_Mesh::GetSubMesh(), GetSubShape(), SMESH_Algo::isDegenerated(), IsMeshComputed(), SMESH_Algo::NeedDiscreteBoundary(), SMESH_ComputeError::New(), SMESH_Algo::OnlyUnaryInput(), SUBMESH_COMPUTED, and updateDependantsState().

Referenced by checkComputeError(), and ComputeStateEngine().

◆ CheckConcurrentHypothesis()

◆ cleanDependants()

void SMESH_subMesh::cleanDependants ( )
protected

◆ cleanDependsOn()

◆ ClearAncestors()

void SMESH_subMesh::ClearAncestors ( )

Clears the vector of ancestor sub-meshes.

References _ancestors.

◆ computeCost()

int SMESH_subMesh::computeCost ( ) const
protected

Return cost of computing this sub-mesh.

The cost depends on the shape type and number of sub-meshes this one DependsOn().

Returns
int - the computation cost in abstract units.

References _computeCost, _subShape, computeCost(), and getDependsOnIterator().

Referenced by AlgoStateEngine(), and computeCost().

◆ ComputeStateEngine()

bool SMESH_subMesh::ComputeStateEngine ( compute_event  event)

References _algo, _algoState, _alwaysComputed, _computeError, _computeState, _father, _Id, _subShape, SMESHDS_Mesh::AddNode(), SMESHDS_Hypothesis::ALGO_1D, SMESHDS_Hypothesis::ALGO_3D, SMESH_Algo::CancelCompute(), CHECK_COMPUTE_STATE, checkComputeError(), SMESH_Algo::CheckHypothesis(), SMDS_Mesh::CheckMemory(), CLEAN, cleanDependants(), cleanDependsOn(), cleanSubMesh(), COMPERR_ALGO_FAILED, COMPERR_BAD_INPUT_MESH, COMPERR_EXCEPTION, COMPERR_MEMORY_PB, COMPERR_OCC_EXCEPTION, COMPERR_OK, COMPERR_SLM_EXCEPTION, COMPERR_STD_EXCEPTION, COMPERR_WARNING, SMESH_Algo::Compute(), COMPUTE, COMPUTE_CANCELED, COMPUTE_EVENT, COMPUTE_NOGEOM, COMPUTE_OK, COMPUTE_SUBMESH, ComputeStateEngine(), ComputeSubMeshStateEngine(), Edge, FAILED_TO_COMPUTE, GetAlgo(), getCollection(), SMESH_Algo::GetComputeError(), GetComputeState(), getDependsOnIterator(), SMESH_Mesh::GetGen(), SMESH_Mesh::GetHypothesisList(), GetId(), SMESH_Mesh::GetIsModified(), SMESH_Mesh::GetMeshDS(), SMESHDS_Hypothesis::GetName(), SMESH_Mesh::GetParallelElement(), SMESH_Mesh::GetSubMesh(), GetSubMeshDS(), GetSubShape(), SMESH_Algo::GetUsedHypothesis(), SMESH_Mesh::HasShapeToMesh(), HYP_OK, SMESH_Algo::InitComputeError(), SMESH_Algo::isDegenerated(), IsEmpty(), IsMeshComputed(), SMESH_Mesh::IsNotConformAllowed(), SMESH_Mesh::IsParallel(), loadDependentMeshes(), MESH_ENTITY_REMOVED, MESSAGE, MISSING_HYP, MODIF_ALGO_STATE, SMESHDS_SubMesh::NbNodes(), SMESH_Algo::NeedDiscreteBoundary(), SMESH_ComputeError::New(), NOT_READY, notifyListenersOnEvent(), OCC_CATCH_SIGNALS, SMESH_Algo::OnlyUnaryInput(), READY_TO_COMPUTE, removeSubMeshElementsAndNodes(), setAlgoState(), SMESH_MesherHelper::SetElementsOnShape(), SMESHDS_Mesh::SetNodeOnVertex(), SMESH_Algo::setSubMeshesToCompute(), SMESH_MesherHelper::SetSubShape(), SMESH_Comment::Stream(), SUBMESH_COMPUTED, SUBMESH_LOADED, SUBMESH_RESTORED, SubMeshesComputed(), SMESH_Algo::SubMeshesToCompute(), SMESH_Algo::SubmeshRestored(), SMESH_Algo::SupportSubmeshes(), updateDependantsState(), and SMESH_ComputeError::Worst().

Referenced by AlgoStateEngine(), cleanDependsOn(), StdMeshers_Penta_3D::ClearMeshOnFxy1(), StdMeshers_Prism_3D::compute(), StdMeshers_CompositeSegment_1D::Compute(), StdMeshers_Import_1D2D::Compute(), StdMeshers_PolyhedronPerSolid_3D::Compute(), StdMeshers_Prism_3D::Compute(), StdMeshers_Prism_3D::computeBase(), ComputeStateEngine(), StdMeshers_Prism_3D::computeWalls(), SMESH_Gen_i::CopyMeshWithGeom(), SMESH_Pattern::createElements(), VISCOUS_3D::_ViscousBuilder::error(), SMESH_PreMeshInfo::FullLoadFromFile(), StdMeshers_Quadrangle_2D::getEnforcedUV(), StdMeshers_Penta_3D::MakeMeshOnFxy1(), StdMeshers_Prism_3D::makeQuadsForOutInProjection(), SMESH_Gen::parallelComputeSubMeshes(), StdMeshers_Prism_3D::project2dMesh(), VISCOUS_2D::_ViscousBuilder2D::refine(), VISCOUS_2D::_ViscousBuilder2D::removeMeshFaces(), SMESH_Gen::sequentialComputeSubMeshes(), SetIsAlwaysComputed(), and VISCOUS_3D::_ViscousBuilder::shrink().

◆ ComputeSubMeshStateEngine()

void SMESH_subMesh::ComputeSubMeshStateEngine ( compute_event  event,
const bool  includeSelf = false 
)

◆ CopyAlgo()

SMESH_Algo * SMESH_subMesh::CopyAlgo ( ) const

◆ CreateSubMeshDS()

◆ DeleteEventListener()

void SMESH_subMesh::DeleteEventListener ( EventListener listener)

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

Unregister the listener and delete listener's data.

Parameters
listener- the event listener to delete
listener- the event listener

References _eventListeners.

Referenced by VISCOUS_3D::_ViscousListener::ProcessEvent(), and VISCOUS_3D::_ViscousListener::RemoveSolidMesh().

◆ deleteOwnListeners()

void SMESH_subMesh::deleteOwnListeners ( )
protected

Delete event listeners depending on algo of this submesh.

References _father, _ownListeners, MESHCUT::d, SMESH_Mesh::FindMesh(), and SMESH_Mesh::GetSubMeshContaining().

Referenced by AlgoStateEngine(), and ~SMESH_subMesh().

◆ DependsOn() [1/3]

◆ DependsOn() [2/3]

bool SMESH_subMesh::DependsOn ( const int  shapeID) const

Return true if this sub-mesh depends on a shape.

References _father, DependsOn(), and SMESH_Mesh::GetSubMeshContaining().

◆ DependsOn() [3/3]

bool SMESH_subMesh::DependsOn ( const SMESH_subMesh other) const

Return true if this sub-mesh depends on other.

References _mapDepend.

◆ DumpAlgoState()

◆ Evaluate()

◆ FindIntersection()

bool SMESH_subMesh::FindIntersection ( const SMESH_subMesh theOther,
std::set< const SMESH_subMesh * > &  theSetOfCommon 
) const

Find common submeshes (based on shared subshapes with other.

Find common submeshes (based on shared sub-shapes with other.

Parameters
theOthersubmesh to check
theCommonIdsset of common submesh IDs NOTE: this method does not cleat set before collect common IDs
theOthersubmesh to check
theSetOfCommonset of common submesh

References _mapDepend, and GetId().

◆ GetAlgo()

◆ GetAlgoState()

◆ GetAncestors()

◆ getCollection()

TopoDS_Shape SMESH_subMesh::getCollection ( SMESH_Gen theGen,
SMESH_Algo theAlgo,
bool theSubComputed,
bool theSubFailed,
std::vector< SMESH_subMesh * > &  theSubs 
)
protected

◆ GetComputeCost()

int SMESH_subMesh::GetComputeCost ( ) const

Return cost of computing this sub-mesh.

If hypotheses are not well defined, zero is returned

Returns
int - the computation cost in abstract units.

References _realComputeCost.

Referenced by SMESH_Mesh::GetComputeProgress().

◆ GetComputeError()

◆ GetComputeState()

◆ getDependsOnIterator()

SMESH_subMeshIteratorPtr SMESH_subMesh::getDependsOnIterator ( const bool  includeSelf,
const bool  reverse = false 
) const

Return iterator on the sub-meshes this one depends on.

Return iterator on the submeshes this one depends on.

By default most simple sub-meshes go first.

Parameters
includeSelf- this submesh to be returned also
reverse- if true, complex shape submeshes go first

References DependsOn(), and reverse().

Referenced by SMESH_Mesh::AddHypothesis(), checkComputeError(), checkConformIgnoredAlgos(), SMESH_Mesh::CheckHypothesesOnSubMeshes(), checkMissing(), cleanDependsOn(), StdMeshers_Prism_3D::compute(), StdMeshers_PolyhedronPerSolid_3D::Compute(), StdMeshers_Prism_3D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_Prism_3D::computeBase(), computeCost(), VISCOUS_3D::_ViscousBuilder::computeGeomSize(), ComputeStateEngine(), ComputeSubMeshStateEngine(), StdMeshers_Prism_3D::computeWalls(), SMESH_Gen_i::CopyMeshWithGeom(), Evaluate(), StdMeshers_PolyhedronPerSolid_3D::Evaluate(), StdMeshers_Projection_1D2D::Evaluate(), VISCOUS_3D::_ViscousBuilder::findCollisionEdges(), VISCOUS_3D::_ViscousBuilder::findShapesToSmooth(), VISCOUS_3D::_ViscousBuilder::findSolidsWithLayers(), SMESH_Gen::GetAlgoState(), getCollection(), SMESH_Gen_i::GetComputeErrors(), GetFirstToCompute(), VISCOUS_3D::_ConvexFace::GetMaxCurvature(), SMESH_subMesh_i::GetNumberOfNodes(), SMESH_Mesh::GetSubMesh(), getSubMeshes(), StdMeshers_Prism_3D::initPrism(), IsComputedPartially(), SMESH_MesherHelper::IsDistorted2D(), SMESH_Gen::parallelComputeSubMeshes(), SMESH_Gen_i::Precompute(), VISCOUS_3D::_ViscousBuilder::putOnOffsetSurface(), SMESH_Mesh::RemoveHypothesis(), SMESH_Gen::sequentialComputeSubMeshes(), MeshEditor_I::TSearchersDeleter::Set(), StdMeshers_CompositeSegment_1D::SetEventListener(), VISCOUS_3D::_ViscousBuilder::shrink(), SubMeshesAlgoStateEngine(), SubMeshesComputed(), and updateSubMeshState().

◆ GetEventListenerData() [1/2]

EventListenerData * SMESH_subMesh::GetEventListenerData ( const std::string &  listenerName,
const bool  myOwn = false 
) const

Return an event listener data.

Parameters
listenerName- the listener name
myOwn- if true, returns a listener set by this sub-mesh, else returns a listener listening to events of this sub-mesh
Return values
EventListenerData*- found data, maybe NULL

References _eventListeners, _father, _ownListeners, MESHCUT::d, and SMESH_Mesh::MeshExists().

◆ GetEventListenerData() [2/2]

EventListenerData * SMESH_subMesh::GetEventListenerData ( EventListener listener,
const bool  myOwn = false 
) const

Return an event listener data.

Parameters
listener- the listener whose data is
myOwn- if true, returns a listener set by this sub-mesh, else returns a listener listening to events of this sub-mesh
Return values
EventListenerData*- found data, maybe NULL

References _eventListeners, _father, _ownListeners, MESHCUT::d, and SMESH_Mesh::MeshExists().

Referenced by VISCOUS_2D::_ProxyMeshHolder::FindProxyMeshOfFace(), VISCOUS_3D::_ViscousListener::GetSolidMesh(), StdMeshers_ProjectionUtils::SetEventListener(), and VISCOUS_3D::ToClearSubWithMain().

◆ GetFather()

◆ GetFirstToCompute()

SMESH_subMesh * SMESH_subMesh::GetFirstToCompute ( )

◆ GetId()

◆ getSimilarAttached()

const SMESH_Hypothesis * SMESH_subMesh::getSimilarAttached ( const TopoDS_Shape &  theShape,
const SMESH_Hypothesis theHyp,
const int  theHypType = 0 
)
protected

◆ GetSubMeshDS() [1/2]

SMESHDS_SubMesh * SMESH_subMesh::GetSubMeshDS ( )

References _father, _subMeshDS, _subShape, SMESH_Mesh::GetMeshDS(), and SMESHDS_Mesh::MeshElements().

Referenced by StdMeshers_Prism_3D::assocOrProjBottom2Top(), cleanSubMesh(), StdMeshers_Prism_3D::Compute(), StdMeshers_Projection_1D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_Projection_3D::Compute(), StdMeshers_Regular_1D::computeInternalParameters(), ComputePentahedralMesh(), ComputeStateEngine(), StdMeshers_Prism_3D::computeWalls(), SMESH_MeshEditor::ConvertFromQuadratic(), SMESH_MeshEditor::ConvertToQuadratic(), SMESH_Gen_i::CopyMeshWithGeom(), CreateSubMeshDS(), Evaluate(), StdMeshers_Projection_1D::Evaluate(), StdMeshers_Projection_1D2D::Evaluate(), StdMeshers_Projection_2D::Evaluate(), StdMeshers_Projection_3D::Evaluate(), SMESH_MeshEditor_i::ExtrusionAlongPathObjects(), VISCOUS_3D::_ViscousBuilder::findNeiborsOnEdge(), StdMeshers_Penta_3D::FindNodeOnShape(), VISCOUS_3D::_ViscousBuilder::findSolidsWithLayers(), SMESH_MesherHelper::FixQuadraticElements(), VISCOUS_3D::ShrinkFace::GetElements(), SMESH_Mesh::GetGroupSubMeshesContaining(), SMESH_Algo::GetMeshError(), SMESH_subMesh_i::GetNumberOfNodes(), SMESH_Mesh_i::GetSubMeshElementsId(), SMESH_Mesh_i::GetSubMeshElementType(), getSubMeshes(), SMESH_Mesh_i::GetSubMeshNodesId(), Handle(), StdMeshers_Prism_3D::initPrism(), IsEmpty(), VISCOUS_3D::ShrinkFace::IsSameNbElements(), SMESH_MesherHelper::IsStructured(), SMESH_MeshEditor_i::LinearAnglesVariation(), StdMeshers_Penta_3D::MakeBlock(), VISCOUS_3D::_ViscousBuilder::makeLayer(), StdMeshers_Penta_3D::MakeMeshOnFxy1(), StdMeshers_Penta_3D::MakeNodes(), StdMeshers_Penta_3D::MakeVolumeMesh(), SMESH_Algo::NumberOfPoints(), StdMeshers_ProjectionUtils::Morph::Perform(), SMESH_Gen_i::Precompute(), VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace(), StdMeshers_Prism_3D::project2dMesh(), StdMeshers_Prism_3D::projectBottomToTop(), VISCOUS_2D::_ViscousBuilder2D::removeMeshFaces(), StdMeshers_ProjectionUtils::SetEventListener(), VISCOUS_3D::_ViscousBuilder::setShapeData(), VISCOUS_3D::_ViscousBuilder::shrink(), and SubMeshesComputed().

◆ GetSubMeshDS() [2/2]

const SMESHDS_SubMesh * SMESH_subMesh::GetSubMeshDS ( ) const

◆ GetSubShape()

const TopoDS_Shape & SMESH_subMesh::GetSubShape ( ) const

Return a shape of this sub-mesh.

References _subShape.

Referenced by StdMeshers_Prism_3D::assocOrProjBottom2Top(), checkComputeError(), checkConformIgnoredAlgos(), checkMissing(), cleanDependsOn(), StdMeshers_PolyhedronPerSolid_3D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_Prism_3D::computeBase(), VISCOUS_3D::_ViscousBuilder::computeGeomSize(), ComputeStateEngine(), StdMeshers_Prism_3D::computeWalls(), SMESH_MeshEditor::ConvertToQuadratic(), SMESH_Gen_i::CopyMeshWithGeom(), VISCOUS_3D::_ViscousBuilder::error(), Evaluate(), StdMeshers_PolyhedronPerSolid_3D::Evaluate(), StdMeshers_Projection_1D2D::Evaluate(), SMESH_Mesh_i::findConcurrentSubMeshes(), VISCOUS_3D::_ViscousBuilder::findShapesToSmooth(), VISCOUS_3D::_ViscousBuilder::findSolidsWithLayers(), SMESH_Gen::GetAlgo(), SMESH_Gen::GetAlgoState(), SMESH_Mesh::GetGroupSubMeshesContaining(), SMESH_Mesh::GetHypotheses(), SMESH_Mesh::GetHypothesis(), SMESH_Algo::GetMeshError(), SMESH_Mesh_i::GetSubMeshElementType(), getSubMeshes(), SMESH_Mesh::HasModificationsToDiscard(), StdMeshers_Prism_3D::initPrism(), IsComputedPartially(), SMESH_MesherHelper::IsDistorted2D(), VISCOUS_3D::ShrinkFace::IsSame(), VISCOUS_3D::ShrinkFace::IsShrunk(), SMESH_MesherHelper::IsStructured(), StdMeshers_ProjectionUtils::MakeComputed(), VISCOUS_3D::_ViscousBuilder::MakeN2NMap(), SMESH_Mesh::NotifySubMeshesHypothesisModification(), SMESH_Gen::parallelComputeSubMeshes(), SMESH_Gen_i::Precompute(), SMESH_Mesh_i::removeSubMesh(), SMESH_Gen::sequentialComputeSubMeshes(), VISCOUS_3D::ShrinkFace::SetBoundary(), StdMeshers_CompositeSegment_1D::SetEventListener(), StdMeshers_Import_1D::SetEventListener(), StdMeshers_Import_1D2D::SetEventListener(), StdMeshers_RadialQuadrangle_1D2D::SetEventListener(), StdMeshers_ProjectionUtils::SetEventListener(), VISCOUS_3D::_ViscousBuilder::setShapeData(), VISCOUS_3D::_ViscousBuilder::shrink(), StdMeshers_ProjectionUtils::SourceNotComputedError(), and SubMeshesComputed().

◆ insertDependence()

void SMESH_subMesh::insertDependence ( const TopoDS_Shape  aShape,
TopAbs_ShapeEnum  aSubType,
TopAbs_ShapeEnum  avoidType = TopAbs_SHAPE 
)
protected

Add sub-meshes on sub-shapes of a given type into the dependence map.

References _father, _mapDepend, DependsOn(), GetId(), and SMESH_Mesh::GetSubMesh().

Referenced by DependsOn().

◆ IsAlwaysComputed()

bool SMESH_subMesh::IsAlwaysComputed ( ) const

◆ IsApplicableHypothesis() [1/2]

bool SMESH_subMesh::IsApplicableHypothesis ( const SMESH_Hypothesis theHypothesis) const

◆ IsApplicableHypothesis() [2/2]

◆ IsComputedPartially()

bool SMESH_subMesh::IsComputedPartially ( ) const

Check if any upper level sub-shape is not computed.

Used to update a sub-mesh icon

References COMPUTE_OK, FAILED_TO_COMPUTE, GetComputeState(), getDependsOnIterator(), GetSubShape(), NOT_READY, and READY_TO_COMPUTE.

◆ IsConform()

◆ IsEmpty()

◆ IsMeshComputed()

◆ loadDependentMeshes()

void SMESH_subMesh::loadDependentMeshes ( )
protected

loads dependent meshes on SUBMESH_LOADED event

References _father, _ownListeners, MESHCUT::d, and SMESH_Mesh::FindMesh().

Referenced by ComputeStateEngine().

◆ notifyListenersOnEvent()

void SMESH_subMesh::notifyListenersOnEvent ( const int  event,
const event_type  eventType,
SMESH_Hypothesis hyp = 0 
)
protected

Notify stored event listeners on the occurred event.

Parameters
event- algo_event or compute_event itself
eventType- algo_event or compute_event
hyp- hypothesis, if eventType is algo_event

References _eventListeners.

Referenced by AlgoStateEngine(), and ComputeStateEngine().

◆ removeSubMeshElementsAndNodes()

void SMESH_subMesh::removeSubMeshElementsAndNodes ( )
protected

◆ setAlgoState()

void SMESH_subMesh::setAlgoState ( algo_state  state)
protected

References _algoState.

Referenced by AlgoStateEngine(), and ComputeStateEngine().

◆ SetAllowedSubShapes()

void SMESH_subMesh::SetAllowedSubShapes ( const TopTools_IndexedMapOfShape *  subShapes)

Set sub-shapes that are allowed to compute at once by a multidimensional algo.

Referenced by SMESH_Gen::sequentialComputeSubMeshes(), and VISCOUS_3D::_ViscousBuilder::shrink().

◆ setEventListener()

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.

References _eventListeners, SMESH_subMeshEventListener::GetName(), SMESH_subMeshEventListener::IsDeletable(), and SMESH_subMeshEventListenerData::IsDeletable().

Referenced by SetEventListener().

◆ SetEventListener()

void SMESH_subMesh::SetEventListener ( EventListener listener,
EventListenerData data,
SMESH_subMesh where 
)

Set an event listener and its data to a submesh.

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 \awhere it puts the listener in order to delete it when HYP_OK algo_state is lost After being set, event listener is notified on each event of \awhere submesh.

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

It remembers the submesh where 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 where submesh.

References _ownListeners, and setEventListener().

Referenced by VISCOUS_2D::_ProxyMeshHolder::_ProxyMeshHolder(), VISCOUS_3D::_ViscousListener::GetSolidMesh(), StdMeshers_Penta_3D::MakeMeshOnFxy1(), MeshEditor_I::TSearchersDeleter::Set(), StdMeshers_CompositeSegment_1D::SetEventListener(), StdMeshers_QuadFromMedialAxis_1D2D::SetEventListener(), StdMeshers_ProjectionUtils::SetEventListener(), and VISCOUS_3D::ToClearSubWithMain().

◆ SetIsAlwaysComputed()

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.

Allow algo->Compute() if a sub-shape of lower dim is meshed but none mesh entity is bound to it (PAL13615, 2nd part)

References _alwaysComputed, _computeState, CHECK_COMPUTE_STATE, COMPUTE_OK, and ComputeStateEngine().

Referenced by AlgoStateEngine(), StdMeshers_CompositeSegment_1D::Compute(), StdMeshers_UseExisting_2D::Compute(), StdMeshers_UseExisting_1D::Compute(), and StdMeshers_CompositeSegment_1D::SetEventListener().

◆ SubMeshesAlgoStateEngine()

SMESH_Hypothesis::Hypothesis_Status SMESH_subMesh::SubMeshesAlgoStateEngine ( algo_event  event,
SMESH_Hypothesis anHyp,
bool  exitOnFatal = false 
)

Send an event to sub-meshes.

Parameters
[in]event- the event
[in]anHyp- an hypothesis
[in]exitOnFatal- to stop iteration on sub-meshes if a sub-mesh reports a fatal result
Returns
SMESH_Hypothesis::Hypothesis_Status - the worst result

Optional description of a problematic situation (if any) can be retrieved via GetComputeError().

References _computeError, AlgoStateEngine(), getDependsOnIterator(), SMESH_Hypothesis::HYP_OK, and SMESH_Hypothesis::IsStatusFatal().

Referenced by SMESH_Mesh::AddHypothesis(), SMESH_Mesh::CheckHypothesesOnSubMeshes(), and SMESH_Mesh::RemoveHypothesis().

◆ SubMeshesComputed()

◆ updateDependantsState()

void SMESH_subMesh::updateDependantsState ( const compute_event  theEvent)
protected

References GetAncestors().

Referenced by checkComputeError(), and ComputeStateEngine().

◆ updateSubMeshState()

void SMESH_subMesh::updateSubMeshState ( const compute_state  theState)
protected

Field Documentation

◆ _algo

SMESH_Algo* SMESH_subMesh::_algo
protected

◆ _algoShape

TopoDS_Shape SMESH_subMesh::_algoShape
protected

Referenced by GetAlgo(), and getCollection().

◆ _algoState

algo_state SMESH_subMesh::_algoState
protected

◆ _allowedSubShapes

const TopTools_IndexedMapOfShape* SMESH_subMesh::_allowedSubShapes
protected

Referenced by getCollection(), and SMESH_subMesh().

◆ _alwaysComputed

bool SMESH_subMesh::_alwaysComputed
protected

◆ _ancestors

std::vector< SMESH_subMesh * > SMESH_subMesh::_ancestors
protected

Referenced by ClearAncestors(), and GetAncestors().

◆ _computeCost

int SMESH_subMesh::_computeCost
protected

Referenced by computeCost(), and SMESH_subMesh().

◆ _computeError

◆ _computeState

◆ _dependenceAnalysed

bool SMESH_subMesh::_dependenceAnalysed
protected

Referenced by DependsOn(), and SMESH_subMesh().

◆ _eventListeners

std::map< EventListener*, EventListenerData* > SMESH_subMesh::_eventListeners
protected

< event listeners to notify

event listeners to delete when HYP_OK algo_state is lost

Referenced by DeleteEventListener(), GetEventListenerData(), notifyListenersOnEvent(), and setEventListener().

◆ _father

◆ _Id

int SMESH_subMesh::_Id
protected

◆ _mapDepend

std::map< int, SMESH_subMesh * > SMESH_subMesh::_mapDepend
protected

◆ _ownListeners

std::list< OwnListenerData > SMESH_subMesh::_ownListeners
protected

◆ _realComputeCost

int SMESH_subMesh::_realComputeCost
protected

◆ _subMeshDS

SMESHDS_SubMesh* SMESH_subMesh::_subMeshDS
protected

Referenced by GetSubMeshDS(), and SMESH_subMesh().

◆ _subShape