25#ifndef OPENSWMMVIS_TRANSECT_TRANSECTPROVIDER_H
26#define OPENSWMMVIS_TRANSECT_TRANSECTPROVIDER_H
51 QString
name() const noexcept {
return m_name; }
52 QString
comments() const noexcept {
return m_comments; }
56 double nLeftBank() const noexcept {
return m_nLeft; }
58 double nChannel() const noexcept {
return m_nChannel; }
62 double xLeftBank() const noexcept {
return m_xLeftBank; }
63 double xRightBank() const noexcept {
return m_xRightBank; }
78 int pointCount() const noexcept {
return m_points.size(); }
80 const QVector<TransectPoint>&
points() const noexcept {
return m_points; }
81 QVector<QPair<double,double>>
allPoints()
const;
91 void setModifiers(
double xFactor,
double yFactor,
double lengthFactor);
95 bool setAllPoints(QVector<TransectPoint> newPoints, QString *reasonOut =
nullptr);
98 bool setElevationAt(
int i,
double newElev, QString *reasonOut =
nullptr);
102 bool setPointAt(
int i,
double newStation,
double newElev,
103 QString *reasonOut =
nullptr);
109 bool *clamped =
nullptr);
113 int insertPoint(
double station,
double elev, QString *reasonOut =
nullptr);
135 static bool isStrictlyMonotone_(
const QVector<TransectPoint> &
pts);
140 double m_nLeft = 0.030;
141 double m_nRight = 0.030;
142 double m_nChannel = 0.030;
144 double m_xLeftBank = 0.0;
145 double m_xRightBank = 0.0;
147 double m_xLeftEncroach = 0.0;
148 double m_xRightEncroach = 0.0;
150 double m_xFactor = 1.0;
151 double m_yFactor = 0.0;
152 double m_lengthFactor = 1.0;
154 QVector<TransectPoint> m_points;
Definition transectprovider.h:42
double nRightBank() const noexcept
Definition transectprovider.h:57
QString comments() const noexcept
Definition transectprovider.h:52
bool setAllPoints(QVector< TransectPoint > newPoints, QString *reasonOut=nullptr)
Replace the entire station list. Validates strict-monotone stations before applying....
Definition transectprovider.cpp:100
~TransectProvider() override
void encroachmentStationsChanged()
void nameChanged(QString prev, QString now)
const TransectPoint & pointAt(int i) const
Definition transectprovider.h:79
void removePointsAt(QVector< int > indices)
Remove points by index. Indices are deduplicated + sorted descending internally so the loop is safe.
Definition transectprovider.cpp:201
int pointCount() const noexcept
Definition transectprovider.h:78
double elevationOffset() const noexcept
Definition transectprovider.h:73
double nLeftBank() const noexcept
Definition transectprovider.h:56
double xRightEncroachment() const noexcept
Definition transectprovider.h:68
bool setPointAt(int i, double newStation, double newElev, QString *reasonOut=nullptr)
Edit both station and elevation at index i. Validates that the new station still slots strictly betwe...
Definition transectprovider.cpp:133
void setBankStations(double xLeft, double xRight)
Definition transectprovider.cpp:72
void setModifiers(double xFactor, double yFactor, double lengthFactor)
Definition transectprovider.cpp:88
double meanderFactor() const noexcept
Definition transectprovider.h:74
bool setPointLive(int i, double newStation, double newElev, bool *clamped=nullptr)
Live drag variant: skips strict monotonicity by clamping the new station to lie in (prev + eps,...
Definition transectprovider.cpp:163
const QVector< TransectPoint > & points() const noexcept
Definition transectprovider.h:80
void setRoughness(double nLeft, double nRight, double nChannel)
Definition transectprovider.cpp:63
void pointsInserted(int at, int count)
void setName(QString newName)
Definition transectprovider.cpp:46
bool setElevationAt(int i, double newElev, QString *reasonOut=nullptr)
Edit elevation at index i; station stays put.
Definition transectprovider.cpp:119
void pointsRemoved(int at, int count)
void bankStationsChanged()
void setComments(QString newComments)
Definition transectprovider.cpp:54
double stationMultiplier() const noexcept
Definition transectprovider.h:72
QString name() const noexcept
Definition transectprovider.h:51
void mutationRejected(QString reason)
void pointsChanged(int firstIndex, int count)
int insertPoint(double station, double elev, QString *reasonOut=nullptr)
Insert one point. Returns the new index on success, -1 on collision / out-of-order.
Definition transectprovider.cpp:184
QVector< QPair< double, double > > allPoints() const
Definition transectprovider.cpp:35
double xLeftEncroachment() const noexcept
Definition transectprovider.h:67
void setEncroachmentStations(double xLeft, double xRight)
Definition transectprovider.cpp:80
double xLeftBank() const noexcept
Definition transectprovider.h:62
double nChannel() const noexcept
Definition transectprovider.h:58
double xRightBank() const noexcept
Definition transectprovider.h:63
size_t i
Definition contourjob.cpp:27
QVector< QPointF > pts
Definition meshpatch.cpp:62
Definition transectprovider.h:33
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
One (station, elevation) sample on a transect cross-section.
Definition transectprovider.h:36
double station
Definition transectprovider.h:37
double elevation
Definition transectprovider.h:38