-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReconstruView.cpp
More file actions
76 lines (59 loc) · 1.95 KB
/
Copy pathReconstruView.cpp
File metadata and controls
76 lines (59 loc) · 1.95 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "ReconstruView.h"
CReconstruView::CReconstruView(void)
{
renWin= vtkRenderWindow::New();
ren = vtkRenderer::New();
//StyleSwitch=vtkInteractorStyleSwitch::New();
StyleTrackballCamera = vtkInteractorStyleTrackballCamera::New();
//StyleTrackballActor = vtkInteractorStyleTrackballActor::New();
StyleTrackballActor = interactorStyleTrackballActor::New();
iren=vtkRenderWindowInteractor::New();
}
void CReconstruView::Initialize()
{
//picker=vtkCellPicker::New();
picker=vtkWorldPointPicker::New();
iren->SetRenderWindow(renWin);
iren->SetPicker(picker);
iren->Initialize();
//iren->SetInteractorStyle(StyleSwitch);
iren->SetInteractorStyle(StyleTrackballCamera);
m_bStyleTrackballCamera=true;
//stlPolyData=vtkPolyData::New() ;
//clipActor=vtkActor::New();
//clipLeftActor=vtkActor::New();
textMapper=vtkTextMapper::New();
textActor=vtkActor2D::New();
annotatePick=vtkAnnotatePick::New();
iren->AddObserver(vtkCommand::EndPickEvent,annotatePick);
mCommand = vtkSmartPointer<MoveCommand>::New();
mCommand->qSignal = new QtSignal();
annotatePick->textMapper=textMapper;
annotatePick->textActor=textActor;
textActor->SetMapper(textMapper);
ren->AddActor2D(textActor);
ren->SetBackground(109.0/255.0,90.0/255.0,205.0/255.0);
//myCallback=vtkTPWCallback::New();
planeWidget=vtkPlaneWidget::New();
planeWidget->SetInteractor(iren);
//planeWidget->SetInput(stlActor->GetMapper()->GetInput());
//planeWidget->NormalToXAxisOn();
//planeWidget->SetResolution(20);
//planeWidget->SetPlaceFactor(0.25);
//planeWidget->SetRepresentationToSurface();
//planeWidget->PlaceWidget();
//planeWidget->AddObserver(vtkCommand::InteractionEvent,myCallback);
}
CReconstruView::~CReconstruView(void)
{
textMapper->Delete();
textActor->Delete();
StyleTrackballActor->Delete();
StyleTrackballCamera->Delete();
renWin->Delete();
ren->Delete();
iren->Delete();
//StyleTrackballCamera->Delete();
picker->Delete();
annotatePick->Delete();
}