|
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
|
pathfolloweruserinteraction.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 PATHFOLLOWER_UI_H 00012 #define PATHFOLLOWER_UI_H 00013 00014 #include <memory> 00015 #include <QObject> 00016 #include <orcaice/context.h> 00017 #include <hydroqguipath/pathdesignscreen.h> 00018 #include <hydroqguipath/pathfollowerbuttons.h> 00019 #include <hydroqguipath/ipathinput.h> 00020 #include <orcaqgui2dfactory/pathfollowerinput.h> 00021 #include <orcaqgui2dfactory/pathfilehandler.h> 00022 00023 namespace hydroqgui { 00024 class GuiElementSet; 00025 } 00026 00027 namespace hydroqguielementutil { 00028 class MouseEventManager; 00029 class IHumanManager; 00030 class ShortcutKeyManager; 00031 } 00032 00033 namespace orcaqgui2d { 00034 00035 class PathFollower2dElement; 00036 class PathPainter; 00037 00043 class PathFollowerUserInteraction : public QObject, 00044 public hydroqguipath::IPathUserInteraction 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 PathFollowerUserInteraction( PathFollower2dElement *pfElement, 00050 const std::string &proxyString, 00051 hydroqguielementutil::IHumanManager &humanManager, 00052 hydroqguielementutil::MouseEventManager &mouseEventManager, 00053 hydroqguielementutil::ShortcutKeyManager &shortcutKeyManager, 00054 const hydroqgui::GuiElementSet &guiElementSet, 00055 const PathPainter &painter, 00056 const orcaice::Context &context, 00057 const hydroqguipath::PathInputFactory *inputFactory ); 00058 00059 void noLongerMouseEventReceiver(); 00060 void paint( QPainter *p ); 00061 void setFocus( bool inFocus ); 00062 void setUseTransparency( bool useTransparency ); 00063 00064 void mousePressEvent(QMouseEvent *e) 00065 {pathInput_->processPressEvent(e);} 00066 00067 void mouseMoveEvent(QMouseEvent *e) 00068 {pathInput_->processMoveEvent(e);} 00069 00070 void mouseReleaseEvent(QMouseEvent *e) 00071 {pathInput_->processReleaseEvent(e);} 00072 00073 void mouseDoubleClickEvent(QMouseEvent *e) 00074 {pathInput_->processDoubleClickEvent(e);} 00075 00076 00077 public slots: 00078 void savePathAs(); 00079 void savePath(); 00080 void waypointSettingsDialog(); 00081 void waypointModeSelected(); 00082 void send(); 00083 void cancel(); 00084 void allGo(); 00085 void allStop(); 00086 void go(); 00087 void stop(); 00088 void toggleEnabled(); 00089 00090 private: 00091 00092 PathFollower2dElement *pfElement_; 00093 std::string proxyString_; 00094 hydroqguielementutil::IHumanManager &humanManager_; 00095 hydroqguielementutil::MouseEventManager &mouseEventManager_; 00096 hydroqguielementutil::ShortcutKeyManager &shortcutKeyManager_; 00097 const hydroqgui::GuiElementSet &guiElementSet_; 00098 const PathPainter &painter_; 00099 orcaice::Context context_; 00100 const hydroqguipath::PathInputFactory *inputFactory_; 00101 hydroqguipath::WaypointSettings wpSettings_; 00102 00103 // saving the path which the pathfollower *interface* holds 00104 // (as opposed to the path the user enters in green) 00105 QString ifacePathFileName_; 00106 bool haveIfacePathFileName_; 00107 std::auto_ptr<PathFileHandler> ifacePathFileHandler_; 00108 00109 // handles all user path input through clicking, tables, etc. 00110 std::auto_ptr<hydroqguipath::IPathInput> pathInput_; 00111 00112 // automatic saving of paths on send 00113 int numAutoPathDumps_; 00114 00115 // remember the filename of the green user path 00116 QString loadPreviousPathFilename_; 00117 00118 // sets up and destroys buttons and associated actions 00119 std::auto_ptr<hydroqguipath::PathfollowerButtons> buttons_; 00120 00121 // Do we own the global mode? 00122 bool gotMode_; 00123 00124 bool useTransparency_; 00125 00126 }; 00127 00128 } // end of namespace 00129 00130 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5