#ifndef _CGPSMAPPER_DLL #define _CGPSMAPPER_DLL #include #ifdef __cplusplus extern "C" { #endif #ifdef _DLL_VERSION #define LIBSPEC __declspec(dllexport) #define CALL_API __stdcall #else #define LIBSPEC __declspec(dllimport) #define CALL_API __stdcall #endif #define _CG_OK 1 #define _CG_NOT_INITIATED -1 #define _CG_BAD_PARAMS -2 #define _CG_NO_INIT_POLYGON_HOLES -3 #define _CG_ERROR_BUILDING_MAP -4 // Simple coordinate type struct cg_coordinate { double we; double ns; }; /** Initialisation of the library - *MUST* be call before using any other function @param output_filename name of the output file (IMG file) - with path - cannot be longer than MAX_PATH const @param map_id id value for the map @param map_name internam map name @param levels number of map levels, valid number between 1-9 @param level_def array with levels grid definition - there is *NO* check if levels are defined correctly the highest grid value is 24, values should be descending @return _CG const */ LIBSPEC int CALL_API cg_init(const char *output_filename,int map_id,char* map_name,int levels,unsigned char level_def[10]); /** Deinitialisation of the library - *MUST* be called after building of the map - or memory won't be deallocated @return _CG const */ LIBSPEC int CALL_API cg_done(); /** Return cGPSmapper version @return version */ LIBSPEC char* CALL_API cg_getVersion(); /** Return cGPSmapper version - Visual Basic version @return version */ //LIBSPEC BSTR CALL_API cg_getVersionVB(); /** When using commercial version of the library - must be call *AFTER* cg_init If the key is invalid - IMG file will be incorrect - function always return _CG_BAD_PARAMS if the key has inproper lengths, otherwise it always return _CG_OK value, no matter if the key is valid or not @param key unlock key for the cGPSmapper library @return _CG_OK or _CG_BAD_PARAMS */ LIBSPEC int CALL_API cg_setSecurityValue(char* key); /** Setting optional map attributes @param poi_number_first if 0 then numbers are *after* street, if value is non zero - then before @param poi_zip_first @param tre_size as for MP: TreSize @param index_poi as for MP: PoiIndex @param index_intersection as for MP: MG @return _CG const */ LIBSPEC int CALL_API cg_setOptionalMapAttributes(int poi_number_first,int poi_zip_first,int tre_size,int index_poi,int index_intersection); /** Setting optional map attributes */ LIBSPEC int CALL_API cg_setOptional2(int marine_data_exist); /** Setting optional map attributes @param preprocess 0 - no generalisation 3 - full generalisation (recommended!) 2 - generalisation without preserving intersections @param elevation_units 'm' - meters 'f' - feet @param transparent_map 0 - not transparent, any other value - map is transparent @param draw_priority map draw priority - default value should be 23 @return _CG const */ LIBSPEC int CALL_API cg_setOptional3(int preprocess,const char* elevation_units,int transparent_map, int draw_priority); /******* Feeding cGPSmapper library with data *******/ LIBSPEC int CALL_API cg_readMP(const char* file_name); /** Add point, function decides if the point is city or POI by checking the 'type' - if type is smaller or equal to 0x11 then it is city otherwise - POI Two functions are available - simple point adding and extended (with more parameters) @param type type of the object @param sub_type suby type of the objecs, can be 0 @param level level of the map into which the object should be inserted @param end_level defines range of levels (between level & end_level) into which object should be inserted, can be 0 @param label label of the object @param coord coordinates @param label2 street name or additional description of the object, can be NULL @param phone phone, can be NULL @param bouse_number house number, can be NULL @param city_name city name, can be NULL @param region_name region name, can be NULL @param country_name country name, can be NULL @param zip zip code, can be NULL @return _CG const */ LIBSPEC int CALL_API cg_addPoint(int type,int sub_type,int level,int end_level,const char* label,cg_coordinate& coord); LIBSPEC int CALL_API cg_addPointEx(int type,int sub_type,int level,int end_level, const char* label, const char* label2, const char* phone, const char* house_number, const char* city_name, const char* region_name, const char* country_name, const char* zip, cg_coordinate& coord); /** Add line Two functions are available - simple line adding and extended (with more parameters) @param type type of the object @param sub_type suby type of the objecs, used only by marine maps @param level level of the map into which the object should be inserted @param end_level defines range of levels (between level & end_level) into which object should be inserted, can be 0 @param label label of the object @param coord array of coordinates @param coord_size size of the array with coordinates @param label2 secondary street name, can be NULL @return _CG const */ LIBSPEC int CALL_API cg_addPolyline(int type,int sub_type, int level,int end_level,const char* label,cg_coordinate* coord,const int coord_size); LIBSPEC int CALL_API cg_addPolylineEx(int type,int sub_type, int level,int end_level, const char* label, const char* label2, cg_coordinate* coord,const int coord_size); /** Add polygon without holes @param type type of the object @param sub_type suby type of the objecs, used only by marine maps @param level level of the map into which the object should be inserted @param end_level defines range of levels (between level & end_level) into which object should be inserted, can be 0 @param label label of the object @param coord array of coordinates @param coord_size size of the array with coordinates */ LIBSPEC int CALL_API cg_addPolygon(int type,int sub_type, int level,int end_level,const char* label,cg_coordinate* coord,const int coord_size); /** Add polygon with holes Adding polygons with holes requires initialisation of adding polygon with holes cg_initAddPolygonHoles Then there could be several calls of cg_addPolygonMaster to add parent polygons and cg_addPolygonHole to add holes When finishing adding the polygons with holes, there must be call to cg_doneAddPolygonHoles @param type type of the object @param sub_type suby type of the objecs, used only by marine maps @param level level of the map into which the object should be inserted @param end_level defines range of levels (between level & end_level) into which object should be inserted, can be 0 @param label label of the object @param coord array of coordinates @param coord_size size of the array with coordinates */ LIBSPEC int CALL_API cg_initAddPolygonHoles(int type, int sub_type, int level,int end_level,const char* label); LIBSPEC int CALL_API cg_addPolygonMaster(cg_coordinate* coord,const int coord_size); LIBSPEC int CALL_API cg_addPolygonHole(cg_coordinate* coord,const int coord_size); LIBSPEC int CALL_API cg_doneAddPolygonHoles(); /******* Creating the final IMG file *******/ /** Not yet used */ LIBSPEC int CALL_API cg_setProgressMessage(const char* progress_title,const char* progress_message); /** Build the IMG file and store it on the disc @return _CG const */ LIBSPEC int CALL_API cg_buildMap(); /** Return error message after cg_buildMap if the return code is not _CG_OK @return error message */ LIBSPEC char* CALL_API cg_getError(); /** Return error message after cg_buildMap if the return code is not _CG_OK - Visual Basic version @return error message */ //LIBSPEC BSTR CALL_API cg_getErrorVB(); #undef LIBSPEC #ifdef __cplusplus } #endif #endif