|
Heightfield 1.0
|
This class implements the structure coding the flow direction over a terrain. More...
#include <heightfield.h>
Public Member Functions | |
| HeightFieldNext8 (const HeightField &, bool) | |
| Create the flow direction field. | |
| HeightFieldNext8 () | |
| Empty. | |
| ~HeightFieldNext8 () | |
| Empty. | |
| unsigned char | At (int, int) const |
| Return the flowing directions, compacted into one byte. | |
| unsigned char | At (const QPoint &) const |
| Return the flowing directions, compacted into one byte. | |
| QPoint | FlowTo (const QPoint &) const |
| Return the steepest flow direction. | |
| QPoint | FlowTo (const QPoint &, int) const |
| Return the k-th flow direction. | |
| int | N (int, int) const |
| Return the number of flowing directions. | |
| int | N (const QPoint &) const |
| Return the number of flowing directions. | |
Protected Member Functions | |
| unsigned char | Flow (const HeightField &, const QPoint &, bool) const |
| Compute the flow directions at a given point. | |
Protected Attributes | |
| QVector< unsigned char > | flow |
| Array of directions. | |
This class implements the structure coding the flow direction over a terrain.
| HeightFieldNext8::HeightFieldNext8 | ( | const HeightField & | h, |
| bool | steep ) |
Create the flow direction field.
| h | Heightfield. |
| steep | Set to true if steepest slope is needed (which is the D8 algorithm), false for complete flow (which is D∞ algorithm). |
|
inline |
Return the flowing directions, compacted into one byte.
| p | Point. |
|
inline |
Return the flowing directions, compacted into one byte.
| i,j | Integer coordinates of the sample. |
|
protected |
Compute the flow directions at a given point.
| h | Heightfield. |
| a | Point. |
| steep | Boolean, set to true to compute only the steepest slope, false to compute the average flow. |
| QPoint HeightFieldNext8::FlowTo | ( | const QPoint & | p | ) | const |
Return the steepest flow direction.
Note that the instance should have been initialized with the steepest slope algorithm. This is the same as:
| p | Point. |
| QPoint HeightFieldNext8::FlowTo | ( | const QPoint & | p, |
| int | k ) const |
Return the k-th flow direction.
Note that the instance should have been initialized with the average flow algorithm.
| p | Point. |
| k | Index of the k-th flow direction. |
| int HeightFieldNext8::N | ( | const QPoint & | p | ) | const |
Return the number of flowing directions.
| p | Point. |
| int HeightFieldNext8::N | ( | int | i, |
| int | j ) const |
Return the number of flowing directions.
| i,j | Integer coordinates of the sample. |