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

 

         

pathplanneruserinteraction.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 PATHPLANNER_HI_H
00012 #define PATHPLANNER_HI_H
00013 
00014 #include <memory>
00015 #include <QObject>
00016 #include <orcaice/context.h>
00017 #include <hydroqguipath/pathdesignscreen.h>
00018 #include <hydroqguipath/pathplannerbuttons.h>
00019 #include <hydroqguipath/ipathinput.h>
00020 #include <orcaqgui2dfactory/pathplannerinput.h>
00021     
00022 namespace hydroqgui {
00023     class GuiElementSet;
00024 }
00025 
00026 namespace hydroqguielementutil {
00027     class MouseEventManager;
00028     class IHumanManager;
00029     class ShortcutKeyManager;
00030 }
00031 
00032 namespace orcaqgui2d {
00033 
00034 class PathPlanner2dElement;
00035 class PathPlannerPainter;
00036 
00042 class PathPlannerUserInteraction  : public QObject, 
00043                                     public hydroqguipath::IPathUserInteraction
00044 {
00045     Q_OBJECT
00046 
00047 public:
00048     PathPlannerUserInteraction( PathPlanner2dElement                     *ppElement,
00049                                 const std::string                        &proxyString,
00050                                 hydroqguielementutil::IHumanManager      &humanManager,
00051                                 hydroqguielementutil::ShortcutKeyManager &shortcutKeyManager,
00052                                 hydroqguielementutil::MouseEventManager  &mouseEventManager,
00053                                 PathPlannerPainter                       &painter,
00054                                 const orcaice::Context                   &context );
00055     
00056     ~PathPlannerUserInteraction();
00057 
00058     void noLongerMouseEventReceiver();
00059     void paint( QPainter *p );
00060     void setFocus( bool inFocus );
00061     void setUseTransparency( bool useTransparency ); 
00062 
00063     void mousePressEvent(QMouseEvent *e) 
00064         {pathInput_->processPressEvent(e);}
00065     
00066     void mouseMoveEvent(QMouseEvent *e) 
00067         {pathInput_->processMoveEvent(e);}
00068     
00069     void mouseReleaseEvent(QMouseEvent *e) 
00070         {pathInput_->processReleaseEvent(e);}
00071     
00072     void mouseDoubleClickEvent(QMouseEvent *e) 
00073         {pathInput_->processDoubleClickEvent(e);}
00074     
00075     void saveUserPath( const hydroqguipath::GuiPath &guiPath,
00076                        int numLoops,
00077                        float timeOffset );
00078     
00079     void loadUserPath(hydroqguipath::GuiPath &guiPath);
00080     void loadPreviousUserPath(hydroqguipath::GuiPath &guiPath);
00081 
00082 public slots:
00083     void savePathAs();
00084     void savePath();
00085     void waypointSettingsDialog();
00086     void waypointModeSelected();
00087     void send();
00088     void cancel();
00089 
00090 private:
00091 
00092     PathPlanner2dElement *ppElement_;
00093     std::string proxyString_;
00094     hydroqguielementutil::IHumanManager &humanManager_;
00095     hydroqguielementutil::MouseEventManager &mouseEventManager_;
00096     hydroqguielementutil::ShortcutKeyManager &shortcutKeyManager_;
00097     PathPlannerPainter &painter_;
00098     orcaice::Context context_;
00099     hydroqguipath::WaypointSettings wpSettings_;
00100 
00101     // saving the path which the pathplanner *interface* holds
00102     QString ifacePathFileName_;
00103     bool haveIfacePathFileName_;
00104     std::auto_ptr<PathFileHandler> ifacePathFileHandler_;
00105     
00106     // saving the path which the user enters (green waypoints)
00107     QString userPathFileName_;
00108     bool haveUserPathFileName_;
00109     std::auto_ptr<PathFileHandler> userPathFileHandler_;
00110 
00111     // handles all user input through clicking, tables, etc.
00112     std::auto_ptr<PathPlannerInput> pathInput_;
00113     // sets up and destroys buttons and associated actions
00114     std::auto_ptr<hydroqguipath::PathplannerButtons> buttons_;
00115     
00116     // Do we own the global mode?
00117     bool gotMode_;
00118     
00119     bool useTransparency_;
00120 };
00121 
00122 }
00123 
00124 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5