![]() |
Trax3 3.1.0
trax track library
|
Home of the Track and TrackBuilder interfaces. More...
#include "IDType.h"#include "Units.h"#include "Identified.h"#include "Orientation.h"#include "RoadwayTwist.h"#include "common/Interval.h"#include "spat/Box.h"#include "spat/Frame.h"#include "spat/Vector2D.h"#include "spat/VectorBundle.h"#include "spat/VectorBundle2.h"

Go to the source code of this file.
Classes | |
| struct | trax::Track |
| Interface for a track used to calculate 3D positions. More... | |
| struct | trax::Track::End |
| Designates an end at a specific track. More... | |
| struct | trax::Track::Coupling |
| Designates two track ends. Typically used for coupling relations. More... | |
| struct | trax::Track::Overlap |
| Overlapping data. More... | |
| struct | trax::TrackBuilder |
| Interface for making and shaping tracks. More... | |
Namespaces | |
| namespace | trax |
| Namespace of all the trax track libraries classes and methods. | |
Functions | |||||||||||||||||||||||||||
| dclspc const char * | trax::ToString (Track::TrackType type) | ||||||||||||||||||||||||||
| Converts a TrackType to readable string. | |||||||||||||||||||||||||||
| dclspc Track::TrackType | trax::TrackType (const std::string &type) noexcept | ||||||||||||||||||||||||||
| Finds TrackType for string. | |||||||||||||||||||||||||||
| bool | trax::operator== (const Track::End &theone, const Track::End &theother) noexcept | ||||||||||||||||||||||||||
| Tests for equality. | |||||||||||||||||||||||||||
| bool | trax::operator!= (const Track::End &theone, const Track::End &theother) noexcept | ||||||||||||||||||||||||||
| Tests for inequality. | |||||||||||||||||||||||||||
| bool | trax::operator== (const Track::Coupling &theone, const Track::Coupling &theother) noexcept | ||||||||||||||||||||||||||
| Tests for equality. | |||||||||||||||||||||||||||
| bool | trax::operator!= (const Track::Coupling &theone, const Track::Coupling &theother) noexcept | ||||||||||||||||||||||||||
| Tests for inequality. | |||||||||||||||||||||||||||
| bool | trax::operator== (const Track::Overlap &a, const Track::Overlap &b) noexcept | ||||||||||||||||||||||||||
| bool | trax::operator< (const Track::Overlap &a, const Track::Overlap &b) noexcept | ||||||||||||||||||||||||||
| dclspc std::string | trax::ToString (Track::EndType end) | ||||||||||||||||||||||||||
| Makes a string from the status. | |||||||||||||||||||||||||||
| dclspc Track::EndType | trax::ToEndType (const std::string &end) | ||||||||||||||||||||||||||
| Makes a status value from a status string. | |||||||||||||||||||||||||||
| Track::EndType | trax::operator! (Track::EndType end) noexcept | ||||||||||||||||||||||||||
| dclspc Length | trax::Segment (const Track &track, Length s, Length e, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false) | ||||||||||||||||||||||||||
| Calculates a segment length ds so that the visible failure in a track would become smaller than some marginal distance of e. | |||||||||||||||||||||||||||
| dclspc Length | trax::Segment (const Track &track, Length s, Length e, Length w, Length h, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false) | ||||||||||||||||||||||||||
| Works like the first overload, but takes the dimensions of the track model into account. | |||||||||||||||||||||||||||
| dclspc Length | trax::Segment_Checked (const Track &track, Length s, Length e, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false) | ||||||||||||||||||||||||||
| Works like Segment(), but checks the result and shrinks it if necessary. | |||||||||||||||||||||||||||
| dclspc Length | trax::Segment_Checked (const Track &track, Length s, Length e, Length w, Length h, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false) | ||||||||||||||||||||||||||
| Works like the first overload, but takes the dimensions of the track model into account. | |||||||||||||||||||||||||||
| dclspc Length | trax::Segment_TotallyChecked (const Track &track, Length s, Length e, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false) | ||||||||||||||||||||||||||
| Works like Segment(), but checks the result. | |||||||||||||||||||||||||||
| dclspc Length | trax::Segment_TotallyChecked (const Track &track, Length s, Length e, Length w, Length h, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false) | ||||||||||||||||||||||||||
| Works like the first overload, but takes the dimensions of the track model. into account. | |||||||||||||||||||||||||||
| dclspc std::pair< bool, Length > | trax::Foot (const spat::Position< Length > &ofPoint, const Track &toTrack) | ||||||||||||||||||||||||||
| Foot for point in space. | |||||||||||||||||||||||||||
| dclspc std::pair< bool, Length > | trax::Foot (const spat::Position< Length > &ofPoint, const Track &toTrack, Length bestGuess) | ||||||||||||||||||||||||||
| dclspc std::pair< bool, Length > | trax::Foot (const spat::Position< Length > &ofPoint, const Track &toTrack, Length bestGuess, common::Interval< Length > inRange) | ||||||||||||||||||||||||||
| dclspc std::pair< bool, Length > | trax::Foot (const spat::VectorBundle< Length, One > &ofRay, const Track &toTrack) | ||||||||||||||||||||||||||
| Foot for a ray in space. | |||||||||||||||||||||||||||
| dclspc std::pair< bool, Length > | trax::Foot (const spat::VectorBundle< Length, One > &ofRay, const Track &toTrack, Length bestGuess) | ||||||||||||||||||||||||||
| dclspc std::pair< bool, Length > | trax::Foot (const spat::VectorBundle< Length, One > &ofRay, const Track &toTrack, Length bestGuess, common::Interval< Length > inRange) | ||||||||||||||||||||||||||
| dclspc Length | trax::Closest (const spat::Position< Length > &toPoint, const Track &onTrack, bool includeEndpoints=true) | ||||||||||||||||||||||||||
| Closest point on a track to a point in space. | |||||||||||||||||||||||||||
| dclspc Length | trax::Closest (const spat::VectorBundle< Length, One > &toRay, const Track &onTrack, bool includeEndpoints=true) | ||||||||||||||||||||||||||
| Closest point on a track to a ray in space. | |||||||||||||||||||||||||||
| dclspc void | trax::Couple (std::pair< std::shared_ptr< Track >, Track::EndType > trackA, std::pair< std::shared_ptr< Track >, Track::EndType > trackB) | ||||||||||||||||||||||||||
| Couple this trackA at endA with trackB at endB. | |||||||||||||||||||||||||||
| dclspc Length | trax::DistanceOf (Track::cTrackEnd trackEndA, Track::cTrackEnd trackEndB) | ||||||||||||||||||||||||||
| dclspc Length | trax::DistanceToCoupled (const Track &track, Track::EndType atEnd) | ||||||||||||||||||||||||||
| dclspc Angle | trax::KinkToCoupled (const Track &track, Track::EndType atEnd) | ||||||||||||||||||||||||||
| dclspc Angle | trax::TwistToCoupled (const Track &track, Track::EndType atEnd) | ||||||||||||||||||||||||||
| bool dclspc | trax::SetFrame (TrackBuilder &track, const spat::Frame< Length, One > &start, Length s) noexcept | ||||||||||||||||||||||||||
| Same as track.SetFrame( start, s ), but does not throw. | |||||||||||||||||||||||||||
| void dclspc | trax::TransformToNonEEPCurve (TrackBuilder &track) | ||||||||||||||||||||||||||
| Creates a matching Curve, Twist and Frame from an EEPCurve. | |||||||||||||||||||||||||||
| bool dclspc | trax::Mirror (TrackBuilder &track, const spat::VectorBundle< Length, One > mirrorPlane, bool bTest=false) | ||||||||||||||||||||||||||
| Mirrors the track's geometry on a plane. | |||||||||||||||||||||||||||
| bool dclspc | trax::Normalize (TrackBuilder &track, bool bTest=false) | ||||||||||||||||||||||||||
| Normalizes the attached Curve's projected parameter length to the 0_m to track.GetLength() range. | |||||||||||||||||||||||||||
| void dclspc | trax::StraightenUp (TrackBuilder &track, const spat::Vector< One > &up=Up) | ||||||||||||||||||||||||||
| Some curves maintain a local up direction. It might be pleasing for the user to have his curve straightended up in the sense that this direction alignes with what he thinks is being 'up'. | |||||||||||||||||||||||||||
| bool dclspc | trax::Simplify (TrackBuilder &track) noexcept | ||||||||||||||||||||||||||
| Simplifies the track's curve. | |||||||||||||||||||||||||||
| std::vector< std::shared_ptr< TrackBuilder > > dclspc | trax::CloseGap (spat::Frame< Length, One > start, spat::Frame< Length, One > end, common::Interval< Length > limits, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle, bool cloneCurve=false) | ||||||||||||||||||||||||||
| Creates a series of new tracks that close the gap between start and end. | |||||||||||||||||||||||||||
Equip a track by a streched curve. | |||||||||||||||||||||||||||
Creates a most simple curve for the track, so that the endpoints get connected. A new curve will get created and applied to the track, to make the geometry of the track fit the demand. The different overloads differ in what values of the track ends will be preserved. The methods give the strong guarantee, i.e. they will either succeed or keep the curve of the track untouched.
| |||||||||||||||||||||||||||
| bool dclspc | trax::Strech (TrackBuilder &track, spat::VectorBundle< Length, One > start, spat::VectorBundle< Length, One > end, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle) | ||||||||||||||||||||||||||
| bool dclspc | trax::StrechStart (TrackBuilder &track, spat::Position< Length > start, common::Interval< Length > length_limits={0_m,+infinite__length}, const spat::Vector< One > &up=Up, Length e_length=epsilon__length) | ||||||||||||||||||||||||||
| bool dclspc | trax::StrechStart (TrackBuilder &track, spat::Position< Length > start, bool bKeepStartTangent, Length cubicOvershootStart, Length cubicOvershootEnd, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle) | ||||||||||||||||||||||||||
| bool dclspc | trax::StrechStart (TrackBuilder &track, spat::VectorBundle< Length, One > start, Length cubicOvershootEnd, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle) | ||||||||||||||||||||||||||
| bool dclspc | trax::StrechEnd (TrackBuilder &track, spat::Position< Length > end, common::Interval< Length > length_limits={0_m,+infinite__length}, const spat::Vector< One > &up=Up, Length e_length=epsilon__length) | ||||||||||||||||||||||||||
| bool dclspc | trax::StrechEnd (TrackBuilder &track, spat::Position< Length > end, bool bKeepEndTangent, Length cubicOvershootStart, Length cubicOvershootEnd, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle) | ||||||||||||||||||||||||||
| bool dclspc | trax::StrechEnd (TrackBuilder &track, spat::VectorBundle< Length, One > end, Length cubicOvershootStart, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle) | ||||||||||||||||||||||||||
Copying Tracks | |||||||||||||||||||||||||||
Creates a new track with the parameter range copyRange and the same geometry as a template track has inside this range. The copyRange gets clipped to the original track's range. The first method creates a new track; the second one takes an existing one to make it the copy. This can be used to change the track type (e.g. to movable or paralleizable track).
| |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::CopyTrack (const TrackBuilder &originalTrack, TrackBuilder ©Track, bool cloneCurve=false) | ||||||||||||||||||||||||||
| Creates a new track from a template track. | |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::CopyTrack (const TrackBuilder &originalTrack, bool cloneCurve=false) | ||||||||||||||||||||||||||
| Creates a new track from a template track. | |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::CopyTrack (const TrackBuilder &originalTrack, TrackBuilder ©Track, common::Interval< Length > copyRange, bool cloneCurve=false) | ||||||||||||||||||||||||||
| Creates a new track from a template track. | |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::CopyTrack (const TrackBuilder &originalTrack, common::Interval< Length > copyRange, bool cloneCurve=false) | ||||||||||||||||||||||||||
| Creates a new track from a template track. | |||||||||||||||||||||||||||
Splitting Tracks | |||||||||||||||||||||||||||
Creates new tracks that follow the same path of a given track. The tracks will have all the length track.GetLength()/numPieces.
| |||||||||||||||||||||||||||
| std::vector< std::shared_ptr< TrackBuilder > > dclspc | trax::SplitTrack (const TrackBuilder &track, int numPieces=2, bool cloneCurve=false) | ||||||||||||||||||||||||||
| std::vector< std::shared_ptr< TrackBuilder > > dclspc | trax::SplitTrack (const TrackBuilder &track, Length atParameter, bool cloneCurve=false) | ||||||||||||||||||||||||||
Parallel points and tangents to track | |||||||||||||||||||||||||||
Parallel to twisted track. /// Cp = Fw.P + h * Fw.N + v * Fw.B /// D1 = dCp(s)/ds = (1 + k * (v*sin(w) - h*cos(w))) * Fw.T - (t + dw/ds) * (v*Fw.N - h*Fw.B); /// where s is the arc length parameter of the original curve, not of the parallel. See traxBook Appendix C.
| |||||||||||||||||||||||||||
| spat::VectorBundle2< Length, One > dclspc | trax::Parallel (const TrackBuilder &originalTrack, Length s, spat::Vector2D< Length > shift) | ||||||||||||||||||||||||||
| Parallel with respect to some plane, defined by an up-direction. | |||||||||||||||||||||||||||
| spat::VectorBundle2< Length, One > dclspc | trax::ParallelToUp (const TrackBuilder &originalTrack, Length s, spat::Vector2D< Length > shift, spat::Vector< One > up=Up) | ||||||||||||||||||||||||||
| Parallel with respect to some plane, defined by an up-direction. | |||||||||||||||||||||||||||
Parallel Tracks | |||||||||||||||||||||||||||
Make a parallel track.
| |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::MakeParallelTrack (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift=spat::Null2D< trax::Length >, bool bShiftRelativeToTwistOrUp=true, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, Angle maxDeviationAngle=epsilon__angle) | ||||||||||||||||||||||||||
| Makes a parallel track by trying Line, Arc and Helix first. If that does not apply it returns nullptr. | |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::MakeParallelTrackWithPolygonalChain (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift=spat::Null2D< trax::Length >, bool bShiftRelativeToTwistOrUp=true, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, common::Interval< Length > sampleDistanceLimits={ 1_m, 10_m }) | ||||||||||||||||||||||||||
| Parallel approximation by Polygonal Chain. | |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::MakeParallelTrackWithSampledCurve (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift=spat::Null2D< trax::Length >, bool bShiftRelativeToTwistOrUp=true, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, Angle maxDeviationAngle=epsilon__angle, common::Interval< Length > sampleDistanceLimits={ epsilon__length, 20_m }) | ||||||||||||||||||||||||||
| Parallel approximation by SampledCurve. | |||||||||||||||||||||||||||
| std::shared_ptr< TrackBuilder > dclspc | trax::MakeParallelTrackWithSpline (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift, bool bShiftRelativeToTwistOrUp, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, common::Interval< Length > sampleDistanceLimits={ 1_m, 1000_m }) | ||||||||||||||||||||||||||
| Parallel approximation by Spline. | |||||||||||||||||||||||||||
Home of the Track and TrackBuilder interfaces.