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
|
pathplanner2delement.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 PATHPLANNER2DELEMENT_H 00012 #define PATHPLANNER2DELEMENT_H 00013 00014 #include <iostream> 00015 #include <orca/pathplanner2d.h> 00016 00017 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00018 #include <orcaqguielementutil/icestormguielement2d.h> 00019 00020 #include <orcaqgui2dfactory/pathplannerpainter.h> 00021 #include <orcaqgui2dfactory/pathplanneruserinteraction.h> 00022 00023 namespace orcaqgui2d { 00024 00025 // There's two consumer objects: the first one for icestorm (pathplanner pushes out whatever it computed) which is part 00026 // of the base class IceStormGuiElement2d. 00027 // The second one here is for answers to tasks which were set by the GUI. 00028 00030 class PathPlannerTaskAnswerConsumer : public orca::PathPlanner2dConsumer 00031 { 00032 public: 00033 00034 virtual void setData(const ::orca::PathPlanner2dData& data, const ::Ice::Current& = ::Ice::Current()); 00035 gbxiceutilacfr::Store<QString> msgStore_; 00036 }; 00038 00039 00040 // 00041 // @author Tobias Kaupp 00042 // 00043 class PathPlanner2dElement : public orcaqguielementutil::IceStormGuiElement2d<PathPlannerPainter, 00044 orca::PathPlanner2dData, 00045 orca::PathPlanner2dPrx, 00046 orca::PathPlanner2dConsumer, 00047 orca::PathPlanner2dConsumerPrx> 00048 { 00049 00050 public: 00051 00052 PathPlanner2dElement( const hydroqguielementutil::GuiElementInfo &guiElementInfo, 00053 const orcaice::Context &context ); 00054 ~PathPlanner2dElement(); 00055 00056 void update(); 00057 00058 // overriding paint since we have to paint human input 00059 void paint( QPainter *p, int z ); 00060 00061 virtual void iceStormConnectedEvent(); 00062 virtual bool isInGlobalCS() { return true; } 00063 virtual QStringList contextMenu(); 00064 virtual void execute( int action ); 00065 virtual void setColor( QColor color ) { painter_.setColor( color ); }; 00066 virtual void setFocus( bool inFocus ); 00067 virtual void setUseTransparency( bool useTransparency ); 00068 00069 virtual void noLongerMouseEventReceiver() { pathHI_.noLongerMouseEventReceiver(); } 00070 virtual void mousePressEvent(QMouseEvent *e) { pathHI_.mousePressEvent(e); } 00071 virtual void mouseMoveEvent(QMouseEvent *e) { pathHI_.mouseMoveEvent(e); } 00072 virtual void mouseReleaseEvent(QMouseEvent *e) { pathHI_.mouseReleaseEvent(e); } 00073 virtual void mouseDoubleClickEvent(QMouseEvent *e) { pathHI_.mouseDoubleClickEvent(e); } 00074 void sendPath( const PathPlannerInput &pathInput ); 00075 00076 private: 00077 00078 PathPlannerPainter painter_; 00079 00080 // Task answer 00081 PathPlannerTaskAnswerConsumer *pathTaskAnswerConsumer_; 00082 orca::PathPlanner2dConsumerPrx taskCallbackPrx_; 00083 Ice::ObjectPtr pathPlanner2dConsumerObj_; 00084 00085 orca::PathPlanner2dPrx pathPlanner2dPrx_; 00086 00087 orcaice::Context context_; 00088 std::string proxyString_; 00089 00090 // Handles user interaction 00091 PathPlannerUserInteraction pathHI_; 00092 }; 00093 00094 } 00095 00096 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)