Invalid work in preview mode

This commit is contained in:
eap 2017-10-03 17:32:53 +03:00
parent a110ca107e
commit 0e73b458b6
3 changed files with 12 additions and 6 deletions

View File

@ -13233,6 +13233,10 @@ void SMESH_MeshEditor::MakePolyLine( TListOfPolySegments& theSegments,
SMESH_MeshAlgos::FaceNormal( face, const_cast< gp_XYZ& >( polySeg.myVector.XYZ() )); SMESH_MeshAlgos::FaceNormal( face, const_cast< gp_XYZ& >( polySeg.myVector.XYZ() ));
polySeg.myMidProjPoint = pMid + polySeg.myVector.XYZ(); polySeg.myMidProjPoint = pMid + polySeg.myVector.XYZ();
} }
else
{
polySeg.myVector = polySeg.myMidProjPoint.XYZ() - pMid;
}
} }
} }

View File

@ -1641,7 +1641,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
case POS_RIGHT: case POS_RIGHT:
{ {
// point is inside the face // point is inside the face
double distToFacePlane = tmpPnt.Y(); double distToFacePlane = Abs( tmpPnt.Y() );
if ( closestPnt ) if ( closestPnt )
{ {
if ( distToFacePlane < std::numeric_limits<double>::min() ) { if ( distToFacePlane < std::numeric_limits<double>::min() ) {
@ -1653,7 +1653,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
*closestPnt = tmpPnt; *closestPnt = tmpPnt;
} }
} }
return Abs( distToFacePlane ); return distToFacePlane;
} }
case POS_VERTEX: case POS_VERTEX:
{ {

View File

@ -6864,12 +6864,14 @@ void SMESH_MeshEditor_i::MakePolyLine(SMESH::ListOfPolySegments& theSegments,
initData(/*deleteSearchers=*/false); initData(/*deleteSearchers=*/false);
SMESHDS_Group* groupDS = 0; SMESHDS_Group* groupDS = 0;
SMESHDS_Mesh* meshDS = getMeshDS();
if ( myIsPreviewMode ) // copy faces to the tmp mesh if ( myIsPreviewMode ) // copy faces to the tmp mesh
{ {
TPreviewMesh * tmpMesh = getPreviewMesh( SMDSAbs_Edge ); TPreviewMesh * tmpMesh = getPreviewMesh( SMDSAbs_Edge );
SMDS_ElemIteratorPtr faceIt = getMeshDS()->elementsIterator( SMDSAbs_Face ); SMDS_ElemIteratorPtr faceIt = getMeshDS()->elementsIterator( SMDSAbs_Face );
while ( faceIt->more() ) while ( faceIt->more() )
tmpMesh->Copy( faceIt->next() ); tmpMesh->Copy( faceIt->next() );
meshDS = tmpMesh->GetMeshDS();
} }
else if ( theGroupName[0] ) // find/create a group of segments 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::PolySegment& segIn = theSegments[ i ];
::SMESH_MeshEditor::PolySegment& segOut = segments[ i ]; ::SMESH_MeshEditor::PolySegment& segOut = segments[ i ];
segOut.myNode1[0] = getMeshDS()->FindNode( segIn.node1ID1 ); segOut.myNode1[0] = meshDS->FindNode( segIn.node1ID1 );
segOut.myNode2[0] = getMeshDS()->FindNode( segIn.node1ID2 ); segOut.myNode2[0] = meshDS->FindNode( segIn.node1ID2 );
segOut.myNode1[1] = getMeshDS()->FindNode( segIn.node2ID1 ); segOut.myNode1[1] = meshDS->FindNode( segIn.node2ID1 );
segOut.myNode2[1] = getMeshDS()->FindNode( segIn.node2ID2 ); segOut.myNode2[1] = meshDS->FindNode( segIn.node2ID2 );
segOut.myVector.SetCoord( segIn.vector.PS.x, segOut.myVector.SetCoord( segIn.vector.PS.x,
segIn.vector.PS.y, segIn.vector.PS.y,
segIn.vector.PS.z ); segIn.vector.PS.z );