📄 simulateview.h
字号:
// SimulateView.h : interface of the CSimulateView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_SIMULATEVIEW_H__13A91D84_3282_47FF_A332_B557CC5A7424__INCLUDED_)
#define AFX_SIMULATEVIEW_H__13A91D84_3282_47FF_A332_B557CC5A7424__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "SortListCtrl.h"
#include "AnalyseDlg.h"
#include "Rand.h"
#include "SetDlg.h"
//定义点
typedef struct Point
{
float x,y,z;//该点的x,y,z坐标
}Point;
//定义点的方向
typedef struct PointDirct
{
float dx,dy,dz;//该直线的x,y,x方向
}PointDirct;
//定义直线
typedef struct Line
{
Point pPassPoint; //该直线所过的点
PointDirct dPointDirct; //该直线的方向
}Line;
class CMainFrame;
class CSimulateDoc;
class CSimulateView : public CListView
{
public: // create from serialization only
CSimulateView();
DECLARE_DYNCREATE(CSimulateView)
// Attributes
public:
CSimulateDoc* GetDocument();
// Operations
public:
RecordString CopyRecord(int nIndex); //拷贝整条记录
void AnalyseData(float fError,CSimulateView* p);
//分析数据
void InsertRecord(Record m_Record); //插入记录,p为数据分析视图指针
void OnSelectionChanged();
void SetDefaultViewPointer();
void SingleSimulate(SetParam sp); //单独模拟 ,a为长半轴,b为短半轴
DWORD WINAPI SingleSimulateProc(); //单个模拟线程函数
int IsCutWithPipe(Line l0); //反射直线是否与光电倍增管相交
bool IsCutWithObj(Line l0,int nObjSort); //反射直线是否与物体相交
bool IsEven(Point p1,Point p2); //p1和p2是否相同
float GetFocus(float fLAxis); //得到焦距
float GetSAxis(float fLAxis); //得到短半轴
Line GetReflectLine(Line l0); //得到已知直线的反射直线,nID为点号
Point GetCutPoint(Line l0,int nID); //得到已知直线与椭球的交点
float Max(float a,float b);
float Min(float a,float b);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSimulateView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
virtual void OnInitialUpdate();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSimulateView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
public:
void InsertRecord(RecordString rs);
CRand m_Rand; //随机类
SetParam m_SetParam; //参数配置
CSortListCtrl* m_pList;
CMainFrame* m_pMainFrame;
HANDLE m_hThread;
bool m_bStop;
POSITION m_nCurSel; //光标在列表中的位置
int m_nIndex; //序号
float m_fCurLAxis; //当前长半轴
float m_fCurSAxis; //当前短半轴
float m_fFocus; //焦距
float m_fLAxisAdd; //长半轴增量
float m_fLAxisFrom; //长半轴初值
float m_fSAxisAdd; //短半轴增量
float m_fSAxisFrom; //短半轴初值
float m_fObjRadius; //物体半径
int m_nObjSort; //物体类别:0为球面,1为球体
int m_nGoodPhotonCount; //好光子数
int m_nBadPhotonCount; //坏光子数
int m_nDeadPhotonCount; //死光子数
Record m_rMaxRecord; //接收光子最多数的那条记录
int m_nAllPhoton; //总光子数
int m_nReflectCount; //反射次数
float m_fShineIntensity; //光子发光强度
float m_fGoodRate; //光子吸收率
float m_fBadRate; //坏光子率
float m_fDeadRate; //死光子率
CString m_strIndex; //序号
CString m_strLAxis; //长半轴
CString m_strSAxis; //短半轴
CString m_strGoodPhotonCount;
//好光子数
CString m_strBadPhotonCount;
//坏光子数
CString m_strDeadPhotonCount;
//死光子数
CString m_strGoodRate; //光子吸收率
CString m_strBadRate; //坏光子率
CString m_strDeadRate; //死光子率
Record m_Record; //一条记录
// Generated message map functions
//{{AFX_MSG(CSimulateView)
afx_msg void OnClear();
afx_msg void OnDelete();
afx_msg void OnAnalyse();
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnHelp();
afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKeydown(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnProperty();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in SimulateView.cpp
inline CSimulateDoc* CSimulateView::GetDocument()
{ return (CSimulateDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SIMULATEVIEW_H__13A91D84_3282_47FF_A332_B557CC5A7424__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -