|
|
virtual std::shared_ptr< Train > | ThisTrain () const noexcept=0 |
| | Gets a shared pointer to this.
|
| virtual int | GetNumberOfComponents () const noexcept=0 |
| virtual std::shared_ptr< TrainComponent > | GetComponent (int index) const =0 |
| | Gets the TrainComponent at zero based index.
|
| virtual int | GetIndexOf (const TrainComponent &component) const noexcept=0 |
| virtual void | Take (EndType atEnd, Train &fromTrain, EndType withEnd)=0 |
| | Takes all components from another Train.
|
| virtual std::pair< std::shared_ptr< Train >, std::shared_ptr< Train > > | SplitAfter (int idxAt)=0 |
| | Splits this Train into two Trains at the specified index.
|
| virtual std::shared_ptr< Train > | Separate ()=0 |
| | Removes everything south of a broken internal coupling from this Train, and returns a new Train with the components that were removed.
|
| virtual void | Reduce (bool bRecursive=true) noexcept=0 |
| | Removes TrainComponents from this Train and includes them directly to the parent train. This Train will become empty and !IsValid().
|
| virtual void | Clear () noexcept=0 |
| | Removes all components from this train.
|
| virtual bool | Couple (EndType thisEnd, Train &with, EndType withEnd) noexcept=0 |
| | Couples this Train with another at the respective ends.
|
| virtual bool | IsUnCoupledInternally () const noexcept=0 |
|
virtual struct Jack & | JackOnUnCoupleInternal () noexcept=0 |
| | Gets a Jack that pulses its Plug if a coupling inside the train (including all sub-Trains) is uncoupled for whatever reason.
|
| virtual bool | Couple (EndType end, TrainComponent &with, EndType withEnd, bool btriggerPulses=true) noexcept=0 |
| | Couples this TrainComponent with another at the respective ends.
|
Creates a train from components
|
| virtual bool | Create (TrainComponent &trainComponent, Orientation orientation=Orientation::Value::para)=0 |
| virtual bool | Create (const std::vector< std::pair< std::shared_ptr< TrainComponent >, Orientation > > &trainComponents, Orientation orientation=Orientation::Value::para, bool bMoveTo=true, DistanceType distance=DistanceType::actual)=0 |
Positions the component at the respective Train end, but does not couple it or include it in the train.
If this Train is railed, the component will be railed at the respective end; if the Train is not railed, the component will be moved to the respective end. - Exceptions
-
| std::exception | if there is an error in railing the component. |
| std::logic_error | if there are invalid components. |
|
| virtual void | Align (EndType atEnd, TrainComponent &component, EndType withEnd) const =0 |
| virtual void | Align (EndType atEnd, TrainComponent &component, Orientation orientation) const =0 |
Appends a TrainComponent to this Train.
The component gets coupled (if bCouple) and becomes a part of this Train, but it will not get moved or railed. Use Align() to position or rail it properly first. - Parameters
-
| atEnd | End of this Train to append to. |
| pComponent | The TrainComponent to append. Does nothing if nullptr. |
| bCouple | if true, the omponent gets coupled properly, if false the coupling state remains unchanged. |
| withEnd | End of the TrainComponent to append. |
| orientation | Orientation of the TrainComponent to append it in. |
- Exceptions
-
|
|
virtual void | Append (EndType atEnd, std::shared_ptr< TrainComponent > pComponent, EndType withEnd, bool bCouple=true)=0 |
|
virtual void | Append (EndType atEnd, std::shared_ptr< TrainComponent > pComponent, Orientation orientation, bool bCouple=true)=0 |
|
virtual std::shared_ptr< TrainComponent > | ThisTrainComponent () const noexcept=0 |
| | Gets a shared pointer to this.
|
| virtual Train * | GetTrain () const noexcept=0 |
| virtual Orientation | GetOrientation () const noexcept=0 |
| virtual std::pair< Train *, Orientation > | GetTopmostTrain () 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 std::pair< std::shared_ptr< TrainComponent >, EndType > | GetCoupledTrainComponent (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 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 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 &, EndType > | GetTipAt (EndType end)=0 |
| virtual std::pair< const Bogie &, EndType > | GetTipAt (EndType end) const =0 |
| virtual const char * | TypeName () const noexcept=0 |
|
virtual std::shared_ptr< RailRunner > | This () 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, One > | GetGlobalAnchor () 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 Jack & | JackOnCouple (EndType end)=0 |
| | Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get coupled.
|
|
virtual Jack & | JackOnUnCouple (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 Jack & | JackOnCouplingActivated (EndType end)=0 |
| | Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings get activated.
|
|
virtual Jack & | JackOnCouplingDeactivated (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 |
| 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 |
A Train is a collection of TrainComponents that are coupled in a row.
A Train can be railed and moved on a track. It can be coupled with other Trains and can be split into two Trains. A Train can be reduced to a collection of RollingStock. If a Train splits by a breaking coupling the Train object dereferences all its components and becomes invalid.