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

📄 mitab_priv.h

📁 在linux环境下
💻 H
📖 第 1 页 / 共 4 页
字号:
    TABMAPObjHdr() {};    virtual ~TABMAPObjHdr() {};    static TABMAPObjHdr *NewObj(GByte nNewObjType, GInt32 nId=0);    static TABMAPObjHdr *ReadNextObj(TABMAPObjectBlock *poObjBlock,                                     TABMAPHeaderBlock *poHeader);    GBool       IsCompressedType();    int         WriteObjTypeAndId(TABMAPObjectBlock *);    void        SetMBR(GInt32 nMinX, GInt32 nMinY, GInt32 nMaxX, GInt32 mMaxY);    virtual int WriteObj(TABMAPObjectBlock *) {return -1;};//  protected:    virtual int ReadObj(TABMAPObjectBlock *) {return -1;};};class TABMAPObjHdrWithCoord: public TABMAPObjHdr{  public:    GInt32      m_nCoordBlockPtr;    GInt32      m_nCoordDataSize;    /* Eventually this class may have methods to help maintaining refs to     * coord. blocks when splitting object blocks.     */};class TABMAPObjNone: public TABMAPObjHdr{  public:    TABMAPObjNone() {};    virtual ~TABMAPObjNone() {};    virtual int WriteObj(TABMAPObjectBlock *) {return 0;};//  protected:    virtual int ReadObj(TABMAPObjectBlock *) {return 0;};};class TABMAPObjPoint: public TABMAPObjHdr{  public:    GInt32      m_nX;    GInt32      m_nY;    GByte       m_nSymbolId;    TABMAPObjPoint() {};    virtual ~TABMAPObjPoint() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjFontPoint: public TABMAPObjPoint{  public:    GByte       m_nPointSize;    GInt16      m_nFontStyle;    GByte       m_nR;    GByte       m_nG;    GByte       m_nB;    GInt16      m_nAngle;  /* In tenths of degree */    GByte       m_nFontId;    TABMAPObjFontPoint() {};    virtual ~TABMAPObjFontPoint() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjCustomPoint: public TABMAPObjPoint{  public:    GByte m_nUnknown_;    GByte m_nCustomStyle;    GByte m_nFontId;    TABMAPObjCustomPoint() {};    virtual ~TABMAPObjCustomPoint() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjLine: public TABMAPObjHdr{  public:    GInt32      m_nX1;    GInt32      m_nY1;    GInt32      m_nX2;    GInt32      m_nY2;    GByte       m_nPenId;    TABMAPObjLine() {};    virtual ~TABMAPObjLine() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjPLine: public TABMAPObjHdrWithCoord{  public:    GInt16      m_numLineSections;  /* MULTIPLINE/REGION only. Not in PLINE */    GInt32      m_nLabelX;      /* Centroid/label location */    GInt32      m_nLabelY;    GInt32      m_nComprOrgX;   /* Present only in compressed coord. case */    GInt32      m_nComprOrgY;    GByte       m_nPenId;    GByte       m_nBrushId;    GBool       m_bSmooth;      /* TRUE if (m_nCoordDataSize & 0x80000000) */    TABMAPObjPLine() {};    virtual ~TABMAPObjPLine() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjRectEllipse: public TABMAPObjHdr{  public:    GInt32      m_nCornerWidth;   /* For rounded rect only */    GInt32      m_nCornerHeight;    GByte       m_nPenId;    GByte       m_nBrushId;    TABMAPObjRectEllipse() {};    virtual ~TABMAPObjRectEllipse() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjArc: public TABMAPObjHdr{  public:    GInt32      m_nStartAngle;    GInt32      m_nEndAngle;    GInt32      m_nArcEllipseMinX;  /* MBR of the arc defining ellipse */    GInt32      m_nArcEllipseMinY;  /* Only present in arcs            */    GInt32      m_nArcEllipseMaxX;    GInt32      m_nArcEllipseMaxY;    GByte       m_nPenId;    TABMAPObjArc() {};    virtual ~TABMAPObjArc() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjText: public TABMAPObjHdrWithCoord{  public:    /* String and its len stored in the nCoordPtr and nCoordSize */    GInt16      m_nTextAlignment;    GInt32      m_nAngle;    GInt16      m_nFontStyle;    GByte       m_nFGColorR;    GByte       m_nFGColorG;    GByte       m_nFGColorB;    GByte       m_nBGColorR;    GByte       m_nBGColorG;    GByte       m_nBGColorB;    GInt32      m_nLineEndX;    GInt32      m_nLineEndY;    GInt32      m_nHeight;    GByte       m_nFontId;    GByte       m_nPenId;    TABMAPObjText() {};    virtual ~TABMAPObjText() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};class TABMAPObjMultiPoint: public TABMAPObjHdrWithCoord{  public:    GInt32      m_nNumPoints;    GInt32      m_nComprOrgX;   /* Present only in compressed coord. case */    GInt32      m_nComprOrgY;    GByte       m_nSymbolId;    GInt32      m_nLabelX;      /* Not sure if it's a label point, but */    GInt32      m_nLabelY;      /* it's similar to what we find in PLINE */    TABMAPObjMultiPoint() {};    virtual ~TABMAPObjMultiPoint() {};    virtual int WriteObj(TABMAPObjectBlock *);//  protected:    virtual int ReadObj(TABMAPObjectBlock *);};/*=====================================================================          Classes to handle .MAP files low-level blocks =====================================================================*//*--------------------------------------------------------------------- *                      class TABBinBlockManager * * This class is used to keep track of allocated blocks and is used * by various classes that need to allocate a new block in a .MAP file. *--------------------------------------------------------------------*/class TABBinBlockManager{  protected:    int         m_nBlockSize;    GInt32      m_nLastAllocatedBlock;  public:    TABBinBlockManager(int nBlockSize=512) {m_nBlockSize=nBlockSize;                                            m_nLastAllocatedBlock = -1; };    ~TABBinBlockManager()  {};    GInt32      AllocNewBlock()   {if (m_nLastAllocatedBlock==-1)                                        m_nLastAllocatedBlock = 0;                                   else                                        m_nLastAllocatedBlock+=m_nBlockSize;                                   return m_nLastAllocatedBlock; };    void        Reset()  {m_nLastAllocatedBlock=-1; };    void        SetLastPtr(int nBlockPtr) {m_nLastAllocatedBlock=nBlockPtr; };};/*--------------------------------------------------------------------- *                      class TABRawBinBlock * * This is the base class used for all other data block types... it  * contains all the base functions to handle binary data. *--------------------------------------------------------------------*/class TABRawBinBlock{  protected:    FILE        *m_fp;          /* Associated file handle               */    TABAccess   m_eAccess;      /* Read/Write access mode               */    int         m_nBlockType;    GByte       *m_pabyBuf;     /* Buffer to contain the block's data    */    int         m_nBlockSize;   /* Size of current block (and buffer)    */    int         m_nSizeUsed;    /* Number of bytes used in buffer        */    GBool       m_bHardBlockSize;/* TRUE=Blocks MUST always be nSize bytes  */                                 /* FALSE=last block may be less than nSize */    int         m_nFileOffset;  /* Location of current block in the file */    int         m_nCurPos;      /* Next byte to read from m_pabyBuf[]    */    int         m_nFirstBlockPtr;/* Size of file header when different from */                                 /* block size (used by GotoByteInFile())   */    int         m_bModified;     /* Used only to detect changes        */  public:    TABRawBinBlock(TABAccess eAccessMode = TABRead,                   GBool bHardBlockSize = TRUE);    virtual ~TABRawBinBlock();    virtual int ReadFromFile(FILE *fpSrc, int nOffset, int nSize = 512);    virtual int CommitToFile();    virtual int InitBlockFromData(GByte *pabyBuf, int nSize,                               GBool bMakeCopy = TRUE,                              FILE *fpSrc = NULL, int nOffset = 0);    virtual int InitNewBlock(FILE *fpSrc, int nBlockSize, int nFileOffset=0);    int         GetBlockType();    virtual int GetBlockClass() { return TAB_RAWBIN_BLOCK; };    GInt32      GetStartAddress() {return m_nFileOffset;};#ifdef DEBUG    virtual void Dump(FILE *fpOut = NULL);#endif    int         GotoByteRel(int nOffset);    int         GotoByteInBlock(int nOffset);    int         GotoByteInFile(int nOffset);    void        SetFirstBlockPtr(int nOffset);    int         GetNumUnusedBytes();    int         GetFirstUnusedByteOffset();    int         GetCurAddress();    virtual int ReadBytes(int numBytes, GByte *pabyDstBuf);    GByte       ReadByte();    GInt16      ReadInt16();    GInt32      ReadInt32();    float       ReadFloat();    double      ReadDouble();    virtual int WriteBytes(int nBytesToWrite, GByte *pBuf);    int         WriteByte(GByte byValue);    int         WriteInt16(GInt16 n16Value);    int         WriteInt32(GInt32 n32Value);    int         WriteFloat(float fValue);    int         WriteDouble(double dValue);    int         WriteZeros(int nBytesToWrite);    int         WritePaddedString(int nFieldSize, const char *pszString);    void        SetModifiedFlag(GBool bModified) {m_bModified=bModified;};    // This semi-private method gives a direct access to the internal     // buffer... to be used with extreme care!!!!!!!!!    GByte *     GetCurDataPtr() { return (m_pabyBuf + m_nCurPos); } ;};/*--------------------------------------------------------------------- *                      class TABMAPHeaderBlock * * Class to handle Read/Write operation on .MAP Header Blocks  *--------------------------------------------------------------------*/class TABMAPHeaderBlock: public TABRawBinBlock{  protected:    TABProjInfo m_sProj;  public:    TABMAPHeaderBlock(TABAccess eAccessMode = TABRead);    ~TABMAPHeaderBlock();    virtual int CommitToFile();    virtual int InitBlockFromData(GByte *pabyBuf, int nSize,                               GBool bMakeCopy = TRUE,                              FILE *fpSrc = NULL, int nOffset = 0);    virtual int InitNewBlock(FILE *fpSrc, int nBlockSize, int nFileOffset=0);    virtual int GetBlockClass() { return TABMAP_HEADER_BLOCK; };    int         Int2Coordsys(GInt32 nX, GInt32 nY, double &dX, double &dY);    int         Coordsys2Int(double dX, double dY, GInt32 &nX, GInt32 &nY,                              GBool bIgnoreOverflow=FALSE);    int         ComprInt2Coordsys(GInt32 nCenterX, GInt32 nCenterY,                                   int nDeltaX, int nDeltaY,                                   double &dX, double &dY);    int         Int2CoordsysDist(GInt32 nX, GInt32 nY, double &dX, double &dY);    int         Coordsys2IntDist(double dX, double dY, GInt32 &nX, GInt32 &nY);    int         SetCoordsysBounds(double dXMin, double dYMin,                                   double dXMax, double dYMax);    int         GetMapObjectSize(int nObjType);    GBool       MapObjectUsesCoordBlock(int nObjType);    int         GetProjInfo(TABProjInfo *psProjInfo);    int         SetProjInfo(TABProjInfo *psProjInfo);#ifdef DEBUG    virtual void Dump(FILE *fpOut = NULL);#endif    // Instead of having over 30 get/set methods, we'll make all data     // members public and we will initialize them in the overloaded    // LoadFromFile().  For this reason, this class should be used with care.    GInt16      m_nMAPVersionNumber;    GInt16      m_nBlockSize;        double      m_dCoordsys2DistUnits;    GInt32      m_nXMin;    GInt32      m_nYMin;    GInt32      m_nXMax;    GInt32      m_nYMax;    GBool       m_bIntBoundsOverflow;  // Set to TRUE if coordinates                                        // outside of bounds were written    GInt32      m_nFirstIndexBlock;    GInt32      m_nFirstGarbageBlock;    GInt32      m_nFirstToolBlock;    GInt32      m_numPointObjects;    GInt32      m_numLineObjects;    GInt32      m_numRegionObjects;    GInt32      m_numTextObjects;    GInt32      m_nMaxCoordBufSize;    GByte       m_nDistUnitsCode;       // See Appendix F

⌨️ 快捷键说明

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