Skip to content
Permalink
Browse files
init zm support in QgsAdvancedDigitzingDockWidgetBase
  • Loading branch information
lbartoletti authored and nyalldawson committed Sep 12, 2021
1 parent a300d3b commit 0706585e0f0eba0b245a1587339022e97d5570ef
@@ -39,11 +39,13 @@ The :py:class:`QgsCadUtils` class provides routines for CAD editing.

QgsCadUtils::AlignMapPointConstraint xConstraint;
QgsCadUtils::AlignMapPointConstraint yConstraint;
QgsCadUtils::AlignMapPointConstraint zConstraint;
QgsCadUtils::AlignMapPointConstraint mConstraint;
QgsCadUtils::AlignMapPointConstraint distanceConstraint;
QgsCadUtils::AlignMapPointConstraint angleConstraint;
QgsCadUtils::AlignMapPointConstraint commonAngleConstraint;

QList<QgsPointXY> cadPointList;
QList<QgsPoint> cadPointList;

};

@@ -239,6 +239,20 @@ Returns the ``CadConstraint`` on the X coordinate
const CadConstraint *constraintY() const;
%Docstring
Returns the ``CadConstraint`` on the Y coordinate
%End

const CadConstraint *constraintZ() const;
%Docstring
Returns the ``CadConstraint`` on the Z coordinate

.. versionadded:: 3.20
%End

const CadConstraint *constraintM() const;
%Docstring
Returns the ``CadConstraint`` on the M coordinate

.. versionadded:: 3.20
%End
bool commonAngleConstraint() const;
%Docstring
@@ -283,21 +297,21 @@ automatically populated when user clicks with left mouse button on map canvas.
.. versionadded:: 3.0
%End

QgsPointXY currentPoint( bool *exists = 0 ) const;
QgsPoint currentPoint( bool *exists = 0 ) const;
%Docstring
The last point.
Helper for the CAD point list. The CAD point list is the list of points
currently digitized. It contains both "normal" points and intermediate points (construction mode).
%End

QgsPointXY previousPoint( bool *exists = 0 ) const;
QgsPoint previousPoint( bool *exists = 0 ) const;
%Docstring
The previous point.
Helper for the CAD point list. The CAD point list is the list of points
currently digitized. It contains both "normal" points and intermediate points (construction mode).
%End

QgsPointXY penultimatePoint( bool *exists = 0 ) const;
QgsPoint penultimatePoint( bool *exists = 0 ) const;
%Docstring
The penultimate point.
Helper for the CAD point list. The CAD point list is the list of points
@@ -372,6 +386,36 @@ Can be used to set constraints by external widgets.
unstable API (will likely change)

.. versionadded:: 3.8
%End

void setZ( const QString &value, WidgetSetMode mode );
%Docstring
Set the Z value on the widget.
Can be used to set constraints by external widgets.

:param mode: What type of interaction to emulate
:param value: The value (as a QString, as it could be an expression)

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void setM( const QString &value, WidgetSetMode mode );
%Docstring
Set the M value on the widget.
Can be used to set constraints by external widgets.

:param mode: What type of interaction to emulate
:param value: The value (as a QString, as it could be an expression)

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void setAngle( const QString &value, WidgetSetMode mode );
@@ -404,8 +448,6 @@ Can be used to set constraints by external widgets.
.. versionadded:: 3.8
%End



signals:

void pushWarning( const QString &message );
@@ -420,7 +462,7 @@ Push a warning
Remove any previously emitted warnings (if any)
%End

void pointChanged( const QgsPointXY &point );
void pointChanged( const QgsPoint &point );
%Docstring
Sometimes a constraint may change the current point out of a mouse event. This happens normally
when a constraint is toggled.
@@ -464,6 +506,30 @@ Could be used by widgets that must reflect the current advanced digitizing state
unstable API (will likely change)

.. versionadded:: 3.8
%End

void valueZChanged( const QString &value );
%Docstring
Emitted whenever the Z ``value`` changes (either the mouse moved, or the user changed the input).
Could be used by widgets that must reflect the current advanced digitizing state.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void valueMChanged( const QString &value );
%Docstring
Emitted whenever the M ``value`` changes (either the mouse moved, or the user changed the input).
Could be used by widgets that must reflect the current advanced digitizing state.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void valueAngleChanged( const QString &value );
@@ -512,6 +578,30 @@ Could be used by widgets that must reflect the current advanced digitizing state
unstable API (will likely change)

.. versionadded:: 3.8
%End

void lockZChanged( bool locked );
%Docstring
Emitted whenever the Z parameter is ``locked``.
Could be used by widgets that must reflect the current advanced digitizing state.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void lockMChanged( bool locked );
%Docstring
Emitted whenever the M parameter is ``locked``.
Could be used by widgets that must reflect the current advanced digitizing state.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void lockAngleChanged( bool locked );
@@ -564,6 +654,34 @@ Could be used by widgets that must reflect the current advanced digitizing state
unstable API (will likely change)

.. versionadded:: 3.8
%End

void relativeZChanged( bool relative );
%Docstring
Emitted whenever the Z parameter is toggled between absolute and relative.
Could be used by widgets that must reflect the current advanced digitizing state.

:param relative: Whether the Z parameter is relative or not.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void relativeMChanged( bool relative );
%Docstring
Emitted whenever the M parameter is toggled between absolute and relative.
Could be used by widgets that must reflect the current advanced digitizing state.

:param relative: Whether the M parameter is relative or not.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void relativeAngleChanged( bool relative );
@@ -609,6 +727,36 @@ Could be used by widgets that must reflect the current advanced digitizing state
unstable API (will likely change)

.. versionadded:: 3.8
%End

void enabledChangedZ( bool enabled );
%Docstring
Emitted whenever the Z field is enabled or disabled. Depending on the context, some parameters
do not make sense (e.g. you need a previous point to define a distance).
Could be used by widgets that must reflect the current advanced digitizing state.

:param enabled: Whether the Z parameter is enabled or not.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void enabledChangedM( bool enabled );
%Docstring
Emitted whenever the M field is enabled or disabled. Depending on the context, some parameters
do not make sense (e.g. you need a previous point to define a distance).
Could be used by widgets that must reflect the current advanced digitizing state.

:param enabled: Whether the M parameter is enabled or not.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void enabledChangedAngle( bool enabled );
@@ -663,6 +811,30 @@ Could be used by widgets to capture the focus when a field is being edited.
unstable API (will likely change)

.. versionadded:: 3.8
%End

void focusOnZRequested();
%Docstring
Emitted whenever the Z field should get the focus using the shortcuts (Z).
Could be used by widgets to capture the focus when a field is being edited.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void focusOnMRequested();
%Docstring
Emitted whenever the M field should get the focus using the shortcuts (M).
Could be used by widgets to capture the focus when a field is being edited.

.. note::

unstable API (will likely change)

.. versionadded:: 3.20
%End

void focusOnAngleRequested();
@@ -62,6 +62,10 @@ class CORE_EXPORT QgsCadUtils
QgsCadUtils::AlignMapPointConstraint xConstraint;
//! Constraint for Y coordinate
QgsCadUtils::AlignMapPointConstraint yConstraint;
//! Constraint for Z coordinate
QgsCadUtils::AlignMapPointConstraint zConstraint;
//! Constraint for M coordinate
QgsCadUtils::AlignMapPointConstraint mConstraint;
//! Constraint for distance
QgsCadUtils::AlignMapPointConstraint distanceConstraint;
//! Constraint for angle
@@ -74,7 +78,7 @@ class CORE_EXPORT QgsCadUtils
* First point is the most recent point. Currently using only "previous" point (index 1) and "penultimate"
* point (index 2) for alignment purposes.
*/
QList<QgsPointXY> cadPointList;
QList<QgsPoint> cadPointList;

/**
* Dumps the context's properties, for debugging.

0 comments on commit 0706585

Please sign in to comment.