当前位置: 首页>>代码示例>>C++>>正文


C++ Corner::copyAsNotFromTilePlane方法代码示例

本文整理汇总了C++中Corner::copyAsNotFromTilePlane方法的典型用法代码示例。如果您正苦于以下问题:C++ Corner::copyAsNotFromTilePlane方法的具体用法?C++ Corner::copyAsNotFromTilePlane怎么用?C++ Corner::copyAsNotFromTilePlane使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Corner的用法示例。


在下文中一共展示了Corner::copyAsNotFromTilePlane方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CornerSequence

CornerSequence *CornerSequence::copy() {
    CornerSequence *copiedCornerSequence = new CornerSequence(
        cornerHorizontalTilePlane->getXStart(),
        cornerHorizontalTilePlane->getYStart(),
        cornerHorizontalTilePlane->getXEnd(),
        cornerHorizontalTilePlane->getYEnd(),
        macros->size(), initialWidthSortedMacros, initialHeightSortedMacros);
    for (int i = 0; i < fixedMacros->size(); ++i) {
        copiedCornerSequence->addFixedMacro(fixedMacros->at(i));
    }
    for (int i = 0; i < macros->size(); ++i) {
        Corner *corner = corners->at(i);
        if (corner != 0) {
            corner = corner->copyAsNotFromTilePlane();
        }
        copiedCornerSequence->addMacroCornerPair(macros->at(i), corner);
        copiedCornerSequence->setOrientation(i, orientations->at(i));
    }
    return copiedCornerSequence;
}
开发者ID:areong,项目名称:CornerMacroPlacer,代码行数:20,代码来源:CornerSequence.cpp

示例2: placeMacrosWithIncrementalUpdate


//.........这里部分代码省略.........
                    if (cornerHorizontalTilePlane->checkAreaEmptyCheckFromTop(
                        macroXStart, macroYStart, macroXEnd, macroYEnd,
                        corner->getHorizontalTile())) {
                        // Does not overlap.
                        break;
                    }
                }
            }

            // corner is not valid.
            // Select another Corner.
            sizeQuadtree->remove(corner);
            temporarilyRemovedCorners->push_back(corner);
            corner = static_cast<Corner *>(sizeQuadtree->getPointRandomlyByXY(macroWidth, macroHeight, true, true));
            if (corner == 0) {
                // No Corner is available.
                placedUnsuccessfully = true;
                indexPlacedUnsuccessfully = i;
                break;
            }
        }
        if (placedUnsuccessfully) {
            break;
        }
        // A valid Corner is selected.
        // Insert removed Corners back to quadtrees.
        for (int j = 0; j < temporarilyRemovedCorners->size(); ++j) {
            sizeQuadtree->insert(temporarilyRemovedCorners->at(j));
        }
        temporarilyRemovedCorners->clear();

        // Copy the valid Corner and replace corners->at(i)
        // because the valid Corner will be deleted after macro is placed.
        corners->at(i) = corner->copyAsNotFromTilePlane();

        // Place macro at corner.
        macro->setXStart(macroXStart);
        macro->setYStart(macroYStart);
        macro->updateRectanglesPosition();
        Tile *horizontalTile = new Tile(macroXStart, macroYStart, macroXEnd, macroYEnd, true);
        Tile *verticalTile = new Tile(macroXStart, macroYStart, macroXEnd, macroYEnd, true);
        Tile *startHorizontalTile;
        Tile *startVerticalTile;
        switch (cornerDirection) {
        case 0:
            // Bl
            startHorizontalTile = corner->getHorizontalTile();
            startVerticalTile = corner->getVerticalTile();
            break;
        case 1:
            // Br
            startHorizontalTile = corner->getHorizontalTile();
            startVerticalTile = cornerVerticalTilePlane->findTile(macroXStart, macroYStart, corner->getVerticalTile());
            break;
        case 2:
            // Tl
            startHorizontalTile = cornerHorizontalTilePlane->findTile(macroXStart, macroYStart, corner->getHorizontalTile());
            startVerticalTile = corner->getVerticalTile();
            break;
        case 3:
            // Tr
            startHorizontalTile = cornerHorizontalTilePlane->findTile(macroXStart, macroYStart, corner->getHorizontalTile());
            startVerticalTile = cornerVerticalTilePlane->findTile(macroXStart, macroYStart, corner->getVerticalTile());
            break;
        }
        cornerHorizontalTilePlane->placeSolidTileGivenBothStartTiles(horizontalTile, startHorizontalTile, startVerticalTile);
开发者ID:areong,项目名称:CornerMacroPlacer,代码行数:67,代码来源:CornerSequence.cpp


注:本文中的Corner::copyAsNotFromTilePlane方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。