-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInteractorCamera.cpp
43 lines (35 loc) · 1.24 KB
/
InteractorCamera.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include "InteractorCamera.h"
#include "InteractorActor.h"
#include "InteractorChange.h"
void InteractorCamera::GiveInteractor(vtkRenderWindowInteractor* renwinin)
{
static InteractorChange* changer = new InteractorChange();
changer->GiveInteractor(renwinin);
}
void InteractorCamera::OnLeftButtonDown(bool)
{
int x = this->Interactor->GetEventPosition()[0];
int y = this->Interactor->GetEventPosition()[1];
this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
this->Interactor->GetEventPosition()[1]);
vtkPicker* picker = vtkPicker::New();
vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
}
void InteractorCamera::OnLeftButtonDown()
{
int x = this->Interactor->GetEventPosition()[0];
int y = this->Interactor->GetEventPosition()[1];
static InteractorChange* changer = new InteractorChange();
static InteractorActor* actorStyle = new InteractorActor();
vtkPicker* picker = vtkPicker::New();
//styleÀ» trackball actorÀÇ axistool·Î Àüȯ
if (picker->Pick(x, y, 0, this->CurrentRenderer))
{
changer->GiveInteractor(this->Interactor);
changer->ChangeStyle(actorStyle);
actorStyle->OnLeftButtonDown();
return;
}
vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
}