00001 /* -*- mode: C++ -*- */ 00002 /* 00003 * Copyright (C) 2007, 2010 David Li, Patrick Beeson, Jack O'Quin 00004 * 00005 * License: Modified BSD Software License Agreement 00006 * 00007 * $Id: zones.h 1704 2011-08-22 16:16:18Z jack.oquin $ 00008 */ 00009 00018 #ifndef __ZONES_H__ 00019 #define __ZONES_H__ 00020 00021 #define PLAYER_OPAQUE_MAX_SIZE 1048576 00022 00023 #include <vector> 00024 00025 #include <art_map/coordinates.h> 00026 #include <art_map/types.h> 00027 00028 #define DEFAULT_ZONE_SPEED 3.0f 00029 00030 00031 typedef std::vector<MapXY> ObstacleList; 00032 00033 // MGR: Currently, these two have to be typedefs of the same thing 00034 typedef WayPointNode PerimeterPoint; 00035 typedef WayPointNode zone_pp_type; 00036 00037 typedef std::vector<PerimeterPoint> PerimeterPointList; 00038 00039 // This class is not called Zone to avoid confusion with the RNDF Zone 00040 // class, which has more information 00041 class ZonePerimeter 00042 { 00043 public: 00044 ZonePerimeter(): 00045 speed_limit(0.0), 00046 zone_id(-1) 00047 {} 00048 float speed_limit; 00049 segment_id_t zone_id; 00050 PerimeterPointList perimeter_points; 00051 }; 00052 00053 typedef std::vector<ZonePerimeter> ZonePerimeterList; 00054 00055 typedef struct zone_pp_count { 00056 segment_id_t zone_id; 00057 uint32_t perimeter_points_count; 00058 } zone_pp_count_t; 00059 00060 #if 0 00061 00062 // MGR: How do we pick this value? 00063 #define MAX_ZONE_COUNT 100 00064 00065 #define MAX_TOTAL_PERIMETER_POINTS (PLAYER_OPAQUE_MAX_SIZE - \ 00066 sizeof(art_message_header_t) - \ 00067 sizeof(uint32_t) - \ 00068 sizeof(uint32_t) - \ 00069 (MAX_ZONE_COUNT * sizeof(zone_pp_count_t)) \ 00070 ) / sizeof(zone_pp_type) 00071 00072 typedef struct zones_msg { 00073 uint32_t zone_count; 00074 uint32_t total_perimeter_points; 00075 zone_pp_count_t zones[MAX_ZONE_COUNT]; 00076 zone_pp_type perimeter_points[MAX_TOTAL_PERIMETER_POINTS]; 00077 } zones_msg_t; 00078 00079 #endif 00080 00081 #endif /* __ZONES_H__ */