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