From 88f6bd235b57c4364536d05616a478e6386c7b49 Mon Sep 17 00:00:00 2001 From: akl Date: Fri, 17 May 2013 12:23:47 +0000 Subject: [PATCH] Fix to take into account 'vtkQuadraticEdge' type also. --- src/SVTK/SALOME_Actor.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index f13f3cc0b..bc7b43ad7 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -48,6 +48,7 @@ // VTK Includes #include #include +#include #include #include #include @@ -87,11 +88,14 @@ namespace double aPickPosition[3]; thePicker->GetPickPosition(aPickPosition); double aMinDist = 1000000.0, aDist = 0; + vtkCell* aSelEdge; for (int i = 0, iEnd = aPickedCell->GetNumberOfEdges(); i < iEnd; i++){ - if(vtkLine* aLine = vtkLine::SafeDownCast(aPickedCell->GetEdge(i))){ + aSelEdge = aPickedCell->GetEdge(i); + if(vtkLine::SafeDownCast(aPickedCell->GetEdge(i)) || + vtkQuadraticEdge::SafeDownCast(aPickedCell->GetEdge(i))){ int subId; double pcoords[3], closestPoint[3], weights[3]; - aLine->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); + aSelEdge->EvaluatePosition(aPickPosition,closestPoint,subId,pcoords,aDist,weights); if (aDist < aMinDist) { aMinDist = aDist; anEdgeId = -1 - i; -- 2.39.2