From 979d9c81fc7d64b846496c171530f06ee7206baf Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 25 Nov 2016 17:24:41 +0300 Subject: [PATCH] Fix regressions --- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 13 +++++++------ src/SMESH_SWIG/StdMeshersBuilder.py | 2 +- src/StdMeshers/StdMeshers_FaceSide.cxx | 2 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 4 ++-- src/StdMeshers/StdMeshers_Projection_2D.cxx | 5 ++--- src/StdMeshers/StdMeshers_Regular_1D.cxx | 14 ++++++++++---- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 240523d4c..d182aa07c 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -3489,7 +3489,8 @@ void SMESHGUI_FilterDlg::UnRegisterFilters() //======================================================================= void SMESHGUI_FilterDlg::insertFilterInViewer() { - if (SVTK_Selector* aSelector = SMESH::GetSelector()) { + if (SVTK_Selector* aSelector = SMESH::GetSelector()) + { SMESH::ElementType anEntType = (SMESH::ElementType)myTable->GetType(); if (myFilter[ myTable->GetType() ]->_is_nil() || @@ -3499,7 +3500,8 @@ void SMESHGUI_FilterDlg::insertFilterInViewer() { SMESH::RemoveFilter(getFilterId(anEntType), aSelector); } - else { + else + { Handle(SMESHGUI_PredicateFilter) aFilter = new SMESHGUI_PredicateFilter(); aFilter->SetPredicate(myFilter[ myTable->GetType() ]->GetPredicate()); SMESH::RemoveFilter(getFilterId(anEntType), aSelector); //skl for IPAL12631 @@ -3659,7 +3661,7 @@ SMESH_Actor* SMESHGUI_FilterDlg::getActor() //======================================================================= void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList& theIds) { - if (mySelectionMgr == 0 || myMesh->_is_nil()) + if (mySelectionMgr == 0 || myMesh->_is_nil() ) return; mySelectionMgr->clearFilters(); @@ -3667,7 +3669,8 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList& th // Set new selection mode if necessary Selection_Mode aSelMode = getSelMode(theType); SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); - if ( aViewWindow && aViewWindow->SelectionMode()!=aSelMode) { + if ( aViewWindow && aViewWindow->SelectionMode() != aSelMode ) + { mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); SMESH::SetPointRepresentation( aSelMode == NodeSelection ); @@ -3680,8 +3683,6 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList& th return; Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); - //mySelectionMgr->clearSelected(); - //mySelectionMgr->AddIObject(anIO, false); SALOME_ListIO aList; aList.Append(anIO); mySelectionMgr->setSelectedObjects(aList, false); diff --git a/src/SMESH_SWIG/StdMeshersBuilder.py b/src/SMESH_SWIG/StdMeshersBuilder.py index 203a9ff48..19f3375f7 100644 --- a/src/SMESH_SWIG/StdMeshersBuilder.py +++ b/src/SMESH_SWIG/StdMeshersBuilder.py @@ -263,7 +263,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm): # on curve from 0 to 1 (additionally it is neecessary to check # orientation of edges and create list of reversed edges if it is # needed) and sets numbers of segments between given points (default - # values are equals 1 + # values are 1) # @param points defines the list of parameters on curve # @param nbSegs defines the list of numbers of segments # @param reversedEdges is a list of edges to mesh using reversed orientation. diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index b7a492654..921269126 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -450,7 +450,7 @@ const std::vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons { return myPoints; } - if (( myNbPonits > 0 ) && + if (( u2node.size() > 0 ) && ( u2node.begin()->first < 0 || u2node.rbegin()->first > 1 )) { return myPoints; diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 75219db95..b3f34cadb 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -4892,8 +4892,8 @@ bool StdMeshers_Sweeper::ComputeNodes( SMESH_MesherHelper& helper, } } - //centerIntErrorIsSmall = true; - //bndErrorIsSmall = true; + centerIntErrorIsSmall = true; // 3D_mesh_Extrusion_00/A3 + bndErrorIsSmall = true; if ( !centerIntErrorIsSmall ) { // Compensate the central error; continue adding projection diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 31db57e96..2888a362c 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -704,9 +704,9 @@ namespace { tgtMeshDS->SetNodeOnEdge( n, tgtE, srcU ); if ( !tgtFace.IsPartner( srcFace )) { - bool isOk = true; edgeHelper.SetSubShape( tgtE ); - edgeHelper.GetNodeU( tgtE, n, 0, &isOk ); + double tol = BRep_Tool::Tolerance( tgtE ); + bool isOk = edgeHelper.CheckNodeU( tgtE, n, srcU, 2 * tol, /*force=*/true ); if ( !isOk ) // projection of n to tgtE failed (23395) { double sF, sL, tF, tL; @@ -717,7 +717,6 @@ namespace { tgtMeshDS->SetNodeOnEdge( n, tgtE, tgtU ); gp_Pnt newP = BRepAdaptor_Curve( tgtE ).Value( tgtU ); double dist = newP.Distance( tgtP ); - double tol = BRep_Tool::Tolerance( tgtE ); if ( tol < dist && dist < 1000*tol ) tgtMeshDS->MoveNode( n, newP.X(), newP.Y(), newP.Z() ); } diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 2f2c879f0..331cb75e6 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -992,10 +992,6 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, { const std::vector& aPnts = _fpHyp->GetPoints(); std::vector nbsegs = _fpHyp->GetNbSegments(); - if ( theReverse ) - std::reverse( nbsegs.begin(), nbsegs.end() ); - if ( nbsegs.empty() ) - nbsegs.push_back( 1 ); // sort normalized params, taking into account theReverse TColStd_SequenceOfReal Params; @@ -1033,6 +1029,16 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, uVec.back() = theLastU; // divide segments + if ( theReverse ) + { + if ((int) nbsegs.size() > Params.Length() + 1 ) + nbsegs.resize( Params.Length() + 1 ); + std::reverse( nbsegs.begin(), nbsegs.end() ); + } + if ( nbsegs.empty() ) + { + nbsegs.push_back( 1 ); + } Params.InsertBefore( 1, 0.0 ); Params.Append( 1.0 ); double eltSize, segmentSize, par1, par2; -- 2.39.2