MCPcopy Create free account
hub / github.com/OctoMap/octomap / init

Method init

octovis/src/ViewerWidget.cpp:45–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void ViewerWidget::init() {
46
47 // setHandlerKeyboardModifiers(QGLViewer::CAMERA, Qt::AltModifier);
48 // setHandlerKeyboardModifiers(QGLViewer::FRAME, Qt::NoModifier);
49 // setHandlerKeyboardModifiers(QGLViewer::CAMERA, Qt::ControlModifier);
50 setMouseTracking(true);
51
52 // Restore previous viewer state.
53 restoreStateFromFile();
54
55 // Make camera the default manipulated frame.
56 setManipulatedFrame( camera()->frame() );
57 // invert mousewheel (more like Blender)
58 camera()->frame()->setWheelSensitivity(-1.0);
59
60
61 // Light initialization:
62 glEnable(GL_LIGHT0);
63
64 float pos[4] = {-1.0, 1.0, 1.0, 0.0};
65 // Directional light
66 glLightfv(GL_LIGHT0, GL_POSITION, pos);
67
68 // background color defaults to white
69 this->setBackgroundColor( QColor(255,255,255) );
70}
71
72void ViewerWidget::resetView(){
73 this->camera()->setOrientation((float) -M_PI_2, (float) M_PI_2);

Callers

nothing calls this directly

Calls 2

cameraFunction · 0.85
frameMethod · 0.45

Tested by

no test coverage detected