16#ifndef QGSADVANCEDDIGITIZINGDOCK
17#define QGSADVANCEDDIGITIZINGDOCK
19#include "ui_qgsadvanceddigitizingdockwidgetbase.h"
113 CadConstraint( QLineEdit *
lineEdit, QToolButton *lockerButton, QToolButton *relativeButton =
nullptr, QToolButton *repeatingLockButton =
nullptr )
115 , mLockerButton( lockerButton )
116 , mRelativeButton( relativeButton )
117 , mRepeatingLockButton( repeatingLockButton )
146 double value()
const {
return mValue; }
156 void setLockMode( LockMode mode );
164 void setRepeatingLock(
bool repeating );
169 void setRelative(
bool relative );
176 void setValue(
double value,
bool updateWidget =
true );
182 QString displayValue()
const;
192 void toggleRelative();
208 void setPrecision(
int precision );
236 QLineEdit *mLineEdit =
nullptr;
237 QToolButton *mLockerButton =
nullptr;
238 QToolButton *mRelativeButton =
nullptr;
239 QToolButton *mRepeatingLockButton =
nullptr;
240 LockMode mLockMode = NoLock;
241 bool mRepeatingLock =
false;
242 bool mRelative =
false;
264 bool canvasKeyPressEventFilter( QKeyEvent *e );
315 void releaseLocks(
bool releaseRepeatingLocks =
true );
322 void keyPressEvent( QKeyEvent *e )
override;
337 void setEnabledZ(
bool enable );
343 void setEnabledM(
bool enable );
361 bool showConstructionGuides()
const;
367 bool snapToConstructionGuides()
const;
373 bool recordConstructionGuides()
const;
422 void toggleConstraintDistance();
441 void clearLockedSnapVertices(
bool force =
true );
457 void removePreviousPoint();
463 void updateCurrentPoint(
const QgsPoint &point );
471 void setPoints(
const QList<QgsPointXY> &points );
480 QgsPoint currentPointV2(
bool *exists =
nullptr )
const;
502 QgsPoint previousPointV2(
bool *exists =
nullptr )
const;
517 QgsPoint penultimatePointV2(
bool *exists =
nullptr )
const;
535 inline bool snappedToVertex()
const {
return ( mSnapMatch.isValid() && ( mSnapMatch.hasVertex() || mSnapMatch.hasLineEndpoint() ) ); }
561 void updateCadPaintItem();
571 void setX(
const QString &value, WidgetSetMode mode );
581 void setY(
const QString &value, WidgetSetMode mode );
591 void setZ(
const QString &value, WidgetSetMode mode );
601 void setM(
const QString &value, WidgetSetMode mode );
611 void setAngle(
const QString &value, WidgetSetMode mode );
621 void setDistance(
const QString &value, WidgetSetMode mode );
627 double getLineZ()
const;
633 double getLineM()
const;
642 void setWeight(
const QString &value,
bool enabled );
649 QString weight()
const;
661 QString formatCommonAngleSnapping(
double angle );
1063 void betweenLineConstraintClicked(
bool activated );
1066 void lockConstraint(
bool activate =
true );
1069 void lockParameterlessConstraint(
bool activate =
true );
1075 void constraintTextEdited(
const QString &textValue );
1081 void constraintFocusOut();
1084 void setConstraintRelative(
bool activate );
1087 void setConstraintRepeatingLock(
bool activate );
1093 void activateCad(
bool enabled );
1096 void setConstructionMode(
bool enabled );
1099 void settingsButtonTriggered( QAction *action );
1108 void setCadEnabled(
bool enabled );
1114 void updateCapacity(
bool updateUIwithoutChange =
false );
1124 QList<QgsPointXY> snapSegmentToAllLayers(
const QgsPointXY &originalMapPoint,
bool *snapped =
nullptr )
const;
1130 bool filterKeyPress( QKeyEvent *e );
1136 bool eventFilter( QObject *obj, QEvent *event )
override SIP_SKIP;
1139 void triggerMouseMoveEvent();
1142 CadConstraint *objectToConstraint(
const QObject *obj )
const;
1153 void updateConstraintValue(
CadConstraint *constraint,
const QString &textValue,
bool convertExpression =
false );
1156 void updateUnlockedConstraintValues(
const QgsPoint &point );
1168 void resetConstructionGuides();
1174 void updateConstructionGuidesCrs();
1181 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
1185 bool mCurrentMapToolSupportsCad =
false;
1192 bool mCadEnabled =
false;
1193 bool mConstructionMode =
false;
1196 std::unique_ptr<CadConstraint> mAngleConstraint;
1197 std::unique_ptr<CadConstraint> mDistanceConstraint;
1198 std::unique_ptr<CadConstraint> mXConstraint;
1199 std::unique_ptr<CadConstraint> mYConstraint;
1200 std::unique_ptr<CadConstraint> mZConstraint;
1201 std::unique_ptr<CadConstraint> mMConstraint;
1202 std::unique_ptr<CadConstraint> mLineExtensionConstraint;
1203 std::unique_ptr<CadConstraint> mXyVertexConstraint;
1205 double mCommonAngleConstraint;
1208 QString mWeightValue;
1209 bool mWeightEnabled =
false;
1212 bool mSnappingPrioritizeFeatures =
false;
1215 QList<QgsPoint> mCadPointList;
1216 QList<QgsPointXY> mSnappedSegment;
1218 bool mSessionActive =
false;
1221 std::unique_ptr<QgsVectorLayer> mConstructionGuidesLayer;
1224 bool mDeferredUpdateConstructionGuidesCrs =
false;
1227 std::unique_ptr<QgsMessageBarItem> mErrorMessage;
1230 QMap<double, QAction *> mCommonAngleActions;
1231 QAction *mLineExtensionAction =
nullptr;
1232 QAction *mXyVertexAction =
nullptr;
1233 QAction *mRecordConstructionGuides =
nullptr;
1234 QAction *mShowConstructionGuides =
nullptr;
1235 QAction *mSnapToConstructionGuides =
nullptr;
1236 QAction *mClearConstructionGuides =
nullptr;
1246 QQueue<QgsPointLocator::Match> mLockedSnapVertices;
1249 QPointer<QgsAdvancedDigitizingTool> mCurrentTool;
1253 bool eventFilter( QObject *obj, QEvent *event );
1258 QMenu *mCommonAngleActionsMenu =
nullptr;
1259 QMenu *mFloaterActionsMenu =
nullptr;
1263 bool mTargetLayerSupportsZ =
false;
1264 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 QgsGeometry with associated coordinate reference system.
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