![]() |
Mapper
0.9.0
API documentation
|
A PathCoord represents a node in a polygonal approximation of a path. More...
#include <path_coord.h>
Public Types | |
using | size_type = quint32 |
A reaonably sized unsigned integer type for map coord vector sizes and indexes. More... | |
using | length_type = float |
A reaonably precise float type for lengths and distances. More... | |
using | param_type = float |
A reaonably precise float type for relative position in the range [0, 1). More... | |
Public Member Functions | |
constexpr | PathCoord () noexcept |
Default constructor. More... | |
constexpr | PathCoord (const PathCoord &) noexcept=default |
Copy constructor. More... | |
PathCoord (PathCoord &&) noexcept=default | |
Move constructor. More... | |
constexpr | PathCoord (const MapCoordF &pos, size_type index, param_type param, length_type clen) noexcept |
Explicit construction with all member values. More... | |
PathCoord & | operator= (const PathCoord &) noexcept=default |
Assignment operator. More... | |
PathCoord & | operator= (PathCoord &&) noexcept=default |
Move assignment operator. More... | |
Static Public Member Functions | |
static double | bezierError () |
Global position error threshold for approximating bezier curves with straight segments. More... | |
static bool | indexLessThanValue (const PathCoord &coord, size_type value) |
Returns true if the PathCoord's index is lower than value. More... | |
static bool | valueLessThanIndex (size_type value, const PathCoord &coord) |
Returns true if the value is lower than the PathCoord's index. More... | |
static void | splitBezierCurve (MapCoordF c0, MapCoordF c1, MapCoordF c2, MapCoordF c3, float p, MapCoordF &o0, MapCoordF &o1, MapCoordF &o2, MapCoordF &o3, MapCoordF &o4) |
Splits a cubic bezier curve. More... | |
static constexpr qreal | tangentEpsilonSquared () |
The minimum required (squared) distance of neighboring nodes which are to be considered for determining path tangents. More... | |
Public Attributes | |
MapCoordF | pos |
Position. More... | |
size_type | index |
MapCoordVector(F) index of the start of the edge which this position belongs to. More... | |
param_type | param |
Relative location of this position on the MapCoordVector edge ([0.0, 1.0)). More... | |
length_type | clen |
Cumulative length of the path since the start of the current part. More... | |
Friends | |
class | PathCoordVector |
A PathCoord represents a node in a polygonal approximation of a path.
Complex paths which may consist of straight edges and curves are processed into PathCoordVectors, approximating the path with straight edges only.
Apart from a point on this polygonal path, a PathCoord contains additional information about that point:
using OpenOrienteering::PathCoord::length_type = float |
A reaonably precise float type for lengths and distances.
using OpenOrienteering::PathCoord::param_type = float |
A reaonably precise float type for relative position in the range [0, 1).
using OpenOrienteering::PathCoord::size_type = quint32 |
A reaonably sized unsigned integer type for map coord vector sizes and indexes.
|
noexcept |
Default constructor.
|
defaultnoexcept |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
noexcept |
Explicit construction with all member values.
|
static |
Global position error threshold for approximating bezier curves with straight segments.
|
static |
Returns true if the PathCoord's index is lower than value.
This function can be used for doing a binary search on a sorted container of PathCoords.
Assignment operator.
Move assignment operator.
|
static |
Splits a cubic bezier curve.
The curve made up by the points c0 ... c3 is split up at the relative position p (0..1). The new intermediate points (between c0 and c3) are returned in o0 ... o4.
If not all returned values are needed, it is possible to have a subset of o0..o4 point to the same memory.
|
static |
The minimum required (squared) distance of neighboring nodes which are to be considered for determining path tangents.
|
static |
Returns true if the value is lower than the PathCoord's index.
This function can be used for doing a binary search on a sorted container of PathCoords.
|
friend |
length_type OpenOrienteering::PathCoord::clen |
Cumulative length of the path since the start of the current part.
size_type OpenOrienteering::PathCoord::index |
MapCoordVector(F) index of the start of the edge which this position belongs to.
param_type OpenOrienteering::PathCoord::param |
Relative location of this position on the MapCoordVector edge ([0.0, 1.0)).
MapCoordF OpenOrienteering::PathCoord::pos |
Position.