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

 

         

utils/orcaview3d/worldview.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 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 <orcaqgui3d/platformcsfinder.h>
00019 #include "viewhandler.h"
00020 #include <osgUtil/SceneView>
00021 #include <osg/Group>
00022 #include <osg/LightSource>
00023 #include <hydroqguielementutil/mouseeventmanager.h>
00024 #include <hydroqgui/guielementset.h>
00025 #include <hydroqgui/coordinateframemanager.h>
00026 #include <hydroqguielementutil/ihumanmanager.h>
00027 #include <hydroqgui/platformfocusmanager.h>
00028 
00029 namespace orcaview3d 
00030 {
00031 
00032 class WorldView : public QGLWidget
00033 {
00034    Q_OBJECT
00035 public:
00036     WorldView( orcaqgui3d::PlatformCSFinder              &platformCSFinder,
00037                ::hydroqguielementutil::MouseEventManager &mouseEventManager,
00038                hydroqgui::GuiElementSet                  &guiElementSet,
00039                hydroqgui::CoordinateFrameManager         &coordinateFrameManager,
00040                ::hydroqguielementutil::IHumanManager     &humanManager,
00041                hydroqgui::PlatformFocusManager           &platformFocusManager,
00042                int                                        displayRefreshTime,
00043                QWidget                                   *parent = NULL );
00044 
00045     QSize sizeHint() const { return QSize( 400, 400 ); }
00046 
00047 private slots:
00048 
00049     void reDisplay();
00050     void setOrthographicProjection(bool orthoProj);
00051 
00052 private:
00053 
00054     void updateAllGuiElements();
00055     void attachAllGuiElements( bool isCoordinateFramePlatformLocalised,
00056                                osg::Group *root );
00057 
00058     // finds coord system of a platform
00059     const orcaqgui3d::PlatformCSFinder &platformCSFinder_;
00060     hydroqgui::CoordinateFrameManager &coordinateFrameManager_;
00061 
00062     // handles distribution of mouse events to GuiElements
00063     ::hydroqguielementutil::MouseEventManager &mouseEventManager_;
00064 
00065     hydroqgui::GuiElementSet     &guiElementSet_;
00066 
00067     ::hydroqguielementutil::IHumanManager &humanManager_;
00068     hydroqgui::PlatformFocusManager &platformFocusManager_;
00069 
00070     orcaqgui3d::CoordinateFrame getCameraPose( bool &isCameraPoseLocalised );
00071 
00072     // from QGLWidget
00073     void initializeGL();
00074     void paintGL();
00075     void resizeGL(int w, int h);
00076 
00077     // event handlers
00078     void mousePressEvent( QMouseEvent* );
00079     void mouseMoveEvent( QMouseEvent* );
00080     void mouseReleaseEvent( QMouseEvent* );
00081     void mouseDoubleClickEvent( QMouseEvent* );
00082     void keyPressEvent(QKeyEvent *e);
00083     
00084     QTimer *displayTimer_;
00085 
00086     // Current user input in terms of viewpoint manipulation
00087     ViewHandler viewHandler_;
00088 
00089     // Current camera pose
00090     orcaqgui3d::CoordinateFrame cameraPose_;
00091 
00092     // SceneView: Literally the view of the scene, encapsulating
00093     // how it's rendered.
00094     osg::ref_ptr<osgUtil::SceneView> sceneView_;
00095 
00096     osg::ref_ptr<osg::LightSource> lightSource_;
00097 
00098     bool isOrthographicProjection_;
00099 };
00100 
00101 } // namespace
00102 
00103 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5