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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

orcaqgui2dfactory/localise2dpainter.h

00001 /*
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 #ifndef ORCAGUI_LOCALISE2D_PAINTER_H
00011 #define ORCAGUI_LOCALISE2D_PAINTER_H
00012 
00013 #include <QColor>
00014 #include <hydroqguielementutil/definitions2d.h>
00015 #include <hydroqguielementutil/paintutils.h>
00016 
00017 // forward declarations
00018 class QPainter;
00019 
00020 namespace orcaqgui2d
00021 {
00022     
00023 enum PlatformType
00024 {
00025     PlatformTypeCubic,
00026     PlatformTypeCylindrical
00027 };
00028 
00029 class Localise2dPainter
00030 {
00031   public:
00032     Localise2dPainter( bool beginDisplayHistory );
00033 
00034     void setData( const orca::Localise2dData& data );
00035     void setPlatformType( PlatformType &type );
00036     
00037     void setTypeAndGeometry( PlatformType type, double length, double width ) { platformType_ = type; length_ = length; width_ = width;};
00038     void setTypeAndGeometry( PlatformType type, double radius ) { platformType_ = type; radius_ = radius; };
00039     void setOrigin( double x, double y, double o ) { originX_ = x; originY_ = y; originRot_ = o; };
00040 
00041     void paint( QPainter *p, int z );
00042     bool paintThisLayer(int z) const {return z==hydroqguielementutil::Z_POSE || z==hydroqguielementutil::Z_POSE-2;}
00043     void setUseTransparency( bool useTransparency ) { useTransparency_= useTransparency; };
00044     void clear();
00045     void setColor( QColor color );
00046     void setFocus( bool inFocus );
00047 
00048     void toggleDisplayHistory()  { isDisplayHistory_ = !isDisplayHistory_; }
00049     void toggleMultiHypothesis() { isDisplayMultiHypothesis_ = !isDisplayMultiHypothesis_; }
00050     void setMaxNumHistoryPoints( int maxNumPoints ) { history_.setMaxNumPoints( maxNumPoints ); }
00051     int currentMaxNumHistoryPoints() const { return history_.currentMaxNumPoints(); }
00052 
00053   private:
00054 
00055     double length_;
00056     double width_;
00057     double radius_;
00058     
00059     PlatformType platformType_;
00060     
00061     double originX_;
00062     double originY_;
00063     double originRot_;
00064       
00065     void paintHypothesis( QPainter* p, const orca::Pose2dHypothesis &hypothesis );
00066 
00067     orca::Localise2dData data_;
00068     bool isDataAvailable_;
00069 
00070     QColor basicColor_;
00071     QColor currentColor_;
00072 
00073     bool useTransparency_;
00074     bool isDisplayHistory_;
00075     hydroqguielementutil::PoseHistory history_;
00076 
00077     bool isDisplayMultiHypothesis_;
00078 
00079     bool isInFocus_;
00080 };
00081 
00082 }
00083 
00084 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5