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


C++ KoPathShape::closeSubpath方法代码示例

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


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

示例1: undo

void KoPathBreakAtPointCommand::undo()
{
    KUndo2Command::undo();
    KoPathShape * lastPathShape = 0;

    for (int i = 0; i < m_pointDataList.size(); ++i) {
        const KoPathPointData & pd = m_pointDataList.at(i);
        KoPathShape * pathShape = pd.pathShape;
        KoPathPointIndex pointIndex = pd.pointIndex;
        ++pointIndex.second;
        if (m_closedIndex.at(i).first != -1) {
            m_closedIndex[i] = pathShape->closeSubpath(m_closedIndex.at(i));
        } else {
            pointIndex.second = pointIndex.second + m_closedIndex.at(i).second;
            pathShape->join(pd.pointIndex.first);
        }
        m_points[i] = pathShape->removePoint(pointIndex);

        if (lastPathShape != pathShape) {
            if (lastPathShape) {
                lastPathShape->update();
            }
            lastPathShape = pathShape;
        }
    }
    if (lastPathShape) {
        lastPathShape->update();
    }

    m_deletePoints = true;
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:31,代码来源:KoPathBreakAtPointCommand.cpp

示例2: redo

void KoSubpathJoinCommand::redo()
{
    KUndo2Command::redo();
    KoPathShape * pathShape = m_pointData1.pathShape;

    bool closeSubpath = m_pointData1.pointIndex.first == m_pointData2.pointIndex.first;

    KoPathPoint * point1 = pathShape->pointByIndex(m_pointData1.pointIndex);
    KoPathPoint * point2 = pathShape->pointByIndex(m_pointData2.pointIndex);

    // if the endpoint is has a control point create a contol point for the new segment to be
    // at the symetric position to the exiting one
    if (m_reverse & ReverseFirst || closeSubpath) {
        if (point1->activeControlPoint2())
            point1->setControlPoint1(2.0 * point1->point() - point1->controlPoint2());
    } else if (point1->activeControlPoint1())
        point1->setControlPoint2(2.0 * point1->point() - point1->controlPoint1());
    if (m_reverse & ReverseSecond || closeSubpath) {
        if (point2->activeControlPoint1())
            point2->setControlPoint2(2.0 * point2->point() - point2->controlPoint1());
    } else if (point2->activeControlPoint2())
        point2->setControlPoint1(2.0 * point2->point() - point2->controlPoint2());

    if (closeSubpath) {
        pathShape->closeSubpath(m_pointData1.pointIndex);
    } else {
        if (m_reverse & ReverseFirst) {
            pathShape->reverseSubpath(m_pointData1.pointIndex.first);
        }
        if (m_reverse & ReverseSecond) {
            pathShape->reverseSubpath(m_pointData2.pointIndex.first);
        }
        pathShape->moveSubpath(m_pointData2.pointIndex.first, m_pointData1.pointIndex.first + 1);
        m_splitIndex = m_pointData1.pointIndex;
        m_splitIndex.second = pathShape->subpathPointCount(m_pointData1.pointIndex.first) - 1;
        pathShape->join(m_pointData1.pointIndex.first);
    }
    pathShape->normalize();
    pathShape->update();
}
开发者ID:AninaRJ,项目名称:krita,代码行数:40,代码来源:KoSubpathJoinCommand.cpp


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