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

📄 testview.h

📁 图形学的基本变换。。。几个合在一起的
💻 H
字号:
// TestView.h : interface of the CTestView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TESTVIEW_H__A75FDCFB_621C_4E38_A154_C344803E6372__INCLUDED_)
#define AFX_TESTVIEW_H__A75FDCFB_621C_4E38_A154_C344803E6372__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTestView : public CView
{
protected: // create from serialization only
	CTestView();
	DECLARE_DYNCREATE(CTestView)

// Attributes
public:
	CTestDoc* GetDocument();

// Operations
public:
	void GetMaxY();//获得屏幕的最大y值
	void GetMaxX();//获得屏幕的最大x值
	void ReadCube();//读入立方体数据
	void DrawCube();//绘制立方体
	void ClearMatrix(double A[4][4]);//矩阵元素清零
	void Transform3DTo2D(double const P3D[8][4],double P2D[8][2],const int n);//三维坐标变换为二维坐标
    void Calculate(double P0[][4],double T[][4]);//两个矩阵相乘
	void KeepOriginalMatrix(double Orig[8][4],double Dest[8][4]);//保留矩阵
	void Tmove(double Tx,double Ty,double Tz);//平移矩阵
	void Tscale(double Sx,double Sy,double Sz);//比例矩阵
	void Tzrotate(double thta);//Z轴旋转矩阵
	void Txrotate(double thta);//X旋转矩阵
	void Tyrotate(double thta);//Y旋转矩阵
	void Treflect(double Fx,double Fy,double Fz);//反射矩阵
	void Treform(double b,double c,double d,double f,double g,double h);//错切矩阵
	void Line(CPoint p[]);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTestView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CTestView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	int MaxX,MaxY;//屏幕x和y的最大坐标
	double P3D[8][4];//3维变换点
	double P2D[8][2];//2维变换点
	double TM[4][4];//变换矩阵
	double TS[4][4];//比例矩阵
    double TZR[4][4];//z轴旋转矩阵
	double TXR[4][4];//x轴旋转矩阵
	double TYR[4][4];//y轴旋转矩阵
	double TF[4][4];//反射矩阵
	double TC[4][4];//错切矩阵
// Generated message map functions
protected:
	//{{AFX_MSG(CTestView)
	afx_msg void OnMENULeft();
	afx_msg void OnMENU3D();
	afx_msg void OnMENUFront();
	afx_msg void OnMENUBack();
	afx_msg void OnMENUright();
	afx_msg void OnMENUUp();
	afx_msg void OnMENUDown();
	afx_msg void OnMENUIncrease();
	afx_msg void OnMENUDecrease();
	afx_msg void OnMENUzrotate();
	afx_msg void OnMENUxrotate();
	afx_msg void OnMENUyrotate();
	afx_msg void OnMENUReset();
	afx_msg void OnMENUxoy();
	afx_msg void OnMENUyoz();
	afx_msg void OnMENUzox();
	afx_msg void OnMENUXdirection();
	afx_msg void OnMENUYdirection();
	afx_msg void OnMENUZdirection();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in TestView.cpp
inline CTestDoc* CTestView::GetDocument()
   { return (CTestDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TESTVIEW_H__A75FDCFB_621C_4E38_A154_C344803E6372__INCLUDED_)

⌨️ 快捷键说明

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