16#ifndef QGSADVANCEDDIGITIZINGDOCK
17#define QGSADVANCEDDIGITIZINGDOCK
19#include "ui_qgsadvanceddigitizingdockwidgetbase.h"
111 CadConstraint( QLineEdit *
lineEdit, QToolButton *lockerButton, QToolButton *relativeButton =
nullptr, QToolButton *repeatingLockButton =
nullptr )
113 , mLockerButton( lockerButton )
114 , mRelativeButton( relativeButton )
115 , mRepeatingLockButton( repeatingLockButton )
144 double value()
const {
return mValue; }
154 void setLockMode( LockMode mode );
162 void setRepeatingLock(
bool repeating );
167 void setRelative(
bool relative );
174 void setValue(
double value,
bool updateWidget =
true );
180 QString displayValue()
const;
190 void toggleRelative();
206 void setPrecision(
int precision );
234 QLineEdit *mLineEdit =
nullptr;
235 QToolButton *mLockerButton =
nullptr;
236 QToolButton *mRelativeButton =
nullptr;
237 QToolButton *mRepeatingLockButton =
nullptr;
238 LockMode mLockMode = NoLock;
239 bool mRepeatingLock =
false;
240 bool mRelative =
false;
262 bool canvasKeyPressEventFilter( QKeyEvent *e );
313 void releaseLocks(
bool releaseRepeatingLocks =
true );
320 void keyPressEvent( QKeyEvent *e )
override;
335 void setEnabledZ(
bool enable );
341 void setEnabledM(
bool enable );
359 bool showConstructionGuides()
const;
365 bool snapToConstructionGuides()
const;
371 bool recordConstructionGuides()
const;
420 void toggleConstraintDistance();
439 void clearLockedSnapVertices(
bool force =
true );
455 void removePreviousPoint();
461 void updateCurrentPoint(
const QgsPoint &point );
469 void setPoints(
const QList<QgsPointXY> &points );
478 QgsPoint currentPointV2(
bool *exists =
nullptr )
const;
500 QgsPoint previousPointV2(
bool *exists =
nullptr )
const;
515 QgsPoint penultimatePointV2(
bool *exists =
nullptr )
const;
533 inline bool snappedToVertex()
const {
return ( mSnapMatch.isValid() && ( mSnapMatch.hasVertex() || mSnapMatch.hasLineEndpoint() ) ); }
559 void updateCadPaintItem();
569 void setX(
const QString &value, WidgetSetMode mode );
579 void setY(
const QString &value, WidgetSetMode mode );
589 void setZ(
const QString &value, WidgetSetMode mode );
599 void setM(
const QString &value, WidgetSetMode mode );
609 void setAngle(
const QString &value, WidgetSetMode mode );
619 void setDistance(
const QString &value, WidgetSetMode mode );
625 double getLineZ()
const;
631 double getLineM()
const;
640 void setWeight(
const QString &value,
bool enabled );
647 QString weight()
const;
659 QString formatCommonAngleSnapping(
double angle );
1059 void betweenLineConstraintClicked(
bool activated );
1062 void lockConstraint(
bool activate =
true );
1065 void lockParameterlessConstraint(
bool activate =
true );
1071 void constraintTextEdited(
const QString &textValue );
1077 void constraintFocusOut();
1080 void setConstraintRelative(
bool activate );
1083 void setConstraintRepeatingLock(
bool activate );
1089 void activateCad(
bool enabled );
1092 void setConstructionMode(
bool enabled );
1095 void settingsButtonTriggered( QAction *action );
1104 void setCadEnabled(
bool enabled );
1110 void updateCapacity(
bool updateUIwithoutChange =
false );
1120 QList<QgsPointXY> snapSegmentToAllLayers(
const QgsPointXY &originalMapPoint,
bool *snapped =
nullptr )
const;
1126 bool filterKeyPress( QKeyEvent *e );
1132 bool eventFilter( QObject *obj, QEvent *event )
override SIP_SKIP;
1135 void triggerMouseMoveEvent();
1138 CadConstraint *objectToConstraint(
const QObject *obj )
const;
1149 void updateConstraintValue(
CadConstraint *constraint,
const QString &textValue,
bool convertExpression =
false );
1152 void updateUnlockedConstraintValues(
const QgsPoint &point );
1164 void resetConstructionGuides();
1170 void updateConstructionGuidesCrs();
1177 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
1181 bool mCurrentMapToolSupportsCad =
false;
1188 bool mCadEnabled =
false;
1189 bool mConstructionMode =
false;
1192 std::unique_ptr<CadConstraint> mAngleConstraint;
1193 std::unique_ptr<CadConstraint> mDistanceConstraint;
1194 std::unique_ptr<CadConstraint> mXConstraint;
1195 std::unique_ptr<CadConstraint> mYConstraint;
1196 std::unique_ptr<CadConstraint> mZConstraint;
1197 std::unique_ptr<CadConstraint> mMConstraint;
1198 std::unique_ptr<CadConstraint> mLineExtensionConstraint;
1199 std::unique_ptr<CadConstraint> mXyVertexConstraint;
1201 double mCommonAngleConstraint;
1204 QString mWeightValue;
1205 bool mWeightEnabled =
false;
1208 bool mSnappingPrioritizeFeatures =
false;
1211 QList<QgsPoint> mCadPointList;
1212 QList<QgsPointXY> mSnappedSegment;
1214 bool mSessionActive =
false;
1217 std::unique_ptr<QgsVectorLayer> mConstructionGuidesLayer;
1220 bool mDeferredUpdateConstructionGuidesCrs =
false;
1223 std::unique_ptr<QgsMessageBarItem> mErrorMessage;
1226 QMap<double, QAction *> mCommonAngleActions;
1227 QAction *mLineExtensionAction =
nullptr;
1228 QAction *mXyVertexAction =
nullptr;
1229 QAction *mRecordConstructionGuides =
nullptr;
1230 QAction *mShowConstructionGuides =
nullptr;
1231 QAction *mSnapToConstructionGuides =
nullptr;
1232 QAction *mClearConstructionGuides =
nullptr;
1242 QQueue<QgsPointLocator::Match> mLockedSnapVertices;
1245 QPointer<QgsAdvancedDigitizingTool> mCurrentTool;
1249 bool eventFilter( QObject *obj, QEvent *event );
1254 QMenu *mCommonAngleActionsMenu =
nullptr;
1255 QMenu *mFloaterActionsMenu =
nullptr;
1259 bool mTargetLayerSupportsZ =
false;
1260 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