From: eap Date: Tue, 3 Oct 2017 14:32:53 +0000 (+0300) Subject: Invalid work in preview mode X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e73b458b691c7c15347e7bc8b05d1c65b09bf71;p=modules%2Fsmesh.git Invalid work in preview mode --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 45d0f256c..981458a6a 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -13233,6 +13233,10 @@ void SMESH_MeshEditor::MakePolyLine( TListOfPolySegments& theSegments, SMESH_MeshAlgos::FaceNormal( face, const_cast< gp_XYZ& >( polySeg.myVector.XYZ() )); polySeg.myMidProjPoint = pMid + polySeg.myVector.XYZ(); } + else + { + polySeg.myVector = polySeg.myMidProjPoint.XYZ() - pMid; + } } } diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index 8e03e4e67..4bcfc1d97 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1641,7 +1641,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face, case POS_RIGHT: { // point is inside the face - double distToFacePlane = tmpPnt.Y(); + double distToFacePlane = Abs( tmpPnt.Y() ); if ( closestPnt ) { if ( distToFacePlane < std::numeric_limits::min() ) { @@ -1653,7 +1653,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face, *closestPnt = tmpPnt; } } - return Abs( distToFacePlane ); + return distToFacePlane; } case POS_VERTEX: { diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 7ef2f4633..5e4c7fd65 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -6864,12 +6864,14 @@ void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments, initData(/*deleteSearchers=*/false); SMESHDS_Group* groupDS = 0; + SMESHDS_Mesh* meshDS = getMeshDS(); if ( myIsPreviewMode ) // copy faces to the tmp mesh { TPreviewMesh * tmpMesh = getPreviewMesh( SMDSAbs_Edge ); SMDS_ElemIteratorPtr faceIt = getMeshDS()->elementsIterator( SMDSAbs_Face ); while ( faceIt->more() ) tmpMesh->Copy( faceIt->next() ); + meshDS = tmpMesh->GetMeshDS(); } else if ( theGroupName[0] ) // find/create a group of segments { @@ -6898,10 +6900,10 @@ void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments, { SMESH::PolySegment& segIn = theSegments[ i ]; ::SMESH_MeshEditor::PolySegment& segOut = segments[ i ]; - segOut.myNode1[0] = getMeshDS()->FindNode( segIn.node1ID1 ); - segOut.myNode2[0] = getMeshDS()->FindNode( segIn.node1ID2 ); - segOut.myNode1[1] = getMeshDS()->FindNode( segIn.node2ID1 ); - segOut.myNode2[1] = getMeshDS()->FindNode( segIn.node2ID2 ); + segOut.myNode1[0] = meshDS->FindNode( segIn.node1ID1 ); + segOut.myNode2[0] = meshDS->FindNode( segIn.node1ID2 ); + segOut.myNode1[1] = meshDS->FindNode( segIn.node2ID1 ); + segOut.myNode2[1] = meshDS->FindNode( segIn.node2ID2 ); segOut.myVector.SetCoord( segIn.vector.PS.x, segIn.vector.PS.y, segIn.vector.PS.z );