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


C++ MgShape::shape方法代码示例

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


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

示例1: eraseWnd

void MgCmdManagerImpl::eraseWnd(const MgMotion* sender)
{
    Box2d snap(sender->view->xform()->getWndRectM());
    std::vector<int> delIds;
    void *it = NULL;
    MgShapes* s = sender->view->shapes();

    for (MgShape* shape = s->getFirstShape(it); shape; shape = s->getNextShape(it)) {
        if (shape->shape()->hitTestBox(snap)) {
            delIds.push_back(shape->getID());
        }
    }
    s->freeIterator(it);

    if (!delIds.empty()
            && sender->view->shapeWillDeleted(s->findShape(delIds.front()))) {
        MgShapesLock locker(MgShapesLock::Remove, sender->view);

        for (std::vector<int>::iterator i = delIds.begin(); i != delIds.end(); ++i) {
            MgShape* shape = s->findShape(*i);
            if (shape && sender->view->removeShape(shape)) {
                shape->release();
            }
        }
        sender->view->regenAll();
    }
}
开发者ID:rhcad,项目名称:touchvg-v0.6,代码行数:27,代码来源:mgcmdmgr2.cpp

示例2: touchMoved

bool MgCmdErase::touchMoved(const MgMotion* sender)
{
    Box2d snap(sender->startPointM, sender->pointM);
    void *it = NULL;
    MgShape* shape = m_boxsel ? sender->view->shapes()->getFirstShape(it) : NULL;
    
    m_delIds.clear();
    for (; shape; shape = sender->view->shapes()->getNextShape(it)) {
        if (isIntersectMode(sender) ? shape->shape()->hitTestBox(snap)
            : snap.contains(shape->shape()->getExtent())) {
            m_delIds.push_back(shape->getID());
        }
    }
    sender->view->shapes()->freeIterator(it);
    sender->view->redraw(false);
    
    return true;
}
开发者ID:thinkfeed,项目名称:touchvg,代码行数:18,代码来源:mgcmderase.cpp

示例3: _transform

void MgComposite::_transform(const Matrix2d& mat)
{
    void* it;
    for (MgShape* sp = _shapes->getFirstShape(it); sp;
        sp = _shapes->getNextShape(it)) {
        sp->shape()->transform(mat);
    }
    _shapes->freeIterator(it);
}
开发者ID:arthur-zhang,项目名称:touchvg,代码行数:9,代码来源:mgcomposite.cpp

示例4: _offset

bool MgGroup::_offset(const Vector2d& vec, int segment)
{
    MgShape* sp = _shapes->findShape(segment);

    if (sp && canOffsetShapeAlone(sp)) {
        return sp->shape()->offset(vec, -1);
    }

    return __super::_offset(vec, segment);
}
开发者ID:cw2018,项目名称:touchvg,代码行数:10,代码来源:mgcomposite.cpp

示例5: _update

void MgComposite::_update()
{
    void* it;
    _extent.empty();

    for (MgShape* sp = _shapes->getFirstShape(it); sp;
        sp = _shapes->getNextShape(it)) {
        sp->shape()->update();
        _extent.unionWith(sp->shapec()->getExtent());
    }
    _shapes->freeIterator(it);
}
开发者ID:arthur-zhang,项目名称:touchvg,代码行数:12,代码来源:mgcomposite.cpp

示例6: _offset

bool MgComposite::_offset(const Vector2d& vec, int)
{
    void* it;
    int n = 0;

    for (MgShape* sp = _shapes->getFirstShape(it); sp;
        sp = _shapes->getNextShape(it)) {
        n += sp->shape()->offset(vec, -1) ? 1 : 0;
    }
    _shapes->freeIterator(it);

    return n > 0;
}
开发者ID:arthur-zhang,项目名称:touchvg,代码行数:13,代码来源:mgcomposite.cpp


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