PolygonAnnotation::PolygonAnnotation(ShapeAnnotation *pShapeAnnotation, GraphicsView *pGraphicsView) : ShapeAnnotation(true, pGraphicsView, 0) { updateShape(pShapeAnnotation); setShapeFlags(true); mpGraphicsView->addItem(this); connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed())); connect(pShapeAnnotation, SIGNAL(added()), this, SLOT(referenceShapeAdded())); connect(pShapeAnnotation, SIGNAL(changed()), this, SLOT(referenceShapeChanged())); connect(pShapeAnnotation, SIGNAL(deleted()), this, SLOT(referenceShapeDeleted())); }
PolygonAnnotation::PolygonAnnotation(QString annotation, GraphicsView *pGraphicsView) : ShapeAnnotation(false, pGraphicsView, 0) { // set the default values GraphicItem::setDefaults(); FilledShape::setDefaults(); ShapeAnnotation::setDefaults(); // set users default value by reading the settings file. ShapeAnnotation::setUserDefaults(); parseShapeAnnotation(annotation); setShapeFlags(true); }
BitmapAnnotation::BitmapAnnotation(QString classFileName, QString annotation, GraphicsView *pGraphicsView) : ShapeAnnotation(false, pGraphicsView, 0) { mpComponent = 0; mClassFileName = classFileName; // set the default values GraphicItem::setDefaults(); ShapeAnnotation::setDefaults(); // set users default value by reading the settings file. ShapeAnnotation::setUserDefaults(); parseShapeAnnotation(annotation); setShapeFlags(true); }
RectangleAnnotation::RectangleAnnotation(QString annotation, bool inheritedShape, GraphicsView *pGraphicsView) : ShapeAnnotation(inheritedShape, pGraphicsView, 0) { // set the default values GraphicItem::setDefaults(); FilledShape::setDefaults(); ShapeAnnotation::setDefaults(); // set users default value by reading the settings file. ShapeAnnotation::setUserDefaults(); parseShapeAnnotation(annotation); setShapeFlags(true); mpGraphicsView->addShapeObject(this); mpGraphicsView->scene()->addItem(this); connect(this, SIGNAL(updateClassAnnotation()), mpGraphicsView, SLOT(addClassAnnotation())); }
/*! * \brief RectangleAnnotation::RectangleAnnotation * Used by OMSimulator FMU ModelWidget\n * We always make this shape as inherited shape since its not allowed to be modified. * \param pGraphicsView */ RectangleAnnotation::RectangleAnnotation(GraphicsView *pGraphicsView) : ShapeAnnotation(true, pGraphicsView, 0) { // set the default values GraphicItem::setDefaults(); FilledShape::setDefaults(); ShapeAnnotation::setDefaults(); // create a grey rectangle setLineColor(QColor(0, 0, 0)); setFillColor(QColor(240, 240, 240)); setFillPattern(StringHandler::FillSolid); QList<QPointF> extents; extents << QPointF(-100, -100) << QPointF(100, 100); setExtents(extents); setPos(mOrigin); setRotation(mRotation); setShapeFlags(true); }
/*! * \brief BitmapAnnotation::BitmapAnnotation * Used by OMSimulator FMU ModelWidget\n * We always make this shape as inherited shape since its not allowed to be modified. * \param classFileName * \param pGraphicsView */ BitmapAnnotation::BitmapAnnotation(QString classFileName, GraphicsView *pGraphicsView) : ShapeAnnotation(true, pGraphicsView, 0) { mpComponent = 0; mClassFileName = classFileName; // set the default values GraphicItem::setDefaults(); ShapeAnnotation::setDefaults(); // set users default value by reading the settings file. ShapeAnnotation::setUserDefaults(); QList<QPointF> extents; extents << QPointF(-100, -100) << QPointF(100, 100); setExtents(extents); setPos(mOrigin); setRotation(mRotation); setShapeFlags(true); setFileName(mClassFileName); if (!mFileName.isEmpty() && QFile::exists(mFileName)) { mImage.load(mFileName); } else { mImage = QImage(":/Resources/icons/bitmap-shape.svg"); } }