VisualView.h
上传用户:fjejplh001
上传日期:2007-06-11
资源大小:324k
文件大小:5k
- // VisualView.h : interface of the CVisualView class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_VISUALVIEW_H__45E24C44_3953_49F2_8ECC_DDB348A6F49A__INCLUDED_)
- #define AFX_VISUALVIEW_H__45E24C44_3953_49F2_8ECC_DDB348A6F49A__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- enum{black,white,yellow,indigotic,fuchsine,selfdefine};
- enum{White,Red,Yellow,Green,Indigotic,Blue,Fuchsine,Black};
- enum{A,B,C,D};
- class CVisualView : public CView
- {
- protected: // create from serialization only
- CVisualView();
- DECLARE_DYNCREATE(CVisualView)
- // Attributes
- public:
- CVisualDoc* GetDocument();
- // Operations
- public:
- CVisualDoc* m_pDoc;
- HGLRC m_hRC; //绘图 RC
- CClientDC * m_pDC; //绘图 DC
- int m_H;//窗口高度
- int m_W;//窗口宽度
- float m_Fovy;//视角大小
- float m_Distance;//视点离坐标原点距离
- int m_Viewport[4]; //记录视区变换的四个参数
- double m_ModelViewMatrix[16];//记录物体变换的矩阵
- double m_ProjectionMatrix[16];//记录投影变换的矩阵
- GLfloat m_RotateX; GLfloat m_RotateY; GLfloat m_RotateZ; //控制图形旋转变量
- GLfloat m_TranslateX; GLfloat m_TranslateY; GLfloat m_TranslateZ; //控制图形平移变量
- GLfloat m_ScaleX; GLfloat m_ScaleY; GLfloat m_ScaleZ; //控制图形缩放变量
- GLfloat m_ClipX; GLfloat m_ClipY; GLfloat m_ClipZ;
- GLfloat m_Clipd; GLfloat m_ClipPlane; //控制图形切片变量
- GLfloat m_ColorRed; GLfloat m_ColorGreen; GLfloat m_ColorBlue; //控制视图背景颜色变量
- int m_BackgroundColor; //控制视图背景颜色变量
- int m_LineWidth; //控制图形线宽变量
- int m_ModelColor; //控制模型颜色变量
- BOOL m_bStressModel; //控制模型应力模式显示与否
- BOOL m_bStressParameters; //控制模型应力图示显示与否
-
- BOOL m_bAutoRX; BOOL m_bAutoRY; BOOL m_bAutoRZ; //控制图形自动旋转演示与否
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CVisualView)
- 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);
- virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void ControlNormal(GLdouble *dVertex1, GLdouble *dVertex2, GLdouble *dVertex3, GLdouble *dNormal);
- void DrawCube(double L,double W,double H);
- double GetFovy(double height, double distance);
- virtual ~CVisualView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- void ControlModelColor();
- void ControlClip();
- void ControlStressParameters();
- void ControlLighting();
- void ControlMaterials();
- void ControlLineWidth();
- void ControlGuise();
- BOOL VisualPixelFormat();
- void VisualInit();
- //{{AFX_MSG(CVisualView)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnAntialias();
- afx_msg void OnFill();
- afx_msg void OnWireframe();
- afx_msg void OnRotateX1();
- afx_msg void OnRotateX2();
- afx_msg void OnRotateY1();
- afx_msg void OnRotateY2();
- afx_msg void OnRotateZ1();
- afx_msg void OnRotateZ2();
- afx_msg void OnScale1();
- afx_msg void OnScale2();
- afx_msg void OnTranslateX1();
- afx_msg void OnTranslateX2();
- afx_msg void OnTranslateY1();
- afx_msg void OnTranslateY2();
- afx_msg void OnTranslateZ1();
- afx_msg void OnTranslateZ2();
- afx_msg void OnToHome();
- afx_msg void OnLinewidthA();
- afx_msg void OnUpdateLinewidthA(CCmdUI* pCmdUI);
- afx_msg void OnLinewidthB();
- afx_msg void OnUpdateLinewidthB(CCmdUI* pCmdUI);
- afx_msg void OnLinewidthC();
- afx_msg void OnUpdateLinewidthC(CCmdUI* pCmdUI);
- afx_msg void OnLinewidthD();
- afx_msg void OnUpdateLinewidthD(CCmdUI* pCmdUI);
- afx_msg void OnAxis();
- afx_msg void OnLighting();
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg void OnAutoRotateZ();
- afx_msg void OnAutoRotateX();
- afx_msg void OnAutoRotateY();
- afx_msg void OnUpdateAutoRotateX(CCmdUI* pCmdUI);
- afx_msg void OnUpdateAutoRotateY(CCmdUI* pCmdUI);
- afx_msg void OnUpdateAutoRotateZ(CCmdUI* pCmdUI);
- afx_msg void OnStressParameters();
- afx_msg void OnUpdateStressParameters(CCmdUI* pCmdUI);
- afx_msg void OnStressModel();
- afx_msg void OnUpdateStressModel(CCmdUI* pCmdUI);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- };
- #ifndef _DEBUG // debug version in VisualView.cpp
- inline CVisualDoc* CVisualView::GetDocument()
- { return (CVisualDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_VISUALVIEW_H__45E24C44_3953_49F2_8ECC_DDB348A6F49A__INCLUDED_)