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


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

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


在下文中一共展示了MgShape::release方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: touchEnded

bool MgCmdErase::touchEnded(const MgMotion* sender)
{
    MgShapes* s = sender->view->shapes();
    
    if (!m_delIds.empty()
        && sender->view->shapeWillDeleted(s->findShape(m_delIds.front()))) {
        MgShapesLock locker(s, MgShapesLock::Remove);
        int count = 0;
        
        for (std::vector<int>::iterator it = m_delIds.begin(); it != m_delIds.end(); ++it) {
            MgShape* shape = s->findShape(*it);
            if (shape && sender->view->removeShape(shape)) {
                shape->release();
                count++;
            }
        }
        if (count > 0) {
            sender->view->regen();
        }
    }
    
    m_delIds.clear();
    m_boxsel = false;
    sender->view->redraw(false);
    
    return true;
}
开发者ID:thinkfeed,项目名称:touchvg,代码行数:27,代码来源:mgcmderase.cpp

示例3: click

bool MgCmdErase::click(const MgMotion* sender)
{
    MgShape* shape = hitTest(sender);
    if (shape && sender->view->shapeWillDeleted(shape)) {
        MgShapesLock locker(sender->view->shapes(), MgShapesLock::Remove);
        if (sender->view->removeShape(shape)) {
            shape->release();
            sender->view->regen();
        }
    }
    
    return true;
}
开发者ID:thinkfeed,项目名称:touchvg,代码行数:13,代码来源:mgcmderase.cpp


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