-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdpregionlist.h
73 lines (61 loc) · 1018 Bytes
/
dpregionlist.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
#ifndef DPRegionList_h
#define DPRegionList_h
#include "diaglist.h"
enum DPREGIONTYPE
{
DPREGIONTYPE_Unknown,
DPREGIONTYPE_Diag,
DPREGIONTYPE_Rect
};
struct DPRegion
{
DPREGIONTYPE m_Type;
union
{
Diag m_Diag;
Rect m_Rect;
};
};
const unsigned MAX_DPREGIONS = 1024;
class DPRegionList
{
public:
DPRegionList()
{
m_uCount = 0;
}
~DPRegionList()
{
Free();
}
public:
// Creation
void Clear()
{
Free();
}
void Add(const DPRegion &r);
// Accessors
unsigned GetCount() const
{
return m_uCount;
}
const DPRegion &Get(unsigned uIndex) const
{
assert(uIndex < m_uCount);
return m_DPRegions[uIndex];
}
// Diagnostics
void LogMe() const;
private:
void Free()
{
m_uCount = 0;
}
private:
unsigned m_uCount;
DPRegion m_DPRegions[MAX_DPREGIONS];
};
void DiagListToDPRegionList(const DiagList &DL, DPRegionList &RL,
unsigned uLengthA, unsigned uLengthB);
#endif // DPRegionList_h