Fawkes API Fawkes Development Version
field_lines.h
1/***************************************************************************
2 * field_lines.h - Container for field lines
3 *
4 * Created: Mon Sep 22 12:00:00 2008
5 * Copyright 2008 Christof Rath <christof.rath@gmail.com>
6 *
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Library General Public License for more details.
18 *
19 * Read the full text in the LICENSE.GPL file in the doc directory.
20 */
21
22#ifndef _FVUTILS_DRAW_FIELD_LINES_H__
23#define _FVUTILS_DRAW_FIELD_LINES_H__
24
25#include <utils/math/types.h>
26
27#include <list>
28#include <string>
29
30namespace firevision {
31
32typedef std::list<fawkes::arc_t> field_circles_t;
33
34class FieldLines : public std::list<fawkes::field_line_t>
35{
36public:
37 virtual ~FieldLines();
38
39 float get_line_width() const;
40 float
42 {
43 return _field_length;
44 }
45 float
47 {
48 return _field_width;
49 }
52 {
53 return _field_offsets;
54 }
55 const field_circles_t &
57 {
58 return _field_circles;
59 }
60 const std::string &get_name() const;
61
62protected:
63 FieldLines(std::string field_name, float field_length, float field_width, float line_width);
64 virtual void init() = 0;
65
66 void calc_offsets();
67
68 std::string _field_name;
73 field_circles_t _field_circles;
74};
75
77{
78public:
79 FieldLines6x4(float length, float width);
80 virtual ~FieldLines6x4();
81
82private:
83 virtual void init();
84};
85
87{
88public:
89 FieldLinesCityTower(float length, float width);
90 virtual ~FieldLinesCityTower();
91
92private:
93 virtual void init();
94};
95
97{
98public:
99 FieldLinesCityTowerSeminar(float length, float width);
101
102private:
103 virtual void init();
104};
105
106} // end namespace firevision
107
108#endif
This class implements the 6 by 4 meter SPL field according to the 2008 roules.
Definition: field_lines.h:77
FieldLines6x4(float length, float width)
Contructor.
This class implements the test field in Graz, Austria at the CityTower.
Definition: field_lines.h:97
FieldLinesCityTowerSeminar(float length, float width)
Constructor.
This class implements the test field in Graz, Austria at the CityTower.
Definition: field_lines.h:87
FieldLinesCityTower(float length, float width)
Constructor.
This class acts as a container for lines on a soccer field.
Definition: field_lines.h:35
float _field_width
The total width of the field (actually of the field lines)
Definition: field_lines.h:71
void calc_offsets()
Calculates the field's offsets.
fawkes::cart_coord_2d_t get_field_offsets() const
Offset getter.
Definition: field_lines.h:51
virtual void init()=0
Initializes the field (creates all field lines)
float get_line_width() const
Line width getter.
field_circles_t _field_circles
A std::list of arcs and/or circles on the field.
Definition: field_lines.h:73
virtual ~FieldLines()
Destructor.
float get_field_length() const
Field length getter.
Definition: field_lines.h:41
fawkes::cart_coord_2d_t _field_offsets
The center offset (used to draw unsymmetrically fields - usually zero)
Definition: field_lines.h:72
const field_circles_t & get_circles() const
Get circles.
Definition: field_lines.h:56
float _field_length
The total length of the field (actually of the field lines)
Definition: field_lines.h:70
const std::string & get_name() const
Returns the field name.
float get_field_width() const
Field width getter.
Definition: field_lines.h:46
float _line_width
The width of the field lines.
Definition: field_lines.h:69
std::string _field_name
The name of the field.
Definition: field_lines.h:68
FieldLines(std::string field_name, float field_length, float field_width, float line_width)
Creates a new FieldLines container.
Definition: field_lines.cpp:89
Cartesian coordinates (2D).
Definition: types.h:65