void EllipseObject::vulcanize() { qDebug("EllipseObject vulcanize()"); updateRubber(); setObjectRubberMode(OBJ_RUBBER_OFF); }
void LineObject::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* /*widget*/) { QGraphicsScene* objScene = scene(); if(!objScene) return; QPen paintPen = pen(); painter->setPen(paintPen); updateRubber(painter); if(option->state & QStyle::State_Selected) { paintPen.setStyle(Qt::DashLine); } if(objScene->property(ENABLE_LWT).toBool()) { paintPen = lineWeightPen(); } painter->setPen(paintPen); if(objectRubberMode() != OBJ_RUBBER_LINE) painter->drawLine(line()); //TODO: This is the initial concept for what realistic rendering be like. It's somewhat decent but needs improvement. if(objScene->property(ENABLE_LWT).toBool() && objScene->property(ENABLE_REAL).toBool()) { painter->setPen(objectColor().darker(150)); //TODO: Improve this for black and dark colors QPainterPathStroker stroker; stroker.setWidth(0.35); stroker.setCapStyle(Qt::RoundCap); stroker.setJoinStyle(Qt::RoundJoin); QPainterPath realPath = stroker.createStroke(path()); painter->drawPath(realPath); QLinearGradient grad(mapFromScene(objectMidPoint()), mapFromScene(objectEndPoint1())); grad.setColorAt(0, objectColor()); grad.setColorAt(1, objectColor().darker(150)); //TODO: Improve this for black and dark colors grad.setSpread(QGradient::ReflectSpread); painter->fillPath(realPath, QBrush(grad)); } }
void PolygonObject::vulcanize() { qDebug("PolygonObject vulcanize()"); updateRubber(); setObjectRubberMode(OBJ_RUBBER_OFF); }
void EllipseObject::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* /*widget*/) { QGraphicsScene* objScene = scene(); if(!objScene) return; QPen paintPen = pen(); if(option->state & QStyle::State_Selected) { paintPen.setStyle(Qt::DashLine); } if(objScene->property(ENABLE_LWT).toBool()) { paintPen = lineWeightPen(); } painter->setPen(paintPen); updateRubber(painter); painter->drawEllipse(rect()); }
void CDTMapToolSelectTrainingSamples::setSampleID(QUuid id) { if (id.isNull()) return; clearRubberBand(); model->clear(); model->setQuery(QString("select name,id from category where imageid = " "(select imageid from segmentationlayer where id = " "(select segmentationid from sample_segmentation " "where id = '%1'))").arg(id), QSqlDatabase::database("category")); sampleID = id; updateRubber(); }
void PolygonObject::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* /*widget*/) { QGraphicsScene* objScene = scene(); if(!objScene) return; QPen paintPen = pen(); painter->setPen(paintPen); updateRubber(painter); if(option->state & QStyle::State_Selected) { paintPen.setStyle(Qt::DashLine); } if(objScene->property(ENABLE_LWT).toBool()) { paintPen = lineWeightPen(); } painter->setPen(paintPen); painter->drawPath(normalPath); QPainterPath::Element zero = normalPath.elementAt(0); QPainterPath::Element last = normalPath.elementAt(normalPath.elementCount()-1); painter->drawLine(QPointF(zero.x, zero.y), QPointF(last.x, last.y)); }