30 #include "../../core/pattern/mvc/ItemController.h"
31 #include "../core/Scene.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/PaperModel.h"
43 this->setFlags(QGraphicsItem::ItemSendsGeometryChanges);
47 m_nameClass = std::string(this->metaObject()->className());
64 drawBackground( painter );
71 if (option->state & QStyle::State_Selected)
73 drawSelection(painter);
86 boundRect = boundingRect();
92 cback.setRed(clrPaper.
getRed());
94 cback.setBlue(clrPaper.
getBlue());
99 cShadow.setRed(clrShadow.
getRed());
100 cShadow.setGreen(clrShadow.
getGreen());
101 cShadow.setBlue(clrShadow.
getBlue());
102 cShadow.setAlpha(clrShadow.
getAlpha());
106 cBorder.setRed(clrBorder.
getRed());
107 cBorder.setGreen(clrBorder.
getGreen());
108 cBorder.setBlue(clrBorder.
getBlue());
109 cBorder.setAlpha(clrBorder.
getAlpha());
112 painter->setBrush(bsh);
114 painter->setPen(pen);
126 QRectF boxShadow(boundRect.x() + shadowPadding, boundRect.y(), boundRect.width() - shadowPadding, boundRect.height() - shadowPadding);
127 painter->drawRect(boxShadow);
130 painter->setBrush(bsh);
132 QRectF boxPaper = QRectF(boundRect.x(), boundRect.y() + shadowPadding, boundRect.width() - shadowPadding, boundRect.height() - shadowPadding);
133 painter->drawRect(boxPaper);
Abstract class to represent an observable. "Model" part of MVC component.
Class that represents a "Model" part of Paper MVC component. Its coordinate system is the same of sce...
int getRed() const
It returns the red component color value (a value from 0 to 255).
PaperItem(ItemController *controller, Observable *o)
Constructor.
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 te::color::RGBAColor getBorderColor()
Returns the border color of the MVC component.
Abstract class that represents a graphic item. This object is of type QGraphicsObject.
virtual ~PaperItem()
Destructor.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Mandatory implementation from QGraphicsItem.
bool m_canChangeGraphicOrder
Define if item can send to back or bring to front.
int getAlpha() const
It returns the alpha component color value (a value from 0 to 255).
virtual te::color::RGBAColor getPaperColor()
std::string m_nameClass
Class name.
virtual double getShadowPadding()
virtual void drawPaper(QPainter *painter)
virtual void getPaperSize(double &w, double &h)
Returns paper size. Height and Width.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual te::color::RGBAColor getShadowColor()
virtual PaperConfig * getPaperConfig() const
Class that represents a graphic sheet of paper. Its coordinate system is the same of scene (millimete...