33 #include <QGraphicsSceneHoverEvent>
34 #include <QGraphicsSceneMouseEvent>
88 const QStyleOptionGraphicsItem *option,
102 painter->setPen(pen);
103 painter->drawLine(x, y,
w, y);
110 painter->setPen(pen);
115 painter->setBrush(baseColor);
119 baseColor.getHsv(&
h, &s, &v, &
a);
122 if (
h>359) h2 = h2-359;
123 QLinearGradient gradient;
124 gradient.setCoordinateMode(QGradient::ObjectBoundingMode);
125 gradient.setColorAt(0, baseColor.darker(200));
128 gradient.setColorAt(1, QColor::fromHsv(h2, s, v,
a));
129 QBrush brush(gradient);
130 painter->setBrush(brush);
159 DEBTRACE(
"SceneHeaderNodeItem::autoPosNewPort");
181 yTop += nbPorts * deltaY;
186 QPointF topLeft(xLeft, yTop);
193 DEBTRACE(
"SceneHeaderNodeItem::reorganizePorts() " << ss <<
" " <<
_label.toStdString());
202 std::list<SceneInPortItem*>::iterator iti =
_inPorts.begin();
204 for (; iti !=
_inPorts.end(); ++iti)
208 (*iti)->setTopLeft(topLeft);
209 if (isShown) nbPorts++;
212 std::list<SceneOutPortItem*>::iterator ito =
_outPorts.begin();
223 QPointF topLeft(xLeft, yTop);
224 (*ito)->setTopLeft(topLeft);
225 if (isShown) nbPorts++;
239 DEBTRACE(
"SceneHeaderNodeItem::adjustGeometry() " <<
_label.toStdString());
240 prepareGeometryChange();
271 return QRectF(x(), y(), width, height);
276 DEBTRACE(
"SceneHeaderNodeItem::adaptComposedNode " << deltaY);
277 QPointF oldPos(x(),y() - deltaY);
281 bloc->collisionResolv(port, oldPos);
288 DEBTRACE(
"SceneHeaderNodeItem::setEdited " << isEdited);
305 DEBTRACE(
"SceneHeaderNodeItem::setValid " << isValid);
315 DEBTRACE(
"SceneHeaderNodeItem::setExecState " << execState);
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
virtual void setTopLeft(QPointF topLeft)=0
YACS::HMI::Scene * _scene
static QtGuiContext * getQtCurrent()
static int DataPort_Width
static QColor DESACTIVATED
static int CtrlPort_Width
static QColor WAITINGTASKS
static QColor NOTYETINITIALIZED
static int CtrlPort_Height
static QColor INTERNALERR
static int DataPort_Height
static QColor normalNodeBrushColor
static QColor editedNodeBrushColor
static QColor validNodeColor
static QColor INITIALISED
static QColor runNodeBrushColor
static QColor invalidNodeColor
static int progressBar_Height
virtual void popupMenu(QWidget *caller, const QPoint &globalPos)
virtual void setTopLeft(QPointF topLeft)
bool hasProgressBar() const
shownState getShownState()
def h(x, y, destx, desty)