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