📄 mitab_priv.h
字号:
int nPointWidth;
GInt32 rgbColor;
} TABPenDef;
/* MI Default = PEN(1,2,0) */
#define MITAB_PEN_DEFAULT {0, 1, 2, 0, 0x000000}
/*---------------------------------------------------------------------
* TABBrushDef - Brush definition information
*--------------------------------------------------------------------*/
typedef struct TABBrushDef_t
{
GInt32 nRefCount;
GByte nFillPattern;
GByte bTransparentFill; // 1 = Transparent
GInt32 rgbFGColor;
GInt32 rgbBGColor;
} TABBrushDef;
/* MI Default = BRUSH(1,0,16777215) */
#define MITAB_BRUSH_DEFAULT {0, 1, 0, 0, 0xffffff}
/*---------------------------------------------------------------------
* TABFontDef - Font Name information
*--------------------------------------------------------------------*/
typedef struct TABFontDef_t
{
GInt32 nRefCount;
char szFontName[33];
} TABFontDef;
/* MI Default = FONT("Arial",0,0,0) */
#define MITAB_FONT_DEFAULT {0, "Arial"}
/*---------------------------------------------------------------------
* TABSymbolDef - Symbol definition information
*--------------------------------------------------------------------*/
typedef struct TABSymbolDef_t
{
GInt32 nRefCount;
GInt16 nSymbolNo;
GInt16 nPointSize;
GByte _nUnknownValue_;// Style???
GInt32 rgbColor;
} TABSymbolDef;
/* MI Default = SYMBOL(35,0,12) */
#define MITAB_SYMBOL_DEFAULT {0, 35, 12, 0, 0x000000}
/*---------------------------------------------------------------------
* class TABToolDefTable
*
* Class to handle the list of Drawing Tool Definitions for a dataset
*
* This class also contains methods to read tool defs from the file and
* write them to the file.
*--------------------------------------------------------------------*/
class TABToolDefTable
{
protected:
TABPenDef **m_papsPen;
int m_numPen;
int m_numAllocatedPen;
TABBrushDef **m_papsBrush;
int m_numBrushes;
int m_numAllocatedBrushes;
TABFontDef **m_papsFont;
int m_numFonts;
int m_numAllocatedFonts;
TABSymbolDef **m_papsSymbol;
int m_numSymbols;
int m_numAllocatedSymbols;
public:
TABToolDefTable();
~TABToolDefTable();
int ReadAllToolDefs(TABMAPToolBlock *poToolBlock);
int WriteAllToolDefs(TABMAPToolBlock *poToolBlock);
TABPenDef *GetPenDefRef(int nIndex);
int AddPenDefRef(TABPenDef *poPenDef);
int GetNumPen();
TABBrushDef *GetBrushDefRef(int nIndex);
int AddBrushDefRef(TABBrushDef *poBrushDef);
int GetNumBrushes();
TABFontDef *GetFontDefRef(int nIndex);
int AddFontDefRef(TABFontDef *poFontDef);
int GetNumFonts();
TABSymbolDef *GetSymbolDefRef(int nIndex);
int AddSymbolDefRef(TABSymbolDef *poSymbolDef);
int GetNumSymbols();
int GetMinVersionNumber();
};
/*=====================================================================
Classes to handle Object Headers inside TABMAPObjectBlocks
=====================================================================*/
class TABMAPObjectBlock;
class TABMAPHeaderBlock;
class TABMAPObjHdr
{
public:
GByte m_nType;
GInt32 m_nId;
GInt32 m_nMinX; /* Object MBR */
GInt32 m_nMinY;
GInt32 m_nMaxX;
GInt32 m_nMaxY;
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:
GInt32 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 *);
};
class TABMAPObjCollection: public TABMAPObjHdrWithCoord
{
public:
GInt32 m_nRegionDataSize;
GInt32 m_nPolylineDataSize;
GInt32 m_nMPointDataSize;
GInt32 m_nComprOrgX; /* Present only in compressed coord. case */
GInt32 m_nComprOrgY;
GInt32 m_nNumMultiPoints;
GInt32 m_nNumRegSections;
GInt32 m_nNumPLineSections;
GByte m_nMultiPointSymbolId;
GByte m_nRegionPenId;
GByte m_nRegionBrushId;
GByte m_nPolylinePenId;
TABMAPObjCollection() {};
virtual ~TABMAPObjCollection()
{}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -