本文整理汇总了C++中Corner::print方法的典型用法代码示例。如果您正苦于以下问题:C++ Corner::print方法的具体用法?C++ Corner::print怎么用?C++ Corner::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Corner
的用法示例。
在下文中一共展示了Corner::print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillInWastedRegion
void CornerSequence::fillInWastedRegion() {
std::cout << "fillInWastedRegion()\n";
int smallestMacroWidth = widthSortedMacros->getSmallest()->getWidth();
int smallestMacroHeight = heightSortedMacros->getSmallest()->getHeight();
while (true) {
int numFills = 0;
// Try to fill a horizontal empty Tile.
Tile *emptyTile = cornerHorizontalTilePlane->getEmptyTileWithSmallestWidth();
if (emptyTile != 0 && emptyTile->getWidth() < smallestMacroWidth) {
std::cout << "fill horizontalTile\n";
emptyTile->print();
Tile *horizontalTile = new Tile(emptyTile->getXStart(), emptyTile->getYStart(),
emptyTile->getXEnd(), emptyTile->getYEnd(), true);
Tile *verticalTile = new Tile(emptyTile->getXStart(), emptyTile->getYStart(),
emptyTile->getXEnd(), emptyTile->getYEnd(), true);
horizontalTile->setTemporarilySolid();
verticalTile->setTemporarilySolid();
// Find startVerticalTile.
Corner *corner = emptyTile->getBlCorner();
Tile *startVerticalTile;
if (corner == 0) {
corner = emptyTile->getTlCorner();
}
if (corner != 0) {
startVerticalTile = corner->getVerticalTile();
} else {
// If emptyTile has no Corner, than emptyTile's lb and rt
// are empty Tiles, and lb has top Corners and rt has bottom Corners.
startVerticalTile = cornerVerticalTilePlane->findTile(emptyTile->getXStart(), emptyTile->getYStart(),
emptyTile->getRt()->getBlCorner()->getVerticalTile());
}
// Place horizontalTile.
std::cout << "place horizontal\n";
cornerHorizontalTilePlane->placeSolidTileGivenBothStartTiles(horizontalTile, emptyTile, startVerticalTile);
// Place verticalTile.
std::cout << "place vertical\n";
cornerVerticalTilePlane->placeSolidTileGivenBothStartTiles(verticalTile, horizontalTile, startVerticalTile);
cornerHorizontalTilePlane->calculateCurrentCornersWidthAndHeight();
cornerVerticalTilePlane->calculateCurrentCornersWidthAndHeight();
std::cout << "updateQuadtrees()\n";
updateQuadtrees();
std::cout << "updateQuadtrees() end\n";
numFills += 1;
}
// Try to fill a vertical empty Tile.
emptyTile = cornerVerticalTilePlane->getEmptyTileWithSmallestHeight();
if (emptyTile != 0 && emptyTile->getHeight() < smallestMacroHeight) {
std::cout << "fill verticalTile\n";
emptyTile->print();
Tile *horizontalTile = new Tile(emptyTile->getXStart(), emptyTile->getYStart(),
emptyTile->getXEnd(), emptyTile->getYEnd(), true);
Tile *verticalTile = new Tile(emptyTile->getXStart(), emptyTile->getYStart(),
emptyTile->getXEnd(), emptyTile->getYEnd(), true);
horizontalTile->setTemporarilySolid();
verticalTile->setTemporarilySolid();
// Find startHorizontalTile.
Corner *corner = emptyTile->getBlCorner();
Tile *startHorizontalTile;
if (corner == 0) {
corner = emptyTile->getBrCorner();
}
if (corner != 0) {
corner->print();
startHorizontalTile = corner->getHorizontalTile();
cornerHorizontalTilePlane->getBottomRightMostTile()->print();
} else {
// If emptyTile has no Corner, than emptyTile's bl and tr
// are empty Tiles, and bl has right Corners and tr has left Corners.
startHorizontalTile = cornerHorizontalTilePlane->findTile(emptyTile->getXStart(), emptyTile->getYStart(),
emptyTile->getTr()->getBlCorner()->getHorizontalTile());
}
// Place horizontalTile.
std::cout << "place horizontal\n";
horizontalTile->print();
startHorizontalTile->print();
startHorizontalTile->printFourNeighbors();
cornerHorizontalTilePlane->placeSolidTileGivenBothStartTiles(horizontalTile, startHorizontalTile, emptyTile);
// Place verticalTile.
std::cout << "place vertical\n";
cornerVerticalTilePlane->placeSolidTileGivenBothStartTiles(verticalTile, horizontalTile, emptyTile);
cornerHorizontalTilePlane->calculateCurrentCornersWidthAndHeight();
cornerVerticalTilePlane->calculateCurrentCornersWidthAndHeight();
std::cout << "updateQuadtrees()\n";
updateQuadtrees();
std::cout << "updateQuadtrees() end\n";
numFills += 1;
}
// Continue or not.
if (numFills == 0) {
break;
}
}
}