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

📄 3d-treedlg.h

📁 此文档是用vistual studio 2005 开发的用来描述3D-tree 的生长过程
💻 H
字号:
// 3D-treeDlg.h : 头文件
//

#pragma once
#include "afxcmn.h"
#include "afxwin.h"
#include "ControlDialog.h"
#include "MyTree.h"
#include "Land.h"
#include "InfoDlg.h"
#include "ChIni.h"

// CMy3DtreeDlg 对话框
class CMy3DtreeDlg : public CDialog
{
// 构造
public:
	CMy3DtreeDlg(CWnd* pParent = NULL);	// 标准构造函数

	BOOL SetWindowPixelFormat(HDC hDC);   //设定象素格式
	BOOL CreateViewGLContext(HDC hDC);     //View GL Context
	void RenderScene();                                //绘制场景

	HDC hrenderDC;      //DC
	HGLRC hrenderRC;  //RC
	float m_yRotate;       //转速
	int PixelFormat;

	// 对话框数据
	enum { IDD = IDD_MY3DTREE_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持
private:
	int startX, startY, endX, endY;
	float rotateX, rotateY;
	float translateX, translateY, translateZ;
	float changeStep;
	CControlDialog* controlPanel;
	CInfoDlg* infoDlg;
	MyTree* tree;
	MyTree* randomTree[ 100 ];
	bool reGenerateRandomTree;
	Land* land;
	ChIni* ini;
	bool showTips;
	bool isDrag;
	bool showGrowProcess;
	bool isAutoRotate;
	bool isDrawForest;
	CRect mainRect;
	CRect controlRect;
	CMenu *pMenu;

// 实现
protected:
	HICON m_hIcon;

	bool InitGL();

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void WinHelp(DWORD dwData, UINT nCmd);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	DECLARE_MESSAGE_MAP()
public:
	void resetRender();
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
public:
	afx_msg void OnTimer(UINT_PTR nIDEvent);
public:
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
public:
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
public:
	afx_msg void OnWindowPosChanged(WINDOWPOS* lpwndpos);
public:
	CSliderCtrl m_depth;
public:
	CSliderCtrl m_radius;
public:
	CSliderCtrl m_length;
public:
	CSliderCtrl m_slices;
public:
	CSliderCtrl m_leftBranchTwist;
public:
	CSliderCtrl m_leftBranchExpand;
public:
	CSliderCtrl m_leafSize;
public:
	CButton m_leafVisible;
public:
	CButton m_drawLand;
public:
	CButton m_landVisible;
public:
	CSliderCtrl m_rightBranchExpand;
public:
	afx_msg void OnNMCustomdrawTreeDepth(NMHDR *pNMHDR, LRESULT *pResult);
public:
	afx_msg void OnMenuitemAbout();
public:
	afx_msg void OnMenuitemExit();
public:
	afx_msg void OnMunuitemHelp();
public:
	afx_msg void OnBnClickedCancel();
public:
	afx_msg void OnMenuitemControl();
public:
	afx_msg void OnFullscreen();
public:
	afx_msg void OnClose();
public:
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
public:
	afx_msg void OnOrthoViewer();
public:
	afx_msg void OnOverlookViewer();
public:
	afx_msg void OnSideViewer();
public:
	afx_msg void OnPerspectiveViewer();
public:
	afx_msg void OnMenuitemInfo();
public:
	afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point);
public:
	afx_msg void OnDestroy();
public:
	afx_msg void OnMenuitemAutomove();
};

⌨️ 快捷键说明

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