QPainterPath SchedulePoint::shape() const
{
    // provide shape of each point
    QRectF rect = outlineRect();
    QPainterPath path;
    path.addRoundRect(rect,roundness(rect.width()), roundness(rect.height()));
    return path;
}
Beispiel #2
0
QPainterPath usecaseclass::shape() const
{
    QRectF rect = outlineRect();

    QPainterPath path;
    path.addRoundRect(rect, roundness(rect.width()),
                      roundness(rect.height()));
    return path;
}
Beispiel #3
0
/** Fill the feature vector v for the Object o */
void getFeatures(Object *o, featureVector v)
{
	v[0]=roundness(o);
	v[1]=rectangularity(o);
	v[2]=secondMoment(o->sm.a, o->sm.b, o->sm.c, o->sm.thetaMin);
	v[3]=secondMoment(o->sm.a, o->sm.b, o->sm.c, o->sm.thetaMax);
}
Beispiel #4
0
QPainterPath EvButton::backgroundPath() const
{
    QPainterPath path;
    if(m_rounded){
        path.addRoundRect(rect(),roundness());
    }
    else{
        path.addRect(rect());
    }

    return path;
}
void SchedulePoint::paint(QPainter *painter,
                          const QStyleOptionGraphicsItem *option, QWidget * /*widget*/)
{
    // draw point itself

    if(option->state & QStyle::State_Selected) {

    }



    if(m_disabled)
    {
        painter->setBrush(QColor(150,150,150));
        painter->setPen(QColor(110,110,110));
    }

    else if(m_selected)
    {
        pen.setWidth(3);
        pen.setColor(QColor(255, 189, 43));
        painter->setPen(pen);
        myBackgroundColor = tempToColor(temp);
        painter->setBrush(myBackgroundColor);
    }
    else
    {
        myBackgroundColor = tempToColor(temp);
        pen.setColor(Qt::white);
        pen.setWidth(1);
        painter->setPen(pen);
        painter->setBrush(myBackgroundColor);
    }

    QRectF rect = outlineRect();
    painter->drawRoundRect(rect, roundness(rect.width()), roundness(rect.height()));
    painter->setPen(Qt::white);
    painter->drawText(rect, Qt::AlignCenter, myText);
}
Beispiel #6
0
void writeObject(FILE *f, Object *o)
{
	double eMin=secondMoment(o->sm.a, o->sm.b, o->sm.c, o->sm.thetaMin);
	
	fprintf(f, "%d %d %d %f %f %f %d %d %d %d %d %d %d %d %d\n",
			o->label, 
			o->fm[0], o->fm[1],
			eMin,
			DEG_PER_RAD*(PI/2 - o->sm.thetaMin),
			roundness(o),
			o->area,
			o->holes,
			o->sm.a, o->sm.b, o->sm.c,
			o->top, o->bottom, o->left, o->right);
}