From 23be894aedc916ff8350ae007158c408880ad0ea Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 29 Apr 2005 11:48:39 +0000 Subject: [PATCH] Take into account position of actor for selection --- src/VTKViewer/VTKViewer_InteractorStyleSALOME.cxx | 6 ++++++ src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/VTKViewer/VTKViewer_InteractorStyleSALOME.cxx b/src/VTKViewer/VTKViewer_InteractorStyleSALOME.cxx index 0fd4d7c52..3be94d216 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyleSALOME.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyleSALOME.cxx @@ -1217,6 +1217,12 @@ void VTKViewer_InteractorStyleSALOME::onCursorMove(QPoint mousePos) { SALOME_Actor* SActor = SALOME_Actor::SafeDownCast(aPicker->GetActor()); + if (SActor && myPreSelectionActor){ + float aPos[3]; + SActor->GetPosition(aPos); + myPreSelectionActor->SetPosition(aPos); + } + if (vtkCellPicker* picker = vtkCellPicker::SafeDownCast(aPicker)) { int aVtkId = picker->GetCellId(); if ( aVtkId >= 0 ) { diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index d8d86e86c..285141453 100644 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -879,6 +879,9 @@ void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfIn TUpdateActor theFun) { (*theFun)(theMapIndex,theMapActor,theActor); + float aPos[3]; + theMapActor->GetPosition(aPos); + theActor->SetPosition(aPos); } -- 2.39.2