📄 tabmapobjectblock.h
字号:
// tabmapobjectblock.h: interface for the TABMAPObjectBlock class.///*--------------------------------------------------------------------- * class TABMAPObjectBlock * * Class to handle Read/Write operation on .MAP Object data Blocks (Type 02) *--------------------------------------------------------------------*/#ifndef TABMAPObjectBlock_H#define TABMAPObjectBlock_H#include "tabmapheaderblock.h"#include "tabrawbinblock.h"class TABMAPObjHdr;class TABMAPObjectBlock : public TABRawBinBlock {protected: int m_numDataBytes; /* Excluding first 4 bytes header */ UGKInt32 m_nFirstCoordBlock; UGKInt32 m_nLastCoordBlock; UGKInt32 m_nCenterX; UGKInt32 m_nCenterY; // In order to compute block center, we need to keep track of MBR UGKInt32 m_nMinX; UGKInt32 m_nMinY; UGKInt32 m_nMaxX; UGKInt32 m_nMaxY; int m_nCurObjectOffset; // -1 if there is no current object. int m_nCurObjectId; // -1 if there is no current object. int m_nCurObjectType; // -1 if there is no current object. // Array of object headers held in memory until CommitToFile() is called TABMAPObjHdr **m_papoObjHdr; int m_numObjects; void FreeObjectArray();public: TABMAPObjectBlock(TABAccess eAccessMode = TABRead); virtual ~TABMAPObjectBlock(); virtual int CommitToFile(); virtual int InitBlockFromData(UGKByte *pabyBuf, int nSize, UGKBool bMakeCopy = TRUE, FILE *fpSrc = NULL, int nOffset = 0); virtual int InitNewBlock(FILE *fpSrc, int nBlockSize, int nFileOffset=0); virtual int GetBlockClass() { return TABMAP_OBJECT_BLOCK; }; virtual int ReadIntCoord(UGKBool bCompressed, UGKInt32 &nX, UGKInt32 &nY); int WriteIntCoord(UGKInt32 nX, UGKInt32 nY, UGKBool bCompressed); int WriteIntMBRCoord(UGKInt32 nXMin, UGKInt32 nYMin, UGKInt32 nXMax, UGKInt32 nYMax, UGKBool bCompressed); int UpdateMBR(UGKInt32 nX, UGKInt32 nY); int AddObject(TABMAPObjHdr *poObjHdr); void AddCoordBlockRef(UGKInt32 nCoordBlockAddress); void GetMBR(UGKInt32 &nXMin, UGKInt32 &nYMin, UGKInt32 &nXMax, UGKInt32 &nYMax); int AdvanceToNextObject( TABMAPHeaderBlock * ); int GetCurObjectOffset() { return m_nCurObjectOffset; } int GetCurObjectId() { return m_nCurObjectId; } int GetCurObjectType() { return m_nCurObjectType; } virtual void Dump(FILE *fpOut = NULL) { Dump(fpOut, FALSE); }; void Dump(FILE *fpOut, UGKBool bDetails);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -