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
|
localisepainter.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 ORCAGUI3D_LOCALISE_PAINTER_H 00011 #define ORCAGUI3D_LOCALISE_PAINTER_H 00012 00013 #include <QColor> 00014 #include <orca/localise2d.h> 00015 #include <orca/localise3d.h> 00016 #include <hydroqguielementutil/paintutils.h> 00017 #include <osg/Group> 00018 #include <osg/Geode> 00019 #include <osg/PositionAttitudeTransform> 00020 00021 // forward declarations 00022 class QPainter; 00023 00024 namespace orcaqgui3d 00025 { 00026 00027 class LocalisePainter 00028 { 00029 public: 00030 LocalisePainter( bool beginDisplayHistory ); 00031 00032 void setData( const orca::Localise2dData& data ); 00033 void setData( const orca::Localise3dData& data ); 00034 void setCubicDescr( double length, 00035 double width, 00036 double height, 00037 const orca::Frame3d &platformToGeometryTransform ); 00038 void setCylindricalDescr( double radius, 00039 double height, 00040 const orca::Frame3d &platformToGeometryTransform ); 00041 00042 void clear(); 00043 void setColor( QColor color ); 00044 void setFocus( bool inFocus ); 00045 00046 void toggleMultiHypothesis() { isDisplayMultiHypothesis_ = !isDisplayMultiHypothesis_; } 00047 void setUseTransparency(bool u) { useTransparency_ = u; } 00048 00049 osg::Node *osgNode() const { return root_.get(); } 00050 00051 private: 00052 00053 void drawCuboidPlatform(); 00054 void drawCylindricalPlatform(); 00055 00056 void paintHypothesis( const orca::Pose3dHypothesis &hypothesis ); 00057 00058 QColor basicColor_; 00059 QColor currentColor_; 00060 00061 bool useTransparency_; 00062 bool isDisplayMultiHypothesis_; 00063 00064 // This is where the platform is located 00065 osg::ref_ptr<osg::Group> platformNode_; 00066 // The platform geometry may not be centred on the platform 00067 osg::ref_ptr<osg::PositionAttitudeTransform> platformGeometryNode_; 00068 osg::ref_ptr<osg::Group> root_; 00069 }; 00070 00071 } 00072 00073 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)