Next version of JABA
[jabaws.git] / binaries / src / muscle / dpregionlist.h
1 #ifndef DPRegionList_h\r
2 #define DPRegionList_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         const DPRegion &Get(unsigned uIndex) const\r
51                 {\r
52                 assert(uIndex < m_uCount);\r
53                 return m_DPRegions[uIndex];\r
54                 }\r
55 \r
56 // Diagnostics\r
57         void LogMe() const;\r
58 \r
59 private:\r
60         void Free()\r
61                 {\r
62                 m_uCount = 0;\r
63                 }\r
64 \r
65 private:\r
66         unsigned m_uCount;\r
67         DPRegion m_DPRegions[MAX_DPREGIONS];\r
68         };\r
69 \r
70 void DiagListToDPRegionList(const DiagList &DL, DPRegionList &RL,\r
71   unsigned uLengthA, unsigned uLengthB);\r
72 \r
73 #endif  // DPRegionList_h\r