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
|
localise2dpainter.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 #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 // The default color is the color when the robot is not selected. 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 00052 private: 00053 00054 double length_; 00055 double width_; 00056 double radius_; 00057 00058 PlatformType platformType_; 00059 00060 double originX_; 00061 double originY_; 00062 double originRot_; 00063 00064 void paintHypothesis( QPainter* p, const orca::Pose2dHypothesis &hypothesis ); 00065 00066 orca::Localise2dData data_; 00067 bool isDataAvailable_; 00068 00069 QColor basicColor_; 00070 QColor currentColor_; 00071 00072 bool useTransparency_; 00073 bool isDisplayHistory_; 00074 hydroqguielementutil::PoseHistory history_; 00075 00076 bool isDisplayMultiHypothesis_; 00077 }; 00078 00079 } 00080 00081 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)