30#include "RailRunner.h"
31#include "trax/Orientation.h"
59 virtual
bool IsFinal() const noexcept = 0;
67 enum class DistanceType{
81 virtual void Rail(
const Location& location,
bool bMoveTo, DistanceType distance ) = 0;
182 virtual
Length GetLength( DistanceType distance = DistanceType::actual ) const noexcept = 0;
204 friend class Train_Imp;
206 virtual
void SetTrain(
Train* pTrain ) noexcept = 0;
208 virtual
void SetOrientation(
Orientation orientation ) noexcept = 0;
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 0, 1, 0 > > Mass
Mass.
Definition DimensionedValues.h:327
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
dclspc Train * CommonParent(const TrainComponent &a, const TrainComponent &b) noexcept
std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > dclspc Couple(const TrackCollection &collection, TrackBuilder &track, Track::EndType endType, Length maxDistance=1_m, Angle maxKink=pi, bool bSilent=true)
Searches open track ends inside an area around a given track end and couples to the closest.
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
A Bogie is a RailRunner that can be attached to another Bogie by a swivel and can be coupled to anoth...
Definition Bogie.h:67
A jack a plug can get connected with.
Definition Jack.h:83
Provides two values for orientation.
Definition Orientation.h:37
Interface for train and rolling stock that can be railed on a track and might provide brakes and powe...
Definition RailRunner.h:345
virtual void ResetToGlobalAnchor(const spat::Frame< Length, One > &anchorPose)=0
Sets the position of the RailRunner so that its global anchor alignes to the given global pose.
EndType
Types of the RailRunner's end's.
Definition RailRunner.h:351
virtual void Rail(const Location &location, bool bMoveTo=true)=0
Attaches this RailRunner onto the specified track location.
Structure describing a coupling between two TrainComponents.
Definition TrainComponent.h:93
EndType endB
The end of B.
Definition TrainComponent.h:97
EndType endA
The end of A.
Definition TrainComponent.h:95
std::shared_ptr< TrainComponent > pTrainComponentA
The TrainComponent A.
Definition TrainComponent.h:94
std::shared_ptr< TrainComponent > pTrainComponentB
The TrainComponent B.
Definition TrainComponent.h:96
A TrainComponent is a part of a Train.
Definition TrainComponent.h:40
virtual std::pair< std::shared_ptr< TrainComponent >, EndType > GetCoupledTrainComponent(EndType end) const noexcept=0
Get the coupled TrainComponent.
virtual Mass GetTotalMass() const noexcept=0
virtual void Rail(const Location &location, bool bMoveTo, DistanceType distance)=0
Rails this TrainComponent at the given location.
virtual Length GetOverhang(EndType end, DistanceType distance=DistanceType::actual) const noexcept=0
Gets the distances from the track location (i.e. global anchor) to the north or south tip of the Rail...
virtual Length GetLength(DistanceType distance=DistanceType::actual) const noexcept=0
Gets the total length of this RailRunner.
virtual Orientation GetOrientation() const noexcept=0
virtual Train * GetTrain() const noexcept=0
virtual bool IsParent(const Train &train) const noexcept=0
virtual bool IsFinal() const noexcept=0
virtual Jack & JackOnRail() noexcept=0
Gets a Jack that pulses its Plug if the RailRunner gets railed on a track.
virtual Jack & JackOnDerail() noexcept=0
Gets a Jack that pulses its Plug if the RailRunner derails.
virtual std::shared_ptr< TrainComponent > ThisTrainComponent() const noexcept=0
Gets a shared pointer to this.
virtual std::pair< Bogie &, EndType > GetTipAt(EndType end)=0
virtual Length GetCouplingLength(EndType end, DistanceType distance=DistanceType::max) const noexcept=0
Gets the length of the coupling from TrainComponent edge to TrainComponent edge.
virtual bool Couple(EndType end, TrainComponent &with, EndType withEnd, bool btriggerPulses=true) noexcept=0
Couples this TrainComponent with another at the respective ends.
virtual std::pair< Train *, Orientation > GetTopmostTrain() const noexcept=0
A Train is a collection of TrainComponents that are coupled in a row.
Definition Train.h:43