Jhy3DView.h
资源名称:Jhy3D.rar [点击查看]
上传用户:eehhbb
上传日期:2022-08-03
资源大小:2550k
文件大小:4k
源码类别:
OpenGL
开发平台:
Visual C++
- // Jhy3DView.h : interface of the CJhy3DView class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_JHY3DVIEW_H__F7137F3D_15C9_459F_93EC_A51A2E0BD80F__INCLUDED_)
- #define AFX_JHY3DVIEW_H__F7137F3D_15C9_459F_93EC_A51A2E0BD80F__INCLUDED_
- #include "3DPolygon.h" // Added by ClassView
- #include "3DTeapot.h" // Added by ClassView
- #include "Light.h" // Added by ClassView
- #include "3DBox.h"
- #include "glglaux.h"// GLaux库的头文件 // Added by ClassView
- #include "3DBezierSurface.h" // Added by ClassView
- #include "3DNurbsSurface.h" // Added by ClassView
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- class CJhy3DView : public CView
- {
- protected: // create from serialization only
- CJhy3DView();
- DECLARE_DYNCREATE(CJhy3DView)
- // Attributes
- public:
- CJhy3DDoc* GetDocument();
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CJhy3DView)
- 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:
- C3DNurbsSurface m_3dnurbsSuf;
- C3DBezierSurface m_3dbezierSuf;
- int LoadGLTextures();
- AUX_RGBImageRec *LoadBMP(char *Filename); // 载入位图图象
- GLuint m_texture[1];
- C3DBox m_3dbox;
- void DrawPyramid();
- void CloseLight();
- CLight m_light;
- void OpenLight();
- CPoint m_TempMovePos;
- int m_n3dRotate_z;
- int m_n3dRotate_y;
- int m_n3dRotate_x;
- short m_n3DRenderMode;
- C3DTeapot m_3dteapot;
- C3DPolygon m_3dpolygon;
- void DrawPolygon();
- void DrawOGLscene();
- bool InitOpenGL();
- CDC* m_pDC;
- HGLRC m_hRC;
- virtual ~CJhy3DView();
- int m_nGraph;//1线框多边形 2填充多边形 3填充三角形 4茶壶 5四棱锥 6长方体 7光照材质及纹理设置
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CJhy3DView)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnDestroy();
- afx_msg void OnTriangle();
- afx_msg void OnPolygon();
- afx_msg void OnWirePolygon();
- afx_msg void OnRenderWireMode();
- afx_msg void OnWireTeapot();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnCancelMode();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnCaptureChanged(CWnd *pWnd);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnRenderSolidMode();
- afx_msg void OnPyramid();
- afx_msg void OnLightingSet();
- afx_msg void On3DBox();
- afx_msg void OnRender3DTextureModeTeapot();
- afx_msg void OnRenderLightSolid3dBox();
- afx_msg void OnDraw3dBeziersurface();
- afx_msg void OnRENDERTextureMode3dbox();
- afx_msg void OnSphereMapModeTeapot();
- afx_msg void OnSPHEREMAPMODE3dbox();
- afx_msg void OnDraw3dNurbsSurface();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #ifndef _DEBUG // debug version in Jhy3DView.cpp
- inline CJhy3DDoc* CJhy3DView::GetDocument()
- { return (CJhy3DDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_JHY3DVIEW_H__F7137F3D_15C9_459F_93EC_A51A2E0BD80F__INCLUDED_)