From 92bb7ceb6e3649e91fc0ad6942e838b79b71cab2 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 26 Dec 2016 18:42:19 +0300 Subject: [PATCH] IPAL53872: Projection of Node Distribution does not work with Adaptive hypothesis --- src/StdMeshers/StdMeshers_Regular_1D.cxx | 13 ++++++++++--- src/StdMeshers/StdMeshers_Regular_1D.hxx | 3 +-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 331cb75e6..c3430af05 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -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 on this edge; // get non-auxiliary assigned to _mainEdge nbHyp = aMesh.GetHypotheses( _mainEdge, *compatibleFilter, _usedHypList, true ); diff --git a/src/StdMeshers/StdMeshers_Regular_1D.hxx b/src/StdMeshers/StdMeshers_Regular_1D.hxx index 7786f4ac7..d2af675f7 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.hxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.hxx @@ -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 -- 2.30.2