forked from springzfx/point-cloud-annotation-tool
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vtkBoxWidgetCallback.cpp
47 lines (38 loc) · 1.07 KB
/
vtkBoxWidgetCallback.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
44
45
46
47
#include <vtkBoxWidgetCallback.h>
#include <Annotaion.h>
#include <vtkBoxWidget.h>
#include <vtkTransform.h>
vtkBoxWidgetCallback0 *vtkBoxWidgetCallback0::New()
{
return new vtkBoxWidgetCallback0;
}
void vtkBoxWidgetCallback0::Execute(vtkObject *caller, unsigned long, void *)
{
// Here we use the vtkBoxWidget to transform the underlying coneActor
// (by manipulating its transformation matrix).
vtkSmartPointer<vtkTransform> t =
vtkSmartPointer<vtkTransform>::New();
vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);
widget->GetTransform( t );
if (anno){
// widget->GetProp3D()->SetUserTransform(t);
anno->applyTransform(t);
}
}
void vtkBoxWidgetCallback0::setAnno(Annotation *value){
anno = value;
}
vtkBoxWidgetCallback1 *vtkBoxWidgetCallback1::New()
{
return new vtkBoxWidgetCallback1;
}
void vtkBoxWidgetCallback1::Execute(vtkObject *caller, unsigned long, void *)
{
if (anno){
anno->adjustToAnchor();
}
}
void vtkBoxWidgetCallback1::setAnno(Annotation *value)
{
anno=value;
}