40 static dclspc std::unique_ptr<NarrowSwitch>
Make(
unsigned char numBranches )
noexcept;
188 static dclspc std::unique_ptr<Switch>
Make() noexcept;
191 static constexpr
char slot_count = 3;
192 static constexpr
char status_count = 2;
193 static constexpr
char branch_count = 1;
329 static dclspc std::unique_ptr<ThreeWaySwitch>
Make() noexcept;
332 static constexpr
char slot_count = 4;
333 static constexpr
char status_count = 3;
334 static constexpr
char branch_count = 2;
442 static dclspc std::unique_ptr<SingleSlipSwitch>
Make() noexcept;
530 static dclspc std::unique_ptr<DoubleSlipSwitch>
Make() noexcept;
606 struct SwitchAligned{
608 virtual void Attach( std::shared_ptr<Connector> pSwitch ) = 0;
610 virtual bool PreserveUpDirection()
const = 0;
612 virtual void PreserveUpDirection(
bool bPreserveUpDirection ) = 0;
614 virtual IDType GetSwitchRef()
const = 0;
616 virtual std::shared_ptr<Connector> GetSwitch()
const = 0;
619 virtual ~SwitchAligned() =
default;
620 SwitchAligned(
const SwitchAligned& ) =
delete;
621 SwitchAligned( SwitchAligned&& ) =
delete;
622 SwitchAligned& operator=(
const SwitchAligned& ) =
delete;
623 SwitchAligned& operator=( SwitchAligned&& ) =
delete;
625 SwitchAligned() =
default;
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
constexpr Length infinite__length
Dimensionated infinite values.
Definition DimensionedValues.h:359
Value< Dimension<-1, 0, 0 > > AnglePerLength
Angle per length.
Definition DimensionedValues.h:321
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
dclspc DoubleSlipSwitch::Status ToDoubleSlipSwitchStatus(const std::string &status)
Makes a status value from a status string.
dclspc NarrowSwitch::Status NarrowSwitchStatusFrom(const std::string &socketName)
dclspc NarrowSwitch::Status ToNarrowSwitchStatus(const std::string &status)
Makes a status value from a status string.
dclspc SingleSlipSwitch::Status SingleSlipSwitchStatusFrom(const std::string &socketName)
dclspc DoubleSlipSwitch::Status DoubleSlipSwitchStatusFrom(const std::string &socketName)
dclspc SingleSlipSwitch::Status ToSingleSlipSwitchStatus(const std::string &status)
Makes a status value from a status string.
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
A Connector rearranges the connections between several track ends.
Definition Connector.h:226
virtual void Set(const Track &trackA, Track::EndType trackendA, const Track &trackB, Track::EndType trackendB, bool pulse=true)=0
Sets the Connector to the setting that connects the two track ends.
A double slip switch is made from eight tracks that form a crossing with the possibility to divert th...
Definition Switch.h:527
virtual MultiPlug & PlugTo(Status status)=0
Gets a Plug that switches to the specified Status.
virtual Status Set(Status to, bool pulse=true)=0
Turns the switch to the specified setting.
Status
Status values of a switch.
Definition Switch.h:556
static dclspc std::unique_ptr< DoubleSlipSwitch > Make() noexcept
Makes a standard DoubleSlipSwitch object.
virtual void SetCenter(const spat::Frame< Length, One > ¢er)=0
Sets the center of the switch.
virtual Status Get() const =0
Gets the setting of the switch.
SlotNames
Definition Switch.h:533
@ slot_10
diverging track end connected with third narrowing
Definition Switch.h:545
@ slot_8
diverging track end connected with first narrowing
Definition Switch.h:543
@ slot_7
crossing track end connected with fourth narrowing
Definition Switch.h:542
@ slot_0
first narrowing track end
Definition Switch.h:535
@ slot_11
diverging track end connected with second narrowing
Definition Switch.h:546
@ slot_6
crossing track end connected with third narrowing
Definition Switch.h:541
@ slot_1
second narrowing track end on the same side of first
Definition Switch.h:536
@ slot_3
fourth narrowing track end on same side to third
Definition Switch.h:538
@ slot_2
third narrowing track end on opposite side to the first
Definition Switch.h:537
@ slot_5
crossing track end connected with second narrowing
Definition Switch.h:540
@ slot_9
diverging track end connected with fourth narrowing
Definition Switch.h:544
@ slot_4
crossing track end connected with first narrowing
Definition Switch.h:539
virtual Jack & JackOn(Status status)=0
Gets a Jack that pulses its Plug if the specified Status is set.
Type used for IDs in the trax library.
Definition IDType.h:43
A jack a plug can get connected with.
Definition Jack.h:83
A MultiPlug provides a variable number of actual Plugs to one input slot.
Definition Plug.h:307
Common interface for switch types that maintain an incomming (narrow) track, an outgoing straight tra...
Definition Switch.h:37
virtual Location Bifurcation() const =0
Gets a track Location object right at the bifurcation point of the switch with a foreward direction a...
virtual void NarrowTrack(std::shared_ptr< TrackBuilder > pNarrowTrack, Track::EndType trackEnd)=0
Occupies the slot for the narrow track.
virtual Status Get() const =0
Gets the setting of the switch.
virtual std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > StraightTrack() const =0
virtual void DivergedTrack(int divTrackID, std::shared_ptr< TrackBuilder > pDivergedTrack, Track::EndType trackEnd)=0
Occupies the slot for the diverging track.
static dclspc std::unique_ptr< NarrowSwitch > Make(unsigned char numBranches) noexcept
Makes a standard NarrowSwitch object.
virtual MultiPlug & PlugToGo() noexcept=0
Gets a Plug that sets the switch to go.
virtual void ClearStraightTrack()=0
Clears the slot for the straight track.
virtual std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > NarrowTrack() const =0
virtual MultiPlug & PlugToDivergedTrack(int divTrackID)=0
Gets a Plug that sets the switch to the outgoing track.
virtual void StraightTrack(std::shared_ptr< TrackBuilder > pStaightTrack, Track::EndType trackEnd)=0
Occupies the slot for the straight track.
virtual Jack & JackOnDivergedTrack(int divTrackID)=0
Gets a Jack that pulses its Plug if the switch is set to the branching track.
virtual Status Set(Status to, bool pulse=true)=0
Turns the switch to the specified setting.
virtual void ClearNarrowTrack()=0
Clears the slot for the narrow track.
SlotNames
Definition Switch.h:42
@ slot_2
first diverging track
Definition Switch.h:46
@ slot_N
Nth diverging track.
Definition Switch.h:50
@ slot_1
straight track
Definition Switch.h:45
@ slot_5
fourth diverging track
Definition Switch.h:49
@ slot_3
second diverging track
Definition Switch.h:47
@ slot_0
narrow track
Definition Switch.h:44
@ slot_4
third diverging track
Definition Switch.h:48
Status
Status.
Definition Switch.h:56
@ go
go over straight track
Definition Switch.h:58
@ branch2
go over second diverging track
Definition Switch.h:61
@ toggle
toggle the switch
Definition Switch.h:67
@ branch1
go over first diverging track
Definition Switch.h:60
@ branch
go over first diverging track
Definition Switch.h:59
@ empty
set to first empty from go over branch1 to CntDivergedTracks()
Definition Switch.h:69
virtual int CntDivergedTracks() const =0
virtual MultiPlug & PlugTo(Status status)=0
Gets a Plug that switches to the specified Status.
virtual std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > DivergedTrack(int divTrackID) const =0
virtual Jack & JackOnGo() noexcept=0
Gets a Jack that pulses its Plug if the switch is set to go.
virtual Jack & JackOn(Status status)=0
Gets a Jack that pulses its Plug if the specified Status is set.
virtual void ClearDivergedTrack(int divTrackID)=0
Clears the slot for the straight track.
A single slip switch is made from five tracks that form a crossing with the possibility to divert the...
Definition Switch.h:439
virtual void SetCenter(const spat::Frame< Length, One > ¢er)=0
Sets the center of the switch.
virtual MultiPlug & PlugTo(Status status)=0
Gets a Plug that switches to the specified Status.
Status
Status values of a switch.
Definition Switch.h:460
virtual Status Get() const =0
Gets the setting of the switch.
SlotNames
Definition Switch.h:444
@ slot_4
diverging track end connecting to slot_0
Definition Switch.h:450
@ slot_5
diverging track end connecting to slot_1
Definition Switch.h:451
@ slot_3
second straight track end
Definition Switch.h:449
@ slot_1
second narrow track end
Definition Switch.h:447
@ slot_0
first narrow track end
Definition Switch.h:446
@ slot_2
first straight track end
Definition Switch.h:448
static dclspc std::unique_ptr< SingleSlipSwitch > Make() noexcept
Makes a standard SingleSlipSwitch object.
virtual Status Set(Status to, bool pulse=true)=0
Turns the switch to the specified setting.
virtual Jack & JackOn(Status status)=0
Gets a Jack that pulses its Plug if the specified Status is set.
A Switch rearranges the connections between three track ends.
Definition Switch.h:186
virtual bool IsNormal(bool bStopAtFirstTrack=true, Length maxDistance=infinite__length) const =0
Returns true, if the straight track has fewer deviation from the narrow's track direction than the di...
virtual bool IsY(bool bStopAtFirstTrack=true, Length maxDistance=infinite__length, AnglePerLength margin=epsilon__angle/80_m) const =0
Is this an Y - switch?
virtual bool IsHorizontal(bool bStopAtFirstTrack=true, Length maxDistance=infinite__length) const =0
virtual void DivergedTrack(std::shared_ptr< TrackBuilder > pDivergedTrack, Track::EndType trackEnd)=0
Occupies the slot for the diverged track.
virtual bool BranchLeftOrRight(bool bStopAtFirstTrack=true, Length maxDistance=infinite__length) const =0
Tests wether the branching track develops to the left or right side of the straight track.
virtual MultiPlug & PlugToBranch() noexcept=0
Gets a Plug that sets the switch to branch.
virtual bool Normalize()=0
Swaps the outgoing tracks if this switch is not normal.
virtual bool BranchUpOrDown(bool bStopAtFirstTrack=true, Length maxDistance=infinite__length) const =0
Tests wether the branching track develops to the up or down side of the straight track.
virtual void ClearDivergedTrack()=0
Clears the slot for the diverged track.
virtual void SwapTracks()=0
Swaps the straight and the diverged track.
virtual Jack & JackOnBranch() noexcept=0
Gets a Jack that pulses its Plug if the switch is set to branch.
static dclspc std::unique_ptr< Switch > Make() noexcept
Makes a standard Switch object.
virtual bool IsVertical(bool bStopAtFirstTrack=true, Length maxDistance=infinite__length) const =0
A switch that is connecting one narrow end to three outgoing track ends.
Definition Switch.h:326
virtual MultiPlug & PlugToBranch2() noexcept=0
Gets a Plug that sets the switch to branch.
virtual Status StatusToRight() const =0
virtual Jack & JackOnBranch2() noexcept=0
Gets a Jack that pulses its Plug if the switch is set to branch.
virtual void SwapStraightWithDiverged2()=0
Swaps the straight and the diverged2 track.
virtual void DivergedTrack2(std::shared_ptr< TrackBuilder > pDivergedTrack2, Track::EndType trackEnd)=0
Occupies the slot for the diverged track.
virtual void DivergedTrack1(std::shared_ptr< TrackBuilder > pDivergedTrack1, Track::EndType trackEnd)=0
Occupies the slot for the diverged track.
virtual bool IsNormal() const =0
Returns true, if the straight track lies in the middle of the two diverging tracks and the first dive...
virtual void SwapStraightWithDiverged()=0
Swaps the straight and the diverged track.
virtual bool Normalize()=0
Rearranges the outgoing tracks if this switch is not normal.
virtual Status StatusToMiddle() const =0
virtual Jack & JackOnBranch1() noexcept=0
Gets a Jack that pulses its Plug if the switch is set to branch.
virtual void ClearDivergedTrack2()=0
Clears the slot for the diverged2 track.
virtual Status StatusToLeft() const =0
virtual void ClearDivergedTrack1()=0
Clears the slot for the diverged1 track.
virtual MultiPlug & PlugToBranch1() noexcept=0
Gets a Plug that sets the switch to branch.
static dclspc std::unique_ptr< ThreeWaySwitch > Make() noexcept
Makes a standard ThreeWaySwitch object.
virtual void SwapDivergedWithDiverged2()=0
Swaps the diverged and the diverged2 track.
Interface for making and shaping tracks.
Definition Track.h:831
Interface for a track used to calculate 3D positions.
Definition Track.h:275
EndType
Designates one of the two ends of a track.
Definition Track.h:292