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

📄 designdoc.h

📁 本文以数字图像处理、压缩技术和MATLAB应用为基础
💻 H
字号:
// DesignDoc.h : interface of the CDesignDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DESIGNDOC_H__BB3E885C_C092_11D1_9F93_000000000000__INCLUDED_)
#define AFX_DESIGNDOC_H__BB3E885C_C092_11D1_9F93_000000000000__INCLUDED_

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

//	Base class--CElement
enum	ElementType { BASE = 1, ROOM, DOOR, WINDOW, ROOF };
enum	WindowDir {OPENUP = 1, OPENDOWN, OPENLEFT, OPENRIGHT};
class CElement: public CObject
{
protected:
	COLORREF	m_Color;
	DWORD		m_Thickness;
	DWORD		m_X1, m_Y1, m_X2, m_Y2;

	CElement()	{}
	DECLARE_SERIAL(CElement)

public:
	virtual void Draw(CDC *pDC)	{}
	CRect	GetDimRect();
	virtual void Serialize(CArchive& ar);
	int		m_ElemType;
};

class CRoom: public CElement
{
protected:
	CRoom()	{}
	DECLARE_SERIAL(CRoom)

public:
	CRoom(int X1, int Y1, int X2, int Y2, COLORREF Color, int Thickness);
	virtual void Draw (CDC *pDC);
	virtual void Serialize(CArchive &ar);
};

class CDoor: public CElement
{
protected:
	CDoor()	{}
	DECLARE_SERIAL(CDoor)

public:
	CDoor(int X1, int Y1, int X2, int Y2, COLORREF Color, int Thickness);
	virtual void Draw (CDC *pDC);
	virtual void Serialize(CArchive &ar);
};

class CWindow: public CElement
{
protected:
	DWORD		m_OutXY;
	CWindow()	{}
	DECLARE_SERIAL(CWindow)

public:
	CWindow(int X1, int Y1, int X2, int Y2, int outxy, COLORREF Color, int Thickness);
	virtual void Draw (CDC *pDC);
	virtual void Serialize(CArchive &ar);
};

class CRoof: public CElement
{
protected:
	CRoof()	{}
	DECLARE_SERIAL(CRoof)

public:
	int m_Dir;
	CRoof(int X1, int Y1, int X2, int Y2, COLORREF Color, int Thickness, int Direction);
	virtual void Draw (CDC *pDC);
	virtual void Serialize(CArchive &ar);
};








///////////////////////////////////////////////////////////////////////////////
class CDesignDoc : public CDocument
{
protected:

public:
	void AddElem (CElement *pElement);
	CElement *GetElem(int Index);
	int GetNumElem();

protected: // create from serialization only
	CDesignDoc();
	DECLARE_DYNCREATE(CDesignDoc)

// Attributes
public:
	CTypedPtrArray<CObArray, CElement*> m_ElemArray;

	int	   m_ElemSelected;
	CPoint m_sel_pt_a;
	CPoint m_sel_pt_b;

	double eyex;
	double eyey;
	double eyez;

	double centerx;
	double centery;
	double centerz;
	
	double m_xz_angle;
	double m_yz_angle;

	int	m_Thickness;
	COLORREF m_Color;
	UINT m_CurrentElement;
	UINT m_CurrentMode;
	
	GLdouble m_yRotate;
	GLdouble m_xRotate;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDesignDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:
	BOOL m_Transparent;
	void RenderScene(void);
	virtual ~CDesignDoc();
	CSize	GetDocSize() { return m_sizeDoc; }
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	CSize	m_sizeDoc;

// Generated message map functions
protected:
	//{{AFX_MSG(CDesignDoc)
	afx_msg void OnEditUndo();
	afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
	afx_msg void OnViewTransparent();
	afx_msg void OnUpdateViewTransparent(CCmdUI* pCmdUI);
	afx_msg void OnElementRoom();
	afx_msg void OnUpdateElementRoom(CCmdUI* pCmdUI);
	afx_msg void OnElementCursor();
	afx_msg void OnUpdateElementCursor(CCmdUI* pCmdUI);
	afx_msg void OnElementDoor();
	afx_msg void OnUpdateElementDoor(CCmdUI* pCmdUI);
	afx_msg void OnElementWindow();
	afx_msg void OnUpdateElementWindow(CCmdUI* pCmdUI);
	afx_msg void OnElementRoof();
	afx_msg void OnUpdateElementRoof(CCmdUI* pCmdUI);
	afx_msg void OnViewWalkthrough();
	afx_msg void OnUpdateViewWalkthrough(CCmdUI* pCmdUI);
	afx_msg void OnViewNormal();
	afx_msg void OnUpdateViewNormal(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DESIGNDOC_H__BB3E885C_C092_11D1_9F93_000000000000__INCLUDED_)

⌨️ 快捷键说明

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