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
|
pathplannerpainter.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 00011 #ifndef PATHPLANNERPAINTER_H 00012 #define PATHPLANNERPAINTER_H 00013 00014 #include <QColor> 00015 #include <hydroqguipath/pathutils.h> 00016 #include <hydroqguielementutil/definitions2d.h> 00017 00018 // forward declarations 00019 class QPainter; 00020 00021 namespace orca { 00022 class PathPlanner2dData; 00023 } 00024 00025 namespace orcaqgui2d { 00026 00027 00028 class PathPlannerPainter 00029 { 00030 00031 public: 00032 PathPlannerPainter(); 00033 00034 void initialize( bool useTransparency, bool displayWaypoints ) 00035 { useTransparency_ = useTransparency; 00036 displayWaypoints_ = displayWaypoints; 00037 } 00038 00039 void setData( const orca::PathPlanner2dData& path ); 00040 00041 void paint( QPainter *p, int z ); 00042 00043 bool paintThisLayer(int z) const 00044 { return z==hydroqguielementutil::Z_PATH; } 00045 00046 void clear() 00047 { guiPath_.resize(0); } 00048 00049 void toggleDisplayWaypoints() 00050 { displayWaypoints_ = !displayWaypoints_; } 00051 00052 void setDisplayWaypoints( bool display ) 00053 { displayWaypoints_ = display; } 00054 00055 bool displayWaypoints() 00056 { return displayWaypoints_; } 00057 00058 void setUseTransparency( bool useTransparency ) 00059 { useTransparency_ = useTransparency; }; 00060 00061 bool useTransparency() 00062 { return useTransparency_; }; 00063 00064 void setColor( QColor color ) 00065 { color_ = color; }; 00066 00067 void setFocus( bool inFocus ) 00068 { inFocus_ = inFocus; }; 00069 00070 const hydroqguipath::GuiPath ¤tPath() const 00071 { return guiPath_; }; 00072 00073 private: 00074 00075 hydroqguipath::GuiPath guiPath_; 00076 00077 // The index of the waypoint we're currently pursuing 00078 int wpIndex_; 00079 00080 bool useTransparency_; 00081 bool displayWaypoints_; 00082 00083 QColor color_; 00084 bool inFocus_; 00085 00086 00087 }; 00088 00089 } 00090 00091 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)