Mapper  0.9.0
API documentation
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
OpenOrienteering::SplitPathCoord Class Reference

An arbitrary position on a path. More...

#include <path_coord.h>

Collaboration diagram for OpenOrienteering::SplitPathCoord:
Collaboration graph
[legend]

Public Types

using length_type = PathCoord::length_type
 A reaonably precise float type for lengths and distances. More...
 

Public Member Functions

MapCoordF tangentVector () const
 Returns a vector which is a tangent to the path at this position. More...
 

Static Public Member Functions

static SplitPathCoord begin (const PathCoordVector &path_coords)
 Returns a SplitPathCoord at the begin of the given path. More...
 
static SplitPathCoord end (const PathCoordVector &path_coords)
 Returns a SplitPathCoord at the end of the given path. More...
 
static SplitPathCoord at (const PathCoordVector &path_coords, std::vector< PathCoord >::size_type path_coord_index)
 Returns a SplitPathCoord at the given PathCoordVector index. More...
 
static SplitPathCoord at (length_type length, const SplitPathCoord &first)
 Returns a SplitPathCoord at the given length. More...
 
static SplitPathCoord at (const PathCoordVector &path_coords, length_type length)
 Returns a SplitPathCoord at the given length. More...
 

Public Attributes

MapCoordF pos
 Position. More...
 
PathCoord::size_type index
 Index of the cooresponding or preceding map coordinate and flags. More...
 
float 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...
 
const PathCoordVectorpath_coords
 The underlying vector path coordinates. More...
 
std::vector< PathCoord >::size_type path_coord_index
 Index of the corresponding or preceding path_coord in a vector. More...
 
bool is_curve_end
 If true, a bezier edge ends at this split position. More...
 
bool is_curve_start
 If true, a bezier edge starts at this split position. More...
 
MapCoordF curve_end [2]
 If a bezier edge ends here, this will hold the last control points. More...
 
MapCoordF curve_start [2]
 If a bezier edge starts here, this will hold the next control points. More...
 

Detailed Description

An arbitrary position on a path.

A SplitPathCoord supports processing paths in connection with PathCoordVector. It can represent an arbitrary position even between the elements of the PathCoordVector. Other than PathCoord, it keeps a reference to the PathCoordVector. It captures additional state such as adjusted curve parameters.

See also
PathCoord

Member Typedef Documentation

◆ length_type

A reaonably precise float type for lengths and distances.

Member Function Documentation

◆ at() [1/3]

SplitPathCoord OpenOrienteering::SplitPathCoord::at ( const PathCoordVector path_coords,
std::vector< PathCoord >::size_type  path_coord_index 
)
static

Returns a SplitPathCoord at the given PathCoordVector index.

◆ at() [2/3]

SplitPathCoord OpenOrienteering::SplitPathCoord::at ( length_type  length,
const SplitPathCoord first 
)
static

Returns a SplitPathCoord at the given length.

The search for the position will start at first.

Todo:
Handle closed paths.

◆ at() [3/3]

SplitPathCoord OpenOrienteering::SplitPathCoord::at ( const PathCoordVector path_coords,
SplitPathCoord::length_type  length 
)
inlinestatic

Returns a SplitPathCoord at the given length.

◆ begin()

SplitPathCoord OpenOrienteering::SplitPathCoord::begin ( const PathCoordVector path_coords)
static

Returns a SplitPathCoord at the begin of the given path.

◆ end()

SplitPathCoord OpenOrienteering::SplitPathCoord::end ( const PathCoordVector path_coords)
static

Returns a SplitPathCoord at the end of the given path.

◆ tangentVector()

MapCoordF OpenOrienteering::SplitPathCoord::tangentVector ( ) const

Returns a vector which is a tangent to the path at this position.

Check distances, advance to a significant length, handle closed paths.

Member Data Documentation

◆ clen

length_type OpenOrienteering::SplitPathCoord::clen

Cumulative length of the path since the start of the current part.

◆ curve_end

MapCoordF OpenOrienteering::SplitPathCoord::curve_end[2]

If a bezier edge ends here, this will hold the last control points.

Otherwise, curve_end[1] will hold the preceding coordinate, or the current coordinate for the start of open paths.

◆ curve_start

MapCoordF OpenOrienteering::SplitPathCoord::curve_start[2]

If a bezier edge starts here, this will hold the next control points.

Otherwise, curve_start[0] will hold the next coordinate, or the current coordinate for the end of open paths

◆ index

PathCoord::size_type OpenOrienteering::SplitPathCoord::index

Index of the cooresponding or preceding map coordinate and flags.

◆ is_curve_end

bool OpenOrienteering::SplitPathCoord::is_curve_end

If true, a bezier edge ends at this split position.

◆ is_curve_start

bool OpenOrienteering::SplitPathCoord::is_curve_start

If true, a bezier edge starts at this split position.

◆ param

float OpenOrienteering::SplitPathCoord::param

Relative location of this position on the MapCoordVector edge ([0.0, 1.0)).

◆ path_coord_index

std::vector<PathCoord>::size_type OpenOrienteering::SplitPathCoord::path_coord_index

Index of the corresponding or preceding path_coord in a vector.

◆ path_coords

const PathCoordVector* OpenOrienteering::SplitPathCoord::path_coords

The underlying vector path coordinates.

◆ pos

MapCoordF OpenOrienteering::SplitPathCoord::pos

Position.


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