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 #include <list>
27 #include <string>
28 
29 namespace firevision {
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 typedef std::list<fawkes::arc_t> field_circles_t;
35 
36 class FieldLines: public std::list<fawkes::field_line_t>
37 {
38 public:
39  virtual ~FieldLines();
40 
41  float get_line_width() const;
42  float get_field_length() const { return _field_length; }
43  float get_field_width() const { return _field_width; }
45  const field_circles_t& get_circles() const { return _field_circles; }
46  const std::string& get_name() const;
47 
48 protected:
49  FieldLines(std::string field_name, float field_length, float field_width, float line_width);
50  virtual void init() = 0;
51 
52  void calc_offsets();
53 
54  std::string _field_name;
55  float _line_width;
57  float _field_width;
59  field_circles_t _field_circles;
60 };
61 
63 {
64 public:
65  FieldLines6x4(float length, float width);
66  virtual ~FieldLines6x4();
67 
68 private:
69  virtual void init();
70 };
71 
73 {
74 public:
75  FieldLinesCityTower(float length, float width);
76  virtual ~FieldLinesCityTower();
77 
78 private:
79  virtual void init();
80 };
81 
83 {
84 public:
85  FieldLinesCityTowerSeminar(float length, float width);
86  virtual ~FieldLinesCityTowerSeminar();
87 
88 private:
89  virtual void init();
90 };
91 
92 } // end namespace firevision
93 
94 #endif
float get_field_length() const
Field length getter.
Definition: field_lines.h:42
This class implements the 6 by 4 meter SPL field according to the 2008 roules.
Definition: field_lines.h:62
float _line_width
The width of the field lines.
Definition: field_lines.h:55
Cartesian coordinates (2D).
Definition: types.h:59
field_circles_t _field_circles
A std::list of arcs and/or circles on the field.
Definition: field_lines.h:59
float _field_width
The total width of the field (actually of the field lines)
Definition: field_lines.h:57
virtual void init()=0
Initializes the field (creates all field lines)
virtual ~FieldLines()
Destructor.
float _field_length
The total length of the field (actually of the field lines)
Definition: field_lines.h:56
void calc_offsets()
Calculates the field&#39;s offsets.
const field_circles_t & get_circles() const
Get circles.
Definition: field_lines.h:45
fawkes::cart_coord_2d_t _field_offsets
The center offset (used to draw unsymmetrically fields - usually zero)
Definition: field_lines.h:58
float get_field_width() const
Field width getter.
Definition: field_lines.h:43
float get_line_width() const
Line width getter.
This class implements the test field in Graz, Austria at the CityTower.
Definition: field_lines.h:72
FieldLines(std::string field_name, float field_length, float field_width, float line_width)
Creates a new FieldLines container.
Definition: field_lines.cpp:91
This class acts as a container for lines on a soccer field.
Definition: field_lines.h:36
std::string _field_name
The name of the field.
Definition: field_lines.h:54
fawkes::cart_coord_2d_t get_field_offsets() const
Offset getter.
Definition: field_lines.h:44
const std::string & get_name() const
Returns the field name.
This class implements the test field in Graz, Austria at the CityTower.
Definition: field_lines.h:82