#include <bfxalu.h>
Inheritance diagram for BfxErrorRegionList:
Public Member Functions | |
BfxErrorRegionList () | |
Default constructor for ALU. | |
~BfxErrorRegionList () | |
Default constructor for ALU. | |
BOOL | Next () |
BOOL | Init (UINT32 Length) |
Default constructor for ALU. | |
BOOL | ResetRead () |
Resets the read pointer. | |
BOOL | Empty () |
Empties the list. | |
BOOL | Insert (INT32 XCoord, INT32 YCoord, INT32 Area) |
Inserts an item into the list. | |
BOOL | Sort () |
Sorts the list. | |
BOOL | IsSpace () |
BOOL | GetCurrent (INT32 *XCoord, INT32 *YCoord, INT32 *Area) |
BOOL | MarkUsed () |
INT32 | GetSize () |
Protected Member Functions | |
void | Swap (BfxErrorRegionListItem *A, BfxErrorRegionListItem *B) |
Protected Attributes | |
BfxErrorRegionListItem * | pList |
INT32 | ListLength |
INT32 | Used |
INT32 | CurrentRead |
INT32 | CurrentWrite |
BOOL | Sorted |
Private Member Functions | |
CC_DECLARE_DYNCREATE (BfxErrorRegionList) |
Definition at line 180 of file bfxalu.h.
|
Default constructor for ALU.
Definition at line 2723 of file bfxalu.cpp. 02724 { 02725 pList = NULL; 02726 ListLength = 0; 02727 Used = 0; 02728 CurrentRead = 0; 02729 CurrentWrite = 0; 02730 Sorted = FALSE; 02731 }
|
|
Default constructor for ALU.
Definition at line 2750 of file bfxalu.cpp.
|
|
|
|
Empties the list.
Definition at line 2809 of file bfxalu.cpp. 02810 { 02811 ERROR2IF (!pList, FALSE, "No BfxErrorRegionList"); 02812 CurrentRead = 0; 02813 CurrentWrite = 0; 02814 Sorted = FALSE; 02815 02816 pList[CurrentWrite].X=pList[CurrentWrite].Y=pList[CurrentWrite].Area = 0; 02817 02818 return TRUE; 02819 }
|
|
Definition at line 212 of file bfxalu.h. 00213 {return ((pList) && (*XCoord=pList[CurrentRead].X,*YCoord=pList[CurrentRead].Y,*Area = pList[CurrentRead].Area));};
|
|
Definition at line 215 of file bfxalu.h. 00215 { return ListLength; };
|
|
Default constructor for ALU.
Definition at line 2772 of file bfxalu.cpp. 02773 { 02774 if (pList) CCFree(pList); 02775 pList = NULL; 02776 ListLength = 0; 02777 Used = 0; 02778 CurrentRead = 0; 02779 CurrentWrite = 0; 02780 Sorted = FALSE; 02781 02782 if (!Length) return TRUE; 02783 02784 if ((pList = /*assign*/ (BfxErrorRegionListItem *)CCMalloc(sizeof(BfxErrorRegionListItem) * (Length+1))) == NULL) 02785 return FALSE; 02786 02787 ListLength = Length; 02788 02789 return (Empty() && ResetRead()); 02790 }
|
|
Inserts an item into the list.
Definition at line 2859 of file bfxalu.cpp. 02860 { 02861 ERROR2IF (!pList, FALSE, "No BfxErrorRegionList"); 02862 ERROR2IF (!IsSpace(), FALSE, "It's full! Why not use IsSpace() first like a good programmer?"); 02863 ERROR2IF (!Area, FALSE, "BfxErrorRegionLists cannot hold zero area regions coz they aren't really regions, are they?"); 02864 02865 pList[CurrentWrite].X=XCoord; 02866 pList[CurrentWrite].Y=YCoord; 02867 pList[CurrentWrite++].Area=Area; 02868 pList[CurrentWrite].Area=0; 02869 pList[CurrentWrite].X=0; 02870 pList[CurrentWrite].Y=0; 02871 02872 return TRUE; 02873 }
|
|
Definition at line 211 of file bfxalu.h. 00211 { return (CurrentWrite<ListLength); };
|
|
Definition at line 214 of file bfxalu.h. 00214 { return (pList && ((!pList[CurrentRead].Area) || (pList[CurrentRead].Area=/*assign*/1))); };
|
|
Definition at line 205 of file bfxalu.h. 00205 {if (pList && pList[CurrentRead].Area) CurrentRead++;return TRUE;};
|
|
Resets the read pointer.
Definition at line 2836 of file bfxalu.cpp. 02837 { 02838 CurrentRead = 0; 02839 return TRUE; 02840 }
|
|
Sorts the list.
Definition at line 2893 of file bfxalu.cpp. 02894 { 02895 ERROR2IF (!pList, FALSE, "No BfxErrorRegionList"); 02896 Sorted = FALSE; 02897 02898 // Handle special cases 02899 if ((pList[0].Area == 0) || (pList[1].Area ==0)) 02900 { 02901 Sorted = TRUE; 02902 return TRUE; 02903 } 02904 02905 while (!Sorted) 02906 { 02907 INT32 Current = 0; 02908 Sorted = TRUE; 02909 while (pList[++Current].Area !=0) if (pList[Current].Area > pList[Current-1].Area) 02910 { 02911 Sorted=FALSE; 02912 Swap(&pList[Current], &pList[Current-1]); 02913 } 02914 } 02915 return TRUE; 02916 }
|
|
Definition at line 199 of file bfxalu.h. 00199 { BfxErrorRegionListItem T; 00200 T.X=A->X;T.Y=A->Y;T.Area=A->Area;A->X=B->X;A->Y=B->Y;A->Area=B->Area;B->X=T.X;B->Y=T.Y;B->Area=T.Area;};
|
|
|
|
|
|
|
|
|
|
|
|
|