FieldLines Class Reference

This class acts as a container for lines on a soccer field. More...

#include <nao_utils/field_lines.h>

Inheritance diagram for FieldLines:

List of all members.


Public Member Functions

virtual ~FieldLines ()
 Destructor.
float get_line_width () const
 Line width getter.
float get_field_length () const
 Field length getter.
float get_field_width () const
 Field width getter.
fawkes::cart_coord_2d_t get_field_offsets () const
 Offset getter.
const field_circles_t & get_circles () const
 Returns a reference to a std::list of arcs and/or circles on the field.
const std::string & get_name () const
 Returns the field name.

Protected Member Functions

 FieldLines (std::string field_name, float field_length, float field_width, float line_width)
 Creates a new FieldLines container.
virtual void init ()=0
 Initializes the field (creates all field lines).
void calc_offsets ()
 Calculates the field's offsets.

Protected Attributes

std::string _field_name
 The name of the field.
float _line_width
 The width of the field lines.
float _field_length
 The total length of the field (actually of the field lines).
float _field_width
 The total width of the field (actually of the field lines).
fawkes::cart_coord_2d_t _field_offsets
 The center offset (used to draw unsymmetrically fields - usually zero).
field_circles_t _field_circles
 A std::list of arcs and/or circles on the field.

Detailed Description

This class acts as a container for lines on a soccer field.

Definition at line 31 of file field_lines.h.


Constructor & Destructor Documentation

FieldLines::~FieldLines (  )  [virtual]

Destructor.

Definition at line 98 of file field_lines.cpp.

FieldLines::FieldLines ( std::string  field_name,
float  field_length,
float  field_width,
float  line_width 
) [protected]

Creates a new FieldLines container.

Parameters:
field_name The name of the field
field_length Length of the soccer field [m]
field_width Width of the soccer field [m]
line_width Width of a single line [m]

Definition at line 85 of file field_lines.cpp.

References _field_length, _field_offsets, _field_width, _line_width, and fawkes::cart_coord_2d_t::x.


Member Function Documentation

void FieldLines::calc_offsets (  )  [protected]

const field_circles_t & FieldLines::get_circles (  )  const [inline]

Returns a reference to a std::list of arcs and/or circles on the field.

Author:
Christof Rath

Definition at line 40 of file field_lines.h.

References _field_circles.

Referenced by FieldDrawer::draw_lines(), and Field::print().

float FieldLines::get_field_length (  )  const [inline]

Field length getter.

Returns:
The length of the soccer field

Definition at line 37 of file field_lines.h.

References _field_length.

Referenced by FieldDrawer::draw_field(), FieldDrawer::draw_line_points(), FieldDrawer::draw_lines(), Field::get_field_length(), and FieldDrawer::get_scale().

cart_coord_2d_t FieldLines::get_field_offsets (  )  const [inline]

Offset getter.

The field's offset (x,y) is usually zero as the soccer field is symetrically. But in some cases only a part of the field is used and then we need the offset to place the field at the center of a debug image.

Returns:
The offest of the field's center.

Definition at line 39 of file field_lines.h.

References _field_offsets.

Referenced by FieldDrawer::draw_field(), FieldDrawer::draw_line_points(), and FieldDrawer::draw_lines().

float FieldLines::get_field_width (  )  const [inline]

Field width getter.

Returns:
The width of the soccer field

Definition at line 38 of file field_lines.h.

References _field_width.

Referenced by FieldDrawer::draw_field(), FieldDrawer::draw_line_points(), FieldDrawer::draw_lines(), Field::get_field_width(), and FieldDrawer::get_scale().

float FieldLines::get_line_width (  )  const

Line width getter.

Returns:
The width of a single field line

Definition at line 107 of file field_lines.cpp.

References _line_width.

const std::string & FieldLines::get_name (  )  const

Returns the field name.

Returns:
The field name

Definition at line 116 of file field_lines.cpp.

References _field_name.

void FieldLines::init (  )  [protected, pure virtual]

Initializes the field (creates all field lines).


Member Data Documentation

field_circles_t FieldLines::_field_circles [protected]

A std::list of arcs and/or circles on the field.

Definition at line 54 of file field_lines.h.

Referenced by get_circles().

float FieldLines::_field_length [protected]

The total length of the field (actually of the field lines).

Definition at line 51 of file field_lines.h.

Referenced by FieldLines(), and get_field_length().

float FieldLines::_field_name [protected]

The name of the field.

Definition at line 49 of file field_lines.h.

Referenced by get_name().

The center offset (used to draw unsymmetrically fields - usually zero).

Definition at line 53 of file field_lines.h.

Referenced by calc_offsets(), FieldLines(), and get_field_offsets().

float FieldLines::_field_width [protected]

The total width of the field (actually of the field lines).

Definition at line 52 of file field_lines.h.

Referenced by FieldLines(), and get_field_width().

float FieldLines::_line_width [protected]

The width of the field lines.

Definition at line 50 of file field_lines.h.

Referenced by FieldLines(), and get_line_width().


The documentation for this class was generated from the following files: