25 #ifndef DYNAMIC_COVERAGE_HH
26 #define DYNAMIC_COVERAGE_HH
141 template <
int Ai,
int Aj>
196 template <
int Ai,
int Aj>
217 bool FFirstDirection;
262 template <
int Ai,
int Aj,
int Ak>
319 template <
int Ai,
int Aj,
int Ak>
333 std::queue<CDart*> FToTreat;
346 const CDart* ADart,
int AMarkNumber);
387 std::queue<CDart*> FToTreat;
427 template <
int Ai,
int Aj,
int Ak>
529 template <
int Ai,
int Aj,
int Ak>
543 std::list<CDart*> FAllCoverDarts;
546 std::list<CDart*>::iterator FIt2;
598 std::list<CDart*> FAllCoverDarts;
601 std::list<CDart*>::iterator FIt2;
695 std::stack<CDart*> FToTreat;
870 const CDart* ADart1) :
872 FSelf ((
CDart*) ADart1)
932 const CDart* ADart1) :
934 FDart1 ((
CDart*) ADart1)
958 if (! FDart1Active || FMap->isFree(FDart1, Ai))
961 FDart1Active =
false;
973 return FMap->alpha(FDart1, Ai);
1005 template <
int Ai,
int Aj>
1009 FDartCurrent = FDart1;
1014 template <
int Ai,
int Aj>
1019 FDart1 ((
CDart*) ADart1)
1024 template <
int Ai,
int Aj>
1030 template <
int Ai,
int Aj>
1034 return FPrevOp !=
OP_END;
1037 template <
int Ai,
int Aj>
1045 if (FMap->isFree(FDartCurrent, Ai))
1047 if (FMap->isFree(FDartCurrent, Aj))
1052 FDartCurrent = FMap->alpha(FDartCurrent, Aj);
1059 FDartCurrent = FMap->alpha(FDartCurrent, Ai);
1065 if (FMap->alpha(FDartCurrent, Ai) == FDart1)
1067 if (! FMap->isFree(FDartCurrent, Aj))
1070 FDartCurrent = FMap->alpha(FDartCurrent, Aj);
1081 template <
int Ai,
int Aj>
1088 template <
int Ai,
int Aj>
1093 return FDartCurrent;
1096 template <
int Ai,
int Aj>
1106 template <
int Ai,
int Aj>
1115 template <
int Ai,
int Aj>
1119 FDartCurrent = FDart1;
1120 FFirstDirection =
true;
1125 template <
int Ai,
int Aj>
1130 FDart1 ((
CDart*) ADart1)
1135 template <
int Ai,
int Aj>
1141 template <
int Ai,
int Aj>
1145 return FPrevOp !=
OP_END;
1148 template <
int Ai,
int Aj>
1154 if (FFirstDirection)
1158 if (FMap->isFree(FDartCurrent, Ai))
1160 FFirstDirection =
false;
1161 if (FMap->isFree(FDart1, Aj))
1165 FDartCurrent = FMap->alpha(FDart1, Aj);
1171 FDartCurrent = FMap->alpha(FDartCurrent, Ai);
1178 if (FMap->isFree(FDartCurrent, Aj))
1180 FFirstDirection =
false;
1181 if (FMap->isFree(FDart1, Aj))
1185 FDartCurrent = FMap->alpha(FDart1, Aj);
1192 FDartCurrent = FMap->alpha(FDartCurrent, Aj);
1193 if (FDartCurrent == FDart1)
1207 if (FMap->isFree(FDartCurrent, Ai))
1211 FDartCurrent = FMap->alpha(FDartCurrent, Ai);
1218 if (FMap->isFree(FDartCurrent, Aj))
1222 FDartCurrent = FMap->alpha(FDartCurrent, Aj);
1230 template <
int Ai,
int Aj>
1237 template <
int Ai,
int Aj>
1243 return FDartCurrent;
1246 template <
int Ai,
int Aj>
1255 template <
int Ai,
int Aj>
1264 template <
int Ai,
int Aj,
int Ak>
1268 FFirstBorder =
true;
1273 template <
int Ai,
int Aj,
int Ak>
1284 template <
int Ai,
int Aj,
int Ak>
1290 template <
int Ai,
int Aj,
int Ak>
1297 template <
int Ai,
int Aj,
int Ak>
1303 if (! FAkExist || FPrevAk)
1309 if (FIt.prevOperationType() ==
OP_JUMP)
1310 FFirstBorder =
true;
1318 FFirstBorder = ! FFirstBorder;
1322 template <
int Ai,
int Aj,
int Ak>
1331 return FMap->alpha(* FIt, Ak);
1334 template <
int Ai,
int Aj,
int Ak>
1343 template <
int Ai,
int Aj,
int Ak>
1350 return FIt.prevOperationType();
1353 template <
int Ai,
int Aj,
int Ak>
1362 template <
int Ai,
int Aj,
int Ak>
1368 FDartCurrent((
CDart*) ADart1),
1369 FMarkNumber (AMarkNumber),
1375 template <
int Ai,
int Aj,
int Ak>
1381 template <
int Ai,
int Aj,
int Ak>
1385 return FPrevOp !=
OP_END;
1388 template <
int Ai,
int Aj,
int Ak>
1394 template <
int Ai,
int Aj,
int Ak>
1398 #define GET_ALPHAI_AND_MARK(D,AI) \
1399 ( FMap->setMark(FMap->alpha(D,AI), FMarkNumber), FMap->alpha(D,AI) )
1401 #define IS_UNMARKED(D,AI) \
1402 ( ! FMap->isMarked(FMap->alpha(D,AI), FMarkNumber) )
1404 #define PUSH_AND_MARK(D,AI) \
1405 ( FToTreat.push(GET_ALPHAI_AND_MARK(D,AI)) )
1435 else if (! FToTreat.empty())
1437 nd = FToTreat.front();
1446 #undef PUSH_AND_MARK
1447 #undef IS_SEWED_AND_UNMARKED
1450 template <
int Ai,
int Aj,
int Ak>
1457 template <
int Ai,
int Aj,
int Ak>
1462 return FDartCurrent;
1465 template <
int Ai,
int Aj,
int Ak>
1474 template <
int Ai,
int Aj,
int Ak>
1488 FDartCurrent((
CDart*) ADart1),
1489 FMarkNumber (AMarkNumber),
1503 return FPrevOp !=
OP_END;
1518 #define IS_SEWED_AND_UNMARKED(D,AI) \
1519 ! FMap->isFree(D,AI) && ! FMap->isMarked(FMap->alpha(D,AI), FMarkNumber)
1581 else if (! FToTreat.empty())
1583 nd = FToTreat.front();
1590 #undef IS_SEWED_AND_UNMARKED
1606 return FDartCurrent;
1626 template <
int Ai,
int Aj,
int Ak>
1634 FMap->negateMaskMark(FMarkNumber);
1637 (FMap, FDart1, FMarkNumber);
1642 FMap->negateMaskMark(FMarkNumber);
1647 (FMap, FDart1, FMarkNumber);
1650 template <
int Ai,
int Aj,
int Ak>
1655 FDart1 ((
CDart*) ADart1),
1662 template <
int Ai,
int Aj,
int Ak>
1668 FMap->negateMaskMark(FMarkNumber);
1676 FMap->negateMaskMark(FMarkNumber);
1680 FMap->freeMark(FMarkNumber);
1683 template <
int Ai,
int Aj,
int Ak>
1690 template <
int Ai,
int Aj,
int Ak>
1697 template <
int Ai,
int Aj,
int Ak>
1701 return FIt->prevOperationType();
1704 template <
int Ai,
int Aj,
int Ak>
1708 return FIt->operator*();
1711 template <
int Ai,
int Aj,
int Ak>
1720 template <
int Ai,
int Aj,
int Ak>
1753 const CDart* ADart1) :
1755 FDart1 ((
CDart*) ADart1),
1802 return FIt->operator*();
1821 template <
int Ai,
int Aj,
int Ak>
1831 FIt2 = FAllCoverDarts.begin();
1834 template <
int Ai,
int Aj,
int Ak>
1845 template <
int Ai,
int Aj,
int Ak>
1852 while (! FAllCoverDarts.empty())
1854 FMap->unsetMark(FAllCoverDarts.front(), FMarkNumber);
1855 FAllCoverDarts.pop_front();
1858 FMap->freeMark(FMarkNumber);
1861 template <
int Ai,
int Aj,
int Ak>
1866 return FIt1->cont();
1868 return FIt2 != FAllCoverDarts.end();
1871 template <
int Ai,
int Aj,
int Ak>
1881 template <
int Ai,
int Aj,
int Ak>
1886 return FIt1->prevOperationType();
1891 template <
int Ai,
int Aj,
int Ak>
1898 return FIt1->operator*();
1903 template <
int Ai,
int Aj,
int Ak>
1912 template <
int Ai,
int Aj,
int Ak>
1930 FIt2 = FAllCoverDarts.begin();
1948 while (! FAllCoverDarts.empty())
1951 FAllCoverDarts.pop_front();
1961 return FIt1->
cont();
1963 return FIt2 != FAllCoverDarts.end();
1990 return FIt1->operator*();
2032 return FCurrent != NULL;
2039 FCurrent = FCurrent->
getNext();
2074 const CDart* ADart1,
2075 int AMarkNumber,
int ADimension) :
2077 FCurrentDart((
CDart*) ADart1),
2078 FMarkNumber (AMarkNumber),
2079 FBorderDim (ADimension),
2094 return FPrevOp !=
OP_END;
2107 CDart* n = FCurrentDart;
2110 if (FBorderDim != 0)
2115 !
FMap->
isFree(n, FBorderDim-1) && n != FCurrentDart);
2125 for (
int i=3; i>=0; --i)
2126 if ((i<FBorderDim-1 || i>FBorderDim+1) &&
2130 FToTreat.push(
FMap->
alpha(FCurrentDart, i));
2134 if (FToTreat.empty())
2138 FCurrentDart = FToTreat.top();
2148 return FCurrentDart;
2197 const CDart* ADart1,
int ADim) :
2199 FDart1 ((
CDart*) ADart1),
2243 return FIt->operator*();
2268 #endif // DYNAMIC_COVERAGE_HH