-
Notifications
You must be signed in to change notification settings - Fork 0
/
trace.h
77 lines (61 loc) · 2.42 KB
/
trace.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Trace.h: interface for the CTrace class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TRACE_H__734D6353_3B6A_11D3_96D6_00C04FCCB957__INCLUDED_)
#define AFX_TRACE_H__734D6353_3B6A_11D3_96D6_00C04FCCB957__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MyPoint.h"
#include "DataGroup.h"
class CTrace
{
public:
bool Shake(long nLoop);
long GetGridNo(int nx,int ny);
bool IsGridEmpty(int i,int j);
bool IsEmpty();
CObArray& GetRoute(CMyPoint &pointDest);
bool Reset();
CTrace();
virtual ~CTrace();
long m_nGridXNumber;
long m_nGridYNumber;
int m_nGridWidth;
int m_nGridHeight;
bool Set(int nGridX,int nGridY, int nGridWidth,int nGridHeight,CSize sizeScan);
bool SetVelocity(double *pVelocity,long nCol,long nRow);
bool SetSlow(double *pSlow,long nCol,long nRow);
bool SetEmptySlow(double dEmptySlow);
bool Explode(CMyPoint &pSrc,CDC *pDC=NULL);
CObArray& GetStraightRoute(CMyPoint p1,CMyPoint p2,double& dStraightTime);
CDataGroup m_dgGridSlow;
CDataGroup m_dgByteGridFlag; // 0 , NOT reached, 1 Passed, 2 Just reached.
CDataGroup m_dgMyPointFrom; // Indicate which point is the wave from.
CDataGroup m_dgDoubleTime; // Record the traveled time .
CDataGroup m_dgBoolFlag; // Indicate if the grid will be scaned . 1, scan , 0 NOT scan.
CDataGroup m_dgObRoute; // Save the route in a Scanning Grid that a ray passed.
protected:
CObArray m_arrayWaveFront; // temporily save the wave front whose flag are set to 2.
CObArray m_arrayTrace; // for returning the trace that from the source point to the target recieve point.
CObArray m_arrayStraightTrace; // for returning the straight trace from the source point to the recieve point.
CMyPoint m_pointSource;
CSize m_sizeScan;
double m_dEmptySlow;
double CalcTime(CMyPoint &pointSrc,CMyPoint &pointDest);
bool ScanGrid(CMyPoint &pointLastSrc,CMyPoint& pointNewSrc,CMyPoint &pointMinTime);
bool MakeFlags();
};
class CGridRoute :public CObject
{
public:
double nx; // should be long when using for normal route in this class, but
double ny; // we have to let them be double because we want to use it in GetStraightRoute.
double dLen;
CGridRoute(double x,double y,double dL){
nx=x;
ny=y;
dLen=dL;
}
};
#endif // !defined(AFX_TRACE_H__734D6353_3B6A_11D3_96D6_00C04FCCB957__INCLUDED_)