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

A Bogie is a RailRunner that can be attached to another Bogie by a swivel and can be coupled to another Bogie by a coupling. More...

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

Inheritance diagram for trax::Bogie:

Classes

struct  CouplingProps
 Describing data of a coupling. More...

Public Member Functions

virtual std::shared_ptr< BogieThisBogie () const noexcept=0
 Gets a shared pointer to this.
virtual GestaltGetGestalt () const noexcept=0
virtual RollingStockGetRollingStock () const noexcept=0
virtual std::pair< std::shared_ptr< Bogie >, spat::Frame< Length, One > > GetChild (EndType atEnd) const noexcept=0
 Gets the a pointer to a child bogie and the pose relative to this Bogie, were the swivel axis is running through the Bin vector.
virtual std::pair< std::shared_ptr< Bogie >, spat::Frame< Length, One > > GetParent (EndType atEnd=EndType::any) const noexcept=0
 Gets the a pointer to a parent bogie and the
pose relative to this Bogie, were the swivel axis is running through the Bin vector.
virtual std::shared_ptr< BogieGetFirst () const noexcept=0
 Gets the first bogie in the rolling stock.
virtual std::shared_ptr< BogieGetNext () const noexcept=0
 Gets the next bogie in the rolling stock.
virtual std::shared_ptr< BogieGetPrevious () const noexcept=0
 Gets the previous bogie in the rolling stock.
virtual std::shared_ptr< BogieGetLast () const noexcept=0
 Gets the last bogie in the rolling stock.
virtual void Detach (EndType atEnd=EndType::all) noexcept=0
 Detaches a bogie from its parent(s).
virtual bool Couple (EndType end, Bogie &with, EndType withEnd, bool btriggerPulses=true) noexcept=0
 Couples this Bogie with another at the respective ends.
virtual std::pair< std::shared_ptr< Bogie >, EndTypeGetCoupledBogie (EndType end) const noexcept=0
 Get the coupled Bogie.
virtual void SetCouplingProps (EndType atEnd, const CouplingProps &props)=0
 Sets the coupling properties.
virtual CouplingProps GetCouplingProps (EndType atEnd) const noexcept=0
 Gets the coupling properties.
virtual spat::Sphere< LengthGetCoupling (EndType end) const noexcept=0
virtual void SetCouplingHeight (EndType end, Length height)=0
 Sets the height of the coupling over the track.
virtual bool BreakCoupling (EndType atEnd, bool btriggerPulses=true) noexcept=0
 Breaks (not uncouples) the coupling at the enoted end.
virtual JackJackOnMotorStart () noexcept=0
 Gets a Jack that pulses its Plug if the RailRunner's motor starts, i.e. if the thrust is set to nonzero value.
virtual JackJackOnMotorStop () noexcept=0
 Gets a Jack that pulses its Plug if the RailRunner's motor stops, i.e. if the thrust is set to zero.
virtual JackJackOnBrakeApply () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame's brakes are applied, i.e. if the braking value is set to nonzero.
virtual JackJackOnBrakeRelease () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame's brakes are released, i.e. if the braking value is set to zero.
virtual JackJackOnCouplingForceLimitExceeded (EndType end)=0
 Gets a Jack that pulses its Plug if one (or any) of the RailRunner's outmost couplings experiences a force greater than the maximum coupling force.
virtual JackJackOnNorthSwivelBendingIn () noexcept=0
 Gets a Jack that pulses its Plug if the Bogie's hinge, that connects it to its north child, is bending against its natural turning direction about more than pi/64.
virtual JackJackOnNorthSwivelBendingOut () noexcept=0
 Gets a Jack that pulses its Plug if the Bogie's hinge, that connects it to its north child, is returning from its bending against its natural turning direction.
virtual JackJackOnSouthSwivelBendingIn () noexcept=0
 Gets a Jack that pulses its Plug if the Bogie's hinge, that connects it to its south child, is bending against its natural turning direction about more than pi/64.
virtual JackJackOnSouthSwivelBendingOut () noexcept=0
 Gets a Jack that pulses its Plug if the Bogie's hinge, that connects it to its south child, is returning from its bending against its natural turning direction.
Attachement

Attaches a Bogie by a swivel as a child to this Bogie.

There are two child bogies per parent bogie max. It is possible to attach a Bogie to more than one parent as is the case for Jacobs bogies. Seen from a rolling stock a child bogie at the edge will always be connected with its innermost parent slot (i.e. north_child get assigned to south_parent and vice versa).

virtual void Attach (std::shared_ptr< Bogie > pChildBogie, EndType atEnd, const spat::Frame< Length, One > &swivelPose)=0
virtual void Attach (std::shared_ptr< Bogie > pChildBogie, EndType atEnd)=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 void Rail (const Location &location, bool bMoveTo=true)=0
 Attaches this RailRunner onto the specified track location.
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 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 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
Public Member Functions inherited from trax::Simulated
virtual bool Start (Scene &scene)=0
 Called if the simulation is started.
virtual void Idle ()=0
 Called during the simulation calculations, to perform tasks foreign to the physical simulation.
virtual void Update (Time dt=fixed_timestep)=0
 Called to update the simulated object after the simuation step finishes.
virtual void Pause () noexcept=0
 Called if the simulation is paused.
virtual void Resume () noexcept=0
 Called if the simulation is resumed after pause.
virtual void Stop () noexcept=0
 Called if the simulation is stopped.

Static Public Member Functions

static dclspc std::shared_ptr< BogieMake (Scene &scene, std::shared_ptr< Gestalt > pGestalt=nullptr) noexcept
 Makes a Bogie object.

Additional Inherited Members

Public Types inherited from trax::RailRunner
enum class  EndType : char {
  none = 0 , north , south , any ,
  all
}
 Types of the RailRunner's end's. More...

Detailed Description

A Bogie is a RailRunner that can be attached to another Bogie by a swivel and can be coupled to another Bogie by a coupling.

///  <-- north              south -->
/// 
///          |        |
///       [      B       ]      
///    |    |          |    |
///   [     A    ] [   C     ]
/// _____O__O__O_____O__O__O______________
///
/// '|' are the north and south swivel hinges (some of them not connected).
/// 

The north and south parent/child slots are populated in the order along the track. So the north child bogie would have been connected by its south parent slot and the other way around. As a rule north and south and parent and child connects respectively; all other combinations are not allowed. In reality there are configurations with three bogies, sharing one parent, e.g. SBB Re 6/6, which carries a Bo'Bo'Bo' configuration, but the center child bogie is not a Bogie in our sense, since it is not rotatable, but shifts aside. These wheels would be attached to the parent.

Member Function Documentation

◆ Attach() [1/2]

virtual void trax::Bogie::Attach ( std::shared_ptr< Bogie > pChildBogie,
EndType atEnd )
pure virtual
Parameters
pChildBogiePointer to a Bogie to get attached.
atEndThe end of this Bogie to attach the child Bogie to.
Exceptions
std::runtime_errorif the child Bogie is already attached to a parent at the respective slot or there is already a child bogie attached to this parent Bogie in the respective slot. Also attaching a child and parent twice would count as an error. Also if one of the Bogies is already member of a RollingStock the exception is thrown.

Implemented in trax::WheelFrame.

◆ Attach() [2/2]

virtual void trax::Bogie::Attach ( std::shared_ptr< Bogie > pChildBogie,
EndType atEnd,
const spat::Frame< Length, One > & swivelPose )
pure virtual
Parameters
pChildBogiePointer to a Bogie to get attached.
atEndThe end of this Bogie to attach the child Bogie to.
swivelPoseThe pose relative to this Bogie's Body frame through whiches Bin vector the hinge axis will run. It defaults to the child Bogie's Anchor position or the center of its two child swivels.
Exceptions
std::runtime_errorif the child Bogie is already attached to a parent at the respective slot or there is already a child bogie attached to this parent Bogie in the respective slot. Also attaching a child and parent twice would count as an error. Also if one of the Bogies is already member of a RollingStock the exception is thrown.

Implemented in trax::WheelFrame.

◆ BreakCoupling()

virtual bool trax::Bogie::BreakCoupling ( EndType atEnd,
bool btriggerPulses = true )
pure virtualnoexcept

Breaks (not uncouples) the coupling at the enoted end.

Same as uncouple but sends ForceLimitExceeded pulse as if the coupling would have actually broken due to overstrech.

Parameters
atEndCoupling to break.
btriggerPulsesIf true the respective jacks are pulsing.
Returns
True if a coupling was defined and actually coupled.

◆ Couple()

virtual bool trax::Bogie::Couple ( EndType end,
Bogie & with,
EndType withEnd,
bool btriggerPulses = true )
pure virtualnoexcept

Couples this Bogie with another at the respective ends.

It doesn't matter, wether the two couplings are near each other or not. The coupling will try to maintain the actual distance of the two Bogies's ends. The coupling attempt will fail if the two Bogies are already coupled (with different partners or the same parters at different ends) or if one of the couplings is deactivated. An coupling attempt will also fail, when two couplings wear different coupling type indices.

See also
Bogie::CouplingProps.
Parameters
endEnd of this Bogie.
withOther Bogie.
withEndOther Bogie's end to couple with.
btriggerPulsesIf true the respective JackOnCouple jacks are pulsing.
Returns
true if a new coupling was established or the two Bogies were already properly coupled.

◆ GetChild()

virtual std::pair< std::shared_ptr< Bogie >, spat::Frame< Length, One > > trax::Bogie::GetChild ( EndType atEnd) const
pure virtualnoexcept

Gets the a pointer to a child bogie and the pose relative to this Bogie, were the swivel axis is running through the Bin vector.

Parameters
atEndThe child on the north or south end of this Bogie.
Returns
The north or the south child bogie and the relative swivel position.

◆ GetCoupledBogie()

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

Get the coupled Bogie.

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

◆ GetNext()

virtual std::shared_ptr< Bogie > trax::Bogie::GetNext ( ) const
pure virtualnoexcept

Gets the next bogie in the rolling stock.

The bogies of an bogie arrangement form a unique order along the track.

◆ GetParent()

virtual std::pair< std::shared_ptr< Bogie >, spat::Frame< Length, One > > trax::Bogie::GetParent ( EndType atEnd = EndType::any) const
pure virtualnoexcept

Gets the a pointer to a parent bogie and the
pose relative to this Bogie, were the swivel axis is running through the Bin vector.

Parameters
atEndThe parent on the north or south end of this Bogie.
Returns
The north or the south parent bogie and the relative swivel position.

◆ GetPrevious()

virtual std::shared_ptr< Bogie > trax::Bogie::GetPrevious ( ) const
pure virtualnoexcept

Gets the previous bogie in the rolling stock.

The bogies of an bogie arrangement form a unique order along the track.

◆ GetRollingStock()

virtual RollingStock * trax::Bogie::GetRollingStock ( ) const
pure virtualnoexcept
Returns
The RollingStock this Bogie is member of or nullptr if none.

◆ Make()

dclspc std::shared_ptr< Bogie > trax::Bogie::Make ( Scene & scene,
std::shared_ptr< Gestalt > pGestalt = nullptr )
staticnoexcept

Makes a Bogie object.

Parameters
sceneThe scene to put the Bogie into.
pGestaltThe Gestalt to use. If no Gestalt is given one is automatically created.

◆ SetCouplingHeight()

virtual void trax::Bogie::SetCouplingHeight ( EndType end,
Length height )
pure virtual

Sets the height of the coupling over the track.

This changes the CouplingProps::Position of the coupling.

Parameters
endEnd of this TrainComponent to set the coupling height for.
heightThe height of the coupling over the track.
Exceptions
std::runtime_errorif the coupling is already coupled or the Bogie neither is a WheelFrame nor has a northern child WheelFrame.

◆ SetCouplingProps()

virtual void trax::Bogie::SetCouplingProps ( EndType atEnd,
const CouplingProps & props )
pure virtual

Sets the coupling properties.

Exceptions
std::runtime_errorif the coupling is already coupled.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/rigid/trains/Bogie.h