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 
30 namespace firevision {
31 
32 typedef std::list<fawkes::arc_t> field_circles_t;
33 
34 class FieldLines : public std::list<fawkes::field_line_t>
35 {
36 public:
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 &
56  get_circles() const
57  {
58  return _field_circles;
59  }
60  const std::string &get_name() const;
61 
62 protected:
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;
69  float _line_width;
71  float _field_width;
73  field_circles_t _field_circles;
74 };
75 
76 class FieldLines6x4 : public FieldLines
77 {
78 public:
79  FieldLines6x4(float length, float width);
80  virtual ~FieldLines6x4();
81 
82 private:
83  virtual void init();
84 };
85 
87 {
88 public:
89  FieldLinesCityTower(float length, float width);
90  virtual ~FieldLinesCityTower();
91 
92 private:
93  virtual void init();
94 };
95 
97 {
98 public:
99  FieldLinesCityTowerSeminar(float length, float width);
100  virtual ~FieldLinesCityTowerSeminar();
101 
102 private:
103  virtual void init();
104 };
105 
106 } // end namespace firevision
107 
108 #endif
firevision::FieldLines::_line_width
float _line_width
The width of the field lines.
Definition: field_lines.h:69
firevision::FieldLinesCityTower::FieldLinesCityTower
FieldLinesCityTower(float length, float width)
Constructor.
Definition: field_lines.cpp:231
firevision::FieldLines::_field_width
float _field_width
The total width of the field (actually of the field lines)
Definition: field_lines.h:71
firevision::FieldLines::_field_length
float _field_length
The total length of the field (actually of the field lines)
Definition: field_lines.h:70
firevision::FieldLines6x4::FieldLines6x4
FieldLines6x4(float length, float width)
Contructor.
Definition: field_lines.cpp:171
firevision::FieldLines::get_field_offsets
fawkes::cart_coord_2d_t get_field_offsets() const
Offset getter.
Definition: field_lines.h:51
firevision::FieldLines::_field_offsets
fawkes::cart_coord_2d_t _field_offsets
The center offset (used to draw unsymmetrically fields - usually zero)
Definition: field_lines.h:72
firevision::FieldLinesCityTower
This class implements the test field in Graz, Austria at the CityTower.
Definition: field_lines.h:87
firevision::FieldLines::get_field_width
float get_field_width() const
Field width getter.
Definition: field_lines.h:46
firevision::FieldLines::FieldLines
FieldLines(std::string field_name, float field_length, float field_width, float line_width)
Creates a new FieldLines container.
Definition: field_lines.cpp:89
firevision::FieldLines::~FieldLines
virtual ~FieldLines()
Destructor.
Definition: field_lines.cpp:104
firevision::FieldLines6x4
This class implements the 6 by 4 meter SPL field according to the 2008 roules.
Definition: field_lines.h:77
firevision::FieldLinesCityTowerSeminar::FieldLinesCityTowerSeminar
FieldLinesCityTowerSeminar(float length, float width)
Constructor.
Definition: field_lines.cpp:285
firevision::FieldLines
This class acts as a container for lines on a soccer field.
Definition: field_lines.h:35
firevision::FieldLines::get_name
const std::string & get_name() const
Returns the field name.
Definition: field_lines.cpp:122
firevision::FieldLines::get_field_length
float get_field_length() const
Field length getter.
Definition: field_lines.h:41
firevision::FieldLines::get_circles
const field_circles_t & get_circles() const
Get circles.
Definition: field_lines.h:56
fawkes::cart_coord_2d_struct
Cartesian coordinates (2D).
Definition: types.h:65
firevision::FieldLines::calc_offsets
void calc_offsets()
Calculates the field's offsets.
Definition: field_lines.cpp:131
firevision::FieldLinesCityTowerSeminar
This class implements the test field in Graz, Austria at the CityTower.
Definition: field_lines.h:97
firevision::FieldLines::init
virtual void init()=0
Initializes the field (creates all field lines)
firevision::FieldLines::get_line_width
float get_line_width() const
Line width getter.
Definition: field_lines.cpp:113
firevision::FieldLines::_field_circles
field_circles_t _field_circles
A std::list of arcs and/or circles on the field.
Definition: field_lines.h:73
firevision::FieldLines::_field_name
std::string _field_name
The name of the field.
Definition: field_lines.h:68