SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmmvis::curve::CurveProvider Class Reference

#include <curveprovider.h>

Inheritance diagram for openswmmvis::curve::CurveProvider:
Collaboration diagram for openswmmvis::curve::CurveProvider:

Signals

void pointsChanged (int firstIndex, int count)
 Points in [firstIndex, firstIndex+count) had their (x,y) updated.
 
void pointsInserted (int at, int count)
 count points were inserted starting at at.
 
void pointsRemoved (int at, int count)
 count points were removed starting at at.
 
void nameChanged (QString prev, QString now)
 Curve was renamed; dependent-reference cascading is the registry's job.
 
void typeChanged (CurveType prev, CurveType now)
 Curve type changed (axis labels rebuild).
 
void mutationRejected (QString reason)
 A mutator was refused because it would have violated an invariant.
 

Public Member Functions

 CurveProvider (QString name, CurveType type, QObject *parent=nullptr)
 
 ~CurveProvider () override
 
QString name () const noexcept
 
CurveType type () const noexcept
 
int pointCount () const noexcept
 
const CurvePointpointAt (int i) const
 
const QVector< CurvePoint > & points () const noexcept
 
bool setAllPoints (QVector< CurvePoint > newPoints, QString *reasonOut=nullptr)
 Replace the entire point list. Validates strict-monotone X before applying. Atomic.
 
bool setYAt (int i, double newY, QString *reasonOut=nullptr)
 Change the Y value at index i; X stays put so monotonicity is preserved by construction.
 
bool setPointAt (int i, double newX, double newY, QString *reasonOut=nullptr)
 Change both X + Y at index i. Validates that the new X still slots strictly between neighbours.
 
int insertPoint (double x, double y, QString *reasonOut=nullptr)
 Insert one point. Returns the new index on success; -1 if X collides or would break monotonicity.
 
void removePointsAt (QVector< int > indices)
 Remove points by index. Indices are deduplicated + sorted descending internally so the loop is safe.
 
void setName (QString newName)
 Rename the curve. Uniqueness is the registry's responsibility; this just stores + notifies.
 
void setType (CurveType t)
 Switch curve type. Does NOT touch points (X/Y still numeric); axis labels rebuild via signals.
 

Static Public Member Functions

static QString xLabel (CurveType t)
 Short axis label for the X column for the given curve type.
 
static QString yLabel (CurveType t)
 Short axis label for the Y column for the given curve type.
 
static QString typeLabel (CurveType t)
 Human-readable type name ("Storage", "Pump 1: Volume → Flow", …).
 

Constructor & Destructor Documentation

◆ CurveProvider()

openswmmvis::curve::CurveProvider::CurveProvider ( QString  name,
CurveType  type,
QObject *  parent = nullptr 
)

◆ ~CurveProvider()

openswmmvis::curve::CurveProvider::~CurveProvider ( )
overridedefault

Member Function Documentation

◆ insertPoint()

int openswmmvis::curve::CurveProvider::insertPoint ( double  x,
double  y,
QString *  reasonOut = nullptr 
)

Insert one point. Returns the new index on success; -1 if X collides or would break monotonicity.

Here is the call graph for this function:

◆ mutationRejected

void openswmmvis::curve::CurveProvider::mutationRejected ( QString  reason)
signal

A mutator was refused because it would have violated an invariant.

Here is the caller graph for this function:

◆ name()

QString openswmmvis::curve::CurveProvider::name ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ nameChanged

void openswmmvis::curve::CurveProvider::nameChanged ( QString  prev,
QString  now 
)
signal

Curve was renamed; dependent-reference cascading is the registry's job.

Here is the caller graph for this function:

◆ pointAt()

const CurvePoint & openswmmvis::curve::CurveProvider::pointAt ( int  i) const
inline

◆ pointCount()

int openswmmvis::curve::CurveProvider::pointCount ( ) const
inlinenoexcept

◆ points()

const QVector< CurvePoint > & openswmmvis::curve::CurveProvider::points ( ) const
inlinenoexcept

◆ pointsChanged

void openswmmvis::curve::CurveProvider::pointsChanged ( int  firstIndex,
int  count 
)
signal

Points in [firstIndex, firstIndex+count) had their (x,y) updated.

Here is the caller graph for this function:

◆ pointsInserted

void openswmmvis::curve::CurveProvider::pointsInserted ( int  at,
int  count 
)
signal

count points were inserted starting at at.

Here is the caller graph for this function:

◆ pointsRemoved

void openswmmvis::curve::CurveProvider::pointsRemoved ( int  at,
int  count 
)
signal

count points were removed starting at at.

Here is the caller graph for this function:

◆ removePointsAt()

void openswmmvis::curve::CurveProvider::removePointsAt ( QVector< int >  indices)

Remove points by index. Indices are deduplicated + sorted descending internally so the loop is safe.

Here is the call graph for this function:

◆ setAllPoints()

bool openswmmvis::curve::CurveProvider::setAllPoints ( QVector< CurvePoint newPoints,
QString *  reasonOut = nullptr 
)

Replace the entire point list. Validates strict-monotone X before applying. Atomic.

Here is the call graph for this function:

◆ setName()

void openswmmvis::curve::CurveProvider::setName ( QString  newName)

Rename the curve. Uniqueness is the registry's responsibility; this just stores + notifies.

Here is the call graph for this function:

◆ setPointAt()

bool openswmmvis::curve::CurveProvider::setPointAt ( int  i,
double  newX,
double  newY,
QString *  reasonOut = nullptr 
)

Change both X + Y at index i. Validates that the new X still slots strictly between neighbours.

Here is the call graph for this function:

◆ setType()

void openswmmvis::curve::CurveProvider::setType ( CurveType  t)

Switch curve type. Does NOT touch points (X/Y still numeric); axis labels rebuild via signals.

Here is the call graph for this function:

◆ setYAt()

bool openswmmvis::curve::CurveProvider::setYAt ( int  i,
double  newY,
QString *  reasonOut = nullptr 
)

Change the Y value at index i; X stays put so monotonicity is preserved by construction.

Here is the call graph for this function:

◆ type()

CurveType openswmmvis::curve::CurveProvider::type ( ) const
inlinenoexcept

◆ typeChanged

void openswmmvis::curve::CurveProvider::typeChanged ( CurveType  prev,
CurveType  now 
)
signal

Curve type changed (axis labels rebuild).

Here is the caller graph for this function:

◆ typeLabel()

QString openswmmvis::curve::CurveProvider::typeLabel ( CurveType  t)
static

Human-readable type name ("Storage", "Pump 1: Volume → Flow", …).

◆ xLabel()

QString openswmmvis::curve::CurveProvider::xLabel ( CurveType  t)
static

Short axis label for the X column for the given curve type.

Here is the caller graph for this function:

◆ yLabel()

QString openswmmvis::curve::CurveProvider::yLabel ( CurveType  t)
static

Short axis label for the Y column for the given curve type.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: