Fawkes API  Fawkes Development Version
field.h
1 
2 /***************************************************************************
3  * field.h - Encapsulates a soccer field
4  *
5  * Created: Tue Sep 23 12:00:00 2008
6  * Copyright 2008 Christof Rath <christof.rath@gmail.com>
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __FVUTILS_DRAW_FIELD_H_
24 #define __FVUTILS_DRAW_FIELD_H_
25 
26 #include <fvutils/draw/field_lines.h>
27 
28 #include <string>
29 #include <list>
30 
31 namespace firevision {
32 #if 0 /* just to make Emacs auto-indent happy */
33 }
34 #endif
35 
36 typedef std::list<fawkes::cart_coord_2d_t> fld_line_points_t;
37 
38 class Field
39 {
40 public:
41  ~Field();
42 
43  const FieldLines& get_lines() const { return *__lines; }
44  float get_field_length() const;
45  float get_field_width() const;
46 
47  void print(bool in_mm) const;
48 
49  static Field* field_for_name(std::string field_name, float field_length, float field_width);
50 
51 private:
52  Field(FieldLines *lines, bool manage_lines_memory = true);
53 
54  FieldLines *__lines;
55  bool __manage_lines_memory;
56 };
57 
58 } // end namespace firevision
59 
60 #endif
const FieldLines & get_lines() const
Field lines getter.
Definition: field.h:43
~Field()
Destructor.
Definition: field.cpp:57
This class is used to describe a soccer field.
Definition: field.h:38
static Field * field_for_name(std::string field_name, float field_length, float field_width)
Returns the corresponding Field object.
Definition: field.cpp:116
void print(bool in_mm) const
Prints the information to the console.
Definition: field.cpp:90
float get_field_length() const
Field length getter.
Definition: field.cpp:68
float get_field_width() const
Field width getter.
Definition: field.cpp:79
This class acts as a container for lines on a soccer field.
Definition: field_lines.h:36