• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dynshape函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dynshape函数的典型用法代码示例。如果您正苦于以下问题:C++ dynshape函数的具体用法?C++ dynshape怎么用?C++ dynshape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: dynshape

bool MgCmdDrawLine::touchMoved(const MgMotion* sender)
{
    dynshape()->shape()->setPoint(1, snapPoint(sender));
    dynshape()->shape()->update();

    return MgCommandDraw::touchMoved(sender);
}
开发者ID:gkrists,项目名称:TouchVG,代码行数:7,代码来源:mgdrawline.cpp


示例2: pnt

bool MgCmdDrawLines::touchEnded(const MgMotion* sender)
{
    Point2d pnt(snapPoint(sender));
    dynshape()->shape()->setPoint(m_index, pnt);
    
    bool closed = checkClosed(sender, pnt);
    MgBaseLines* lines = (MgBaseLines*)dynshape()->shape();
    
    dynshape()->shape()->update();
    
    if (canAddPoint(sender, pnt)) {
        if (closed || needEnded()) {
            if (closed) {
                lines->removePoint(m_step);
            }
            addShape(sender);
            m_step = 0;
            _lastClicked = false;
        }
        else if (m_step <= dynshape()->shape()->getPointCount()) {
            m_step++;
        }
    }
    else if (m_step > 1) {
        if (m_step >= dynshape()->shape()->getPointCount()) {
            m_step--;
        }
        lines->removePoint(m_index);
    }
    
    return MgCommandDraw::touchEnded(sender);
}
开发者ID:CharlyZhang,项目名称:vgcore,代码行数:32,代码来源:mgdrawlines.cpp


示例3: mgLineHalfWidthModel

bool MgCmdDrawFreeLines::touchMoved(const MgMotion* sender)
{
    MgBaseLines* lines = (MgBaseLines*)dynshape()->shape();
    
    float closelen  = mgLineHalfWidthModel(dynshape(), sender) + mgDisplayMmToModel(5, sender);
    float closedist = sender->pointM.distanceTo(dynshape()->shape()->getPoint(0));
    bool  closed    = (m_step > 2 && closedist < closelen
        && dynshape()->shape()->getExtent().width() > closedist * 1.5f
        && dynshape()->shape()->getExtent().height() > closedist * 1.5f);
    
    if (m_step > 2 && dynshape()->shape()->isClosed() != closed) {
        lines->setClosed(closed);
        if (closed)
            lines->removePoint(m_step);
        else
            lines->addPoint(sender->pointM);
    }
    if (!closed) {
        dynshape()->shape()->setPoint(m_step, sender->pointM);
        if (m_step > 0 && canAddPoint(sender, false)) {
            m_step++;
            if (m_step >= dynshape()->shape()->getPointCount()) {
                ((MgBaseLines*)dynshape()->shape())->addPoint(sender->pointM);
            }
        }
    }
    dynshape()->shape()->update();

    return _touchMoved(sender);
}
开发者ID:huangzongwu,项目名称:touchvg,代码行数:30,代码来源:mgdrawlines.cpp


示例4: dynshape

bool MgCmdDrawTriangle::touchMoved(const MgMotion* sender)
{
    dynshape()->shape()->setPoint(m_step, snapPoint(sender));
    dynshape()->shape()->update();

    return _touchMoved(sender);
}
开发者ID:fanliugen,项目名称:touchvg,代码行数:7,代码来源:mgdrawtriang.cpp


示例5: dynshape

bool MgCmdDrawFreeLines::backStep(const MgMotion* sender)
{
    if (m_step > 2) {                   // 去掉倒数第二个点,倒数第一点是临时动态点
        ((MgBaseLines*)dynshape()->shape())->removePoint(m_step - 1);
        dynshape()->shape()->update();
    }
    return MgCommandDraw::backStep(sender);
}
开发者ID:gkrists,项目名称:TouchVG,代码行数:8,代码来源:mgdrawfreelines.cpp


示例6: dynshape

bool MgCmdDrawDot::touchBegan(const MgMotion* sender)
{
    m_step = 1;
    dynshape()->shape()->setPoint(0, snapPoint(sender, true));
    dynshape()->shape()->update();
    
    return MgCommandDraw::touchBegan(sender);
}
开发者ID:shuangyou,项目名称:TouchVGCore,代码行数:8,代码来源:mgdrawline.cpp


示例7: snapPoint

bool MgCmdDrawRect::touchBegan(const MgMotion* sender)
{
    m_step = 1;
    m_startPt = snapPoint(sender, true);
    ((MgBaseRect*)dynshape()->shape())->setRect2P(m_startPt, m_startPt);
    dynshape()->shape()->update();

    return MgCommandDraw::touchBegan(sender);
}
开发者ID:shuangyou,项目名称:TouchVGCore,代码行数:9,代码来源:mgdrawrect.cpp


示例8: dynshape

bool MgCmdDrawSplines::backStep(const MgMotion* sender)
{
    if (m_step > 1) {                   // freehand: 去掉倒数第二个点,倒数第一点是临时动态点
        ((MgBaseLines*)dynshape()->shape())->removePoint(m_freehand ? m_step - 1 : m_step);
        dynshape()->shape()->update();
    }
    
    return MgCommandDraw::backStep(sender);
}
开发者ID:CharlyZhang,项目名称:vgcore,代码行数:9,代码来源:mgdrawsplines.cpp


示例9: dynshape

bool MgCmdDrawLines::undo(bool &enableRecall, const MgMotion* sender)
{
    enableRecall = true;
    if (m_step > 2) {                   // 去掉倒数第二个点,倒数第一点是临时动态点
        ((MgBaseLines*)dynshape()->shape())->removePoint(m_step - 1);
        dynshape()->shape()->update();
    }
    return MgCommandDraw::_undo(sender);
}
开发者ID:huangzongwu,项目名称:touchvg,代码行数:9,代码来源:mgdrawlines.cpp


示例10: dynshape

bool MgCmdDrawSplines::undo(bool &enableRecall, const MgMotion* sender)
{
    enableRecall = m_freehand;
    if (m_step > 1) {                   // freehand: 去掉倒数第二个点,倒数第一点是临时动态点
        ((MgBaseLines*)dynshape()->shape())->removePoint(m_freehand ? m_step - 1 : m_step);
        dynshape()->shape()->update();
    }
    
    return MgCommandDraw::_undo(sender);
}
开发者ID:lincleejun,项目名称:touchvg,代码行数:10,代码来源:mgdrawsplines.cpp


示例11: pt1

bool MgCmdDrawRect::touchMoved(const MgMotion* sender)
{
    Point2d pt1(m_startPt);
    Point2d pt2(snapPoint(sender));
    MgBaseRect* shape = (MgBaseRect*)dynshape()->shape();
    
    shape->setRect2P(pt1, pt2);
    dynshape()->shape()->update();

    return MgCommandDraw::touchMoved(sender);
}
开发者ID:shuangyou,项目名称:TouchVGCore,代码行数:11,代码来源:mgdrawrect.cpp


示例12: dynshape

bool MgCmdDrawGrid::touchMoved(const MgMotion* sender)
{
    if (m_step == 1) {
        return MgCmdDrawRect::touchMoved(sender);
    }
    
    dynshape()->shape()->setHandlePoint(8, snapPoint(sender), 0);
    dynshape()->shape()->update();
    
    return _touchMoved(sender);
}
开发者ID:thinkfeed,项目名称:touchvg,代码行数:11,代码来源:mgdrawrect.cpp


示例13: ctx

bool MgCmdDrawSplines::draw(const MgMotion* sender, GiGraphics* gs)
{
    if (getStep() > 0 && !m_freehand) {
        GiContext ctx(0, GiColor(64, 128, 64, 172), GiContext::kSolidLine, GiColor(0, 64, 64, 128));
        float radius = sender->displayMmToModel(0.8f, gs);
        
        for (int i = 1, n = dynshape()->shape()->getPointCount(); i < 6 && n >= i; i++) {
            gs->drawCircle(&ctx, dynshape()->shape()->getPoint(n - i), radius);
        }
        gs->drawCircle(&ctx, dynshape()->shape()->getPoint(0), radius * 1.5f);
    }
    return MgCommandDraw::draw(sender, gs);
}
开发者ID:CharlyZhang,项目名称:vgcore,代码行数:13,代码来源:mgdrawsplines.cpp


示例14: while

bool MgCmdDrawLines::doubleClick(const MgMotion* sender)
{
    if (m_step > 1) {
        while (m_step > 1 && mgDisplayMmToModel(3.f, sender) >
            sender->pointM.distanceTo(dynshape()->shape()->getPoint(m_step))) {
            ((MgBaseLines*)dynshape()->shape())->removePoint(m_step--);
        }
        _addshape(sender);
        _delayClear();
        m_step = 0;
    }
    return true;
}
开发者ID:huangzongwu,项目名称:touchvg,代码行数:13,代码来源:mgdrawlines.cpp


示例15: ctx

bool MgCmdDrawSplines::draw(const MgMotion* sender, GiGraphics* gs)
{
    if (m_step > 0 && !m_freehand) {
        GiContext ctx(0, GiColor(64, 128, 64, 172), kLineSolid, GiColor(0, 64, 64, 128));
        float radius = gs->xf().displayToModel(4);
        
        for (UInt32 i = 1, n = dynshape()->shape()->getPointCount(); i < 6 && n >= i; i++) {
            gs->drawEllipse(&ctx, dynshape()->shape()->getPoint(n - i), radius);
        }
        gs->drawEllipse(&ctx, dynshape()->shape()->getPoint(0), radius * 1.5f);
    }
    return MgCommandDraw::draw(sender, gs);
}
开发者ID:lincleejun,项目名称:touchvg,代码行数:13,代码来源:mgdrawsplines.cpp


示例16: pnt

bool MgCmdDrawLines::touchEnded(const MgMotion* sender)
{
    Point2d pnt(snapPoint(sender));
    float distmin = mgDisplayMmToModel(2.f, sender);
    bool closed = false;
    
    dynshape()->shape()->setPoint(m_step, pnt);
    
    if (needCheckClosed()) {
        closed = m_step > 2 && pnt.distanceTo(dynshape()->shape()->getPoint(0)) < distmin;
        ((MgBaseLines*)dynshape()->shape())->setClosed(closed);
    }
    
    dynshape()->shape()->update();
    
    if (pnt.distanceTo(dynshape()->shape()->getPoint(m_step - 1)) > distmin) {
        if (closed || needEnded()) {
            if (closed) {
                ((MgBaseLines*)dynshape()->shape())->removePoint(m_step);
            }
            _addshape(sender);
            _delayClear();
            m_step = 0;
        }
        else if (++m_step >= dynshape()->shape()->getPointCount()) {
            ((MgBaseLines*)dynshape()->shape())->addPoint(pnt);
        }
    }
    
    return _touchEnded(sender);
}
开发者ID:huangzongwu,项目名称:touchvg,代码行数:31,代码来源:mgdrawlines.cpp


示例17: draw

bool MgCmdDrawGrid::draw(const MgMotion* sender, GiGraphics* gs)
{
    if (getStep() == 2) {
        gs->drawHandle(dynshape()->getHandlePoint(8), kGiHandleVertex);
    }
    return MgCmdDrawRect::draw(sender, gs);
}
开发者ID:Vito2015,项目名称:vgcore,代码行数:7,代码来源:mgdrawgrid.cpp


示例18: draw

bool MgCmdDrawLines::draw(const MgMotion* sender, GiGraphics* gs)
{
    if (m_step > (needEnded() ? 3 : 2) && !sender->dragging()) {
        gs->drawHandle(dynshape()->shapec()->getExtent().center(), kGiHandleAccept);
    }
    return MgCommandDraw::draw(sender, gs);
}
开发者ID:CharlyZhang,项目名称:vgcore,代码行数:7,代码来源:mgdrawlines.cpp


示例19: setStepPoint

bool MgCommandDraw::_touchMoved2(const MgMotion* sender)
{
    setStepPoint(m_step, snapPoint(sender));
    dynshape()->shape()->update();

    return _touchMoved(sender);
}
开发者ID:thinkfeed,项目名称:touchvg,代码行数:7,代码来源:mgcmddraw.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ e1函数代码示例发布时间:2022-05-30
下一篇:
C++ dynarray_add函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap