22 #include <core/exceptions/software.h>
23 #include <fvutils/draw/field.h>
31 namespace firevision {
44 Field::Field(FieldLines *lines,
bool manage_lines_memory)
47 manage_lines_memory_ = manage_lines_memory;
55 if (manage_lines_memory_)
64 Field::get_field_length()
const
66 return lines_->get_field_length();
74 Field::get_field_width()
const
76 return lines_->get_field_width();
84 Field::print(
bool in_mm)
const
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();
102 it != lines_->get_circles().end();
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",
131 Field::field_for_name(std::string field_name,
float field_length,
float field_width)
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.
This class is used to describe a soccer field.
Fawkes library namespace.