-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInteractorActor.cpp
More file actions
56 lines (46 loc) · 1.67 KB
/
InteractorActor.cpp
File metadata and controls
56 lines (46 loc) · 1.67 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include "InteractorActor.h"
#include "InteractorCamera.h"
#include "InteractorChange.h"
using namespace std;
//std::vector<vtkSmartPointer<vtkFollower>> vtkPositionCallback::conLabels = { nullptr,nullptr,nullptr };
vtkSmartPointer<vtkFollower> vtkPositionCallback::xLabel = nullptr;
vtkSmartPointer<vtkFollower> vtkPositionCallback::yLabel = nullptr;
vtkSmartPointer<vtkFollower> vtkPositionCallback::zLabel = nullptr;
vtkSmartPointer<vtkAssembly> vtkPositionCallback::Axes = nullptr;
vtkPositionCallback* InteractorActor::callback = nullptr;
void InteractorActor::OnLeftButtonDown()
{
int x = this->Interactor->GetEventPosition()[0];
int y = this->Interactor->GetEventPosition()[1];
static InteractorChange* changer = new InteractorChange();
static InteractorCamera* camera = InteractorCamera::New();
this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
this->Interactor->GetEventPosition()[1]);
if (this->InteractionPicker->Pick(x, y, 0, this->CurrentRenderer))
bActorMouseDown = true;
else
{
changer->GiveInteractor(this->Interactor);
changer->ChangeStyle(camera);
camera->OnLeftButtonDown(0);
return;
}
vtkInteractorStyleTrackballActor::OnLeftButtonDown();
}
void InteractorActor::SetInformation(vtkPolyData* polydata,
vtkMatrix4x4* matrix,
vtkRenderWindowInteractor* renwinin)
{
this->currentPolydata = polydata;
this->currentMatrix = matrix;
this->renwinin = renwinin;
}
void InteractorActor::GetInformation(vtkPolyData* polydata,
vtkMatrix4x4* matrix,
vtkRenderWindowInteractor* renwinin)
{
polydata = this->currentPolydata;
matrix = this->currentMatrix;
renwinin = this->renwinin;
}