INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

viewhandler.h

00001 #ifndef ORCAVIEW3D_VIEWHANDLER_H
00002 #define ORCAVIEW3D_VIEWHANDLER_H
00003 
00004 #include <QMouseEvent>
00005 #include <cmath>
00006 #include <assert.h>
00007 #include <orcaqgui3d/coordinateframe.h>
00008 
00009 namespace orcaview3d {
00010 
00016 class ViewHandler
00017 {
00018 
00019 public: 
00020 
00021     ViewHandler();
00022 
00023     // event handlers: these aren't actually hooked up to Qt,
00024     // they have to be called explicitly.
00025     void mousePressEvent( QMouseEvent* );
00026     // Returns true if the viewpoint has been modified
00027     bool mouseMoveEvent( QMouseEvent* );
00028     // Returns true if the viewpoint has been modified.
00029     // Sets 'needResize' if the eindow needs a resizeEvent (eg due to a zoom operation)
00030     bool keyPressEvent(QKeyEvent *e, bool &needResize);
00031 
00032     const orcaqgui3d::CoordinateFrame &pose() const { return cameraPose_; }
00033     double zoomFactor() const { return zoomFactor_; }
00034 
00035     std::string keyDescription() const;
00036 
00037 private: 
00038 
00039     void reset();
00040 
00041     QPointF mouseDownPnt_;
00042     QPoint prevDragPos_;
00043 
00044     // Current viewpoint
00045     orcaqgui3d::CoordinateFrame cameraPose_;
00046 
00047     double zoomFactor_;
00048 };
00049 
00050 }
00051 
00052 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5