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 Project Download Mailing lists
|
pathfolloweruserinteraction.h00001 /* 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 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 PathFollowerPainter; 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 PathFollowerPainter &painter, 00056 const orcaice::Context &context, 00057 const hydroqguipath::PathInputFactory *inputFactory, 00058 bool enableToolbarButtons = true ); 00059 00060 ~PathFollowerUserInteraction(); 00061 00062 void noLongerMouseEventReceiver(); 00063 void paint( QPainter *p ); 00064 void setFocus( bool inFocus ); 00065 void setUseTransparency( bool useTransparency ); 00066 00067 void mousePressEvent(QMouseEvent *e); 00068 00069 void mouseMoveEvent(QMouseEvent *e); 00070 00071 void mouseReleaseEvent(QMouseEvent *e); 00072 00073 void mouseDoubleClickEvent(QMouseEvent *e); 00074 00075 void saveUserPath( const hydroqguipath::GuiPath &guiPath, 00076 int numLoops = 1, 00077 float timeOffset = 0.0 ); 00078 00079 void loadUserPath(hydroqguipath::GuiPath &guiPath); 00080 void loadPreviousUserPath(hydroqguipath::GuiPath &guiPath); 00081 00082 00083 public slots: 00084 void savePath(); 00085 void savePathAs(); 00086 void waypointSettingsDialog(); 00087 void waypointModeToggled(bool); 00088 00089 void send(); 00090 void cancel(); 00091 void allGo(); 00092 void allStop(); 00093 void go(); 00094 void stop(); 00095 void toggleEnabled(); 00096 00097 private: 00098 00099 PathFollower2dElement *pfElement_; 00100 std::string proxyString_; 00101 hydroqguielementutil::IHumanManager &humanManager_; 00102 hydroqguielementutil::MouseEventManager &mouseEventManager_; 00103 hydroqguielementutil::ShortcutKeyManager &shortcutKeyManager_; 00104 const hydroqgui::GuiElementSet &guiElementSet_; 00105 const PathFollowerPainter &painter_; 00106 orcaice::Context context_; 00107 const hydroqguipath::PathInputFactory *inputFactory_; 00108 hydroqguipath::WaypointSettings wpSettings_; 00109 00110 // saving the path which the pathfollower *interface* holds 00111 QString ifacePathFileName_; 00112 bool haveIfacePathFileName_; 00113 std::auto_ptr<PathFileHandler> ifacePathFileHandler_; 00114 00115 // saving the path which the user enters (green waypoints) 00116 QString userPathFileName_; 00117 bool haveUserPathFileName_; 00118 std::auto_ptr<PathFileHandler> userPathFileHandler_; 00119 00120 // handles all user path input through clicking, tables, etc. 00121 std::auto_ptr<hydroqguipath::IPathInput> pathInput_; 00122 00123 // automatic saving of paths on send 00124 int numAutoPathDumps_; 00125 00126 // sets up and destroys buttons and associated actions 00127 std::auto_ptr<hydroqguipath::PathfollowerButtons> buttons_; 00128 00129 // Do we own the mouse events? 00130 bool ownMouseEvents_; 00131 00132 bool useTransparency_; 00133 00134 bool enableToolbarButtons_; 00135 00136 }; 00137 00138 } // end of namespace 00139 00140 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)