Fawkes API  Fawkes Development Version
firevision::FieldLines Class Referenceabstract

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

#include <>>

Inheritance diagram for firevision::FieldLines:

Public Member Functions

virtual ~FieldLines ()
 Destructor. More...
 
float get_line_width () const
 Line width getter. More...
 
float get_field_length () const
 Field length getter. More...
 
float get_field_width () const
 Field width getter. More...
 
fawkes::cart_coord_2d_t get_field_offsets () const
 Offset getter. More...
 
const field_circles_t & get_circles () const
 Get circles. More...
 
const std::string & get_name () const
 Returns the field name. More...
 

Protected Member Functions

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

Protected Attributes

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

Detailed Description

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

Definition at line 36 of file field_lines.h.

Constructor & Destructor Documentation

◆ ~FieldLines()

firevision::FieldLines::~FieldLines ( )
virtual

Destructor.

Definition at line 104 of file field_lines.cpp.

◆ FieldLines()

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

Creates a new FieldLines container.

Parameters
field_nameThe name of the field
field_lengthLength of the soccer field [m]
field_widthWidth of the soccer field [m]
line_widthWidth of a single line [m]

Definition at line 91 of file field_lines.cpp.

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

Referenced by get_circles().

Member Function Documentation

◆ calc_offsets()

◆ get_circles()

const field_circles_t & firevision::FieldLines::get_circles ( ) const
inline

Get circles.

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

Definition at line 45 of file field_lines.h.

References _field_circles, calc_offsets(), FieldLines(), get_name(), and init().

Referenced by firevision::FieldDrawer::draw_lines().

◆ get_field_length()

float firevision::FieldLines::get_field_length ( ) const
inline

Field length getter.

Returns
The length of the soccer field

Definition at line 42 of file field_lines.h.

References _field_length.

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

◆ get_field_offsets()

cart_coord_2d_t firevision::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 44 of file field_lines.h.

References _field_offsets.

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

◆ get_field_width()

float firevision::FieldLines::get_field_width ( ) const
inline

◆ get_line_width()

float firevision::FieldLines::get_line_width ( ) const

Line width getter.

Returns
The width of a single field line

Definition at line 113 of file field_lines.cpp.

References _line_width.

◆ get_name()

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

Returns the field name.

Returns
The field name

Definition at line 122 of file field_lines.cpp.

References _field_name.

Referenced by get_circles().

◆ init()

void firevision::FieldLines::init ( )
protectedpure virtual

Initializes the field (creates all field lines)

Referenced by get_circles().

Member Data Documentation

◆ _field_circles

field_circles_t firevision::FieldLines::_field_circles
protected

◆ _field_length

float firevision::FieldLines::_field_length
protected

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

Definition at line 56 of file field_lines.h.

Referenced by FieldLines(), and get_field_length().

◆ _field_name

float firevision::FieldLines::_field_name
protected

The name of the field.

Definition at line 54 of file field_lines.h.

Referenced by get_name().

◆ _field_offsets

fawkes::cart_coord_2d_t firevision::FieldLines::_field_offsets
protected

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

Definition at line 58 of file field_lines.h.

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

◆ _field_width

float firevision::FieldLines::_field_width
protected

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

Definition at line 57 of file field_lines.h.

Referenced by FieldLines(), and get_field_width().

◆ _line_width

float firevision::FieldLines::_line_width
protected

The width of the field lines.

Definition at line 55 of file field_lines.h.

Referenced by FieldLines(), and get_line_width().


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