bool MgGroup::_draw(int mode, GiGraphics& gs, const GiContext& ctx, int segment) const { MgShape* sp = _shapes->findShape(segment); if (sp) { return sp->draw(mode, gs, ctx.isNullLine() ? NULL : &ctx, -1); } return __super::_draw(mode, gs, ctx, segment); }
bool MgComposite::_draw(int mode, GiGraphics& gs, const GiContext& ctx, int) const { void* it; int n = 0; for (MgShape* sp = _shapes->getFirstShape(it); sp; sp = _shapes->getNextShape(it)) { n += sp->draw(mode, gs, ctx.isNullLine() ? NULL : &ctx, -1) ? 1 : 0; } _shapes->freeIterator(it); return n > 0; }
bool MgCmdErase::draw(const MgMotion* sender, GiGraphics* gs) { if (m_boxsel) { GiContext ctxshap(0, GiColor(0, 0, 255, 80), isIntersectMode(sender) ? kGiLineDash : kGiLineSolid, GiColor(0, 0, 255, 24)); bool antiAlias = gs->setAntiAliasMode(false); gs->drawRect(&ctxshap, Box2d(sender->startPointM, sender->pointM)); gs->setAntiAliasMode(antiAlias); } GiContext ctx(-4, GiColor(64, 64, 64, 128)); for (std::vector<int>::const_iterator it = m_delIds.begin(); it != m_delIds.end(); ++it) { MgShape* shape = sender->view->shapes()->findShape(*it); if (shape) shape->draw(1, *gs, &ctx); } return true; }