-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecord_events.cpp
38 lines (30 loc) · 947 Bytes
/
record_events.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
#include <vtkActor.h>
#include <vtkInteractorEventRecorder.h>
#include <vtkNew.h>
#include <vtkPolyDataMapper.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkSphereSource.h>
auto main(int argc, char** argv) -> int {
vtkNew<vtkSphereSource> sphere;
sphere->Update();
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(sphere->GetOutputPort());
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
vtkNew<vtkRenderer> render;
render->AddActor(actor);
vtkNew<vtkRenderWindow> window;
window->AddRenderer(render);
vtkNew<vtkRenderWindowInteractor> interactor;
interactor->SetRenderWindow(window);
interactor->Initialize();
vtkNew<vtkInteractorEventRecorder> recorder;
recorder->SetInteractor(interactor);
recorder->SetFileName("interactor_event.log");
window->Render();
recorder->EnabledOn();
recorder->Record();
interactor->Start();
}