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

 

         

orcaqgui2dfactory/laserscanner2dpainter.h

00001 /*
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 ORCAGUI_LASERSCANNER2D_PAINTER_H
00012 #define ORCAGUI_LASERSCANNER2D_PAINTER_H
00013 
00014 #include <QColor>
00015 #include <QPolygonF>
00016 #include <orca/laserscanner2d.h>
00017 #include <hydroqguielementutil/definitions2d.h>
00018 
00019 class QPainter;
00020 
00021 namespace orcaqgui2d
00022 {
00023 
00027 class LaserScanner2dPainter
00028 {
00029   
00030   public:
00031     // -1 means 'default'
00032     LaserScanner2dPainter( QColor outlineColor=QColor( 102,102,153, 255 ),
00033                            float  outlineThickness=-1,
00034                            float  brightReturnWidth=0.2 );
00035 
00036     void setOffset( orca::Frame3d &offset );
00037     void setData( const orca::RangeScanner2dDataPtr &scan );
00038     
00039     void paint( QPainter *p, int z );
00040     bool paintThisLayer(int z) const {return z==hydroqguielementutil::Z_LASER;}
00041 
00042     void clear();
00043     
00044     void execute( int action );
00045     
00046     void setLaserMaxRange( float laserMaxRange ) { laserMaxRange_ = laserMaxRange; }
00047     
00048     void setColor( QColor color );
00049     void setFocus( bool inFocus );
00050 
00051   private:
00052 
00053     std::vector<float>         ranges_;
00054     std::vector<unsigned char> intensities_;
00055     bool                       intensitiesValid_;
00056 
00057     // The scan (set of points for drawing the scan outline)
00058     QPolygonF qScan_;
00059     // The actual returns (doesn't include a point at the origin)
00060     QPolygonF qReturns_;
00061     
00062     double laserMaxRange_;
00063 
00064     bool isDisplayScan_;
00065     bool isDisplayPoints_;
00066     bool isDisplayWalls_;
00067     bool isDisplayReflectors_;
00068     bool isFilledPolygon_;
00069     QColor outlineColor_;
00070     QColor fillColor_;
00071     QColor basisColor_;
00072     float  outlineThickness_;
00073     float  brightReturnWidth_;
00074 
00075     double offsetX_;
00076     double offsetY_;
00077     double offsetYaw_;
00078         double offsetPitch_;
00079 
00080     bool isUpsideDown_;
00081 };
00082 
00083 } // namespace
00084 
00085 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5