bool MgCmdDrawEllipse::draw(const MgMotion* sender, GiGraphics* gs) { if (getStep() > 0 && sender->dragging()) { GiContext ctxshap(0, GiColor(0, 0, 255, 128), kGiLineDash); gs->drawRect(&ctxshap, dynshape()->shape()->getExtent()); } return MgCmdDrawRect::draw(sender, gs); }
bool MgCmdDrawEllipse::draw(const MgMotion* sender, GiGraphics* gs) { if (m_step > 0 && sender->dragging) { GiContext ctxshap(0, GiColor(0, 0, 255, 128), kGiLineDash); bool antiAlias = gs->setAntiAliasMode(false); gs->drawRect(&ctxshap, dynshape()->shape()->getExtent()); gs->setAntiAliasMode(antiAlias); } return MgCmdDrawRect::draw(sender, gs); }
void MgCmdErase::gatherShapes(const MgMotion* sender, MgShapes* shapes) { if (m_boxsel) { MgShapeT<MgRect> shape; GiContext ctxshap(0, GiColor(0, 0, 255, 128), isIntersectMode(sender) ? kGiLineDash : kGiLineSolid, GiColor(0, 0, 255, 32)); *shape.context() = ctxshap; ((MgRect*)shape.shape())->setRect2P(sender->startPointM, sender->pointM); shapes->addShape(shape); } }
bool MgCmdErase::draw(const MgMotion* sender, GiGraphics* gs) { if (m_boxsel) { GiContext ctxshap(0, GiColor(0, 0, 255, 80), isIntersectMode(sender) ? GiContext::kDashLine : GiContext::kSolidLine, GiColor(0, 0, 255, 24)); gs->drawRect(&ctxshap, Box2d(sender->startPtM, sender->pointM)); } GiContext ctx(-4, GiColor(64, 64, 64, 128)); for (std::vector<int>::const_iterator it = m_delIds.begin(); it != m_delIds.end(); ++it) { const MgShape* shape = sender->view->shapes()->findShape(*it); if (shape) { shape->draw(1, *gs, &ctx, -1); } } return true; }
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; }