Salome HOME
Fix to take into account 'vtkQuadraticEdge' type also.
authorakl <akl@opencascade.com>
Fri, 17 May 2013 12:23:47 +0000 (12:23 +0000)
committerakl <akl@opencascade.com>
Fri, 17 May 2013 12:23:47 +0000 (12:23 +0000)
src/SVTK/SALOME_Actor.cxx

index f13f3cc0bd607b0a8bbb0b46efbfdf07fa153371..bc7b43ad7ffaaf511920821b34fdb2fa6f5de0e0 100644 (file)
@@ -48,6 +48,7 @@
 // VTK Includes
 #include <vtkCell.h>
 #include <vtkLine.h>
+#include <vtkQuadraticEdge.h>
 #include <vtkPicker.h>
 #include <vtkPointPicker.h>
 #include <vtkCellPicker.h>
@@ -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;