Heightfield Analysis 1.0
|
A heightfield flow routing structure. More...
#include <watershed.h>
Public Member Functions | |
WatershedAnalysis (const ScalarField2 &, bool=false) | |
Create the heightfield flow routing structure. | |
QVector< QPoint > | Watershed (const QPoint &) const |
Compute the watershed of the argument point. | |
QVector< QPoint > | River (const QPoint &) const |
Compute the longest river flowing to the argument point. | |
QVector< QPoint > | River (const QPoint &, const QPoint &) const |
Compute the river connecting two points. | |
double | WatershedArea (const QPoint &) const |
Compute the drainage area of the watershed flowing through the argument point. | |
double | RiverLength (const QPoint &) const |
Compute the length of the longest river flowing to the argument point. | |
double | RiverLength (const QVector< QPoint >) const |
Compute the river length of a set of points. | |
void | Draw (QGraphicsScene &, int, const QPen &=QPen(), const QBrush &=QBrush()) const |
Draw a rectangle. | |
void | DrawWatershed (QGraphicsScene &, const QVector< QPoint > &, const QPen &=QPen(), const QBrush &=QBrush()) const |
Draw the watershed. | |
double | BreachingCost () const |
Compute the breaching cost. | |
double | FillingCost () const |
Compute the filling cost. | |
double | Flow (int, int) const |
Compute flow. | |
Protected Attributes | |
HeightField | hf |
Reference to heightfield. | |
ScalarField2 | area |
Drainage area. | |
Array2I | upstream |
Upstream topology. | |
Array2I | downstream |
Downstream topology. | |
A heightfield flow routing structure.
This class implements a structure that stores the drainage area and the corresponding upstream and downstream directed graphs.
It is needed to compute the watersheds.
|
explicit |
Create the heightfield flow routing structure.
s | The heightfield. |
steep | Flag, set to true if we rely on the steepest slope, false for multiple convergent and divergent flows. |
double WatershedAnalysis::BreachingCost | ( | ) | const |
Compute the breaching cost.
This function computes the volume of bedrock removed by the breaching process. It then converts it into an average height (like precipitation) by dividing by the area of the terrain.
Results are in meters per squared-meter.
void WatershedAnalysis::Draw | ( | QGraphicsScene & | scene, |
int | n, | ||
const QPen & | pen = QPen(), | ||
const QBrush & | brush = QBrush() ) const |
Draw a rectangle.
scene | Graphics scene. |
pen | The pen. |
n | Upstream or downstream. |
brush | The brush, should the box be filled. |
void WatershedAnalysis::DrawWatershed | ( | QGraphicsScene & | scene, |
const QVector< QPoint > & | w, | ||
const QPen & | pen = QPen(), | ||
const QBrush & | brush = QBrush() ) const |
Draw the watershed.
scene | Graphics scene. |
w | Set of watershed points. |
pen | The pen. |
brush | The brush, should the box be filled. |
double WatershedAnalysis::FillingCost | ( | ) | const |
Compute the filling cost.
double WatershedAnalysis::Flow | ( | int | i, |
int | j ) const |
Compute flow.
Uses a power law to compute flow from drainage area.
QVector< QPoint > WatershedAnalysis::River | ( | const QPoint & | p | ) | const |
Compute the longest river flowing to the argument point.
p | Point. |
QVector< QPoint > WatershedAnalysis::River | ( | const QPoint & | a, |
const QPoint & | b ) const |
Compute the river connecting two points.
The function returns the river flowing to a pit if no connecting river path exists.
a,b | Starting (source) and ending (outlet) points. |
double WatershedAnalysis::RiverLength | ( | const QPoint & | p | ) | const |
Compute the length of the longest river flowing to the argument point.
p | Point. |
double WatershedAnalysis::RiverLength | ( | const QVector< QPoint > | river | ) | const |
Compute the river length of a set of points.
river | Set of points defining the river. |
QVector< QPoint > WatershedAnalysis::Watershed | ( | const QPoint & | p | ) | const |
Compute the watershed of the argument point.
p | Point. |
double WatershedAnalysis::WatershedArea | ( | const QPoint & | p | ) | const |
Compute the drainage area of the watershed flowing through the argument point.
p | Point. |