16 #ifndef QGSADVANCEDDIGITIZINGDOCK 17 #define QGSADVANCEDDIGITIZINGDOCK 23 #include "ui_qgsadvanceddigitizingdockwidgetbase.h" 57 RelativeCoordinates = 4,
60 Q_FLAG( CadCapacities )
99 CadConstraint( QLineEdit *lineEdit, QToolButton *lockerButton, QToolButton *relativeButton =
nullptr, QToolButton *repeatingLockButton =
nullptr )
100 : mLineEdit( lineEdit )
101 , mLockerButton( lockerButton )
102 , mRelativeButton( relativeButton )
103 , mRepeatingLockButton( repeatingLockButton )
104 , mLockMode( NoLock )
105 , mRepeatingLock( false )
119 bool isLocked()
const {
return mLockMode != NoLock; }
137 double value()
const {
return mValue; }
156 void setRepeatingLock(
bool repeating );
161 void setRelative(
bool relative );
168 void setValue(
double value,
bool updateWidget =
true );
178 void toggleRelative();
181 QLineEdit *mLineEdit =
nullptr;
182 QToolButton *mLockerButton =
nullptr;
183 QToolButton *mRelativeButton =
nullptr;
184 QToolButton *mRepeatingLockButton =
nullptr;
201 void hideEvent( QHideEvent * )
override;
209 bool canvasKeyPressEventFilter( QKeyEvent *e );
229 void releaseLocks(
bool releaseRepeatingLocks =
true );
236 void keyPressEvent( QKeyEvent *e )
override;
276 void setPoints(
const QList<QgsPointXY> &points );
283 QgsPointXY currentPoint(
bool *exists =
nullptr )
const;
290 QgsPointXY previousPoint(
bool *exists =
nullptr )
const;
297 QgsPointXY penultimatePoint(
bool *exists =
nullptr )
const;
334 void updateCadPaintItem();
343 void pushWarning(
const QString &message );
360 void additionalConstraintClicked(
bool activated );
363 void lockConstraint(
bool activate =
true );
369 void constraintTextEdited(
const QString &textValue );
375 void constraintFocusOut();
378 void setConstraintRelative(
bool activate );
381 void setConstraintRepeatingLock(
bool activate );
387 void activateCad(
bool enabled );
390 void setConstructionMode(
bool enabled );
393 void settingsButtonTriggered( QAction *action );
397 void setCadEnabled(
bool enabled );
403 void updateCapacity(
bool updateUIwithoutChange =
false );
413 QList<QgsPointXY> snapSegmentToAllLayers(
const QgsPointXY &originalMapPoint,
bool *snapped =
nullptr )
const;
416 void updateCurrentPoint(
const QgsPointXY &point );
418 void removePreviousPoint();
424 bool filterKeyPress( QKeyEvent *e );
430 bool eventFilter( QObject *obj, QEvent *event )
override SIP_SKIP;
433 void triggerMouseMoveEvent();
436 CadConstraint *objectToConstraint(
const QObject *obj )
const;
439 double parseUserInput(
const QString &inputValue,
bool &ok )
const;
447 void updateConstraintValue(
CadConstraint *constraint,
const QString &textValue,
bool convertExpression =
false );
450 void updateUnlockedConstraintValues(
const QgsPointXY &point );
455 CadCapacities mCapacities =
nullptr;
457 bool mCurrentMapToolSupportsCad =
false;
461 bool mCadEnabled =
false;
462 bool mConstructionMode =
false;
465 std::unique_ptr< CadConstraint > mAngleConstraint;
466 std::unique_ptr< CadConstraint > mDistanceConstraint;
467 std::unique_ptr< CadConstraint > mXConstraint;
468 std::unique_ptr< CadConstraint > mYConstraint;
470 int mCommonAngleConstraint = 90;
473 QList<QgsPointXY> mCadPointList;
474 QList<QgsPointXY> mSnappedSegment;
475 bool mSnappedToVertex =
false;
477 bool mSessionActive =
false;
480 std::unique_ptr<QgsMessageBarItem> mErrorMessage;
483 QAction *mEnableAction =
nullptr;
484 QMap< QAction *, int > mCommonAngleActions;
488 bool eventFilter( QObject *obj, QEvent *event );
493 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAdvancedDigitizingDockWidget::CadCapacities )
495 #endif // QGSADVANCEDDIGITIZINGDOCK_H
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
Map canvas is a class for displaying all GIS data types on a canvas.
The QgsAdvancedDigitizingCanvasItem class draws the graphical elements of the CAD tools (...