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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

rangerarraypainter.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 
00011 #ifndef ORCAGUI_RANGERARRAY_PAINTER_H
00012 #define ORCAGUI_RANGERARRAY_PAINTER_H
00013 
00014 #include <QColor>
00015 #include <QPolygonF>
00016 #include <orca/rangerarray.h>
00017 #include <hydroqguielementutil/definitions2d.h>
00018 
00019 class QPainter;
00020 
00021 namespace orcaqgui2d
00022 {
00023 
00027 class RangerArrayPainter
00028 {
00029   
00030   public:
00031     // -1 means 'default'
00032     RangerArrayPainter( QColor outlineColor=Qt::blue,
00033                         float  outlineThickness=-1,
00034                         float  brightReturnWidth=0.2 );
00035 
00036     void setDescription( orca::RangerArrayDescription &description );
00037     void setData( const orca::RangerArrayDataPtr &scan );
00038     
00039     void paint( QPainter *p, int z );
00040     bool paintThisLayer(int z) const {return z==hydroqguielementutil::Z_RANGERARRAY;}
00041 
00042     void clear();
00043     
00044     void execute( int action );
00045     
00046     void setFocus( bool inFocus );
00047 
00048   private:
00049 
00050     std::vector<float>         ranges_;
00051 
00052     // Data for every ray
00053     struct RANGERDATA
00054     {
00055         // Scan (set of points for drawing the scan outline)
00056         QPolygonF qScan;
00057 
00058         // The actual return (doesn't include a point at the origin)
00059         QPolygonF qReturn;
00060 
00061         // The return arc (to make it more visible)
00062         QPolygonF qReturnArc;
00063     };
00064     std::vector<RANGERDATA> rangers_;
00065 
00066     bool isDisplayScan_;
00067     bool isDisplayPoints_;
00068     bool isFilledPolygon_;
00069     QColor outlineColor_;
00070     QColor fillColor_;
00071     QColor basisColor_;
00072     float  outlineThickness_;
00073 
00074     orca::RangerArrayDescription description_;
00075 
00076 };
00077 
00078 } // namespace
00079 
00080 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5