Salome HOME
IPAL53872: Projection of Node Distribution does not work with Adaptive hypothesis
authoreap <eap@opencascade.com>
Mon, 26 Dec 2016 15:42:19 +0000 (18:42 +0300)
committereap <eap@opencascade.com>
Mon, 26 Dec 2016 15:42:19 +0000 (18:42 +0300)
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshers/StdMeshers_Regular_1D.hxx

index 331cb75e689815f865815b66773d8cf9cdb766ab..c3430af05eed4bbd54719167bbd881ac0743312e 100644 (file)
@@ -294,6 +294,10 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh&         aMesh,
     _hypType = MAX_LENGTH;
     aStatus = SMESH_Hypothesis::HYP_OK;
   }
+  else if ( !_mainEdge.IsNull() && _hypType == DISTRIB_PROPAGATION ) // !!! before "Adaptive1D"
+  {
+    aStatus = SMESH_Hypothesis::HYP_OK;
+  }
   else if ( hypName == "Adaptive1D" )
   {
     _adaptiveHyp = dynamic_cast < const StdMeshers_Adaptive1D* >(theHyp);
@@ -672,7 +676,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
 
   // Propagation Of Distribution
   //
-  if ( !_mainEdge.IsNull() && _isPropagOfDistribution )
+  if ( !_mainEdge.IsNull() && _hypType == DISTRIB_PROPAGATION )
   {
     TopoDS_Edge mainEdge = TopoDS::Edge( _mainEdge ); // should not be a reference!
     _gen->Compute( theMesh, mainEdge, SMESH_Gen::SHAPE_ONLY_UPWARD );
@@ -1164,7 +1168,7 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
       // take into account reversing the edge the hypothesis is propagated from
       // (_mainEdge.Orientation() marks mutual orientation of EDGEs in propagation chain)
       reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
-      if ( !_isPropagOfDistribution ) {
+      if ( _hypType != DISTRIB_PROPAGATION ) {
         int mainID = meshDS->ShapeToIndex(_mainEdge);
         if ( std::find( _revEdgesIDs.begin(), _revEdgesIDs.end(), mainID) != _revEdgesIDs.end())
           reversed = !reversed;
@@ -1370,10 +1374,13 @@ StdMeshers_Regular_1D::GetUsedHypothesis(SMESH_Mesh &         aMesh,
   if (nbHyp == 0 && aShape.ShapeType() == TopAbs_EDGE)
   {
     // Check, if propagated from some other edge
+    bool isPropagOfDistribution = false;
     _mainEdge = StdMeshers_Propagation::GetPropagationSource( aMesh, aShape,
-                                                              _isPropagOfDistribution );
+                                                              isPropagOfDistribution );
     if ( !_mainEdge.IsNull() )
     {
+      if ( isPropagOfDistribution )
+        _hypType = DISTRIB_PROPAGATION;
       // Propagation of 1D hypothesis from <aMainEdge> on this edge;
       // get non-auxiliary assigned to _mainEdge
       nbHyp = aMesh.GetHypotheses( _mainEdge, *compatibleFilter, _usedHypList, true );
index 7786f4ac70e38055913903f8fd87cae12ce7f3f2..d2af675f7d182f892601886c0e53eb4d10975239 100644 (file)
@@ -104,7 +104,7 @@ protected:
   StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh &          theMesh,
                                                      const TopoDS_Vertex & theV);
 
-  enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, GEOMETRIC_1D, NONE };
+  enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, ADAPTIVE, GEOMETRIC_1D, DISTRIB_PROPAGATION, NONE };
 
   enum ValueIndex {
     SCALE_FACTOR_IND = 0,
@@ -142,7 +142,6 @@ protected:
   // a source of propagated hypothesis, is set by CheckHypothesis()
   // always called before Compute()
   TopoDS_Shape _mainEdge;
-  bool         _isPropagOfDistribution;
 };
 
 #endif