Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::RollingStock Struct Referenceabstract

A RollingStock is a RailRunner that manages one or more connected Bogies. More...

#include <C:/Trend/Development/Trax3/Code/trax/rigid/trains/RollingStock.h>

Inheritance diagram for trax::RollingStock:

Public Member Functions

virtual std::shared_ptr< RollingStockThisRollingStock () const noexcept=0
 Gets a shared pointer to this.
virtual bool Attach (Bogie &bogie) noexcept=0
 Attaches a configured Bogie arrangement to the RollingStock.
virtual int GetNumberOfBogies () const noexcept=0
virtual BogieGetBogie (int idx) const =0
 Gets the Bogie with index number idx.
virtual int GetNumberOfTopmostParents () const noexcept=0
virtual BogieGetTopmostParent (int idx=0) const =0
 Gets the topmost parent Bogie.
virtual int GetNumberOfWheelFrames () const noexcept=0
virtual WheelFrameGetWheelFrame (int idx) const =0
 Gets the WheelFrame at index, counting from north to south.
virtual std::pair< std::shared_ptr< RollingStock >, EndTypeGetCoupledRollingStock (EndType end) const noexcept=0
 Get the coupled RollingStock.
virtual JackJackOnHoot () noexcept=0
 Gets a Jack that pulses its Plug if the RailRunner's Hoot() member is called.
virtual JackJackOnSteam () noexcept=0
 Gets a Jack that pulses its Plug if the RailRunner's Steam() member is called.
Public Member Functions inherited from trax::TrainComponent
virtual std::shared_ptr< TrainComponentThisTrainComponent () const noexcept=0
 Gets a shared pointer to this.
virtual TrainGetTrain () const noexcept=0
virtual Orientation GetOrientation () const noexcept=0
virtual std::pair< Train *, OrientationGetTopmostTrain () const noexcept=0
virtual bool IsFinal () const noexcept=0
virtual bool IsParent (const Train &train) const noexcept=0
virtual void Rail (const Location &location, bool bMoveTo, DistanceType distance)=0
 Rails this TrainComponent at the given location.
virtual void ResetToGlobalAnchor (const spat::Frame< Length, One > &anchorPose, DistanceType distance)=0
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< std::shared_ptr< TrainComponent >, EndTypeGetCoupledTrainComponent (EndType end) const noexcept=0
 Get the coupled TrainComponent.
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 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 RailRunner.
virtual Length GetLength (DistanceType distance=DistanceType::actual) const noexcept=0
 Gets the total length of this RailRunner.
virtual Mass GetTotalMass () const noexcept=0
virtual JackJackOnRail () noexcept=0
 Gets a Jack that pulses its Plug if the RailRunner gets railed on a track.
virtual JackJackOnDerail () noexcept=0
 Gets a Jack that pulses its Plug if the RailRunner derails.
virtual void Rail (const Location &location, bool bMoveTo=true)=0
 Attaches this RailRunner onto the specified track location.
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.
virtual std::pair< Bogie &, EndTypeGetTipAt (EndType end)=0
virtual std::pair< const Bogie &, EndTypeGetTipAt (EndType end) const =0
Public Member Functions inherited from trax::RailRunner
virtual const char * TypeName () const noexcept=0
virtual std::shared_ptr< RailRunnerThis () const noexcept=0
 Gets a shared pointer to this.
virtual bool IsValid () const noexcept=0
virtual Location GetLocation () const noexcept=0
 Gets the track location were the RailRunner is railed.
virtual void DeRail () noexcept=0
 Take the RailRunner from the track.
virtual bool IsRailed () const noexcept=0
 Is the RailRunner on a track?
virtual spat::Frame< Length, OneGetGlobalAnchor () const =0
 Gets the global anchor of the RailRunner.
virtual void SetVelocity (Velocity velocity)=0
 Sets the velocity of this RailRunner along the track.
virtual Velocity GetVelocity () const =0
virtual void TargetVelocity (Velocity velocity)=0
 Sets the target velocity to aim for by using the supplied Thrust() and Brake() settings.
virtual Velocity TargetVelocity () const noexcept=0
virtual EndType TargetDirection () const noexcept=0
 Gets the principle direction of movement according to the sign of the target velocity.
virtual Power MaximumPowerOutput () const noexcept=0
virtual Power CurrentPowerOutput () const noexcept=0
virtual Velocity MaximumVelocity () const noexcept=0
virtual void Thrust (One byfactor)=0
 Sets the fraction of the maximum thrust to apply in order to reach the target velocity specified by TargetVelocity().
virtual One Thrust () const noexcept=0
 Gets the fraction of the maximum thrust applied.
virtual void ThrustAbsolute (Force thrust)=0
 Sets the thrust as absolute force values. If the value exceeds MaxThrust() it get clipped.
virtual Force ThrustAbsolute () const noexcept=0
virtual void Brake (One byfactor)=0
 Sets the fraction of the maximum braking to apply in order
to reach a zero velocity.
virtual One Brake () const noexcept=0
 Gets the fraction of the maximum braking applied.
virtual void BrakeAbsolute (Force brake)=0
 Sets the brake as absolute force value. If the value exceeds MaxBrake() it gets clipped.
virtual Force BrakeAbsolute () const noexcept=0
virtual Force MaxBrake () const noexcept=0
 Gets the maximal available braking. This value is determined by the properties of the Wheelsets attached to WheelFrames wich in turn are attached to a bogie.
virtual void ActivateCoupling (EndType end)=0
 Activates the coupling at the respective end of the RailRunner.
virtual void DeactivateCoupling (EndType end)=0
 Deactivates the coupling at the respective end of the RailRunner.
virtual bool IsActivated (EndType end) const noexcept=0
virtual bool Uncouple (EndType end=EndType::all, bool btriggerPulses=true) noexcept=0
 Uncouples the RailRunner at the specified end.
virtual bool IsCoupled (EndType end=EndType::any) const noexcept=0
 Is the coupling coupled?
virtual Length GetCouplingHeight (EndType end) const noexcept=0
 Gets the height of the coupling over the track.
virtual JackJackOnCouple (EndType end)=0
 Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get coupled.
virtual JackJackOnUnCouple (EndType end)=0
 Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get uncoupled or breaks.
virtual JackJackOnCouplingActivated (EndType end)=0
 Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get activated.
virtual JackJackOnCouplingDeactivated (EndType end)=0
 Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get deactivated.
virtual void UserData (RailRunnerUserData *pData) noexcept=0
 Sets a pointer to user provided data.
virtual RailRunnerUserData * UserData () const noexcept=0
virtual Force MaxThrust () const noexcept=0
virtual Force MaxThrust (Velocity velocity) const noexcept=0
Public Member Functions inherited from trax::Identified< RailRunner >
virtual const std::string & Reference (const std::string &name) const=0
 Gets a reference that was set for this object by name.
virtual const std::vector< char const * > & ReferenceNames (const std::string &namePart) const=0
 Searches for all reference names that countain namePart as substring in the name.
virtual IDType ID () const noexcept=0
 Identified (const Identified &)=delete
Identified & operator= (const Identified &)=delete

Static Public Member Functions

static dclspc std::shared_ptr< RollingStockMake () noexcept
 Makes a RollingStock object.

Additional Inherited Members

Public Types inherited from trax::TrainComponent
enum class  DistanceType { actual , min , max , half }
Public Types inherited from trax::RailRunner
enum class  EndType : char {
  none = 0 , north , south , any ,
  all
}
 Types of the RailRunner's end's. More...
Protected Member Functions inherited from trax::TrainComponent
virtual void SetTrain (Train *pTrain) noexcept=0
virtual void SetOrientation (Orientation orientation) noexcept=0

Detailed Description

A RollingStock is a RailRunner that manages one or more connected Bogies.

Member Function Documentation

◆ Attach()

virtual bool trax::RollingStock::Attach ( Bogie & bogie)
pure virtualnoexcept

Attaches a configured Bogie arrangement to the RollingStock.

It is only necessarry to call this method once; from a bogie arrangement, any Bogie can be taken, to make the whole arrangement be managed by the RollingStock. The Bogie arrangement is expected to be build after the rules

See also
Bogie. The couplings should be properly positioned (or canceled by index < 0) to make geometrical values like length calculatable.
Parameters
bogieThe Bogie arrangement to be managed by the RollingStock. Any Bogie out of the arrangement will do here.
Returns
true if the Bogie arrangement was successfully attached.

◆ GetBogie()

virtual Bogie & trax::RollingStock::GetBogie ( int idx) const
pure virtual

Gets the Bogie with index number idx.

The idx count from north to south.

Parameters
idxThe index of the Bogie. 0 is the northernmost of several Bogies.
Exceptions
std::out_of_rangeif idx is negative or idx >= GetNumberOfBogies().

◆ GetCoupledRollingStock()

virtual std::pair< std::shared_ptr< RollingStock >, EndType > trax::RollingStock::GetCoupledRollingStock ( EndType end) const
pure virtualnoexcept

Get the coupled RollingStock.

Parameters
endEnd type of this RollingStock.
Returns
A pointer to the other RollingStock coupled at end, or
nullptr if none and the other RollingStock's end type.

◆ GetNumberOfBogies()

virtual int trax::RollingStock::GetNumberOfBogies ( ) const
pure virtualnoexcept
Returns
The number of bogies.

◆ GetNumberOfTopmostParents()

virtual int trax::RollingStock::GetNumberOfTopmostParents ( ) const
pure virtualnoexcept
Returns
The number of topmost parents.

◆ GetNumberOfWheelFrames()

virtual int trax::RollingStock::GetNumberOfWheelFrames ( ) const
pure virtualnoexcept
Returns
The number of WheelFrames.

◆ GetTopmostParent()

virtual Bogie & trax::RollingStock::GetTopmostParent ( int idx = 0) const
pure virtual

Gets the topmost parent Bogie.

For rolling stock with jakobs bogies there can be more than one parent Bogie.

Parameters
idxThe index of the parent Bogie. 0 is the northernmost of several top level Bogies.
Exceptions
std::out_of_rangeif idx is negative or idx >= GetNumberOfParents().

◆ GetWheelFrame()

virtual WheelFrame & trax::RollingStock::GetWheelFrame ( int idx) const
pure virtual

Gets the WheelFrame at index, counting from north to south.

Parameters
idxThe index of the WheelFrame. 0 is the northernmost.
Exceptions
std::out_of_rangeif idx is negative or idx >= GetNumberOfWheelFrame().

The documentation for this struct was generated from the following file: