www.pudn.com > MeshProcess.rar > MeshProcessView.h
// MeshProcessView.h : interface of the CMeshProcessView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MESHPROCESSVIEW_H__E6C3D686_2B2F_4CC5_8ACE_34A63056D4C2__INCLUDED_)
#define AFX_MESHPROCESSVIEW_H__E6C3D686_2B2F_4CC5_8ACE_34A63056D4C2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Transform.h"
#include "Mesh.h"
class CMeshProcessView : public CView
{
protected: // create from serialization only
CMeshProcessView();
DECLARE_DYNCREATE(CMeshProcessView)
// Attributes
public:
CMeshProcessDoc* GetDocument();
CMesh m_mModel;
int *m_Correspond;
CVer3D *m_vSTDifference;
CVer3D *m_vNormalDiffce;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMeshProcessView)
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 MorphMesh(double t);
bool TouchVertex(CMesh &mModel, CPoint point);
void SetupLineColor(CMesh &mModel);
void SetupSolidColor(CMesh &mModel);
int PickupVertex(CMesh &mModel, CPoint point);
void SpinGlobal(float axes[], float angle);
void MouseSpinGlobal(UINT nFlags, int x, int y, int init);
void MouseTranslate(UINT nFlags, int x, int y);
void MouseZoom(UINT nFlags, int x, int y);
void DrawAxes();
virtual void RenderScene( CMesh &mModel );
virtual ~CMeshProcessView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
int m_nCorrespond;
float m_ClearColorRed;
float m_ClearColorGreen;
float m_ClearColorBlue;
EYE m_sEye;
float m_spinAngle;
float m_spinAxes[3];
float m_vProjectCenter[3];
int m_nMouseAct;
BOOL m_bAnimate;
bool m_bLButtonDown;
bool m_bPickup;
bool m_bBox;
bool m_bAxes;
int m_nDisplaymode;
float m_fScaling;
// Generated message map functions
protected:
//{{AFX_MSG(CMeshProcessView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnDestroy();
afx_msg void OnZoomin();
afx_msg void OnZoomout();
afx_msg void OnzRotate();
afx_msg void OnzRotatei();
afx_msg void OnxRotate();
afx_msg void OnxRotatei();
afx_msg void OnyRotate();
afx_msg void OnyRotatei();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnSolid();
afx_msg void OnUpdateSolid(CCmdUI* pCmdUI);
afx_msg void OnWireframes();
afx_msg void OnUpdateWireframes(CCmdUI* pCmdUI);
afx_msg void OnSolidWire();
afx_msg void OnUpdateSolidWire(CCmdUI* pCmdUI);
afx_msg void OnVertices();
afx_msg void OnUpdateVertices(CCmdUI* pCmdUI);
afx_msg void OnFlatSolid();
afx_msg void OnUpdateFlatSolid(CCmdUI* pCmdUI);
afx_msg void OnAxes();
afx_msg void OnUpdateAxes(CCmdUI* pCmdUI);
afx_msg void OnBoundbox();
afx_msg void OnUpdateBoundbox(CCmdUI* pCmdUI);
afx_msg void OnMouseSpin();
afx_msg void OnMouseTranslate();
afx_msg void OnMouseZoom();
afx_msg void OnUpdateMouseSpin(CCmdUI* pCmdUI);
afx_msg void OnUpdateMouseTranslate(CCmdUI* pCmdUI);
afx_msg void OnUpdateMouseZoom(CCmdUI* pCmdUI);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnMouseDefault();
afx_msg void OnUpdateMouseDefault(CCmdUI* pCmdUI);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMousePickup();
afx_msg void OnUpdateMousePickup(CCmdUI* pCmdUI);
afx_msg void OnPickupVertices();
afx_msg void OnUpdatePickupVertices(CCmdUI* pCmdUI);
afx_msg void OnSetupClearcolor();
afx_msg void OnSetupSolidcolor();
afx_msg void OnSetupLinecolor();
afx_msg void OnOpenCorrespond();
afx_msg void OnMeshMorph();
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
void GLRelease();
void GLInit();
void GLSetupRC();
void GLResize(int cx,int cy);
HGLRC m_hRC; //rendering context
HDC m_hDC; //device context
};
#ifndef _DEBUG // debug version in MeshProcessView.cpp
inline CMeshProcessDoc* CMeshProcessView::GetDocument()
{ return (CMeshProcessDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MESHPROCESSVIEW_H__E6C3D686_2B2F_4CC5_8ACE_34A63056D4C2__INCLUDED_)