void MovableObject::absolute_move(const glm::vec3 &move) { translation_matrix_dirty_ = true; position_ += move; position_changed(); matrix_becomes_dirty(); }
void MovableObject::relative_move(const glm::vec3 &move) { translation_matrix_dirty_ = true; position_+= orient_vector(move); position_changed(); matrix_becomes_dirty(); }
void MovableObject::callback_position(const glm::vec3 &position) { position_ = position; translation_matrix_dirty_ = true; position_changed(); matrix_becomes_dirty(); }
void MovableObject::set_matrix(const glm::mat4 &mat) { rotation_matrix_dirty_ = true; translation_matrix_dirty_ = true; orientation_ = glm::quat_cast(mat); orientation_changed(); position_ = glm::vec3(glm::column(mat, 3)); position_changed(); matrix_becomes_dirty(); }
void QtUtil :: Grid3DView :: set_position (int x, int y, int z) { if (m_position != Position (x, y, z)) { m_position = {x, y, z}; emit position_changed (x, y, z); update (); } }
void GeolocationServiceGtk::getPositionCallback(GeocluePosition *position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GError* error, GeolocationServiceGtk* that) { if (error) { that->setError(PositionError::POSITION_UNAVAILABLE, error->message); g_error_free(error); return; } position_changed(position, fields, timestamp, latitude, longitude, altitude, accuracy, that); }
MeshSubWindow::MeshSubWindow(void) { m_pMeshViewer = new MeshViewer; m_pMeshViewer->setAttribute(Qt::WA_OpaquePaintEvent); m_pMeshViewer->setAttribute(Qt::WA_NoSystemBackground); setCentralWidget(m_pMeshViewer); setWindowTitle("Mesh Viewer"); surfacedata = NULL; createActions(); createMenus(); createContextMenus(); createStatusBar(); setCurrentFile(""); connect(m_pMeshViewer, SIGNAL(position_changed()), this, SLOT(updateStatusBar())); //connect(m_pMeshViewer,SIGNAL(CSurfaceData_changed(CSurfaceData*)),this,SLOT(emit_changed_surfacedata(CSurfaceData*))); }
bool window::dispatch_event ( XEvent& evt ) { switch ( evt.type ) { case Expose: exposed(); break; case ButtonPress: if ( evt.xbutton.button & Button2 ) on_right_button_down ( evt.xbutton.x, evt.xbutton.y ); else if ( evt.xbutton.button & Button1 ) on_left_button_down ( evt.xbutton.x, evt.xbutton.y ); break; case ButtonRelease: if ( evt.xbutton.button & Button2 ) on_right_button_up ( evt.xbutton.x, evt.xbutton.y ); else if ( evt.xbutton.button & Button1 ) on_left_button_up ( evt.xbutton.x, evt.xbutton.y ); break; case EnterNotify: on_mouse_enter ( evt.xcrossing.x, evt.xcrossing.y ); break; case LeaveNotify: on_mouse_exit ( evt.xcrossing.x, evt.xcrossing.y ); break; case MotionNotify: on_mouse_move ( evt.xmotion.x, evt.xmotion.y ); break; case FocusIn: on_got_focus(); break; case FocusOut: on_lost_focus(); break; case KeyPress: case KeyRelease: { character cp; KeySym keysym; XComposeStatus status; int count = XLookupString ( &evt.xkey, cp.text, character::MAX_CHAR_TEXT, &keysym, &status ); cp.text[count] = 0; if ( evt.type == KeyPress ) on_key_press ( cp ); else on_key_release ( cp ); } break; case MapNotify: state = WINDOW_SHOWN; shown(); break; case UnmapNotify: state = WINDOW_HIDDEN; hidden(); break; case ConfigureNotify: //XClearWindow ( env, hwnd ); //XFlush ( env ); position_changed(); break; case ClientMessage: { if ( atomDelete == (Atom)evt.xclient.data.l[0] ) destroy(); break; } } return true; }
void MovableObject::set_position(const glm::vec3 &pos) { position_ = pos; translation_matrix_dirty_ = true; position_changed(); }