26 static inline int32_t getDoubleTriangleSurface(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x3, int32_t y3)
28 int32_t ax = x2 - x1, ay = y2 - y1;
29 int32_t bx = x3 - x1, by = y3 - y1;
33 return abs(ax * by - ay * bx);
55 int32_t iErr = getDoubleTriangleSurface(
75 float iErr = getDoubleTriangleSurface(
93 C4FoWBeam *pElim = pNext, *pMerge = pNext->pNext;
94 assert(!!pElim); assert(!!pMerge);
95 assert(!
isDirty()); assert(!pMerge->isDirty());
98 int32_t iErr = getDoubleTriangleSurface(
100 pMerge->getRightEndX(), pMerge->getRightEndY(),
102 iErr += pMerge->iError;
107 iRightX = pMerge->iRightX;
108 iRightY = pMerge->iRightY;
109 iRightEndY = pMerge->iRightEndY;
110 pNext = pMerge->pNext;
124 pBeam->
Dirty(iLeftEndY);
131 pBeam->pNext = pNext;
149 iRightX = pWith->iRightX;
150 iRightY = pWith->iRightY;
176 bool fLeft = (iLeftEndY >= y),
177 fRight = (iRightEndY >= y);
const int32_t C4FoWMergeThreshold
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
StdStrBuf FormatString(const char *szFmt,...)
bool isInside(int32_t x, int32_t y) const
int32_t getRightX(int32_t y) const
bool EliminateRight(int32_t x, int32_t y)
C4FoWBeam(int32_t iLeftX, int32_t iLeftY, int32_t iRightX, int32_t iRightY)
int32_t getRightEndY() const
C4FoWBeam * getNext() const
int32_t getLeftEndX() const
bool isRight(int32_t x, int32_t y) const
void CompileFunc(StdCompiler *pComp)
int32_t getLeftEndY() const
StdStrBuf getDesc() const
bool MergeRight(int32_t x, int32_t y)
int32_t getLeftX(int32_t y) const
bool MergeLeft(int32_t x, int32_t y)
C4FoWBeam * Split(int32_t x, int32_t y)
int32_t getRightEndX() const
bool isLeft(int32_t x, int32_t y) const
void Value(const T &rStruct)