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

A WheelFrame is a Bogie that hosts Wheelsets and a TrackJoint and therefore can directly get attached to a track. It also is responsible for managing a TractionForceCharacteristic and feeding the TrackJoint with data. More...

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

Inheritance diagram for trax::WheelFrame:

Classes

struct  Event

Public Member Functions

virtual void Limits (const TrackJointLimits &wfl)=0
 Sets all the limits for this wheelframe.
virtual const TrackJointLimitsLimits () const noexcept=0
virtual std::shared_ptr< const TractionForceCharacteristicSetTractionForceCharacteristic (std::shared_ptr< const TractionForceCharacteristic > pCharacteristic)=0
 applies a TractionForceCharacteristic to the thrust calculations.
virtual std::shared_ptr< const TractionForceCharacteristicGetTractionForceCharacteristic () const =0
virtual void EnableDerailing (bool bEnable=true) noexcept=0
 A WheelFrame might derail during the simulation, if the stress of forces gets big enough. This switches this possibility on or off.
virtual bool IsDerailingEnabled () const noexcept=0
virtual int Attach (const Wheelset &ws)=0
 Attaches a Wheelset to this WheelFrame.
virtual void DetachAllWheelsets ()=0
 Removes all the Wheelsets.
virtual int CntWheelsets () const noexcept=0
 Gets the number of Wheelsets attached directly to this WheelFrame.
virtual const WheelsetGetWheelset (int idx) const =0
 Gets the Wheelset denoted by idx.
virtual JackJackOnRail () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame gets railed on a track.
virtual JackJackOnDerail () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame derails.
virtual JackJackOnRollingStart () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame starts to roll.
virtual JackJackOnRollingStop () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame stops to roll.
virtual JackJackOnMotorActive () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame's motor gets activated in order to reach the target velocity.
virtual JackJackOnMotorInactive () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame's motor gets deactivated.
virtual JackJackOnBrakeActive () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame's brake gets activated in order to reach the target velocity.
virtual JackJackOnBrakeInactive () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame's brake gets deactivated.
virtual JackJackOnTrackTransition () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame passes the connection between two tracks.
virtual JackJackOnStartTilting () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame starts tilting.
virtual JackJackOnStopTilting () noexcept=0
 Gets a Jack that pulses its Plug if the WheelFrame starts tilting.
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
Anchor

Gets or sets the local anchor that gets aligned to the track by the track joint.

The frame in local coordinates relative to the WheelFrame's body frame, which will get aligned to the track. If the WheelFrame becomes railed in anti direction on a track, this anchor will get flipped.

See also
RailRunner::GetGlobalAnchor()
virtual void Anchor (const spat::Frame< Length, One > &anchor) noexcept=0
virtual spat::Frame< Length, OneAnchor () const noexcept=0
virtual spat::Frame< Length, OneUnflippedAnchor () const noexcept=0
Public Member Functions inherited from trax::Bogie
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.
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< WheelFrameMake (Scene &scene, std::shared_ptr< Gestalt > pGestalt=nullptr) noexcept
 Makes a WheelFrame object.
Static Public Member Functions inherited from trax::Bogie
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 WheelFrame is a Bogie that hosts Wheelsets and a TrackJoint and therefore can directly get attached to a track. It also is responsible for managing a TractionForceCharacteristic and feeding the TrackJoint with data.

Member Function Documentation

◆ Anchor() [1/2]

virtual spat::Frame< Length, One > trax::WheelFrame::Anchor ( ) const
pure virtualnoexcept
Returns
The local anchor actually in use.

◆ Anchor() [2/2]

virtual void trax::WheelFrame::Anchor ( const spat::Frame< Length, One > & anchor)
pure virtualnoexcept
Parameters
anchorOrthogonal frame, describing the anchor in body relative coordinates.

◆ Attach() [1/3]

virtual int trax::WheelFrame::Attach ( const Wheelset & ws)
pure virtual

Attaches a Wheelset to this WheelFrame.

Returns
The index of the attached Wheelset.
Exceptions
std::logic_errorIf the WheelFrame is railed
std::invalid_argumentfor inavild Wheelset parameters.

◆ Attach() [2/3]

virtual void trax::Bogie::Attach ( std::shared_ptr< Bogie > pChildBogie,
EndType atEnd )
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.

Implements trax::Bogie.

◆ Attach() [3/3]

virtual void trax::Bogie::Attach ( std::shared_ptr< Bogie > pChildBogie,
EndType atEnd,
const spat::Frame< Length, One > & swivelPose )
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.

Implements trax::Bogie.

◆ GetTractionForceCharacteristic()

virtual std::shared_ptr< const TractionForceCharacteristic > trax::WheelFrame::GetTractionForceCharacteristic ( ) const
pure virtual
Returns
A pointer to the actually applied characteristic

◆ GetWheelset()

virtual const Wheelset & trax::WheelFrame::GetWheelset ( int idx) const
pure virtual

Gets the Wheelset denoted by idx.

Parameters
idxIndex of the Wheelset 0 <= idx < CntWheelsets()

◆ IsDerailingEnabled()

virtual bool trax::WheelFrame::IsDerailingEnabled ( ) const
pure virtualnoexcept
Returns
true if the derailing feature is enabled.

◆ Limits()

virtual const TrackJointLimits & trax::WheelFrame::Limits ( ) const
pure virtualnoexcept
Returns
A reference to the WheelFrames Limits.

◆ Make()

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

Makes a WheelFrame object.

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

◆ SetTractionForceCharacteristic()

virtual std::shared_ptr< const TractionForceCharacteristic > trax::WheelFrame::SetTractionForceCharacteristic ( std::shared_ptr< const TractionForceCharacteristic > pCharacteristic)
pure virtual

applies a TractionForceCharacteristic to the thrust calculations.

The default is a characteristic wich will allways be 1.

Parameters
pCharacteristicPointer to functor.
Returns
the old value or nullptr if the default was set.

◆ UnflippedAnchor()

virtual spat::Frame< Length, One > trax::WheelFrame::UnflippedAnchor ( ) const
pure virtualnoexcept
Returns
The unflipped local anchor.
Exceptions
std::runtime_errorif the wheelframe is not railed.

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