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/PolygonModel.h"
41 #include <QGraphicsSceneMouseEvent>
42 #include <QStyleOptionGraphicsItem>
48 m_nameClass = std::string(this->metaObject()->className());
65 drawBackground(painter);
72 if (option->state & QStyle::State_Selected)
74 drawSelection(painter);
92 cpen.setRed(clrLne.
getRed());
101 painter->drawPolygon(m_poly);
Abstract class to represent an observable. "Model" part of MVC component.
int getRed() const
It returns the red component color value (a value from 0 to 255).
int getBlue() const
It returns the blue component color value (a value from 0 to 255).
int getGreen() const
It returns the green component color value (a value from 0 to 255).
Abstract class to represent a controller. "Controller" part of MVC component. All classes representin...
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented from QGraphicsItem.
PolygonItem(ItemController *controller, Observable *o)
virtual te::color::RGBAColor getLineColor()
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
std::string m_nameClass
Class name.
virtual void drawPolygon(QPainter *painter)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.