|
QGIS API Documentation 3.99.0-Master (a8882ad4560)
|
Encapsulates the definition of a cross section in 3D map coordinates. More...
#include <qgscrosssection.h>
Public Member Functions | |
| QgsCrossSection ()=default | |
| Constructs an invalid cross section. | |
| QgsCrossSection (const QgsPoint &p1, const QgsPoint &p2, double halfWidth) | |
| Constructs a cross section defined by two points and a half-width. | |
| QgsGeometry | asGeometry (const QgsCoordinateTransform *ct=nullptr) const |
| Returns the cross section extent as a geometry (Polygon or LineString). | |
| QgsPoint | endPoint () const |
| Returns the end point of the cross section. | |
| double | halfWidth () const |
| Returns the half-width of the cross section. | |
| bool | isValid () const |
| Returns cross section validity. | |
| void | nudgeLeft (double distance) |
| Nudges the cross section to the left by the specified distance. | |
| void | nudgeRight (double distance) |
| Nudges the cross section to the right by the specified distance. | |
| void | setHalfWidth (const double halfWidth) |
| Sets the half-width of the cross section. | |
| QgsPoint | startPoint () const |
| Returns the start point of the cross section. | |
Encapsulates the definition of a cross section in 3D map coordinates.
Defined by a line (p1, p2) and a half-width (extent from the line).
Definition at line 32 of file qgscrosssection.h.
|
default |
Constructs an invalid cross section.
Constructs a cross section defined by two points and a half-width.
Definition at line 22 of file qgscrosssection.cpp.
| QgsGeometry QgsCrossSection::asGeometry | ( | const QgsCoordinateTransform * | ct = nullptr | ) | const |
Returns the cross section extent as a geometry (Polygon or LineString).
If a coordinate transform is provided, the geometry is transformed. The transform should be from the cross section CRS (3D map CRS) to the destination CRS (2D map canvas CRS).
Definition at line 29 of file qgscrosssection.cpp.
|
inline |
Returns the end point of the cross section.
Definition at line 51 of file qgscrosssection.h.
|
inline |
Returns the half-width of the cross section.
Definition at line 54 of file qgscrosssection.h.
| bool QgsCrossSection::isValid | ( | ) | const |
Returns cross section validity.
A valid cross section has distinct start and end points and a positive half-width.
Definition at line 91 of file qgscrosssection.cpp.
| void QgsCrossSection::nudgeLeft | ( | double | distance | ) |
Nudges the cross section to the left by the specified distance.
Definition at line 68 of file qgscrosssection.cpp.
| void QgsCrossSection::nudgeRight | ( | double | distance | ) |
Nudges the cross section to the right by the specified distance.
Definition at line 73 of file qgscrosssection.cpp.
|
inline |
Sets the half-width of the cross section.
Definition at line 57 of file qgscrosssection.h.
|
inline |
Returns the start point of the cross section.
Definition at line 48 of file qgscrosssection.h.