Skip to content
Permalink
Browse files

[sipify] Fix header formatting

  • Loading branch information
nyalldawson committed Jun 12, 2020
1 parent cedd73e commit a5101f2ade0a89ad6477d6bb6ec1a71b99c6d761
@@ -21,7 +21,8 @@ help a user to create valid geometries.

Implementing a custom geometry check consists of the following parts

### Writing the check
Writing the check
-----------------

A new subclass of QgsGeometryCheck needs to be written and at least the following
abstract methods need to be implemented:
@@ -53,7 +54,8 @@ into this method with the parameter ids and should be retrieved from the availab
use of caching. New errors should be appended to the error list and other message strings to messages.
The method needs to return a tuple (errors, messages).

### Creating a geometry check factory
Creating a geometry check factory
---------------------------------

A Geometry check factory manages meta information for checks. There will always be one single
geometry check factory created per check type, but it's possible that multiple QgsGeometryCheck
@@ -87,7 +89,8 @@ Returns additional flags for a geometry check. If unsure return QgsGeometryCheck

Returns the type of this geometry check.

### Registering the geometry check
Registering the geometry check
------------------------------

Finally the geometry check factory needs to be registered in QGIS, so the system
is aware of the available geometry checks.
@@ -529,7 +529,8 @@ If the gridified geometry could not be calculated ``None`` will be returned.
It may generate an invalid geometry (in some corner cases).
It can also be thought as rounding the edges and it may be useful for removing errors.

### Example:
Example
-------

In this case we use a 2D grid of 1x1 to gridify.
In this case, it can be thought like rounding the x and y of all the points/vertices to full units (remove all decimals).
@@ -688,7 +689,8 @@ Checks validity of the geometry, and returns ``True`` if the geometry is valid.
Returns Java-style iterator for traversal of parts of the geometry. This iterator
can safely be used to modify parts of the geometry.

### Example:
Example
-------

.. code-block:: python

@@ -728,7 +730,8 @@ Returns a read-only, Java-style iterator for traversal of vertices of all the ge
The iterator returns a copy of individual vertices, and accordingly geometries cannot be
modified using the iterator. See transformVertices() for a safe method to modify vertices "in-place".

### Example:
Example
-------

.. code-block:: python

@@ -410,7 +410,8 @@ Returns a read-only, Java-style iterator for traversal of vertices of all the ge
The iterator returns a copy of individual vertices, and accordingly geometries cannot be
modified using the iterator. See transformVertices() for a safe method to modify vertices "in-place".

### Example:
Example
-------

.. code-block:: python

@@ -438,7 +439,8 @@ can safely be used to modify parts of the geometry.
This method forces a detach. Use constParts() to avoid the detach
if the parts are not going to be modified.

### Example:
Example
-------

.. code-block:: python

@@ -478,7 +480,8 @@ returns read-only references to parts and cannot be used to modify the parts.
Unlike parts(), this method does not force a detach and is more efficient if read-only
iteration only is required.

### Example:
Example
-------

.. code-block:: python

@@ -117,7 +117,8 @@ Compute the intersection between two segments
:return: - Whether the segments intersect
- intersectionPoint: Output parameter, the intersection point

### Example:
Example
-------

.. code-block:: python

@@ -477,7 +478,8 @@ M value is computed if one of this point have M.

:return: New point at middle between points pt1 and pt2.

### Example:
Example
-------

.. code-block:: python

@@ -625,7 +627,8 @@ An algorithm to calculate an (approximate) intersection of two lines in 3D.
:return: - ``True`` if the intersection can be found, ``False`` - otherwise.
- intersection: is the result intersection, of it can be found.

### Example:
Example
-------

.. code-block:: python

@@ -317,7 +317,8 @@ M value is preserved.
:return: The point projected. If a 2D point is projected a 3D point will be returned except if
inclination is 90. A 3D point is always returned if a 3D point is projected.

### Example:
Example
-------

.. code-block:: python

@@ -117,7 +117,8 @@ Returns the three lengths of the triangle.
:return: Lengths of triangle ABC where [AB] is at 0, [BC] is at 1, [CA] is at 2.
An empty list is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -135,7 +136,8 @@ Returns the three angles of the triangle.
:return: Angles in radians of triangle ABC where angle BAC is at 0, angle ABC is at 1, angle BCA is at 2.
An empty list is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -152,7 +154,8 @@ Convenient method checking if the geometry is degenerate (have duplicate or coli

:return: ``True`` if the triangle is degenerate or empty, otherwise ``False``.

### Example:
Example
-------

.. code-block:: python

@@ -178,7 +181,8 @@ Is the triangle isocele (two sides with the same length)?

:return: ``True`` or ``False``. Always ``False`` for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -200,7 +204,8 @@ Is the triangle equilateral (three sides with the same length)?

:return: ``True`` or ``False``. Always ``False`` for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -222,7 +227,8 @@ Is the triangle right-angled?

:return: ``True`` or ``False``. Always ``False`` for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -244,7 +250,8 @@ Is the triangle scalene (all sides have different lengths)?

:return: ``True`` or ``False``. Always ``False`` for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -265,7 +272,8 @@ An altitude is a segment (defined by a :py:class:`QgsLineString`) from a vertex
:return: Three altitudes from this triangle.
An empty list is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -283,7 +291,8 @@ A median is a segment (defined by a :py:class:`QgsLineString`) from a vertex to
:return: Three medians from this triangle.
An empty list is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -303,7 +312,8 @@ The segment (defined by a :py:class:`QgsLineString`) returned bisect the angle o
:return: Three angle bisector from this triangle.
An empty list is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -321,7 +331,8 @@ Medial (or midpoint) triangle of a triangle ABC is the triangle with vertices at
:return: The medial from this triangle.
An empty triangle is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -341,7 +352,8 @@ An orthocenter is the point of intersection of the altitudes of a triangle.
:return: The orthocenter of the triangle.
An empty point is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -359,7 +371,8 @@ Center of the circumscribed circle of the triangle.
:return: The center of the circumscribed circle of the triangle.
An empty point is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -377,7 +390,8 @@ Radius of the circumscribed circle of the triangle.
:return: The radius of the circumscribed circle of the triangle.
0.0 is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -395,7 +409,8 @@ Circumscribed circle of the triangle.
:return: The circumbscribed of the triangle with a :py:class:`QgsCircle`.
An empty circle is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -414,7 +429,8 @@ supported and is retrieved from the first 3D point amongst vertices.
:return: The center of the inscribed circle of the triangle.
An empty point is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -432,7 +448,8 @@ Radius of the inscribed circle of the triangle.
:return: The radius of the inscribed circle of the triangle.
0.0 is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -450,7 +467,8 @@ Inscribed circle of the triangle.
:return: The inscribed of the triangle with a :py:class:`QgsCircle`.
An empty circle is returned for empty triangle.

### Example:
Example
-------

.. code-block:: python

@@ -138,7 +138,8 @@ If ``ui`` is a URL, a local copy of the file will be made and will be used to cr
%Docstring
Set the editor widget config for a widget which is not for a simple field.

### Example:
Example
-------

.. code-block:: python

@@ -338,7 +338,8 @@ This method is a shortcut for calling:

feature.setGeometry( QgsGeometry( geometry ) )

### Example:
Example
-------

.. code-block:: python

@@ -185,6 +185,18 @@ sub processDoxygenLine {
# replace nullptr with None (nullptr means nothing to Python devs)
$line =~ s/\bnullptr\b/None/g;

# convert ### style headings
if ( $line =~ m/^###\s+(.*)$/) {
$line = "$1\n".('-' x length($1));
}
if ( $line =~ m/^##\s+(.*)$/) {
$line = "$1\n".('=' x length($1));
}
if ( $line =~ m/^#\s+(.*)$/) {
$line = "$1\n".('*' x length($1));
}


if ( $line eq '*' ) {
$line = '';
}
@@ -535,7 +535,7 @@ class CORE_EXPORT QgsAbstractGeometry
* It may generate an invalid geometry (in some corner cases).
* It can also be thought as rounding the edges and it may be useful for removing errors.
*
* ### Example:
* ### Example
*
* \code{.cpp}
* geometry->snappedToGrid(1, 1);
@@ -906,7 +906,7 @@ class CORE_EXPORT QgsAbstractGeometry
* Returns Java-style iterator for traversal of parts of the geometry. This iterator
* can safely be used to modify parts of the geometry.
*
* ### Example:
* ### Example
*
* \code{.py}
* # print the WKT representation of each part in a multi-point geometry
@@ -944,7 +944,7 @@ class CORE_EXPORT QgsAbstractGeometry
* \warning The iterator returns a copy of individual vertices, and accordingly geometries cannot be
* modified using the iterator. See transformVertices() for a safe method to modify vertices "in-place".
*
* ### Example:
* ### Example
*
* \code{.py}
* # print the x and y coordinate for each vertex in a LineString

0 comments on commit a5101f2

Please sign in to comment.
You can’t perform that action at this time.