16#include <QtWidgets/qgraphicsscene.h>
25 class GraphicsElement;
26 class GraphicsConnectionItem;
27 class GraphicsConnectionPreviewItem;
52 void stopConnection(
void);
82 void checkMaxTriggerDistance(
double _triggerDistance);
83 void checkMaxTriggerDistance(
const MarginsD& _triggerDistance);
94 QPointF snapToGrid(
const QPointF& _pt)
const;
99 void deselectAll(
void);
101 void moveAllSelectedItems(
const Point2DD& _delta);
103 void rotateAllSelectedItems(
double _relativeAngle);
105 void flipAllSelectedItems(Qt::Orientation _flipAxis);
113 void handleSelectionChanged(
void);
124 void slotSelectionChanged(
void);
130 virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* _event)
override;
131 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent* _event)
override;
132 virtual void mousePressEvent(QGraphicsSceneMouseEvent* _event)
override;
133 virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* _event)
override;
139 virtual void drawBackground(QPainter* _painter,
const QRectF& _rect)
override;
141 void drawGrid(QPainter* _painter,
const QRectF& _rect);
143 qreal calculateScaledGridLineWidth(QPainter* _painter, qreal _normalWidth)
const;
145 void calculateGridLines(
const QRectF& _painterRect, QList<QLineF>& _normalLines, QList<QLineF>& _wideLines, QList<QLineF>& _centerLines)
const;
147 Point2D calculateScaledGridStepSize(
const QRectF& _rect)
const;
149 GraphicsElement* findClosestConnectableElement(
const QPointF& _pos)
const;
151 QList<QGraphicsItem*> findItemsInTriggerDistance(
const QPointF& _pos)
const;
154 void handleMultiSelectionChanged(
void);
155 void handleSingleSelectionChanged(
void);
158 std::list<GraphicsElement *> m_lastHoverElements;
161 double m_maxTriggerDistance;
162 bool m_multiselectionEnabled;
168 QList<QGraphicsItem*> m_lastSelection;
169 bool m_mouseIsPressed;
ConnectionShape
Definition GraphicsConnectionCfg.h:24
Definition GraphicsConnectionItem.h:25
Definition GraphicsConnectionPreviewItem.h:23
Definition GraphicsElement.h:28
Base class for all OpenTwin GraphicsItems GraphicsItems should be created by the GraphicsFactory and ...
Definition GraphicsItem.h:35
Graphics Scene for ot::GraphicsItem Adding QGraphicsItems to the scene that do not inherit ot::Graphi...
Definition GraphicsScene.h:31
GraphicsConnectionCfg::ConnectionShape getConnectionPreviewShape(void) const
Definition GraphicsScene.h:89
void setGridStep(int _step)
Definition GraphicsScene.h:61
Grid::GridSnapMode getGridSnapMode(void) const
Definition GraphicsScene.h:74
void setGridFlag(Grid::GridFlag _flag, bool _active=true)
Definition GraphicsScene.h:69
void setConnectionPreviewShape(GraphicsConnectionCfg::ConnectionShape _shape)
Definition GraphicsScene.h:88
void setGrid(const Grid &_grid)
Definition GraphicsScene.h:58
void setGridFlags(const Grid::GridFlags &_flags)
Definition GraphicsScene.h:70
void setGridSnapMode(Grid::GridSnapMode _mode)
Definition GraphicsScene.h:73
void setWideGridLineCounter(const Point2D &_counter)
Definition GraphicsScene.h:66
const Grid::GridFlags & getGridFlags(void) const
Definition GraphicsScene.h:71
void graphicsItemDoubleClicked(const ot::GraphicsItem *_item)
const OutlineF & getGridLineStyle(void) const
Definition GraphicsScene.h:77
Point2D getGridStep(void) const
Definition GraphicsScene.h:63
void setIgnoreEvents(bool _ignore)
Definition GraphicsScene.h:91
GraphicsView * getGraphicsView(void)
Definition GraphicsScene.h:85
bool getIgnoreEvents(void) const
Definition GraphicsScene.h:92
void setGridStep(const Point2D &_step)
Definition GraphicsScene.h:62
void setWideGridLineCounter(int _counter)
Definition GraphicsScene.h:65
void setMultiselectionEnabled(bool _enabled)
Definition GraphicsScene.h:79
const GraphicsView * getGraphicsView(void) const
Definition GraphicsScene.h:86
bool getMultiselectionEnabled(void) const
Definition GraphicsScene.h:80
Point2D getWideGridLineCounter(void) const
Definition GraphicsScene.h:67
const Grid & getGrid(void) const
Definition GraphicsScene.h:59
void setGridLineStyle(const OutlineF &_outline)
Definition GraphicsScene.h:76
void selectionChangeFinished(void)
View widget used to display GraphicsItems Note that the View creates its own scene.
Definition GraphicsView.h:37
The Grid describes how a 2D Grid should look and behave like.
Definition Grid.h:25
GridSnapMode
The GridSnapMode describe if and how the grid snapping should be performed.
Definition Grid.h:44
GridFlag
A GridFlag describe the grid appearance.
Definition Grid.h:29
The OutlineF class is used to describe how a outline should look like.
Definition Outline.h:161
2D Point with double values
Definition Point2D.h:144
2D Point with integer values
Definition Point2D.h:20