20#ifndef LIBREPCB_EDITOR_GRAPHICSVIEW_H
21#define LIBREPCB_EDITOR_GRAPHICSVIEW_H
29#include <optional/tl/optional.hpp>
41class IF_GraphicsViewEventHandler;
42class WaitingSpinnerWidget;
65 QWidget* parent =
nullptr,
104 const tl::optional<std::pair<Point, CursorOptions>>& cursor)
noexcept;
106 const tl::optional<std::pair<Point, Point>>& pos)
noexcept;
114 bool mapToGrid)
const noexcept;
116 qreal multiplier = 1) const noexcept;
The Circle class.
Definition: circle.h:46
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
Theme class as used by librepcb::WorkspaceSettingsItem_Themes.
Definition: theme.h:44
GridStyle
Definition: theme.h:49
The GraphicsScene class.
Definition: graphicsscene.h:45
The GraphicsView class.
Definition: graphicsview.h:51
void zoomToRect(const QRectF &rect) noexcept
Definition: graphicsview.cpp:319
void setSceneCursor(const tl::optional< std::pair< Point, CursorOptions > > &cursor) noexcept
Definition: graphicsview.cpp:209
QCursor mCursorBeforePanning
Definition: graphicsview.h:187
Theme::GridStyle getGridStyle() const noexcept
Definition: graphicsview.h:76
bool mUseOpenGl
Definition: graphicsview.h:166
void zoomAll() noexcept
Definition: graphicsview.cpp:308
QColor mOverlayFillColor
Definition: graphicsview.h:162
QColor mGridColor
Definition: graphicsview.h:161
QVector< RulerGauge > mRulerGauges
Definition: graphicsview.h:180
PositiveLength mGridInterval
Definition: graphicsview.h:159
const PositiveLength & getGridInterval() const noexcept
Definition: graphicsview.h:73
void setGridStyle(Theme::GridStyle style) noexcept
Definition: graphicsview.cpp:182
void setRulerPositions(const tl::optional< std::pair< Point, Point > > &pos) noexcept
Definition: graphicsview.cpp:215
QPainterPath calcPosWithTolerance(const Point &pos, qreal multiplier=1) const noexcept
Definition: graphicsview.cpp:256
tl::optional< std::pair< Point, Point > > mRulerPositions
Definition: graphicsview.h:181
IF_GraphicsViewEventHandler * mEventHandlerObject
Definition: graphicsview.h:155
void setUseOpenGl(bool useOpenGl) noexcept
Definition: graphicsview.cpp:156
void setOriginCrossVisible(bool visible) noexcept
Definition: graphicsview.cpp:227
void hideWaitingSpinner() noexcept
Definition: graphicsview.cpp:332
void zoomOut() noexcept
Definition: graphicsview.cpp:302
void zoomAnimationValueChanged(const QVariant &value) noexcept
Definition: graphicsview.cpp:340
Theme::GridStyle mGridStyle
Definition: graphicsview.h:158
void setSceneRectMarker(const QRectF &rect) noexcept
Setup the marker for a specific scene rect.
Definition: graphicsview.cpp:204
void handleMouseWheelEvent(QGraphicsSceneWheelEvent *event) noexcept
Definition: graphicsview.cpp:268
QScopedPointer< WaitingSpinnerWidget > mWaitingSpinnerWidget
Definition: graphicsview.h:153
QColor mOverlayContentColor
Definition: graphicsview.h:163
void setOverlayColors(const QColor &fill, const QColor &content) noexcept
Definition: graphicsview.cpp:136
QRectF getVisibleSceneRect() const noexcept
Definition: graphicsview.cpp:120
Qt::MouseButton mPanningButton
Definition: graphicsview.h:185
void setGrayOut(bool grayOut) noexcept
Definition: graphicsview.cpp:177
void cursorScenePositionChanged(const Point &pos)
Cursor scene position changed signal.
bool mGrayOut
Definition: graphicsview.h:167
void drawBackground(QPainter *painter, const QRectF &rect)
Definition: graphicsview.cpp:452
bool mOriginCrossVisible
Definition: graphicsview.h:165
qint64 mIdleTimeMs
Definition: graphicsview.h:188
void zoomIn() noexcept
Definition: graphicsview.cpp:296
tl::optional< std::pair< Point, CursorOptions > > mSceneCursor
If not nullopt, a cursor will be shown at the given position.
Definition: graphicsview.h:170
static constexpr qreal sZoomStepFactor
Definition: graphicsview.h:191
QVariantAnimation * mZoomAnimation
Definition: graphicsview.h:157
volatile bool mPanningActive
Definition: graphicsview.h:184
void setBackgroundColors(const QColor &fill, const QColor &grid) noexcept
Definition: graphicsview.cpp:128
void drawForeground(QPainter *painter, const QRectF &rect)
Definition: graphicsview.cpp:501
void setInfoBoxColors(const QColor &fill, const QColor &text) noexcept
Definition: graphicsview.cpp:143
GraphicsScene * getScene() const noexcept
Definition: graphicsview.h:70
QRectF mSceneRectMarker
Definition: graphicsview.h:164
void wheelEvent(QWheelEvent *event)
Definition: graphicsview.cpp:351
bool getUseOpenGl() const noexcept
Definition: graphicsview.h:72
CursorOption
Definition: graphicsview.h:56
void showWaitingSpinner() noexcept
Definition: graphicsview.cpp:328
void setInfoBoxText(const QString &text) noexcept
Definition: graphicsview.cpp:221
bool eventFilter(QObject *obj, QEvent *event)
Definition: graphicsview.cpp:359
QScopedPointer< QLabel > mInfoBoxLabel
Definition: graphicsview.h:154
void setVisibleSceneRect(const QRectF &rect) noexcept
Definition: graphicsview.cpp:200
qint64 getIdleTimeMs() const noexcept
Definition: graphicsview.h:80
Point mapGlobalPosToScenePos(const QPoint &globalPosPx, bool boundToView, bool mapToGrid) const noexcept
Definition: graphicsview.cpp:241
void setGridInterval(const PositiveLength &interval) noexcept
Definition: graphicsview.cpp:187
QColor mBackgroundColor
Definition: graphicsview.h:160
void setScene(GraphicsScene *scene) noexcept
Definition: graphicsview.cpp:192
GraphicsScene * mScene
Definition: graphicsview.h:156
Qt::MouseButtons mPressedMouseButtons
Definition: graphicsview.h:186
bool isMouseButtonPressed(Qt::MouseButtons btn) const noexcept
Definition: graphicsview.h:77
void setEventHandlerObject(IF_GraphicsViewEventHandler *eventHandler) noexcept
Definition: graphicsview.cpp:232
The IF_GraphicsViewEventHandler class.
Definition: if_graphicsvieweventhandler.h:41
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
Definition: graphicsview.h:173
QString unitSeparator
Definition: graphicsview.h:176
LengthUnit unit
Definition: graphicsview.h:175
Length currentTickInterval
Definition: graphicsview.h:178
int xScale
Definition: graphicsview.h:174
Length minTickInterval
Definition: graphicsview.h:177