Skip to content

Commit

Permalink
[layout] rotated grid ticks/annotations (rebased)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierdalang authored and m-kuhn committed Jul 31, 2020
1 parent e19f27d commit 90cc33b
Show file tree
Hide file tree
Showing 9 changed files with 1,290 additions and 883 deletions.
102 changes: 99 additions & 3 deletions python/core/auto_generated/layout/qgslayoutitemmapgrid.sip.in
Expand Up @@ -172,7 +172,10 @@ An individual grid which is drawn above the map content in a
Horizontal,
Vertical,
VerticalDescending,
BoundaryDirection
BoundaryDirection,
AboveTick,
OnTick,
UnderTick,
};

enum AnnotationFormat
Expand All @@ -193,7 +196,7 @@ An individual grid which is drawn above the map content in a
Left,
Right,
Bottom,
Top
Top,
};

enum FrameStyle
Expand All @@ -208,6 +211,12 @@ An individual grid which is drawn above the map content in a
ZebraNautical,
};

enum TickLengthMode
{
OrthogonalTicks,
NormalizedTicks,
};

enum FrameSideFlag
{
FrameLeft,
Expand Down Expand Up @@ -586,6 +595,7 @@ Returns the text format used when rendering grid annotations.
void setAnnotationFont( const QFont &font ) /Deprecated/;
%Docstring
Sets the ``font`` used for drawing grid annotations.
Shortcut for :py:func:`~QgsLayoutItemMapGrid.annotationTextFormat`.setFont().

.. seealso:: :py:func:`annotationFont`

Expand All @@ -596,6 +606,7 @@ Sets the ``font`` used for drawing grid annotations.
QFont annotationFont() const /Deprecated/;
%Docstring
Returns the font used for drawing grid annotations.
Shortcut for :py:func:`~QgsLayoutItemMapGrid.annotationTextFormat`.font().

.. seealso:: :py:func:`setAnnotationFont`

Expand All @@ -606,6 +617,7 @@ Returns the font used for drawing grid annotations.
void setAnnotationFontColor( const QColor &color ) /Deprecated/;
%Docstring
Sets the font ``color`` used for drawing grid annotations.
Shortcut for :py:func:`~QgsLayoutItemMapGrid.annotationTextFormat`.setColor() and :py:func:`~QgsLayoutItemMapGrid.annotationTextFormat`.setOpacity().

.. seealso:: :py:func:`annotationFontColor`

Expand All @@ -616,6 +628,7 @@ Sets the font ``color`` used for drawing grid annotations.
QColor annotationFontColor() const /Deprecated/;
%Docstring
Returns the font color used for drawing grid annotations.
Shortcut for :py:func:`~QgsLayoutItemMapGrid.annotationTextFormat`.color() and :py:func:`~QgsLayoutItemMapGrid.annotationTextFormat`.opacity().

.. seealso:: :py:func:`setAnnotationFontColor`

Expand Down Expand Up @@ -844,6 +857,90 @@ The size of the line outlines drawn in the frame can be retrieved via the
framePenSize method.

.. seealso:: :py:func:`setFrameWidth`
%End

void setRotatedTicksEnabled( const bool state );
%Docstring
Enable/disable ticks rotation for rotated or reprojected grids.

.. seealso:: :py:func:`rotatedTicksEnabled`
%End

double rotatedTicksEnabled() const;
%Docstring
Gets whether ticks rotation for rotated or reprojected grids is enabled.

.. seealso:: :py:func:`setRotatedTicksEnabled`
%End

void setRotatedTicksLengthMode( const TickLengthMode mode );
%Docstring
Sets the tick length calculation mode.

.. seealso:: :py:func:`rotatedTicksLengthMode`
%End

TickLengthMode rotatedTicksLengthMode() const;
%Docstring
Returns the grid frame style.

.. seealso:: :py:func:`setRotatedTicksLengthMode`
%End

void setRotatedTicksMinimumAngle( const double angle );
%Docstring
Sets the ``minimum`` angle (in degrees) below which ticks are not drawn.

.. seealso:: :py:func:`rotatedTicksMinimumAngle`
%End

double rotatedTicksMinimumAngle() const;
%Docstring
Gets the ``minimum`` angle (in degrees) below which ticks are not drawn.

.. seealso:: :py:func:`setRotatedTicksMinimumAngle`
%End

void setRotatedAnnotationsEnabled( const bool state );
%Docstring
Enable/disable annotations rotation for rotated or reprojected grids.

.. seealso:: :py:func:`rotatedAnnotationsEnabled`
%End

double rotatedAnnotationsEnabled() const;
%Docstring
Gets whether annotations rotation for rotated or reprojected grids is enabled.

.. seealso:: :py:func:`setRotatedAnnotationsEnabled`
%End

void setRotatedAnnotationsLengthMode( const TickLengthMode mode );
%Docstring
Sets the annotation length calculation mode.

.. seealso:: :py:func:`rotatedAnnotationsLengthMode`
%End

TickLengthMode rotatedAnnotationsLengthMode() const;
%Docstring
Returns the grid frame style.

.. seealso:: :py:func:`setRotatedAnnotationsLengthMode`
%End

void setRotatedAnnotationsMinimumAngle( const double angle );
%Docstring
Sets the ``minimum`` angle (in degrees) below which annotated are not drawn.

.. seealso:: :py:func:`rotatedAnnotationsMinimumAngle`
%End

double rotatedAnnotationsMinimumAngle() const;
%Docstring
Gets the ``minimum`` angle (in degrees) below which annotated are not drawn.

.. seealso:: :py:func:`setRotatedAnnotationsMinimumAngle`
%End

void setFrameMargin( const double margin );
Expand Down Expand Up @@ -961,7 +1058,6 @@ Retrieves the second fill color for the grid frame.
virtual void refresh();


public:
};

QFlags<QgsLayoutItemMapGrid::FrameSideFlag> operator|(QgsLayoutItemMapGrid::FrameSideFlag f1, QFlags<QgsLayoutItemMapGrid::FrameSideFlag> f2);
Expand Down

0 comments on commit 90cc33b

Please sign in to comment.