⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ugkglobal.h

📁 linux下一款GIS程序源码
💻 H
📖 第 1 页 / 共 2 页
字号:
// ugkglobal.h  #ifndef UGKGLOBAL_H#define UGKGLOBAL_H#include "ugk_environment.h"#include <stdlib.h>#include <stdio.h>#include <string.h>#include <math.h>#include <assert.h>#include <ctype.h>#include <stdarg.h>#include <sys/stat.h>#ifdef LINUXAPP#include <unistd.h>#endiftypedef    int     UGKErr;typedef    int     UGKBool;typedef   unsigned char UGKByte;typedef   short        UGKInt16;typedef unsigned int    UGKUInt32;typedef   int         UGKInt32;#ifdef LINUXAPPtypedef  long long     UGKInt64;#elsetypedef __int64       UGKInt64;#endif#ifndef NULL#  define NULL  0#endif#ifndef FALSE#  define FALSE 0#endif#ifndef TRUE#  define TRUE  1#endif#ifndef PI#  define PI 3.14159265358979323846#endif#define UGKNullFID            -1#define UGKUnsetMarker        -21121#define UGKERR_NONE                                 0#define UGKERR_UNSUPPORTED_GEOMETRY_TYPE         3#define UGKERR_UNSUPPORTED_OPERATION               4#define UGKERR_FAILURE                               6#ifdef LINUXAPP#  define EQUAL(a,b)              (strcasecmp(a,b)==0)#  define EQUALN(a,b,n)           (strncasecmp(a,b,n)==0)#else#  define EQUAL(a,b)              (stricmp(a,b)==0)#  define EQUALN(a,b,n)           (strnicmp(a,b,n)==0)#endif#  define MIN(a,b)      ((a<b) ? a : b)#  define MAX(a,b)      ((a>b) ? a : b)#  define ABS(x)        ((x<0) ? (-1*(x)) : x)#ifndef ROUND_INT#  define ROUND_INT(dX) ((int)((dX) < 0.0 ? (dX)-0.5 : (dX)+0.5 ))#endif/************************************************************************//*                               UGKEnvelope                            *//************************************************************************/typedef struct{    double      MinX;    double      MaxX;    double      MinY;    double      MaxY;} UGKEnvelope;/************************************************************************//*                               UGKField                               *//************************************************************************//** * UGKFeature field attribute value union. */typedef union {    int         Integer;    double      Real;    char       *String;    /* wchar    *WideString; */        struct {        int     nCount;        int     *paList;    } IntegerList;        struct {        int     nCount;        double  *paList;    } RealList;        struct {        int     nCount;        char    **paList;    } StringList;    /*    union {        int   nCount;        wchar *paList;    } WideStringList;    */    struct {        int     nMarker1;        int     nMarker2;    } Set;} UGKField;/************************************************************************//*                               UGKFieldType                           *//************************************************************************/typedef enum {  /** Simple 32bit integer */                   OFTInteger = 0,  /** List of 32bit integers */                 OFTIntegerList = 1,  /** Double Precision floating point */        OFTReal = 2,  /** List of doubles */                        OFTRealList = 3,  /** String of ASCII chars */                  OFTString = 4,  /** Array of strings */                       OFTStringList = 5,  /** Double byte string (unsupported) */       OFTWideString = 6,  /** List of wide strings (unsupported) */     OFTWideStringList = 7,  /** Raw Binary data (unsupported) */          OFTBinary = 8} UGKFieldType;/************************************************************************//*                              UGKJustification                        *//************************************************************************/typedef enum {    OJUndefined = 0,    OJLeft = 1,    OJRight = 2} UGKJustification;/************************************************************************//*                              UGKwkbGeometryType                      *//************************************************************************/typedef enum {    wkbUnknown = 0,             /* non-standard */    wkbPoint = 1,               /* rest are standard WKB type codes */    wkbLineString = 2,    wkbPolygon = 3,    wkbMultiPoint = 4,    wkbMultiLineString = 5,    wkbMultiPolygon = 6,    wkbGeometryCollection = 7,    wkbNone = 100,              /* non-standard, for pure attribute records */    wkbLinearRing = 101,        /* non-standard, just for createGeometry() */    wkbPoint25D = 0x80000001,   /* 2.5D extensions as per 99-402 */    wkbLineString25D = 0x80000002,    wkbPolygon25D = 0x80000003,    wkbMultiPoint25D = 0x80000004,    wkbMultiLineString25D = 0x80000005,    wkbMultiPolygon25D = 0x80000006,    wkbGeometryCollection25D = 0x80000007} UGKwkbGeometryType;#define wkb25DBit 0x80000000 #define wkbFlatten(x)  ((UGKwkbGeometryType) ((x) & (~wkb25DBit)))#define HDR_MAGIC_COOKIE        42424242  //0x028757B2#define HDR_VERSION_NUMBER      500#define HDR_DATA_BLOCK_SIZE     512#define HDR_DEF_UGK_QUADRANT    1       // N-E Quadrant#define HDR_DEF_REFLECTXAXIS    0#define HDR_OBJ_LEN_ARRAY_SIZE   58class UGKRawPoint{  public:          UGKRawPoint()          {                  x = y = 0.0;          }    double      x;    double      y;};typedef enum{    TABRead,    TABWrite,    TABReadWrite  /* ReadWrite not implemented yet */} TABAccess;typedef enum{    TABFC_MapInfoFile = 0,    TABFC_TABFile,    TABFC_TABView,    TABFC_TABSeamless,    TABFC_MIFFile} TABFileClass;/*--------------------------------------------------------------------- * Supported .MAP block types (the first byte at the beginning of a block) *--------------------------------------------------------------------*/#define TAB_RAWBIN_BLOCK        -1#define TABMAP_HEADER_BLOCK     0#define TABMAP_INDEX_BLOCK      1#define TABMAP_OBJECT_BLOCK     2#define TABMAP_COORD_BLOCK      3#define TABMAP_GARB_BLOCK       4#define TABMAP_TOOL_BLOCK       5#define TABMAP_LAST_VALID_BLOCK_TYPE  5/*--------------------------------------------------------------------- * Codes for the known MapInfo Geometry types *--------------------------------------------------------------------*/#define TAB_GEOM_NONE           0#define TAB_GEOM_SYMBOL_C       0x01#define TAB_GEOM_SYMBOL         0x02#define TAB_GEOM_LINE_C         0x04#define TAB_GEOM_LINE           0x05#define TAB_GEOM_PLINE_C        0x07#define TAB_GEOM_PLINE          0x08#define TAB_GEOM_ARC_C          0x0a#define TAB_GEOM_ARC            0x0b#define TAB_GEOM_REGION_C       0x0d#define TAB_GEOM_REGION         0x0e#define TAB_GEOM_TEXT_C         0x10#define TAB_GEOM_TEXT           0x11#define TAB_GEOM_RECT_C         0x13#define TAB_GEOM_RECT           0x14#define TAB_GEOM_ROUNDRECT_C    0x16#define TAB_GEOM_ROUNDRECT      0x17#define TAB_GEOM_ELLIPSE_C      0x19#define TAB_GEOM_ELLIPSE        0x1a#define TAB_GEOM_MULTIPLINE_C   0x25#define TAB_GEOM_MULTIPLINE     0x26#define TAB_GEOM_FONTSYMBOL_C   0x28 #define TAB_GEOM_FONTSYMBOL     0x29#define TAB_GEOM_CUSTOMSYMBOL_C 0x2b#define TAB_GEOM_CUSTOMSYMBOL   0x2c/* Version 450 object types: */#define TAB_GEOM_V450_REGION_C  0x2e#define TAB_GEOM_V450_REGION    0x2f#define TAB_GEOM_V450_MULTIPLINE_C 0x31#define TAB_GEOM_V450_MULTIPLINE   0x32/* Version 650 object types: */#define TAB_GEOM_MULTIPOINT_C   0x34#define TAB_GEOM_MULTIPOINT     0x35#define TAB_GEOM_COLLECTION_C   0x37#define TAB_GEOM_COLLECTION     0x38/*--------------------------------------------------------------------- * Drawing Tool types *--------------------------------------------------------------------*/#define TABMAP_TOOL_PEN         1#define TABMAP_TOOL_BRUSH       2#define TABMAP_TOOL_FONT        3#define TABMAP_TOOL_SYMBOL      4#define TAB_300_MAX_VERTICES    32767/*--------------------------------------------------------------------- * TABProjInfo * struct used to store the projection parameters from the .MAP header *--------------------------------------------------------------------*/typedef struct TABProjInfo_t{    UGKByte       nProjId;           // See MapInfo Ref. Manual, App. F and G    UGKByte       nEllipsoidId;    UGKByte       nUnitsId;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -