mydrawbplustree.h

来自「B+树的演示程序」· C头文件 代码 · 共 51 行

H
51
字号
#pragma once

#include "MyDrawNode.h"
#include "MyBPlusTree.h"

// MyDrawBPlusTree 命令目标

class MyDrawBPlusTree : public CObject
{
public:
	CDC* m_pDC;
	CRect m_viewRect;
	CRect m_maxRect; 
	MyDrawNode m_drawNode;
	MyBPlusTree* m_tree;
	POINT m_position;		// current leaf position.

	long m_drawKey0;		// draw which node	
	int m_drawLevel;
	long m_firstDrawKey0;
	int m_firstDrawLevel;
	int m_iType;			// the type of draw: 1, search.
	bool m_bDraw;
	void* m_insertPoint;
	bool m_bInsert;
	POINT m_inserPosition;
	int m_iNumber;

public:
	MyDrawBPlusTree();
	virtual ~MyDrawBPlusTree();

	void SetDC(CDC* pDC);
	void SetBPlusTree(MyBPlusTree* tree);
	void Create(CDC* pDC,MyBPlusTree* tree);

	void SetMyRect(RECT viewRect);	// view client rect
	long GetFirstNodeKey0();
    int FindRightNB(int level);
	long GetMaxKey(int i,int level);
	long GetMinKey(int level);
	int GetNumberOfNode(int level);
	
	void Coordinate(POINT& position);
	void DrawTree(long key0,int level,int type,void* insertPoint=NULL,int i=-1);
	POINT DrawSubNode(MyNode* pnode);
	void DrawNode(MyNode* pnode,POINT position,int type);
};


⌨️ 快捷键说明

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