QGIS API Documentation 3.99.0-Master (a8882ad4560)
Loading...
Searching...
No Matches
qgscrosssection.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscrosssection.h
3 ---------------------
4 begin : January 2026
5 copyright : (C) 2026 by Dominik Cindrić
6 email : viper dot miniq at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSCROSSSECTION_H
17#define QGSCROSSSECTION_H
18
19#include "qgis_3d.h"
20#include "qgsgeometry.h"
21#include "qgspointxy.h"
22
24
32class _3D_EXPORT QgsCrossSection
33{
34 public:
36 QgsCrossSection() = default;
37
39 QgsCrossSection( const QgsPoint &p1, const QgsPoint &p2, double halfWidth );
40
45 bool isValid() const;
46
48 QgsPoint startPoint() const { return mStartPoint; }
49
51 QgsPoint endPoint() const { return mEndPoint; }
52
54 double halfWidth() const { return mHalfWidth; }
55
57 void setHalfWidth( const double halfWidth ) { mHalfWidth = halfWidth; }
58
64 QgsGeometry asGeometry( const QgsCoordinateTransform *ct = nullptr ) const;
65
67 void nudgeLeft( double distance );
68
70 void nudgeRight( double distance );
71
72 private:
73 QgsPoint mStartPoint;
74 QgsPoint mEndPoint;
75 double mHalfWidth = 0.0;
76
77 void nudge( double distance );
78};
79
80#endif // QGSCROSSSECTION_H
Handles coordinate transforms between two coordinate systems.
double halfWidth() const
Returns the half-width of the cross section.
QgsPoint endPoint() const
Returns the end point of the cross section.
void setHalfWidth(const double halfWidth)
Sets the half-width of the cross section.
QgsCrossSection()=default
Constructs an invalid cross section.
bool isValid() const
Returns cross section validity.
QgsPoint startPoint() const
Returns the start point of the cross section.
A geometry is the spatial representation of a feature.
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49