www.pudn.com > mfcopentree.rar > MfcopenView.h


// MfcopenView.h : interface of the CMfcopenView class 
//武汉华中科技大学,2002,(C)版权所有 
//作者:金德才 联系方式:iskyflying@163.com 
//请不要将本软件的任何一部分用于商业用途 
//如果您觉得任何地方有用或者错误,请告诉作者,谢谢! 
//如果你想引用部分源程序,请注明作者信息 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_MFCOPENVIEW_H__ADBDC02C_FEAC_4DA1_9478_3ED9479FA892__INCLUDED_) 
#define AFX_MFCOPENVIEW_H__ADBDC02C_FEAC_4DA1_9478_3ED9479FA892__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
#include 			// Header File For The OpenGL32 Library 
#include 			// Header File For The GLu32 Library 
#include 		// Header File For The Glaux Library 
#include  
#include "3DMath.h" 
#include "myfont.h" 
#include "LinkPoint.h" 
#include "ParaSetting.h" 
class CMyFont; 
 
class CMfcopenView : public CView 
{ 
protected: // create from serialization only 
	CMfcopenView(); 
	DECLARE_DYNCREATE(CMfcopenView) 
 
// Attributes 
public: 
	CMfcopenDoc* GetDocument(); 
	CStatusBar*  pStatus;	 
public: 
	HGLRC	 m_primeHrc; 
	CPoint   m_oldpt;//前一时刻的鼠标点 
	CPoint   m_current;//当前的鼠标点 
 
public:		//all the used variables in this app's view 
	STLOctTree *ganshe_first, *ganshe_second; 
	float	 m_lineganshe[2][3];//记录干涉直线 
	float	 m_triangleganshe[3][3];//记录干涉三角形 
	CPoint	 m_zoomcenter;//缩放中心点 
	float	 m_fleft, m_fright, m_fbottom, m_ftop;//投影的图形区域 
	float    m_fstepx, m_fstepy;//右键平移的增量 
	float    m_fanglex, m_fangley, m_fanglez;//右键旋转的增量角度 
	float    m_fxtra, m_fytra;//最后平移量 
	float    m_fxrot; 
	float    m_fyrot; 
	float    m_fzrot;//最后角度 
	float    m_scale;//右键放大倍数 
	bool     m_blmousedown;//左键按下状态开关 
	bool     m_bfileopen;//文件打开状态开关 
	float    LightAmbient[4]; //光照参数 
	float    LightDiffuse[4];                
	float    LightPosition[4]; 
	float    LightSpecular[4]; 
	float    shininess; 
	float    mat_amb_diff[100][4];//材质环境和散射光 
	float	 mat_amb_diff_ganshe[4]; 
	float    mat_amb_diff_org[4]; 
	UINT      m_popmenu;//右键菜单的ID 
	UINT      m_view;//哪一视图 
	HCURSOR  m_hcursor;//当前鼠标HANDLE 
	int      writer;//output写的 次数 
	int      ganshe_writer;//干涉信息写入记号 
	CParaSetting * para; 
	bool m_bFakOpen;//FAK文件打开开关 
	float m_fganshemove[2][3];//到干涉时两个干涉实体的移动量 
	BOOL m_bviewganshe;//查看干涉开关 
	long m_lgcubenumber;//记录画了多少cube 
	int itree;//第几个tree 
	int count;//记录选择反馈的操作 
	int m_movecount; 
	float m_fpasstime; 
	bool m_bIsPrint; 
	BOOL m_bcutplane; 
	int m_iObjectId; 
	float m_fprecision; 
	BOOL m_bviewmess; 
	STLOctTree * root[10]; 
	BOOL m_bcut2; 
	float m_fd; 
	CVector3 m_xishu; 
	BOOL m_bcut1; 
	float m_ortho_bias_x, m_ortho_bias_y; 
	BOOL m_brefresh; 
	float m_disp_radio; 
	UINT m_bfindline; 
	UINT g_Texture[5]; 
	CPoint m_RectZoomOldpoint; 
	float m_ftime_bias_play; 
	float m_ftime_bias_repeat; 
	UINT m_umodelview; 
	int m_itrannumber[100]; 
	int m_istlmove[100]; 
	BOOL m_brepeat; 
	BOOL m_btempstop; 
	BOOL m_banimalfileopen; 
	BOOL m_btypehide[100]; 
	BOOL  m_ballhide; 
	float m_fInformation[100][4][3]; 
	float m_fglobaltime; 
	BOOL m_bplay;//PLAY开关 
	float m_ftimes;//速度控制 
	float m_ftimemove[100][4][2];//运动时序记录 
	float m_fBoxMax;//最大的边长,单位化用 
	float m_fsteptranslate[100][4][3];//平移时每轴的步进 
	UINT m_itreeflag;//被激活的节点 
	int  m_ilflag[100]; //记录实体隐藏的开关变量 
	float m_fmove[100][4][4];//前三个代表物体的终点位置,最后一个是动与停的开关 
	float m_fboxsize[100][3];//每个实体的box三个分量 
	float m_fcenter[100][3];//每个实体的中心点 
	float m_forigincenter[100][3];//初始中心位置 
	float m_fsectcenter[100][3];//每个实体的阶段中心位置 
protected: 
	HGLRC    m_hRC; 
	HDC      m_hDC; 
private: 
	CMyFont  myfont; 
public: 
	bool InitGL(void); 
	bool DrawGLScene(void); 
// Operations 
public: 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMfcopenView) 
	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 BuildFakList(int num); 
	void ViewGanshe(); 
	void ResetData(); 
	void CreateTree(STLArray *data, int i); 
	BOOL NonSynOctTreeCheck(STLOctTree *root, STLOctTree *leaf, float x[3], float y[3]); 
	void DrawCubeWeb(STLOctTree *root); 
	void DestroyTree(STLOctTree *root); 
	BOOL OctTreeCheck(STLOctTree *first, STLOctTree *second, float x[3], float y[3]); 
	Link * FindSketch(Link *dest, Link *back); 
	void ShowSection(int i, int rk); 
	void CreateTexture(UINT textureArray[], LPSTR strFileName, int textureID); 
	BOOL DetailCheck(int i, int j); 
	BOOL InterfaceCheck(int r); 
	int RetrieveObjectID(int x, int y); 
	void ProcessData(STLArray *data);//STL文件的数据处理 
	void BuildDispList(int flag);//建立显示列表 
 
 
	virtual ~CMfcopenView(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected: 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CMfcopenView) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnSize(UINT nType, int cx, int cy); 
	afx_msg void OnTimer(UINT nIDEvent); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg void OnTranslate(); 
	afx_msg void OnUpdateTranslate(CCmdUI* pCmdUI); 
	afx_msg void OnUpdateRotate(CCmdUI* pCmdUI); 
	afx_msg void OnRotate(); 
	afx_msg void OnZoom(); 
	afx_msg void OnUpdateZoom(CCmdUI* pCmdUI); 
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 
	afx_msg void OnTreeColor(); 
	afx_msg void OnUpdateTreeColor(CCmdUI* pCmdUI); 
	afx_msg void OnTreeHide(); 
	afx_msg void OnUpdateTreeHide(CCmdUI* pCmdUI); 
	afx_msg void OnTreeTranslate(); 
	afx_msg void OnUpdateTreeTranslate(CCmdUI* pCmdUI); 
	afx_msg void OnPlay(); 
	afx_msg void OnUpdatePlay(CCmdUI* pCmdUI); 
	afx_msg void OnTreeInformation(); 
	afx_msg void OnUpdateTreeInformation(CCmdUI* pCmdUI); 
	afx_msg void OnTempstop(); 
	afx_msg void OnUpdateTempstop(CCmdUI* pCmdUI); 
	afx_msg void OnRepeat(); 
	afx_msg void OnUpdateRepeat(CCmdUI* pCmdUI); 
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); 
	afx_msg void OnViewFont(); 
	afx_msg void OnUpdateViewFont(CCmdUI* pCmdUI); 
	afx_msg void OnViewLeft(); 
	afx_msg void OnUpdateViewLeft(CCmdUI* pCmdUI); 
	afx_msg void OnViewTop(); 
	afx_msg void OnUpdateViewTop(CCmdUI* pCmdUI); 
	afx_msg void OnViewPoints(); 
	afx_msg void OnUpdateViewPoints(CCmdUI* pCmdUI); 
	afx_msg void OnViewTriangles(); 
	afx_msg void OnUpdateViewTriangles(CCmdUI* pCmdUI); 
	afx_msg void OnViewLines(); 
	afx_msg void OnUpdateViewLines(CCmdUI* pCmdUI); 
	afx_msg void OnViewRefresh(); 
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 
	afx_msg void OnRectScale(); 
	afx_msg void OnFindLine(); 
	afx_msg void OnUpdateFindLine(CCmdUI* pCmdUI); 
	afx_msg void OnFindPort(); 
	afx_msg void OnUpdateFindPort(CCmdUI* pCmdUI); 
	afx_msg void OnToolbar3(); 
	afx_msg void OnUpdateToolbar3(CCmdUI* pCmdUI); 
	afx_msg void OnViewMess(); 
	afx_msg void OnUpdateViewMess(CCmdUI* pCmdUI); 
	afx_msg void OnCreateTree(); 
	afx_msg void OnUpdateCreateTree(CCmdUI* pCmdUI); 
	afx_msg void OnFileClear(); 
	afx_msg void OnUpdateRectScale(CCmdUI* pCmdUI); 
	afx_msg void OnViewGanshe(); 
	afx_msg void OnUpdateViewGanshe(CCmdUI* pCmdUI); 
	afx_msg void OnFit(); 
	afx_msg void OnUpdateFit(CCmdUI* pCmdUI); 
	afx_msg void OnDestroy(); 
	afx_msg void OnViewAllPara(); 
	afx_msg void OnUpdateViewAllPara(CCmdUI* pCmdUI); 
	afx_msg void OnViewBack(); 
	afx_msg void OnUpdateViewBack(CCmdUI* pCmdUI); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
#ifndef _DEBUG  // debug version in MfcopenView.cpp 
inline CMfcopenDoc* CMfcopenView::GetDocument() 
   { return (CMfcopenDoc*)m_pDocument; } 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MFCOPENVIEW_H__ADBDC02C_FEAC_4DA1_9478_3ED9479FA892__INCLUDED_)