16#ifndef QGSADVANCEDDIGITIZINGDOCK
17#define QGSADVANCEDDIGITIZINGDOCK
19#include "ui_qgsadvanceddigitizingdockwidgetbase.h"
112 CadConstraint( QLineEdit *
lineEdit, QToolButton *lockerButton, QToolButton *relativeButton =
nullptr, QToolButton *repeatingLockButton =
nullptr )
114 , mLockerButton( lockerButton )
115 , mRelativeButton( relativeButton )
116 , mRepeatingLockButton( repeatingLockButton )
118 , mRepeatingLock( false )
149 double value()
const {
return mValue; }
159 void setLockMode( LockMode mode );
167 void setRepeatingLock(
bool repeating );
172 void setRelative(
bool relative );
179 void setValue(
double value,
bool updateWidget =
true );
185 QString displayValue()
const;
195 void toggleRelative();
211 void setPrecision(
int precision );
239 QLineEdit *mLineEdit =
nullptr;
240 QToolButton *mLockerButton =
nullptr;
241 QToolButton *mRelativeButton =
nullptr;
242 QToolButton *mRepeatingLockButton =
nullptr;
267 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;
642 QString formatCommonAngleSnapping(
double angle );
987 void betweenLineConstraintClicked(
bool activated );
990 void lockConstraint(
bool activate =
true );
993 void lockParameterlessConstraint(
bool activate =
true );
999 void constraintTextEdited(
const QString &textValue );
1005 void constraintFocusOut();
1008 void setConstraintRelative(
bool activate );
1011 void setConstraintRepeatingLock(
bool activate );
1017 void activateCad(
bool enabled );
1020 void setConstructionMode(
bool enabled );
1023 void settingsButtonTriggered( QAction *action );
1033 void setCadEnabled(
bool enabled );
1039 void updateCapacity(
bool updateUIwithoutChange =
false );
1049 QList<QgsPointXY> snapSegmentToAllLayers(
const QgsPointXY &originalMapPoint,
bool *snapped =
nullptr )
const;
1055 bool filterKeyPress( QKeyEvent *e );
1061 bool eventFilter( QObject *obj, QEvent *event )
override SIP_SKIP;
1064 void triggerMouseMoveEvent();
1067 CadConstraint *objectToConstraint(
const QObject *obj )
const;
1078 void updateConstraintValue(
CadConstraint *constraint,
const QString &textValue,
bool convertExpression =
false );
1081 void updateUnlockedConstraintValues(
const QgsPoint &point );
1093 void resetConstructionGuides();
1099 void updateConstructionGuidesCrs();
1106 std::unique_ptr<QgsSnapIndicator> mSnapIndicator;
1110 bool mCurrentMapToolSupportsCad =
false;
1117 bool mCadEnabled =
false;
1118 bool mConstructionMode =
false;
1121 std::unique_ptr<CadConstraint> mAngleConstraint;
1122 std::unique_ptr<CadConstraint> mDistanceConstraint;
1123 std::unique_ptr<CadConstraint> mXConstraint;
1124 std::unique_ptr<CadConstraint> mYConstraint;
1125 std::unique_ptr<CadConstraint> mZConstraint;
1126 std::unique_ptr<CadConstraint> mMConstraint;
1127 std::unique_ptr<CadConstraint> mLineExtensionConstraint;
1128 std::unique_ptr<CadConstraint> mXyVertexConstraint;
1130 double mCommonAngleConstraint;
1133 bool mSnappingPrioritizeFeatures =
false;
1136 QList<QgsPoint> mCadPointList;
1137 QList<QgsPointXY> mSnappedSegment;
1139 bool mSessionActive =
false;
1142 std::unique_ptr<QgsVectorLayer> mConstructionGuidesLayer;
1145 bool mDeferredUpdateConstructionGuidesCrs =
false;
1148 std::unique_ptr<QgsMessageBarItem> mErrorMessage;
1151 QMap<double, QAction *> mCommonAngleActions;
1152 QAction *mLineExtensionAction =
nullptr;
1153 QAction *mXyVertexAction =
nullptr;
1154 QAction *mRecordConstructionGuides =
nullptr;
1155 QAction *mShowConstructionGuides =
nullptr;
1156 QAction *mSnapToConstructionGuides =
nullptr;
1157 QAction *mClearConstructionGuides =
nullptr;
1167 QQueue<QgsPointLocator::Match> mLockedSnapVertices;
1170 QPointer<QgsAdvancedDigitizingTool> mCurrentTool;
1174 bool eventFilter( QObject *obj, QEvent *event );
1179 QMenu *mCommonAngleActionsMenu =
nullptr;
1180 QMenu *mFloaterActionsMenu =
nullptr;
1184 bool mTargetLayerSupportsZ =
false;
1185 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