91#include "TrackLocation.h"
125 dclspc virtual ~
Location() = default;
222 dclspc
void Transition(
TrackData<
Real>& td,
Real engine_meters_per_unit ) const;
344 std::shared_ptr<const
Track> m_pTrack;
350 bool TrackTransition(
Track::EndType frontend, const
Event* pEvent ) noexcept;
353 bool Resolve() noexcept;
355 bool IsResolved() const noexcept;
360 inline
bool operator==( const
Location& locationA, const
Location& locationB ) noexcept{
361 return locationA.
Equals( locationB, epsilon__length );
365 return !locationA.Equals( locationB, epsilon__length );
Home of the Track and TrackBuilder interfaces.
Value type, dependend from dimensions.
Definition DimensionedValues.h:233
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
dclspc void TNBFrame(spat::Frame< Length, One > &frame) const
Receives the TNB - Frame of the curve at the location.
dclspc Location & Flip() noexcept
Turns the direction of this location to the other side.
dclspc bool IsOnTrack() const noexcept
dclspc void DeleteReservation(IDType forID=anyID)
Deletes a reservation.
dclspc void Reserve(common::Interval< Length > range, IDType forID)
Reserves a range on the track relative to this Location.
dclspc void Get(TrackLocation &tl) const noexcept
Gets the TrackLocation - data of this track location.
dclspc Orientation Orient() const noexcept
dclspc bool Equals(const Location &loc, Length epsilon) const noexcept
Compares two Locations.
dclspc AnglePerLength Curvature() const
dclspc Length Param() const noexcept
dclspc std::shared_ptr< const Track > GetTrack() const noexcept
Gets the track this Location is on.
dclspc Location() noexcept=default
Construction.
dclspc AnglePerLength Torsion() const
dclspc Length MoveToEnd(Orientation direction=Orientation::Value::para, const Event *pEvent=nullptr, SignalTarget *pSignalTarget=nullptr)
Moves the location to the track's end and transitions it to the coupled track's end if any.
dclspc std::shared_ptr< Track > GetMutableTrack() const noexcept
Gets mutable track access.
dclspc void PutOff() noexcept
Removes the Location from its position on the track.
dclspc std::vector< Track::Overlap > Overlaps(IDType forID) const
Finds overlapping areas for reservations.
dclspc std::pair< Length, bool > MoveTransit(Orientation direction=Orientation::Value::para, const Event *pEvent=nullptr, SignalTarget *pSignalTarget=nullptr)
Moves the location to the track's end and transitions it to the coupled track's end if any.
dclspc Length Distance(const Location &loc, Length maxdistance) const
Gets the parameter distance between two locations.
dclspc void PutOn(std::shared_ptr< const Track > pTrack, const TrackLocation &tl)
Attaches this Location onto the specified track.
Namespace of common utility classes and methods.
Definition Helpers.h:43
constexpr bool operator!=(const Interval< Valtype > &i1, const Interval< Valtype > &i2) noexcept
Interval operator.
Definition Interval.h:701
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension<-1, 0, 0 > > AnglePerLength
Angle per length.
Definition DimensionedValues.h:321
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
constexpr Real epsilon
Marginal difference in calculations.
Definition DimensionedValues.h:344
constexpr Value< Dimension< 0, 0, 0 > > tan(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:702
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
dclspc Length ParameterDistanceFrom3DDistance(const Location &location, Length distanceIn3D, Length maxParameter, Length _epsilon=epsilon__length)
Calculate parameter for given 3D distance.
dclspc std::tuple< std::shared_ptr< const Track >, Track::EndType, Length > EndOfLine(const Location &location, Length maxDistance, bool bDeadConnectorOnly=false)
Gets the end of a line.
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a 3D - position in cartesian coordinates.
Definition Position.h:46
Implements a tangential space bundle.
Definition VectorBundle2.h:43
Implements a Vector bundle.
Definition VectorBundle.h:42
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
Type used for IDs in the trax library.
Definition IDType.h:43
Provides two values for orientation.
Definition Orientation.h:37
Target for signal notification.
Definition Signal.h:407
Full geometrical data at a point on a track.
Definition TrackData.h:36
Interface for a track used to calculate 3D positions.
Definition Track.h:275
EndType
Designates one of the two ends of a track.
Definition Track.h:292
A TrackLocation ist a location on a single track.
Definition TrackLocation.h:43
bool Equals(const TrackLocation &loc, Length _epsilon) const noexcept
Definition TrackLocation.h:78
A track location, referencing the track by id.
Definition TrackLocation.h:102