Next version of JABA
[jabaws.git] / binaries / src / muscle / dpreglist.h
1 #ifndef dpreglist_h\r
2 #define dpreglist_h\r
3 \r
4 #include "diaglist.h"\r
5 \r
6 enum DPREGIONTYPE\r
7         {\r
8         DPREGIONTYPE_Unknown,\r
9         DPREGIONTYPE_Diag,\r
10         DPREGIONTYPE_Rect\r
11         };\r
12 \r
13 struct DPRegion\r
14         {\r
15         DPREGIONTYPE m_Type;\r
16         union\r
17                 {\r
18                 Diag m_Diag;\r
19                 Rect m_Rect;\r
20                 };\r
21         };\r
22 \r
23 const unsigned MAX_DPREGIONS = 1024;\r
24 \r
25 class DPRegionList\r
26         {\r
27 public:\r
28         DPRegionList()\r
29                 {\r
30                 m_uCount = 0;\r
31                 }\r
32         ~DPRegionList()\r
33                 {\r
34                 Free();\r
35                 }\r
36 \r
37 public:\r
38 // Creation\r
39         void Clear()\r
40                 {\r
41                 Free();\r
42                 }\r
43         void Add(const DPRegion &r);\r
44 \r
45 // Accessors\r
46         unsigned GetCount() const\r
47                 {\r
48                 return m_uCount;\r
49                 }\r
50 \r
51         const DPRegion &Get(unsigned uIndex) const\r
52                 {\r
53                 assert(uIndex < m_uCount);\r
54                 return m_DPRegions[uIndex];\r
55                 }\r
56 \r
57         unsigned GetDPArea() const;\r
58 \r
59 // Diagnostics\r
60         void LogMe() const;\r
61 \r
62 private:\r
63         void Free()\r
64                 {\r
65                 m_uCount = 0;\r
66                 }\r
67 \r
68 private:\r
69         unsigned m_uCount;\r
70         DPRegion m_DPRegions[MAX_DPREGIONS];\r
71         };\r
72 \r
73 void DiagListToDPRegionList(const DiagList &DL, DPRegionList &RL,\r
74   unsigned uLengthA, unsigned uLengthB);\r
75 \r
76 #endif  // dpreglist_h\r