A helper class for drawing markers indicating distances. More...
#include <Robots/LoBot/ui/LoLaserWindowMarkings.H>
Classes | |
class | Params |
Public Member Functions | |
void | use_canvas (const GLCanvas *C) |
Specify the OpenGL canvas to use. | |
void | set_maximum (float m) |
virtual void | render () const =0 |
virtual | ~LaserWindowMarkings () |
Clean-up. | |
Protected Member Functions | |
LaserWindowMarkings () | |
void | draw_main_axes () const |
Helper for drawing the main axes. | |
Protected Attributes | |
const GLCanvas * | m_canvas |
float | m_max |
| |
typedef range< float > | ZoomRange |
typedef triple< float, GLColor, ZoomRange > | Marking |
typedef std::vector< Marking > | Markings |
Markings | m_markings |
A helper class for drawing markers indicating distances.
The laser range finder's test program depicts the distance measurements as rays emanating from the origin of a world coordinate system that is setup to match the units and range of the LRF device. To help make sense of the lengths of these rays, we draw some markers at regular intervals. Each marker indicates a particular distance from the laser range finder.
We can have markers of different types (e.g., regularly spaced grid or concentric rings). This class provides a common interface for all the different marker types.
Definition at line 97 of file LoLaserWindowMarkings.H.
typedef range<float> lobot::LaserWindowMarkings::ZoomRange |
The markings are drawn using a collection of marking specifications.
Definition at line 102 of file LoLaserWindowMarkings.H.
lobot::LaserWindowMarkings::LaserWindowMarkings | ( | ) | [protected] |
A protected constructor because only derived classes should be able to call it.
Definition at line 156 of file LoLaserWindowMarkings.C.
References transform().
lobot::LaserWindowMarkings::~LaserWindowMarkings | ( | ) | [virtual] |
Clean-up.
Definition at line 171 of file LoLaserWindowMarkings.C.
void lobot::LaserWindowMarkings::draw_main_axes | ( | ) | const [protected] |
Helper for drawing the main axes.
Definition at line 176 of file LoLaserWindowMarkings.C.
References m_max.
virtual void lobot::LaserWindowMarkings::render | ( | ) | const [pure virtual] |
Draw the markers. Each subclass must implement this method using its own technique for representing the markers.
void lobot::LaserWindowMarkings::set_maximum | ( | float | m | ) | [inline] |
We draw the concentric rings (which are contours marking distance from the laser range finder) centered at the canvas's origin and spanning the entire range of the laser range finder's distance measurements. This method allows clients to specify the maximum value in the world coordinate system over which the rings should extend.
Definition at line 135 of file LoLaserWindowMarkings.H.
void lobot::LaserWindowMarkings::use_canvas | ( | const GLCanvas * | C | ) | [inline] |
Specify the OpenGL canvas to use.
Definition at line 127 of file LoLaserWindowMarkings.H.
References m_canvas.
const GLCanvas* lobot::LaserWindowMarkings::m_canvas [protected] |
To draw the markings properly, we need to know the current zoom level, which is maintained by the OpenGL canvas.
Definition at line 111 of file LoLaserWindowMarkings.H.
Referenced by use_canvas().
float lobot::LaserWindowMarkings::m_max [protected] |
The markings usually span the range of the laser range finder's maximum distance measurement. For example, if the device's max reading is 30000 mm, then the markings will cover the area between -30000 and +30000 units both horizontally and vertically.
Clients must specify this maximum value.
Definition at line 119 of file LoLaserWindowMarkings.H.
Referenced by draw_main_axes(), and set_maximum().