Mapper  0.9.0
API documentation
Public Member Functions | Public Attributes | List of all members
OpenOrienteering::ObjectPathCoord Struct Reference

A single PathCoord together with the object it belongs to. More...

#include <object.h>

Inheritance diagram for OpenOrienteering::ObjectPathCoord:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::ObjectPathCoord:
Collaboration graph
[legend]

Public Member Functions

constexpr ObjectPathCoord () noexcept
 
constexpr ObjectPathCoord (PathObject *object) noexcept
 
constexpr ObjectPathCoord (PathObject *object, const PathCoord &coord) noexcept
 
constexpr ObjectPathCoord (PathObject *object, const PathCoord &&coord) noexcept
 
constexpr ObjectPathCoord (const ObjectPathCoord &) noexcept=default
 
constexpr ObjectPathCoord (ObjectPathCoord &&) noexcept=default
 
ObjectPathCoordoperator= (const ObjectPathCoord &) noexcept=default
 
ObjectPathCoordoperator= (ObjectPathCoord &&) noexcept=default
 
 ObjectPathCoord (PathObject *object, MapCoordVector::size_type index)
 This constructor sets the PathCoord members according to the given coordinate index. More...
 
constexpr operator bool () const
 Returns true iff the object is not null. More...
 
float findClosestPointTo (const MapCoordF &map_coord)
 Sets this PathCoord to the point on this path which is the closest to the given coordinate. More...
 
- Public Member Functions inherited from OpenOrienteering::PathCoord
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...
 
PathCoordoperator= (const PathCoord &) noexcept=default
 Assignment operator. More...
 
PathCoordoperator= (PathCoord &&) noexcept=default
 Move assignment operator. More...
 

Public Attributes

PathObjectobject
 
- Public Attributes inherited from OpenOrienteering::PathCoord
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...
 

Additional Inherited Members

- Public Types inherited from OpenOrienteering::PathCoord
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...
 
- Static Public Member Functions inherited from OpenOrienteering::PathCoord
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...
 

Detailed Description

A single PathCoord together with the object it belongs to.

This is a convenient structure for passing around as parameter and return value.

Constructor & Destructor Documentation

◆ ObjectPathCoord() [1/7]

constexpr OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( )
inlinenoexcept

◆ ObjectPathCoord() [2/7]

constexpr OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( PathObject object)
inlinenoexcept

◆ ObjectPathCoord() [3/7]

constexpr OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( PathObject object,
const PathCoord coord 
)
inlinenoexcept

◆ ObjectPathCoord() [4/7]

constexpr OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( PathObject object,
const PathCoord &&  coord 
)
inlinenoexcept

◆ ObjectPathCoord() [5/7]

constexpr OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( const ObjectPathCoord )
defaultnoexcept

◆ ObjectPathCoord() [6/7]

constexpr OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( ObjectPathCoord &&  )
defaultnoexcept

◆ ObjectPathCoord() [7/7]

OpenOrienteering::ObjectPathCoord::ObjectPathCoord ( PathObject object,
MapCoordVector::size_type  index 
)
inline

This constructor sets the PathCoord members according to the given coordinate index.

Member Function Documentation

◆ findClosestPointTo()

float OpenOrienteering::ObjectPathCoord::findClosestPointTo ( const MapCoordF map_coord)
inline

Sets this PathCoord to the point on this path which is the closest to the given coordinate.

Returns
The squared distance of these points.
See also
PathObject::calcClosestPointOnPath

◆ operator bool()

constexpr OpenOrienteering::ObjectPathCoord::operator bool ( ) const
inline

Returns true iff the object is not null.

◆ operator=() [1/2]

ObjectPathCoord& OpenOrienteering::ObjectPathCoord::operator= ( const ObjectPathCoord )
defaultnoexcept

◆ operator=() [2/2]

ObjectPathCoord& OpenOrienteering::ObjectPathCoord::operator= ( ObjectPathCoord &&  )
defaultnoexcept

Member Data Documentation

◆ object

PathObject* OpenOrienteering::ObjectPathCoord::object

The documentation for this struct was generated from the following file: