field.h

00001 /***************************************************************************
00002  *  field.h - Encapsulates a soccer field
00003  *
00004  *  Created:  Tue Sep 23 12:00:00 2008
00005  *  Copyright 2008 Christof Rath <christof.rath@gmail.com>
00006  *
00007  ****************************************************************************/
00008
00009 /*  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  This program is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU Library General Public License for more details.
00018  *
00019  *  Read the full text in the LICENSE.GPL file in the doc directory.
00020  */
00021
00022 #ifndef __FIREVISION_APPS_NAO_LOC_FIELD__
00023 #define __FIREVISION_APPS_NAO_LOC_FIELD__
00024 
00025 #include "field_lines.h"
00026
00027 #include <string>
00028 #include <list>
00029
00030 typedef std::list<fawkes::cart_coord_2d_t> fld_line_points_t;
00031
00032 class Field
00033 {
00034 public:
00035   ~Field();
00036
00037   const FieldLines& get_lines() const { return *__lines; }
00038   float get_field_length() const;
00039   float get_field_width() const;
00040
00041   void print(bool in_mm) const;
00042
00043   static Field* field_for_name(std::string field_name, float field_length, float field_width);
00044
00045 private:
00046   Field(FieldLines *lines, bool manage_lines_memory = true);
00047
00048   FieldLines  *__lines;
00049   bool         __manage_lines_memory;
00050 };
00051
00052 #endif /* __FIREVISION_APPS_NAO_LOC_FIELD__ */