コード例 #1
0
ファイル: graph.cpp プロジェクト: VolkerChristian/qucs
// ---------------------------------------------------------------------
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);
}
コード例 #2
0
ファイル: graph.cpp プロジェクト: AMDmi3/qucs
// ---------------------------------------------------------------------
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);
}
コード例 #3
0
ファイル: SlvPainter.cpp プロジェクト: shooshx/happysolver
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);
    }
}
コード例 #4
0
ファイル: RenderInline.cpp プロジェクト: acss/owb-mirror
void RenderInline::paint(PaintInfo& paintInfo, int tx, int ty)
{
    paintLines(paintInfo, tx, ty);
}