Salome HOME
#16914 EDF 19401 - Wrong quadratic mesh (bis)
authoreap <eap@opencascade.com>
Tue, 7 May 2019 10:30:06 +0000 (13:30 +0300)
committereap <eap@opencascade.com>
Tue, 7 May 2019 10:30:06 +0000 (13:30 +0300)
Bug: SetEventListener() not called when a sub-algo assigned

doc/salome/gui/SMESH/input/quad_from_ma_algo.rst
src/SMESH/SMESH_subMesh.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx

index b9b7cd482eae384846aa0afab3c7eca5ccf42cb1..0cc197930a35ebe98856d2c9e43ee04b26512225 100644 (file)
@@ -17,7 +17,7 @@ hypothesis.
        :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
index ecbfde44c51940908cf992415300bfbbc7aa2453..52d711462d4bba8625849eba1e9bc0b0d836f9ef 100644 (file)
@@ -878,7 +878,10 @@ SMESH_Hypothesis::Hypothesis_Status
         const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( this, f, true );
         if (prevAlgo &&
             string( algo->GetName()) != prevAlgo->GetName())
-          modifiedHyp = true;
+        {
+          oldAlgoState = NO_ALGO; // force setting event listener (#16648)
+          modifiedHyp  = true;
+        }
       }
       else
         setAlgoState(MISSING_HYP);
index 8c5869107d5e0cc5859628bd117bbc22ae3b71bf..8e183e37ea621dd0ff509d988cb62e1203a8f507 100644 (file)
@@ -758,11 +758,23 @@ protected:
 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 );
   }
 }
 
index 8d43c02a2f895b000af97d42e326dd35924fe749..bfbc1a09be286cf553a43e33d48e6903109d298f 100644 (file)
@@ -50,14 +50,13 @@ public:
 
   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);
-  
+
+  // 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 );