22 #include <fvutils/draw/field.h> 24 #include <core/exceptions/software.h> 48 Field::Field(FieldLines *lines,
bool manage_lines_memory)
51 __manage_lines_memory = manage_lines_memory;
59 if (__manage_lines_memory)
delete __lines;
68 Field::get_field_length()
const 70 return __lines->get_field_length();
79 Field::get_field_width()
const 81 return __lines->get_field_width();
90 Field::print(
bool in_mm)
const 92 printf(
"Field lines (start-x -y end-x -y):\n==================================\n");
93 for (FieldLines::const_iterator it = __lines->begin(); it != __lines->end(); ++it) {
94 if (in_mm) printf(
"%d %d %d %d\n", static_cast<int>(it->start.x * 1000), static_cast<int>(it->start.y * 1000), static_cast<int>(it->end.x * 1000), static_cast<int>(it->end.y * 1000));
95 else 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 angle):\n=============================================\n");
100 for (field_circles_t::const_iterator it = __lines->get_circles().begin(); it != __lines->get_circles().end(); ++it) {
101 if (in_mm) printf(
"%d %d %d %0.03f %0.03f\n", static_cast<int>(it->center.x * 1000), static_cast<int>(it->center.y * 1000), static_cast<int>(it->radius * 1000), it->start_phi, it->end_phi);
102 else printf(
"%0.03f %0.03f %0.03f %0.03f %0.03f\n", it->center.x, it->center.y, it->radius, it->start_phi, it->end_phi);
116 Field::field_for_name(std::string field_name,
float field_length,
float field_width)
118 if (field_name ==
"Field6x4")
return new Field(
new FieldLines6x4(field_length, field_width));
This class implements the 6 by 4 meter SPL field according to the 2008 roules.
Fawkes library namespace.
This class is used to describe a soccer field.
This class implements the test field in Graz, Austria at the CityTower.
Expected parameter is missing.
This class implements the test field in Graz, Austria at the CityTower.