From: akl Date: Fri, 17 May 2013 12:23:47 +0000 (+0000) Subject: Fix to take into account 'vtkQuadraticEdge' type also. X-Git-Tag: B4KillOfAutomake~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=88f6bd235b57c4364536d05616a478e6386c7b49;p=modules%2Fgui.git Fix to take into account 'vtkQuadraticEdge' type also. --- 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;