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
|
localise2delement.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 ORCAGUI_LOCALISE2D_GUI_ELEMENT_H 00012 #define ORCAGUI_LOCALISE2D_GUI_ELEMENT_H 00013 00014 #include <QPointF> 00015 00016 #include <orcaobj/orcaobj.h> 00017 #include <orcaice/orcaice.h> 00018 00019 #include <hydroqgui/hydroqgui.h> 00020 #include <hydroqguielementutil/iknowsplatformposition2d.h> 00021 #include <orcaqguielementutil/icestormelement.h> 00022 #include <orcaqgui2dfactory/connectutils.h> 00023 #include <orcaqgui2dfactory/localise2dpainter.h> 00024 00025 namespace orcaqgui2d 00026 { 00027 00028 class Localise2dElement 00029 : public orcaqguielementutil::IceStormElement<Localise2dPainter, 00030 orca::Localise2dData, 00031 orca::Localise2dPrx, 00032 orca::Localise2dConsumer, 00033 orca::Localise2dConsumerPrx>, 00034 public hydroqguielementutil::IKnowsPlatformPosition2d 00035 { 00036 public: 00037 Localise2dElement( const orcaice::Context &context, 00038 const std::string &proxyString, 00039 hydroqguielementutil::IHumanManager *humanManager, 00040 bool beginDisplayHistory=false, 00041 int timeoutMs=30000 ) 00042 : orcaqguielementutil::IceStormElement<Localise2dPainter, 00043 orca::Localise2dData, 00044 orca::Localise2dPrx, 00045 orca::Localise2dConsumer, 00046 orca::Localise2dConsumerPrx>(context, proxyString, painter_, timeoutMs ), 00047 humanManager_(humanManager), 00048 painter_( beginDisplayHistory ), 00049 x_(0), 00050 y_(0), 00051 theta_(0), 00052 haveGeometry_(false) 00053 { 00054 }; 00055 00056 virtual bool isInGlobalCS() { return true; } 00057 virtual void actionOnConnection(); 00058 virtual QStringList contextMenu(); 00059 virtual void execute( int action ); 00060 00061 virtual void setColor( QColor color ) { painter_.setColor(color); } 00062 virtual void setFocus( bool inFocus ) { painter_.setFocus( inFocus ); }; 00063 virtual void setUseTransparency( bool useTransparency ) { painter_.setUseTransparency( useTransparency ); }; 00064 00065 // Need a special update function to set (x,y,theta) 00066 // The Localise2dElement needs this because it's special kind of GuiElement: 00067 // A platform has a position in the world and various other things are 00068 // drawn with respect to that position. 00069 virtual void update(); 00070 00071 // Access to ML estimate. 00072 virtual double x() const { return x_; } 00073 virtual double y() const { return y_; } 00074 virtual double theta() const { return theta_; } 00075 virtual int platformKnowledgeReliability() const { return 7; } 00076 virtual QPointF pos() const { return QPointF(x_,y_); }; 00077 00078 private: 00079 hydroqguielementutil::IHumanManager *humanManager_; 00080 Localise2dPainter painter_; 00081 00082 double x_; 00083 double y_; 00084 double theta_; 00085 00086 void tryToGetGeometry(); 00087 bool haveGeometry_; 00088 }; 00089 00090 } 00091 00092 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)