\( \def\bold#1{\bf #1} \newcommand{\d}{\mathrm{d}} \) BTP: Manual and Source Code Documentation

Power Uphill

bike mass [kg]
body mass [kg]
altitude gain [m]
climb length [km]
gradient [%]
time [s]
speed [km/h]
power [W]
power/mass [W/kg]
climbrate [m/min]

average power on climb stage

BTP  3.0
Routing/ClimbAnalysis/PowerCalculation
Track Class Reference

official representation of Track in BTP3 More...

#include <track.h>

Collaboration diagram for Track:

Public Member Functions

 Track (trackpoint *tpl, int tc, KOOlist *kl, int kc)
 
 Track (Neighbour **narray, int nc)
 ordinary way to create a Track: from a list of Neighbour
 
 Track (double **KOOarray, int count)
 Track object without height information.
 
 Track (double *d, double *h, double *lat, double *lon, int count)
 Track object without BTP reference, e.g. when dealing with gpx files.
 
 Track (Track *tracktocopy)
 deep copy of a Track object
 
void add (trackpoint *tpl, int tc, KOOlist *kl, int kc)
 
void add (Track *t2)
 
void get_data_ref (trackpoint **tpl, int *tc, KOOlist **kl, int *kc)
 
double ** get_d_h_array ()
 returns reference
 
double ** get_d_h_array_copy ()
 returns deep copy
 
double ** get_KOOa ()
 returns reference
 
double ** get_KOOa_copy ()
 returns deep copy
 
long int get_array_length ()
 
long int get_KOOa_length ()
 
float get_height_meters ()
 
float get_height_meters (float dmin, float dmax)
 calculates altitude gain on a section of the track
 
float get_bend ()
 return serpentine index More...
 
KOOget_last_KOO ()
 
double get_length ()
 returns Track length [km]
 
short notNULL ()
 is track empty or not
 
void to_gpx (char *filename)
 save to gpx file
 
void to_binary_KOO (char *filename)
 save binary KOOa to file (website)
 
void delete_cross (int nr)
 deletes last nr cross of Track
 
void delete_to_cross (KOO *k)
 deletes cross after k
 
void delete_complete ()
 
short extract_KOO (KOO *k, double d)
 creates KOO refering distance point d
 
short extract_h (double d, double *h)
 creates double for height refering distance point d
 
short extract_azimtut (double d, double *azimut)
 extract way direction at distance point d
 
short next_d (double lat, double lon, double *d)
 searches for closest point on track to point (lat,lon) More...
 
short next_cross (double clickedlat, double clickedlon, KOO **kdot, float maxd)
 stores cross in kdot which is closest to (clickedlat,clickedlon)
 
short near_check (double lat, double lon, double limit)
 check if point (lat,lon) is closer to track then limit
 
void adapt_brect (double *latmin, double *latmax, double *lonmin, double *lonmax)
 increases rect to contain track, if necessary
 
void get_brect (double *latmin, double *latmax, double *lonmin, double *lonmax)
 return bounding rect of Track
 
int owns (KOO *k)
 
void get_anchors (float d, KOO **kfrom, KOO **kto)
 check if k is an element of Track
 
short found_anchors (double clickedlat, double clickedlon, float maxd, KOO **kfrom, KOO **kto)
 
KOO get_firstKOO ()
 
KOO get_lastKOO ()
 
void invert ()
 
void trim_left (float d)
 
void trim_right (float d)
 
void trim_left (KOO *k)
 
void trim_right (KOO *k)
 
short toggle_marker (KOO *k)
 a KOO of the track can be marked or not, used for drag&drop routing
 

Private Member Functions

void refresh_d_h_array ()
 refreshs d_h_array
 
void refresh_KOOa ()
 refreshs KOOa
 
KOOadd_to_KOOpool (double lat, double lon)
 
void free_KOOpool (KOO *k)
 
void reset_markers ()
 set markers to zero
 
void trim_left (int kci, int tci)
 trim kl to index kci & tpl to tci
 
void trim_right (int kci, int tci)
 trim kl to index kci & tpl to tci
 

Private Attributes

KOOKOOpool
 stores dynamically allocated KOO if public a function requires that
 
trackpointtpl
 
KOOlistkl
 KOO data array. More...
 
int kc
 array length if kl
 
int tc
 
short keep_lists
 destructor instruction, kl might be used outside this class
 
double ** d_h_array
 distance height output, d:0, h:1
 
double ** KOOa
 coordinate output, lat:0, lon:1
 

Detailed Description

official representation of Track in BTP3

This class is frequently used by all routing algorithm to create tracks from Neighbour array and afterwards modify the Track.
Data is stored in arrays d_h_array and KOOa. Every function modifying the Track will realloc these arrays.

Definition at line 14 of file track.h.

Member Function Documentation

void Track::delete_complete ( )

deletes whole Track content

Definition at line 501 of file track.cpp.

float Track::get_bend ( )

return serpentine index

for each bend calculates bend angle, divides by 180° and squares. Sums up this value and returns it.

Definition at line 819 of file track.cpp.

float Track::get_height_meters ( )

calculates total altitude gain

Definition at line 273 of file track.cpp.

short Track::next_d ( double  lat,
double  lon,
double *  d 
)

searches for closest point on track to point (lat,lon)

If track is empty return 0, else 1. In d, the the closest point of track will be stored with its distance on the Track, and NOT the distance to (lat,lon).

Definition at line 423 of file track.cpp.

Member Data Documentation

KOOlist* Track::kl
private

KOO data array.

with marker attribute and cross reference to tpl at every cross

Definition at line 97 of file track.h.

int Track::tc
private

array length if tpl

Definition at line 99 of file track.h.

trackpoint* Track::tpl
private

distance height data array

Definition at line 94 of file track.h.


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