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

 

         

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

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


Generated for Orca Robotics by  doxygen 1.4.5