// --------------------------------------------------------------------- void Graph::paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) { Q_UNUSED(item); Q_UNUSED(widget); if(!ScrPoints.size()) return; // need to know parent to draw based on its coordinates const Diagram *parent= this->parentDiagram(); if(ElemSelected) { /// \todo PrintScale //painter->setPen(QPen(Qt::darkGray,Thick*p->PrintScale+4)); painter->setPen(QPen(Qt::darkGray,Thick)); paintLines(painter, parent->cx , parent->cy); //painter->setPen(QPen(Qt::white, Thick*p->PrintScale, Qt::SolidLine)); painter->setPen(QPen(Qt::white, Thick, Qt::SolidLine)); paintLines(painter, parent->cx, parent->cy); return; } // **** not selected **** //painter->setPen(QPen(QColor(Color), Thick*p->PrintScale, Qt::SolidLine)); painter->setPen(QPen(QColor(Color), Thick, Qt::SolidLine)); paintLines(painter, parent->cx, parent->cy); }
// --------------------------------------------------------------------- void Graph::paint(ViewPainter *p, int x0, int y0) { if(ScrPoints == 0) return; if(isSelected) { p->Painter->setPen(QPen(Qt::darkGray,Thick*p->PrintScale+4)); paintLines(p, x0, y0); p->Painter->setPen(QPen(Qt::white, Thick*p->PrintScale, Qt::SolidLine)); paintLines(p, x0, y0); return; } // **** not selected **** p->Painter->setPen(QPen(QColor(Color), Thick*p->PrintScale, Qt::SolidLine)); paintLines(p, x0, y0); }
void SlvPainter::paint(BaseGLWidget* context, bool fTargets, int singleChoise, int upToStep, ELinesDraw cfgLines) const { M_ASSERT(m_scube != nullptr); M_ASSERT(m_scube->shape != nullptr); context->model.translate(0,0,+1); //cout << "*****" << endl; if (singleChoise < 0) { for (int f = 0; f < m_scube->dt.size(); ++f) { if (upToStep >= 0 && f >= upToStep) // step by step support break; if (m_scube->dt[f].abs_sc == -1) // piece not there (solution transformed) continue; mglCheckErrorsC("x3"); paintPiece(f, context, fTargets); mglCheckErrorsC("x4"); if ((!fTargets) && (cfgLines != LINES_NONE)) { bool linesSingle = false; if (upToStep >= 0) // step by step support { // this is somewhat of a PATCH that doesn't work completely well to make the edges have somewhat proper lines // since we don't want to regenerate to IFS for every stage (and even that doesn't work so well, see flat10x10) const int *knei = m_scube->shape->faces[f].nei; linesSingle = (knei[0] > upToStep) || (knei[1] > upToStep) || (knei[2] > upToStep) || (knei[3] > upToStep); } paintLines(f, linesSingle, context, cfgLines); mglCheckErrorsC("x5"); } } } else { paintPiece(singleChoise, context, fTargets); if ((!fTargets) && (cfgLines == LINES_ALL)) // in single choise, do lines only if ALL (and not if BLACK) paintLines(singleChoise, true, context, cfgLines); } }
void RenderInline::paint(PaintInfo& paintInfo, int tx, int ty) { paintLines(paintInfo, tx, ty); }