19 #include "vtkObjectFactory.h"
20 #include "vtkRenderWindow.h"
21 #include "vtkRenderWindowInteractor.h"
22 #include "vtkRenderer.h"
48 int x,
int y, vtkRenderer* ren, vtkRenderWindowInteractor* rwi)
50 if (ren ==
NULL || !this->GetGUIHelper())
59 if (this->GetGUIHelper()->GetActiveSourceBounds(bounds))
68 for (cc = 0; cc < 3; cc++)
70 center[cc] = (bounds[cc * 2] + bounds[cc * 2 + 1]) / 2;
75 ren->SetWorldPoint(center);
76 ren->WorldToDisplay();
77 ren->GetDisplayPoint(dpoint1);
81 rwi->GetLastEventPosition()[0], rwi->GetLastEventPosition()[1], dpoint1[2]);
82 ren->DisplayToWorld();
83 ren->GetWorldPoint(startpoint);
86 ren->SetDisplayPoint(
x,
y, dpoint1[2]);
87 ren->DisplayToWorld();
88 ren->GetWorldPoint(endpoint);
90 for (cc = 0; cc < 3; cc++)
92 startpoint[cc] /= startpoint[3];
93 endpoint[cc] /= endpoint[3];
97 if (this->GetGUIHelper()->GetActiveActorTranslate(move))
99 for (cc = 0; cc < 3; cc++)
101 move[cc] += endpoint[cc] - startpoint[cc];
104 this->GetGUIHelper()->SetActiveActorTranslate(move);
114 this->Superclass::PrintSelf(os, indent);
void OnButtonUp(int x, int y, vtkRenderer *ren, vtkRenderWindowInteractor *iren) override
void PrintSelf(ostream &os, vtkIndent indent) override
void OnMouseMove(int x, int y, vtkRenderer *ren, vtkRenderWindowInteractor *iren) override
~vtkPVTrackballMoveActor() override
void OnButtonDown(int x, int y, vtkRenderer *ren, vtkRenderWindowInteractor *iren) override
vtkPVTrackballMoveActor()
vtkStandardNewMacro(vtkPVTrackballMoveActor)