OsmAnd
jni/osmand/mapObjects.h
Go to the documentation of this file.
00001 #ifndef _OSMAND_MAP_OBJECTS_H
00002 #define _OSMAND_MAP_OBJECTS_H
00003 
00004 #include <jni.h>
00005 #include <vector>
00006 #include <string>
00007 
00008 #include "common.h"
00009 
00010 typedef std::pair<std::string, std::string> tag_value;
00011 typedef std::pair<int, int> int_pair;
00012 
00013 class BaseMapDataObject
00014 {
00015 
00016 public :
00017         static const unsigned int UNDEFINED_STRING = 0x7fffffff;
00018     const int type;
00019     static const int MAP_DATA_OBJECT = 1;
00020     static const int MULTI_POLYGON = 2;
00021     long long id;
00022     unsigned int stringId;
00023     std::string name;
00024 protected :
00025         BaseMapDataObject(int t) : type(t), id(0), stringId(UNDEFINED_STRING){ }
00026 
00027 };
00028 
00029 struct SearchResult {
00030         std::vector< BaseMapDataObject*> result;
00031 };
00032 
00033 class MultiPolygonObject : public BaseMapDataObject
00034 {
00035 public:
00036         MultiPolygonObject() : BaseMapDataObject(MULTI_POLYGON) {       }
00037         std::string tag;
00038         std::string value;
00039         std::vector< std::string > names;
00040         int layer;
00041         std::vector< std::vector< int_pair> > points;
00042 };
00043 
00044 
00045 class MapDataObject : public BaseMapDataObject
00046 {
00047 public:
00048         MapDataObject() : BaseMapDataObject(MAP_DATA_OBJECT)    {       }
00049 
00050         std::vector< int>  types;
00051         std::vector< int_pair >  points;
00052         std::vector< tag_value >  tagValues;
00053         int highwayAttributes;
00054 };
00055 
00056 
00057 std::vector <BaseMapDataObject* > marshalObjects(jobjectArray binaryMapDataObjects);
00058 
00059 void deleteObjects(std::vector <BaseMapDataObject* > & v);
00060 
00061 void loadJniMapObjects();
00062 
00063 void unloadJniMapObjects();
00064 
00065 // 0 - normal, -1 - under, 1 - bridge,over
00066 int getNegativeWayLayer(int type);
00067 
00068 #endif /*_OSMAND_MAP_OBJECTS_H*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines