MyglView.h
上传用户:cding2008
上传日期:2007-01-03
资源大小:1812k
文件大小:5k
- /////////////////////////////////////////////////////////////////////////////
- // MyglView.h : header file; interface of the CMyglView class
- //
- // ModelMagic 3D and 'glOOP' (OpenGL Object Oriented Programming library)
- // Copyright (c) Craig Fahrnbach 1997, 1999
- //
- // OpenGL is a registered trademark of Silicon Graphics
- //
- //
- // This program is provided for educational and personal use only and
- // is provided without guarantee or warrantee expressed or implied.
- //
- // Commercial use is strickly prohibited without written permission
- // from ImageWare Development.
- //
- /////////////////////////////////////////////////////////////////////////////
- class CEditCameraDlg;
- /////////////////////////////////////////////////////////////////////////////
- // CMyglView
- class CMyglView : public CView
- {
- DECLARE_DYNCREATE(CMyglView)
- // Construction
- public:
- CMyglView();
- virtual ~CMyglView();
- // Attributes
- public:
- C3dCamera m_Camera; // Our windows camera
- CClientDC* m_pDC; // Pointer to our Device Context
- HGLRC m_hRC; // Handle to our Rendering Context
- protected:
- int m_nMouseZ;
- int m_nInitMouseZ;
- CPoint m_CPointLeftButtonDown; // Screen position of the mouse
- GLfloat m_fMouseZCoord; // Coordinate of the mouse 'z'
- GLfloat m_fSelectedCoord[3]; // Coordinate of the selected object
- GLfloat m_fSelectedCoord2[3]; // 2nd Coordinate of the selected object
- GLfloat m_fLeftButtonDownCoord[3]; // World coordinate of the mouse
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMyglView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
- protected:
- virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
- virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
- virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
- virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void DisplayWorldCoord(VECTORF fMouseCoordinate);
- CMyglDoc* GetDocument();
- void CalculateMargins(CDC* pDC, CRect* pRectMargins);
- void ViewIso();
- void ViewFront();
- void ViewSide();
- void ViewTop();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CMyglView)
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
- afx_msg BOOL OnQueryNewPalette();
- afx_msg void OnDestroy();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnViewPerspective();
- afx_msg void OnViewZoomIn();
- afx_msg void OnViewZoomOut();
- afx_msg void OnUpdateViewPerspective(CCmdUI* pCmdUI);
- afx_msg void OnAnimateSceen();
- afx_msg void OnUpdateAnimateSceen(CCmdUI* pCmdUI);
- afx_msg void OnViewWireFrame();
- afx_msg void OnUpdateViewWireFrame(CCmdUI* pCmdUI);
- afx_msg void OnViewFlatShade();
- afx_msg void OnUpdateViewFlatShade(CCmdUI* pCmdUI);
- afx_msg void OnViewDisplayAxis();
- afx_msg void OnUpdateViewDisplayAxis(CCmdUI* pCmdUI);
- afx_msg void OnViewDisplayGrid();
- afx_msg void OnUpdateViewDisplayGrid(CCmdUI* pCmdUI);
- afx_msg void OnViewIso();
- afx_msg void OnUpdateViewIso(CCmdUI* pCmdUI);
- afx_msg void OnViewFront();
- afx_msg void OnUpdateViewFront(CCmdUI* pCmdUI);
- afx_msg void OnViewSide();
- afx_msg void OnUpdateViewSide(CCmdUI* pCmdUI);
- afx_msg void OnViewTop();
- afx_msg void OnUpdateViewTop(CCmdUI* pCmdUI);
- afx_msg void OnViewSmoothShade();
- afx_msg void OnUpdateViewSmoothShade(CCmdUI* pCmdUI);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnCameraEdit();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnViewCullfaces();
- afx_msg void OnUpdateViewCullfaces(CCmdUI* pCmdUI);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnFilePrintPreview();
- afx_msg void OnFilePageSetup();
- afx_msg void OnFileSaveImage();
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnViewOutline();
- afx_msg void OnUpdateViewOutline(CCmdUI* pCmdUI);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #ifndef _DEBUG // debug version in MyglView.cpp
- inline CMyglDoc* CMyglView::GetDocument()
- { return (CMyglDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////