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

📄 cube.h

📁 数学建模中常用到的一些小程序的源码 大家共享哈 哈 哈
💻 H
字号:
// Cube.h: interface for the CCube class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CUBE_H__E70FF1D5_E17D_4551_A2F1_0CFB14D41B7B__INCLUDED_)
#define AFX_CUBE_H__E70FF1D5_E17D_4551_A2F1_0CFB14D41B7B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CDirc
{
public:
	static const int UP;
	static const int DOWN;
	static const int LEFT;
	static const int RIGHT;
	static const int FRONT;
	static const int BACK;
public:
	int value;
public:
	CDirc() {value = UP;}
	~CDirc(){}
};

class CBlock
{
public:
	CBlock() {dirc.value = CDirc::UP; color = RGB(0,0,0);}
	~CBlock(){}
public:
	CDirc dirc;
	COLORREF color;
};

class CPlane
{
public:
	CPlane() {}
	~CPlane(){}
public:
	CBlock block[9];
};

class CParallelogram
{
public:
	CPoint vt[4];
	CPoint xLB  ; // left-bottom point
public:
	BOOL PtInOgram(CPoint pt);
	void Open(CPoint* pv);
	CParallelogram(){}
};

class CCube  
{
public:
	int m_nStep;
	CPlane m_Plane[6]; // 0~5: up, down, left, right, front, back __six planes
public:
	CCube();
	~CCube();
public:
	BOOL Find(CPlane* plane, int* pnPath, int& nStepCnt);
	BOOL Restore(int* pnPath, int& nStepCnt);
	BOOL IsOK(void);
	void Randomize(int nStep);
	void Turnto(int nDirc);
	static int Rot(int n, int time);
	CParallelogram m_xClickOgram[9];
	void RgnClicked(int nRgn);
	void ShowCube(CDC* pDC, POINT Vertex0, int SideLength);
protected:
	BOOL IsOK(CPlane* plane);
	void NextPlane(CPlane* plane, int nRgn);
	COLORREF COLOR[6];
	static int Rotate(int n);
	void InitCube(void);
};

#endif // !defined(AFX_CUBE_H__E70FF1D5_E17D_4551_A2F1_0CFB14D41B7B__INCLUDED_)

⌨️ 快捷键说明

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