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