📄 tabmapindexblock.h
字号:
// tabmapindexblock.h: interface for the TABMAPIndexBlock class.///*--------------------------------------------------------------------- * class TABMAPIndexBlock * * Class to handle Read/Write operation on .MAP Index Blocks (Type 01) *--------------------------------------------------------------------*/#ifndef TABMAPIndexBlock_H#define TABMAPIndexBlock_H#include "ugkglobal.h"#include "tabrawbinblock.h"#include "tabbinblockmanager.h"class TABMAPIndexBlock : public TABRawBinBlock {protected: int m_numEntries; TABMAPIndexEntry m_asEntries[TAB_MAX_ENTRIES_INDEX_BLOCK]; int ReadNextEntry(TABMAPIndexEntry *psEntry); int WriteNextEntry(TABMAPIndexEntry *psEntry); // Use these to keep track of current block's MBR UGKInt32 m_nMinX; UGKInt32 m_nMinY; UGKInt32 m_nMaxX; UGKInt32 m_nMaxY; TABBinBlockManager *m_poBlockManagerRef; //有何用?? // Info about child currently loaded TABMAPIndexBlock *m_poCurChild; int m_nCurChildIndex; //标志当前加载的子索引块在本索引块中的位置 // Also need to know about its parent TABMAPIndexBlock *m_poParentRef; int ReadAllEntries();public: TABMAPIndexBlock(TABAccess eAccessMode = TABRead); virtual ~TABMAPIndexBlock(); 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 CommitToFile(); virtual int GetBlockClass() { return TABMAP_INDEX_BLOCK; }; int GetNumFreeEntries(); int GetNumEntries() {return m_numEntries;}; TABMAPIndexEntry *GetEntry( int iIndex ); int AddEntry(UGKInt32 XMin, UGKInt32 YMin, UGKInt32 XMax, UGKInt32 YMax, UGKInt32 nBlockPtr, UGKBool bAddInThisNodeOnly=FALSE); int GetCurMaxDepth(); void GetMBR(UGKInt32 &nXMin, UGKInt32 &nYMin, UGKInt32 &nXMax, UGKInt32 &nYMax); UGKInt32 GetNodeBlockPtr() { return GetStartAddress();}; void SetMAPBlockManagerRef(TABBinBlockManager *poBlockMgr); void SetParentRef(TABMAPIndexBlock *poParent); void SetCurChildRef(TABMAPIndexBlock *poChild, int nChildIndex); int GetCurChildIndex() { return m_nCurChildIndex; } TABMAPIndexBlock *GetCurChild() { return m_poCurChild; } TABMAPIndexBlock *GetParentRef() { return m_poParentRef; } int SplitNode(int nNewEntryX, int nNewEntryY); int SplitRootNode(int nNewEntryX, int nNewEntryY); void UpdateCurChildMBR(UGKInt32 nXMin, UGKInt32 nYMin, UGKInt32 nXMax, UGKInt32 nYMax, UGKInt32 nBlockPtr); void RecomputeMBR(); int InsertEntry(UGKInt32 XMin, UGKInt32 YMin, UGKInt32 XMax, UGKInt32 YMax, UGKInt32 nBlockPtr); virtual void Dump(FILE *fpOut = NULL);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -