30 #include "../../core/pattern/mvc/ItemController.h"
31 #include "../../core/AbstractScene.h"
32 #include "../../core/pattern/mvc/Observable.h"
33 #include "../../../color/RGBAColor.h"
34 #include "../../../qt/widgets/Utils.h"
35 #include "../../../geometry/Envelope.h"
36 #include "../../../common/STLUtils.h"
37 #include "../../item/ImageModel.h"
40 #include <QStyleOptionGraphicsItem>
45 m_nameClass = std::string(this->metaObject()->className());
62 drawBackground(painter);
69 if (option->state & QStyle::State_Selected)
71 drawSelection(painter);
83 QRectF boundRect = boundingRect();
86 if(fileName.compare(
"") == 0)
91 QImage img(fileName.c_str());
94 QRectF sourceRect(0, 0, img.width(), img.height());
96 painter->drawImage(boundRect, img, sourceRect);
Abstract class to represent an observable. "Model" part of MVC component.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented from QGraphicsItem.
Abstract class to represent a controller. "Controller" part of MVC component. All classes representin...
Abstract class that represents a graphic item. This object is of type QGraphicsObject.
std::string m_nameClass
Class name.
Class that represents a "Model" part of Image MVC component. Its coordinate system is the same of sce...
virtual std::string getFileName()
Change file name.
virtual void drawImage(QPainter *painter)
Drawing method of a ellipse.
ImageItem(ItemController *controller, Observable *o)
Constructor.
virtual ~ImageItem()
Destructor.