field_lines.h

00001 /***************************************************************************
00002  *  field_lines.h - Container for field lines
00003  *
00004  *  Created:  Mon Sep 22 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 __NAO_UTILS_FIELD_LINES_H__
00023 #define __NAO_UTILS_FIELD_LINES_H__
00024 
00025 #include <utils/math/types.h>
00026 #include <list>
00027 #include <string>
00028
00029 typedef std::list<fawkes::arc_t> field_circles_t;
00030
00031 class FieldLines: public std::list<fawkes::field_line_t>
00032 {
00033 public:
00034   virtual ~FieldLines();
00035
00036   float get_line_width() const;
00037   float get_field_length() const { return _field_length; }
00038   float get_field_width() const { return _field_width; }
00039   fawkes::cart_coord_2d_t get_field_offsets() const { return _field_offsets; }
00040   const field_circles_t& get_circles() const { return _field_circles; }
00041   const std::string& get_name() const;
00042
00043 protected:
00044   FieldLines(std::string field_name, float field_length, float field_width, float line_width);
00045   virtual void init() = 0;
00046
00047   void calc_offsets();
00048
00049   std::string             _field_name;
00050   float                   _line_width;
00051   float                   _field_length;
00052   float                   _field_width;
00053   fawkes::cart_coord_2d_t _field_offsets;
00054   field_circles_t         _field_circles;
00055 };
00056
00057 class FieldLines6x4: public FieldLines
00058 {
00059 public:
00060   FieldLines6x4(float length, float width);
00061   virtual ~FieldLines6x4();
00062
00063 private:
00064   virtual void init();
00065 };
00066
00067 class FieldLinesCityTower: public FieldLines
00068 {
00069 public:
00070   FieldLinesCityTower(float length, float width);
00071   virtual ~FieldLinesCityTower();
00072
00073 private:
00074   virtual void init();
00075 };
00076
00077 class FieldLinesCityTowerSeminar: public FieldLines
00078 {
00079 public:
00080   FieldLinesCityTowerSeminar(float length, float width);
00081   virtual ~FieldLinesCityTowerSeminar();
00082
00083 private:
00084   virtual void init();
00085 };
00086 #endif /* __NAO_UTILS_FIELD_LINES_H__ */