Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
WheelFrame.h
1// trax track library
2// AD 2023
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8//
9// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
10// Copyright (c) 2019 Marc-Michael Horstmann
11//
12// Permission is hereby granted to any person obtaining a copy of this software
13// and associated source code (the "Software"), to use, view, and study the
14// Software for personal or internal business purposes, subject to the following
15// conditions:
16//
17// 1. Redistribution, modification, sublicensing, or commercial use of the
18// Software is NOT permitted without prior written consent from the copyright
19// holder.
20//
21// 2. The Software is provided "AS IS", without warranty of any kind, express
22// or implied.
23//
24// 3. All copies of the Software must retain this license notice.
25//
26// For further information, please contact: horstmann.marc@trendverlag.de
27
28#pragma once
29
30#include "Bogie.h"
31#include "trax/Event.h"
32
33namespace trax{
34
36 struct Wheelset;
37 struct TrackJointLimits;
38
44 struct WheelFrame : virtual Bogie
45 {
46
51 static dclspc std::shared_ptr<WheelFrame> Make( Scene& scene, std::shared_ptr<Gestalt> pGestalt = nullptr ) noexcept;
52
53
54
56 virtual void Limits( const TrackJointLimits& wfl ) = 0;
57
58
60 virtual const TrackJointLimits& Limits() const noexcept = 0;
61
62
68 virtual std::shared_ptr<const TractionForceCharacteristic> SetTractionForceCharacteristic( std::shared_ptr<const TractionForceCharacteristic> pCharacteristic ) = 0;
69
70
72 virtual std::shared_ptr<const TractionForceCharacteristic> GetTractionForceCharacteristic() const = 0;
73
74
78 virtual void EnableDerailing( bool bEnable = true ) noexcept = 0;
79
80
82 virtual bool IsDerailingEnabled() const noexcept = 0;
83
84
85
94
96 virtual void Anchor( const spat::Frame<Length,One>& anchor ) noexcept = 0;
97
99 virtual spat::Frame<Length,One> Anchor() const noexcept = 0;
100
103 virtual spat::Frame<Length,One> UnflippedAnchor() const noexcept = 0;
105
106
107 //Wheelsets:
108
109 using Bogie::Attach;
110
115 virtual int Attach( const Wheelset& ws ) = 0;
116
117
119 virtual void DetachAllWheelsets() = 0;
120
121
123 virtual int CntWheelsets() const noexcept = 0;
124
125
128 virtual const Wheelset& GetWheelset( int idx ) const = 0;
129
130
131 struct Event : trax::Event{
132
133 virtual WheelFrame& GetWheelFrame() const noexcept = 0;
134 };
135
136 // Jacks 'N Plugs:
137
140 virtual Jack& JackOnRail() noexcept = 0;
141
142
145 virtual Jack& JackOnDerail() noexcept = 0;
146
147
150 virtual Jack& JackOnRollingStart() noexcept = 0;
151
152
155 virtual Jack& JackOnRollingStop() noexcept = 0;
156
157
160 virtual Jack& JackOnMotorActive() noexcept = 0;
161
162
165 virtual Jack& JackOnMotorInactive() noexcept = 0;
166
167
170 virtual Jack& JackOnBrakeActive() noexcept = 0;
171
172
175 virtual Jack& JackOnBrakeInactive() noexcept = 0;
176
177
180 virtual Jack& JackOnTrackTransition() noexcept = 0;
181
182
185 virtual Jack& JackOnStartTilting() noexcept = 0;
186
187
190 virtual Jack& JackOnStopTilting() noexcept = 0;
191 };
192
193 // Were is this used?
195 //std::shared_ptr<Bogie> RemoveUnusedWheelFrames( std::shared_ptr<Bogie> pBogie );
196
197}
198
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
STL namespace.
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
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
A physical simulation scene for running a simulation and creating physical objects in the scene.
Definition Scene.h:72
The maximum forces and spatial deviations of a WheelFrame used by physics calculations.
Definition TrackJointLimits.h:38
Function that defines the characteristic behaviour of a motor to change its maximum available trackti...
Definition TractionForceCharacteristic.h:59
A WheelFrame is a Bogie that hosts Wheelsets and a TrackJoint and therefore can directly get attached...
Definition WheelFrame.h:45
virtual Jack & JackOnRail() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame gets railed on a track.
virtual const Wheelset & GetWheelset(int idx) const =0
Gets the Wheelset denoted by idx.
virtual int CntWheelsets() const noexcept=0
Gets the number of Wheelsets attached directly to this WheelFrame.
virtual void DetachAllWheelsets()=0
Removes all the Wheelsets.
static dclspc std::shared_ptr< WheelFrame > Make(Scene &scene, std::shared_ptr< Gestalt > pGestalt=nullptr) noexcept
Makes a WheelFrame object.
virtual void Limits(const TrackJointLimits &wfl)=0
Sets all the limits for this wheelframe.
virtual Jack & JackOnStartTilting() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame starts tilting.
virtual void EnableDerailing(bool bEnable=true) noexcept=0
A WheelFrame might derail during the simulation, if the stress of forces gets big enough....
virtual Jack & JackOnBrakeInactive() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame's brake gets deactivated.
virtual Jack & JackOnTrackTransition() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame passes the connection between two tracks.
virtual Jack & JackOnMotorActive() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame's motor gets activated in order to reach the targe...
virtual void Anchor(const spat::Frame< Length, One > &anchor) noexcept=0
virtual spat::Frame< Length, One > UnflippedAnchor() const noexcept=0
virtual Jack & JackOnRollingStart() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame starts to roll.
virtual Jack & JackOnRollingStop() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame stops to roll.
virtual int Attach(const Wheelset &ws)=0
Attaches a Wheelset to this WheelFrame.
virtual Jack & JackOnStopTilting() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame starts tilting.
virtual Jack & JackOnBrakeActive() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame's brake gets activated in order to reach the targe...
virtual std::shared_ptr< const TractionForceCharacteristic > SetTractionForceCharacteristic(std::shared_ptr< const TractionForceCharacteristic > pCharacteristic)=0
applies a TractionForceCharacteristic to the thrust calculations.
virtual Jack & JackOnDerail() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame derails.
virtual Jack & JackOnMotorInactive() noexcept=0
Gets a Jack that pulses its Plug if the WheelFrame's motor gets deactivated.
virtual std::shared_ptr< const TractionForceCharacteristic > GetTractionForceCharacteristic() const =0
virtual bool IsDerailingEnabled() const noexcept=0
Describing data of a wheelset.
Definition Wheelset.h:40