|
orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
worldview.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCA_ORCAGUI3D_WORLDVIEW3D_H 00012 #define ORCA_ORCAGUI3D_WORLDVIEW3D_H 00013 00014 #include <QMouseEvent> 00015 #include <QFileDialog> 00016 #include <QString> 00017 #include <QtOpenGL> 00018 #include <hydroqgui/hydroqgui.h> 00019 #include <orcaqgui3d/platformcsfinder.h> 00020 #include "viewhandler.h" 00021 #include <osgUtil/SceneView> 00022 #include <osg/Group> 00023 #include <osg/LightSource> 00024 00025 namespace orcaview3d 00026 { 00027 00028 class WorldView : public QGLWidget 00029 { 00030 Q_OBJECT 00031 public: 00032 WorldView( orcaqgui3d::PlatformCSFinder &platformCSFinder, 00033 ::hydroqguielementutil::MouseEventManager &mouseEventManager, 00034 hydroqgui::GuiElementSet &guiElementSet, 00035 hydroqgui::CoordinateFrameManager &coordinateFrameManager, 00036 ::hydroqguielementutil::IHumanManager &humanManager, 00037 hydroqgui::PlatformFocusManager &platformFocusManager, 00038 int displayRefreshTime, 00039 QWidget *parent = NULL ); 00040 00041 QSize sizeHint() const { return QSize( 400, 400 ); } 00042 00043 private slots: 00044 00045 void reDisplay(); 00046 void setOrthographicProjection(bool orthoProj); 00047 00048 private: 00049 00050 void updateAllGuiElements(); 00051 void attachAllGuiElements( bool isCoordinateFramePlatformLocalised, 00052 osg::Group *root ); 00053 00054 // finds coord system of a platform 00055 const orcaqgui3d::PlatformCSFinder &platformCSFinder_; 00056 hydroqgui::CoordinateFrameManager &coordinateFrameManager_; 00057 00058 // handles distribution of mouse events to GuiElements 00059 ::hydroqguielementutil::MouseEventManager &mouseEventManager_; 00060 00061 hydroqgui::GuiElementSet &guiElementSet_; 00062 00063 ::hydroqguielementutil::IHumanManager &humanManager_; 00064 hydroqgui::PlatformFocusManager &platformFocusManager_; 00065 00066 orcaqgui3d::CoordinateFrame getCameraPose( bool &isCameraPoseLocalised ); 00067 00068 // from QGLWidget 00069 void initializeGL(); 00070 void paintGL(); 00071 void resizeGL(int w, int h); 00072 00073 // event handlers 00074 void mousePressEvent( QMouseEvent* ); 00075 void mouseMoveEvent( QMouseEvent* ); 00076 void mouseReleaseEvent( QMouseEvent* ); 00077 void mouseDoubleClickEvent( QMouseEvent* ); 00078 void keyPressEvent(QKeyEvent *e); 00079 00080 QTimer *displayTimer_; 00081 00082 // Current user input in terms of viewpoint manipulation 00083 ViewHandler viewHandler_; 00084 00085 // Current camera pose 00086 orcaqgui3d::CoordinateFrame cameraPose_; 00087 00088 // SceneView: Literally the view of the scene, encapsulating 00089 // how it's rendered. 00090 osg::ref_ptr<osgUtil::SceneView> sceneView_; 00091 00092 osg::ref_ptr<osg::LightSource> lightSource_; 00093 00094 bool isOrthographicProjection_; 00095 }; 00096 00097 } // namespace 00098 00099 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5