16#ifndef QGSADVANCEDDIGITIZINGDOCK
17#define QGSADVANCEDDIGITIZINGDOCK
19#include "ui_qgsadvanceddigitizingdockwidgetbase.h"
110 CadConstraint( QLineEdit *
lineEdit, QToolButton *lockerButton, QToolButton *relativeButton =
nullptr, QToolButton *repeatingLockButton =
nullptr )
112 , mLockerButton( lockerButton )
113 , mRelativeButton( relativeButton )
114 , mRepeatingLockButton( repeatingLockButton )
143 double value()
const {
return mValue; }
153 void setLockMode( LockMode mode );
161 void setRepeatingLock(
bool repeating );
166 void setRelative(
bool relative );
173 void setValue(
double value,
bool updateWidget =
true );
179 QString displayValue()
const;
189 void toggleRelative();
205 void setPrecision(
int precision );
233 QLineEdit *mLineEdit =
nullptr;
234 QToolButton *mLockerButton =
nullptr;
235 QToolButton *mRelativeButton =
nullptr;
236 QToolButton *mRepeatingLockButton =
nullptr;
237 LockMode mLockMode = NoLock;
238 bool mRepeatingLock =
false;
239 bool mRelative =
false;
261 bool canvasKeyPressEventFilter( QKeyEvent *e );
312 void releaseLocks(
bool releaseRepeatingLocks =
true );
319 void keyPressEvent( QKeyEvent *e )
override;
334 void setEnabledZ(
bool enable );
340 void setEnabledM(
bool enable );
358 bool showConstructionGuides()
const;
364 bool snapToConstructionGuides()
const;
370 bool recordConstructionGuides()
const;
419 void toggleConstraintDistance();
438 void clearLockedSnapVertices(
bool force =
true );
454 void removePreviousPoint();
460 void updateCurrentPoint(
const QgsPoint &point );
468 void setPoints(
const QList<QgsPointXY> &points );
477 QgsPoint currentPointV2(
bool *exists =
nullptr )
const;
499 QgsPoint previousPointV2(
bool *exists =
nullptr )
const;
514 QgsPoint penultimatePointV2(
bool *exists =
nullptr )
const;
532 inline bool snappedToVertex()
const {
return ( mSnapMatch.isValid() && ( mSnapMatch.hasVertex() || mSnapMatch.hasLineEndpoint() ) ); }
558 void updateCadPaintItem();
568 void setX(
const QString &value, WidgetSetMode mode );
578 void setY(
const QString &value, WidgetSetMode mode );
588 void setZ(
const QString &value, WidgetSetMode mode );
598 void setM(
const QString &value, WidgetSetMode mode );
608 void setAngle(
const QString &value, WidgetSetMode mode );
618 void setDistance(
const QString &value, WidgetSetMode mode );
624 double getLineZ()
const;
630 double getLineM()
const;
639 void setWeight(
const QString &value,
bool enabled );
646 QString weight()
const;
658 QString formatCommonAngleSnapping(
double angle );
1029 void betweenLineConstraintClicked(
bool activated );
1032 void lockConstraint(
bool activate =
true );
1035 void lockParameterlessConstraint(
bool activate =
true );
1041 void constraintTextEdited(
const QString &textValue );
1047 void constraintFocusOut();
1050 void setConstraintRelative(
bool activate );
1053 void setConstraintRepeatingLock(
bool activate );
1059 void activateCad(
bool enabled );
1062 void setConstructionMode(
bool enabled );
1065 void settingsButtonTriggered( QAction *action );
1074 void setCadEnabled(
bool enabled );
1080 void updateCapacity(
bool updateUIwithoutChange =
false );
1090 QList<QgsPointXY> snapSegmentToAllLayers(
const QgsPointXY &originalMapPoint,
bool *snapped =
nullptr )
const;
1096 bool filterKeyPress( QKeyEvent *e );
1102 bool eventFilter( QObject *obj, QEvent *event )
override SIP_SKIP;
1105 void triggerMouseMoveEvent();
1108 CadConstraint *objectToConstraint(
const QObject *obj )
const;
1119 void updateConstraintValue(
CadConstraint *constraint,
const QString &textValue,
bool convertExpression =
false );
1122 void updateUnlockedConstraintValues(
const QgsPoint &point );
1134 void resetConstructionGuides();
1140 void updateConstructionGuidesCrs();
1147 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
1151 bool mCurrentMapToolSupportsCad =
false;
1158 bool mCadEnabled =
false;
1159 bool mConstructionMode =
false;
1162 std::unique_ptr<CadConstraint> mAngleConstraint;
1163 std::unique_ptr<CadConstraint> mDistanceConstraint;
1164 std::unique_ptr<CadConstraint> mXConstraint;
1165 std::unique_ptr<CadConstraint> mYConstraint;
1166 std::unique_ptr<CadConstraint> mZConstraint;
1167 std::unique_ptr<CadConstraint> mMConstraint;
1168 std::unique_ptr<CadConstraint> mLineExtensionConstraint;
1169 std::unique_ptr<CadConstraint> mXyVertexConstraint;
1171 double mCommonAngleConstraint;
1174 QString mWeightValue;
1175 bool mWeightEnabled =
false;
1178 bool mSnappingPrioritizeFeatures =
false;
1181 QList<QgsPoint> mCadPointList;
1182 QList<QgsPointXY> mSnappedSegment;
1184 bool mSessionActive =
false;
1187 std::unique_ptr<QgsVectorLayer> mConstructionGuidesLayer;
1190 bool mDeferredUpdateConstructionGuidesCrs =
false;
1193 std::unique_ptr<QgsMessageBarItem> mErrorMessage;
1196 QMap<double, QAction *> mCommonAngleActions;
1197 QAction *mLineExtensionAction =
nullptr;
1198 QAction *mXyVertexAction =
nullptr;
1199 QAction *mRecordConstructionGuides =
nullptr;
1200 QAction *mShowConstructionGuides =
nullptr;
1201 QAction *mSnapToConstructionGuides =
nullptr;
1202 QAction *mClearConstructionGuides =
nullptr;
1212 QQueue<QgsPointLocator::Match> mLockedSnapVertices;
1215 QPointer<QgsAdvancedDigitizingTool> mCurrentTool;
1219 bool eventFilter( QObject *obj, QEvent *event );
1224 QMenu *mCommonAngleActionsMenu =
nullptr;
1225 QMenu *mFloaterActionsMenu =
nullptr;
1229 bool mTargetLayerSupportsZ =
false;
1230 bool mTargetLayerSupportsM =
false;
CadConstraintType
Advanced digitizing constraint type.
BetweenLineConstraint
Between line constraints which can be enabled.
LineExtensionSide
Designates whether the line extension constraint is currently soft locked with the previous or next v...
Draws the graphical elements of the CAD tools (.
A widget that floats next to the mouse pointer, and allows interaction with the AdvancedDigitizing fe...
Line string geometry type, with support for z-dimension and m-values.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
A mouse event which is the result of a user interaction with a QgsMapCanvas.
Point geometry type, with support for z-dimension and m-values.
A boolean settings entry.
Represents a vector layer which manages a vector based dataset.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).
#define SIP_ENUM_BASETYPE(type)
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features