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 <list>
29#include <string>
30
31namespace firevision {
32
33typedef std::list<fawkes::cart_coord_2d_t> fld_line_points_t;
34
35class Field
36{
37public:
38 ~Field();
39
40 const FieldLines &
41 get_lines() const
42 {
43 return *lines_;
44 }
45 float get_field_length() const;
46 float get_field_width() const;
47
48 void print(bool in_mm) const;
49
50 static Field *field_for_name(std::string field_name, float field_length, float field_width);
51
52private:
53 Field(FieldLines *lines, bool manage_lines_memory = true);
54
55 FieldLines *lines_;
56 bool manage_lines_memory_;
57};
58
59} // end namespace firevision
60
61#endif
This class acts as a container for lines on a soccer field.
Definition: field_lines.h:35
This class is used to describe a soccer field.
Definition: field.h:36
float get_field_length() const
Field length getter.
Definition: field.cpp:64
~Field()
Destructor.
Definition: field.cpp:53
void print(bool in_mm) const
Prints the information to the console.
Definition: field.cpp:84
static Field * field_for_name(std::string field_name, float field_length, float field_width)
Returns the corresponding Field object.
Definition: field.cpp:131
float get_field_width() const
Field width getter.
Definition: field.cpp:74
const FieldLines & get_lines() const
Field lines getter.
Definition: field.h:41