Bug: SetEventListener() not called when a sub-algo assigned
:align: center
.. centered::
:align: center
.. centered::
- A mesh of a river model to the left and of a ring-face to the right
+ A mesh of a river model (to the left) and of a ring-face (to the right)
The algorithm provides proper shape of quadrangles by constructing Medial
Axis between sinuous borders of the face and using it to
The algorithm provides proper shape of quadrangles by constructing Medial
Axis between sinuous borders of the face and using it to
const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( this, f, true );
if (prevAlgo &&
string( algo->GetName()) != prevAlgo->GetName())
const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( this, f, true );
if (prevAlgo &&
string( algo->GetName()) != prevAlgo->GetName())
+ {
+ oldAlgoState = NO_ALGO; // force setting event listener (#16648)
+ modifiedHyp = true;
+ }
}
else
setAlgoState(MISSING_HYP);
}
else
setAlgoState(MISSING_HYP);
void StdMeshers_RadialQuadrangle_1D2D::SubmeshRestored(SMESH_subMesh* faceSubMesh)
{
if ( !faceSubMesh->IsEmpty() )
void StdMeshers_RadialQuadrangle_1D2D::SubmeshRestored(SMESH_subMesh* faceSubMesh)
{
if ( !faceSubMesh->IsEmpty() )
+ SetEventListener( faceSubMesh );
+}
+
+//=======================================================================
+/*!
+ * \brief Sets event listener to a submesh
+ * \param subMesh - submesh where algo is set
+ *
+ * This method is called when a submesh gets HYP_OK algo_state.
+ */
+//=======================================================================
+
+void StdMeshers_RadialQuadrangle_1D2D::SetEventListener(SMESH_subMesh* faceSubMesh)
+{
+ for ( TopExp_Explorer e( faceSubMesh->GetSubShape(), TopAbs_EDGE ); e.More(); e.Next() )
- for ( TopExp_Explorer e( faceSubMesh->GetSubShape(), TopAbs_EDGE ); e.More(); e.Next() )
- {
- TEdgeMarker::markEdge( TopoDS::Edge( e.Current() ), faceSubMesh );
- }
+ TEdgeMarker::markEdge( TopoDS::Edge( e.Current() ), faceSubMesh );
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
- /*!
- * \brief Allow algo to do something after persistent restoration
- * \param subMesh - restored submesh
- *
- * This method is called only if a submesh has HYP_OK algo_state.
- */
+
+ // Allow algo to do something after persistent restoration
virtual void SubmeshRestored(SMESH_subMesh* subMesh);
virtual void SubmeshRestored(SMESH_subMesh* subMesh);
+
+ // Sets event listener to a submesh
+ virtual void SetEventListener(SMESH_subMesh* subMesh);
+
virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
{
return IsApplicable( shape, toCheckAll );
virtual bool IsApplicableToShape(const TopoDS_Shape & shape, bool toCheckAll) const
{
return IsApplicable( shape, toCheckAll );