本文整理汇总了C++中MgCommand::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ MgCommand::draw方法的具体用法?C++ MgCommand::draw怎么用?C++ MgCommand::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MgCommand
的用法示例。
在下文中一共展示了MgCommand::draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDynDraw
void CDrawShapeView::OnDynDraw(GiGraphics* gs)
{
MgCommand* cmd = mgGetCommandManager()->getCommand();
if (cmd) {
cmd->draw(&m_proxy->motion, gs);
}
}
示例2: draw
bool TransformCmd::draw(const MgMotion* sender, GiGraphics* gs)
{
if (_lastCmd)
_lastCmd->draw(sender, gs);
char text[20];
GiContext ctx(-10, GiColor(255, 0, 0, 128));
gs->drawLine(&ctx, getPointM(0, sender), getPointM(1, sender));
Point2d pt(getPointM(1, sender) * gs->xf().modelToDisplay());
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC8
sprintf_s(text, sizeof(text), "X %d %dd",
#else
sprintf(text, "X %d %dd",
#endif
mgRound(_axis[0].length()), mgRound(_axis[0].angle2() * _M_R2D));
gs->rawTextCenter(text, pt.x, pt.y, 40);
ctx.setLineColor(GiColor(0, 0, 255, 128));
gs->drawLine(&ctx, getPointM(0, sender), getPointM(2, sender));
pt = getPointM(2, sender) * gs->xf().modelToDisplay();
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC8
sprintf_s(text, sizeof(text), "Y %d %dd",
#else
sprintf(text, "Y %d %dd",
#endif
mgRound(_axis[1].length()), mgRound(_axis[1].angle2() * _M_R2D));
gs->rawTextCenter(text, pt.x, pt.y, 40);
return true;
}
示例3: drawCommand
bool GiCoreViewImpl::drawCommand(GcBaseView* view, const MgMotion& motion, GiGraphics& gs)
{
bool ret = false;
if (view == curview) {
MgDynShapeLock locker(false, this);
MgCommand* cmd = _cmds->getCommand();
ret = cmd && cmd->draw(&motion, &gs);
if (ret && cmd->isDrawingCommand()) {
getCmdSubject()->drawInShapeCommand(&motion, cmd, &gs);
}
}
return ret;
}