Thunderbots Project
Loading...
Searching...
No Matches
FieldPitchDivision< ZoneEnum > Class Template Referenceabstract

#include <field_pitch_division.h>

Public Member Functions

virtual const RectanglegetZone (ZoneEnum zone_id) const =0
 
virtual ZoneEnum getZoneId (const Point &position) const =0
 
virtual const std::vector< ZoneEnum > & getAllZoneIds () const =0
 

Detailed Description

template<class ZoneEnum>
class FieldPitchDivision< ZoneEnum >

A FieldPitchDivision is abstraction around how we split up the field.

Pitch divisions with zones outside of the field may lead to undefined behaviour. Overlapping zones are supported, but not recommended.

Member Function Documentation

◆ getAllZoneIds()

template<class ZoneEnum >
virtual const std::vector< ZoneEnum > & getAllZoneIds ( ) const
pure virtual

Returns all the zone enums in this field pitch division

Returns
A vector of all the zone ids

Implemented in EighteenZonePitchDivision.

◆ getZone()

template<class ZoneEnum >
virtual const Rectangle & getZone ( ZoneEnum  zone_id) const
pure virtual

Given a zone id, return the rectangular region on the field the zone id corresponds to. It is up to the implementation to define the mapping between the zone_id and the corresponding region.

NOTE: Since most soccer pitch divisions are indexed starting at 1, we define zone 0 to be the entire field.

Parameters
zone_idThe zone id
Returns
The rectangle on the field corresponding to the zone

Implemented in EighteenZonePitchDivision.

◆ getZoneId()

template<class ZoneEnum >
virtual ZoneEnum getZoneId ( const Point position) const
pure virtual

Given a point, returns the Zone Id the point is located in.

Parameters
positionThe position
Returns
the Zone Id of the zone the position is in

Implemented in EighteenZonePitchDivision.


The documentation for this class was generated from the following file: