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

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

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


Generated for Orca Robotics by  doxygen 1.4.5