16#include <QtCore/qrect.h>
17#include <QtGui/qpen.h>
18#include <QtGui/qpainterpath.h>
19#include <QtWidgets/qgraphicsitem.h>
35 virtual QRectF boundingRect(
void)
const override;
36 virtual void paint(QPainter* _painter,
const QStyleOptionGraphicsItem* _opt, QWidget* _widget)
override;
37 virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange _change,
const QVariant& _value)
override;
38 virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event)
override;
39 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event)
override;
40 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent* _event)
override;
41 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent* _event)
override;
50 virtual qreal calculateShortestDistanceToPoint(
const QPointF& _pt)
const override;
53 virtual QGraphicsItem* getQGraphicsItem(
void)
override;
56 virtual const QGraphicsItem* getQGraphicsItem(
void)
const override;
70 void setLineWidth(
double _width) { m_config.setLineWidth(_width); this->update(); };
71 double getLineWidth(
void)
const {
return m_config.getLineWidth(); };
86 void setHandleState(
bool _handlesState);
87 bool getHandleState(
void)
const;
89 void updateConnectionView(
void);
99 void disconnectItems(
void);
113 void updateConnectionInformation(
void);
116 virtual void graphicsElementStateChanged(
const GraphicsElementStateFlags& _flags)
override;
119 void calculatePainterPath(QPainterPath& _path)
const;
120 void calculateDirectLinePath(QPainterPath& _path)
const;
121 void calculateSmoothLinePath(QPainterPath& _path)
const;
122 void calculateSmoothLineStep(
const QPointF& _origin,
const QPointF& _destination,
double _halfdistX,
double _halfdistY, QPointF& _control,
ot::ConnectionDirection _direction)
const;
123 void calculateXYLinePath(QPainterPath& _path)
const;
124 void calculateYXLinePath(QPainterPath& _path)
const;
125 void calculateAutoXYLinePath(QPainterPath& _path)
const;
126 qreal calculateShortestDistanceToPointDirect(
const QPointF& _pt)
const;
127 qreal calculateShortestDistanceToPointSmooth(
const QPointF& _pt)
const;
128 qreal calculateShortestDistanceToPointXY(
const QPointF& _pt)
const;
129 qreal calculateShortestDistanceToPointYX(
const QPointF& _pt)
const;
130 qreal calculateShortestDistanceToPointAutoXY(
const QPointF& _pt)
const;
134 ot::Alignment calculateConnectionDirectionAlignment(
void)
const;
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
Definition GraphicsConnectionCfg.h:22
ConnectionShape
Definition GraphicsConnectionCfg.h:24
Definition GraphicsConnectionItem.h:25
const GraphicsConnectionCfg & getConfiguration(void) const
Creates a configuration object containing the items origin and destination information.
Definition GraphicsConnectionItem.h:65
GraphicsItem * originItem(void) const
Definition GraphicsConnectionItem.h:107
double getLineWidth(void) const
Definition GraphicsConnectionItem.h:71
const OutlineF & getLineStyle(void) const
Definition GraphicsConnectionItem.h:84
void setLineStyle(const OutlineF &_style)
Definition GraphicsConnectionItem.h:83
GraphicsItem * destItem(void) const
Definition GraphicsConnectionItem.h:108
void setLineWidth(double _width)
Definition GraphicsConnectionItem.h:70
const ot::Painter2D * getLinePainter(void) const
Returns the current line painter. The item keeps ownership of the painter.
Definition GraphicsConnectionItem.h:81
void setLinePainter(ot::Painter2D *_painter)
Sets the line painter. The item takes ownership of the painter.
Definition GraphicsConnectionItem.h:77
void setLineColor(const ot::Color &_color)
Definition GraphicsConnectionItem.h:73
void setLineShape(GraphicsConnectionCfg::ConnectionShape _shape)
Definition GraphicsConnectionItem.h:67
GraphicsConnectionCfg::ConnectionShape getLineShape(void) const
Definition GraphicsConnectionItem.h:68
Definition GraphicsElement.h:28
Base class for all OpenTwin GraphicsItems GraphicsItems should be created by the GraphicsFactory and ...
Definition GraphicsItem.h:35
The OutlineF class is used to describe how a outline should look like.
Definition Outline.h:161
Definition Painter2D.h:17
ConnectionDirection
Describes in which direction a connetion from an item is starting.
Definition GuiTypes.h:65
Alignment
Alignment.
Definition GuiTypes.h:21