www.pudn.com > 1012.zip > SCADView.h


// SCADView.h : interface of the CSCADView class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_SCADVIEW_H__7D65F0EE_2F33_11D8_924E_00E044397728__INCLUDED_) 
#define AFX_SCADVIEW_H__7D65F0EE_2F33_11D8_924E_00E044397728__INCLUDED_ 
 
#include "LineNode.h"	// Added by ClassView 
#include "CircleNode.h" 
#include "RectangleNode.h" 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
 
class CSCADView : public CView 
{ 
protected: // create from serialization only 
	CSCADView(); 
	DECLARE_DYNCREATE(CSCADView) 
 
// Attributes 
public: 
	CSCADDoc* GetDocument(); 
 
// Operations 
public: 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CSCADView) 
	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: 
	void DrawCircle(CPoint3d &ptS,CPoint3d &ptE); 
void CSCADView::DrawCircle(CPoint3d ptCen, double dLen,int iNum); 
	void DispCurPt(CString str, CDC *pDC, CPoint point); 
 
	CLineNode *m_pLineNode; 
	CCircleNode *m_pCircleNode; 
	CRectangleNode *m_pRectangleNode; 
 
	void DrawLine(CPoint3d ptStart, CPoint3d ptEnd); 
	void SetupOrtho(void); 
	void DrawRectangle(CPoint3d ptStart,CPoint3d ptEnd); 
	void ConvertToWCS(CPoint &inPoint, CPoint3d &outPt); 
	void SetupOrtho(int cx, int cy); 
	void RenderScene(); 
	void GetCurrent(HDC& hdc, HGLRC& rc); 
	BOOL SetCurrent(HDC hdc, HGLRC rc); 
	BOOL MakeActive(); 
	int InitializeOpenGL(); 
	int SetupPixelFormat(); 
	void Save() ; 
	GLdouble xOrg; 
	GLdouble xMax; 
	GLdouble yOrg; 
	GLdouble yMax; 
	GLdouble zOrg; 
	GLdouble zMax; 
 
	CPoint m_ptCurrent,m_ptOld; 
	CPoint3d m_ptLButtonDown; 
 
	CPoint3d m_ptStart,m_ptEnd; 
 
	bool m_bLButtonDown; 
	BOOL        bFileSaved;//文件是否保存过 
	 
	CDC* m_pDC; 
	HGLRC m_hRC; 
 
	eActionMode m_eActionMode; 
	BYTE *m_eNodeType; 
	unsigned int m_iOpStep; 
	int         nIndex;//图元索引 
	 
	CString     fileName;//当前文件名 
	CString     path;//当前文件路径 
 
	virtual ~CSCADView(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CSCADView) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
	afx_msg void OnSize(UINT nType, int cx, int cy); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
	afx_msg void OnMove(int x, int y); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg void OnViewPan(); 
	afx_msg void OnViewZoom(); 
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); 
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnViewZoomrect(); 
	afx_msg void OnDrawLine(); 
	afx_msg void OnFileSave(); 
	afx_msg void OnFileSaveAs(); 
	afx_msg void OnFileOpen(); 
	afx_msg void OnDrawCircle(); 
	afx_msg void OnDrawRectangle(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
#ifndef _DEBUG  // debug version in SCADView.cpp 
inline CSCADDoc* CSCADView::GetDocument() 
   { return (CSCADDoc*)m_pDocument; } 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_SCADVIEW_H__7D65F0EE_2F33_11D8_924E_00E044397728__INCLUDED_)