22#include <core/exceptions/software.h>
23#include <fvutils/draw/field.h>
44Field::Field(FieldLines *lines,
bool manage_lines_memory)
47 manage_lines_memory_ = manage_lines_memory;
55 if (manage_lines_memory_)
86 printf(
"Field lines (start-x -y end-x -y):\n==================================\n");
87 for (FieldLines::const_iterator it = lines_->begin(); it != lines_->end(); ++it) {
89 printf(
"%d %d %d %d\n",
90 static_cast<int>(it->start.x * 1000),
91 static_cast<int>(it->start.y * 1000),
92 static_cast<int>(it->end.x * 1000),
93 static_cast<int>(it->end.y * 1000));
95 printf(
"%0.03f %0.03f %0.03f %0.03f\n", it->start.x, it->start.y, it->end.x, it->end.y);
99 printf(
"Field circles (center-x/y radius start/end "
100 "angle):\n=============================================\n");
101 for (field_circles_t::const_iterator it = lines_->
get_circles().begin();
105 printf(
"%d %d %d %0.03f %0.03f\n",
106 static_cast<int>(it->center.x * 1000),
107 static_cast<int>(it->center.y * 1000),
108 static_cast<int>(it->radius * 1000),
112 printf(
"%0.03f %0.03f %0.03f %0.03f %0.03f\n",
133 if (field_name ==
"Field6x4")
135 else if (field_name ==
"FieldCityTower")
137 else if (field_name ==
"FieldCityTowerSeminar")
141 "Unknown field name! Please set field_name to a valid value (see field.h)");
Expected parameter is missing.
This class implements the 6 by 4 meter SPL field according to the 2008 roules.
This class implements the test field in Graz, Austria at the CityTower.
This class implements the test field in Graz, Austria at the CityTower.
float get_field_length() const
Field length getter.
const field_circles_t & get_circles() const
Get circles.
float get_field_width() const
Field width getter.
This class is used to describe a soccer field.
float get_field_length() const
Field length getter.
void print(bool in_mm) const
Prints the information to the console.
static Field * field_for_name(std::string field_name, float field_length, float field_width)
Returns the corresponding Field object.
float get_field_width() const
Field width getter.
Fawkes library namespace.