![]() |
Trax3 3.1.0
trax track library
|
Interface for a track used to calculate 3D positions. More...
#include <C:/Trend/Development/Trax3/Code/trax/Track.h>

Classes | |
| struct | End |
| Designates an end at a specific track. More... | |
| struct | Coupling |
| Designates two track ends. Typically used for coupling relations. More... | |
| struct | Overlap |
| Overlapping data. More... | |
Public Types | |
| enum class | TrackType : char { unknown = -1 , none = 0 , standard , withGeoms , movable , movable_autoconnecting , parallel } |
| enum class | EndType : char { none = -1 , front = 0 , end = 1 , any } |
| Designates one of the two ends of a track. More... | |
| typedef std::pair< std::shared_ptr< Track >, EndType > | TrackEnd |
| typedef std::pair< std::shared_ptr< const Track >, const EndType > | cTrackEnd |
Public Member Functions | |||||||||||||||||
| virtual const char * | TypeName () const noexcept=0 | ||||||||||||||||
| virtual TrackType | GetTrackType () const noexcept=0 | ||||||||||||||||
| virtual std::shared_ptr< const Body > | GetBody () const noexcept=0 | ||||||||||||||||
| virtual bool | IsValid () const noexcept=0 | ||||||||||||||||
| virtual Length | GetLength () const noexcept=0 | ||||||||||||||||
| virtual common::Interval< Length > | Range () const noexcept=0 | ||||||||||||||||
| virtual bool | IsCoupled (EndType atend=EndType::any) const noexcept=0 | ||||||||||||||||
| virtual AnglePerLength | Curvature (Length s) const =0 | ||||||||||||||||
| virtual AnglePerLength | Torsion (Length s) const =0 | ||||||||||||||||
| virtual Angle | GetTwistValue (Length s) const =0 | ||||||||||||||||
| virtual AnglePerLength | GetTwistD1 (Length s) const =0 | ||||||||||||||||
| virtual bool | IsFlat () const noexcept=0 | ||||||||||||||||
| virtual spat::Vector< One > | LocalUp () const =0 | ||||||||||||||||
| Gives the Curve's idiosyncratic up direction transformed by the track's frame. Some curves maintain some idea about where they have their upside, either because of their form (e.g Helix) or because it is extra defined (e.g. for Line). Some curves maintain no such notion (e.g. Cubic). | |||||||||||||||||
| virtual void | TNBFrame (Length s, spat::Frame< Length, One > &frame) const =0 | ||||||||||||||||
| Receives the TNB - Frame of the curve at the location. | |||||||||||||||||
| virtual TrackEnd | TransitionEnd (EndType thisEnd) const noexcept=0 | ||||||||||||||||
| Gives the Track coupled to this at the specified end. | |||||||||||||||||
| virtual void | DoTrigger (const common::Interval< Length > &range, const Event &_event) const =0 | ||||||||||||||||
| virtual bool | DoSignal (const common::Interval< Length > &range, Orientation orientation, SignalTarget &signalTarget) const =0 | ||||||||||||||||
| virtual Signal * | GetSignal (const TrackLocation &loc) const noexcept=0 | ||||||||||||||||
| Gets the first Signal in the direction given by loc. | |||||||||||||||||
| virtual Connector * | GetConnector (EndType atend) const noexcept=0 | ||||||||||||||||
| retreives a connector (e.g. a Switch) at the respective track end. | |||||||||||||||||
| virtual Connector * | GetConnector (const Orientation &inDirection) const noexcept=0 | ||||||||||||||||
| retrieves the next connector (e.g. a Switch) that can be found in the given direction. | |||||||||||||||||
| virtual void | UserData (TrackUserData *pData) noexcept=0 | ||||||||||||||||
| Sets a pointer to user provided data. | |||||||||||||||||
| virtual TrackUserData * | UserData () const noexcept=0 | ||||||||||||||||
| virtual std::shared_ptr< const TrackBuilder > | This () const noexcept=0 | ||||||||||||||||
| Gets a shared pointer to this. | |||||||||||||||||
| virtual std::shared_ptr< TrackBuilder > | This () noexcept=0 | ||||||||||||||||
| virtual std::shared_ptr< const MovableTrack > | GetMovableTrack () const noexcept=0 | ||||||||||||||||
| virtual std::shared_ptr< MovableTrack > | GetMovableTrack () noexcept=0 | ||||||||||||||||
| virtual std::shared_ptr< const ParallelizableTrack > | GetParallelizableTrack () const noexcept=0 | ||||||||||||||||
| virtual std::shared_ptr< ParallelizableTrack > | GetParallelizableTrack () noexcept=0 | ||||||||||||||||
Transition to Space | |||||||||||||||||
Gives geometrical data for a specific location along the track. The coordinates are relative to the global frame and take into accout all the Frame offset and the twist of the track.
| |||||||||||||||||
| virtual void | Transition (Length s, spat::Position< Length > &pos) const =0 | ||||||||||||||||
| Gives information about the pose on the track at the specified parameter value. | |||||||||||||||||
| virtual void | Transition (Length s, spat::Vector< One > &tan) const =0 | ||||||||||||||||
| Gives information about the pose on the track at the specified parameter value. | |||||||||||||||||
| virtual void | Transition (Length s, spat::VectorBundle< Length, One > &bundle) const =0 | ||||||||||||||||
| Gives information about the pose on the track at the specified parameter value. | |||||||||||||||||
| virtual void | Transition (Length s, spat::VectorBundle2< Length, One > &bundle) const =0 | ||||||||||||||||
| Gives information about the pose on the track at the specified parameter value. | |||||||||||||||||
| virtual void | Transition (Length s, spat::Frame< Length, One > &frame) const =0 | ||||||||||||||||
| Gives information about the pose on the track at the specified parameter value. | |||||||||||||||||
| virtual void | Transition (Length s, TrackData< Real > &td, Real engine_meters_per_unit) const =0 | ||||||||||||||||
| Gives information about the pose on the track at the specified parameter value. | |||||||||||||||||
| Public Member Functions inherited from trax::Identified< Track > | |||||||||||||||||
| 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 | ||||||||||||||||
Reservation mechanism | |
Reservations are areas on a track that are marked as reserved for some id. They allow to detemine overlappings between different reservations, distinguished by IDs. A reservation interval's near value will be considered inside the reservation, the far value as being outside. | |
| using | Reservation = std::tuple<IDType,common::Interval<Length>> |
| Reserves a parameter range on the track for a specified id. | |
| using | ReservationIterator = std::vector<Reservation>::const_iterator |
| Reserves a parameter range on the track for a specified id. | |
| virtual void | Reserve (common::Interval< Length > range, IDType forID)=0 |
| Reserves a parameter range on the track for a specified id. | |
| virtual ReservationIterator | BeginReservations () const noexcept=0 |
| virtual ReservationIterator | EndReservations () const noexcept=0 |
| virtual void | DeleteReservation (common::Interval< Length > inRange, IDType forID=anyID) noexcept=0 |
| Deletes a reservation with specified ID, if it overlaps with the specified range. | |
| virtual bool | IsReserved (common::Interval< Length > inRange, IDType forID=anyID) const noexcept=0 |
| Is here a reservation for the specified ID inside the range on the track? | |
| virtual std::vector< Overlap > | Overlaps (IDType forID) const =0 |
| Finds overlapping areas for reservations. | |
Interface for a track used to calculate 3D positions.
Trains use this kind of interfaces to calculate their positions in 3D
| using trax::Track::Reservation = std::tuple<IDType,common::Interval<Length>> |
Reserves a parameter range on the track for a specified id.
If the range is outside the track's parameter range, the reservation request will be forwarded to the connected tracks according to the active connections, as determined by switches.
| range | The range to reserve in parameter space. A zero range will count as no reservation at all; the reservations carry direction according to their normalized state. A range completely outside the track will throw an exception. |
| forID | An idintifier to be stored with the reservation. If the reservations are used for trains, the IDs of trains or Railrunners in a collection would make a good candidate for the IDs of reservations. |
| std::range_error | If the range lays completely outside the track. |
| using trax::Track::ReservationIterator = std::vector<Reservation>::const_iterator |
Reserves a parameter range on the track for a specified id.
If the range is outside the track's parameter range, the reservation request will be forwarded to the connected tracks according to the active connections, as determined by switches.
| range | The range to reserve in parameter space. A zero range will count as no reservation at all; the reservations carry direction according to their normalized state. A range completely outside the track will throw an exception. |
| forID | An idintifier to be stored with the reservation. If the reservations are used for trains, the IDs of trains or Railrunners in a collection would make a good candidate for the IDs of reservations. |
| std::range_error | If the range lays completely outside the track. |
|
strong |
|
pure virtualnoexcept |
|
pure virtual |
|
pure virtualnoexcept |
Deletes a reservation with specified ID, if it overlaps with the specified range.
If the reservation transitions the track boundaries, the request will be forewarded to the connected tracks for that reservation. If a reservation overlaps inRange, it is deleted completely (not only the intersectional part).
| inRange | Range to test for. |
| forID | ID to delete a reservation for. If it is anyID all reservations in range will get deleted. |
|
pure virtual |
Receives the notifications in the range along the track.
| range | on the track to receive the notifications for. |
| orientation | Direction along the track to receive the signals for. |
| signalTarget | Target to receive the notifications. |
|
pure virtual |
Triggers all sensors in the range in the order of their positioning along the track according to start and end of the range.
Only the sensors wich are parallel to the range orientation get triggered. Wether the sensor actually sends a pulse will depend from the match between the Event settings and the Effect filter of the sensor.
| range | Trackrange to trigger contacts in. |
| _event | An Event to match with the sensor's filter settings. |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Implemented in trax::MovableTrack.
|
pure virtualnoexcept |
retreives a connector (e.g. a Switch) at the respective track end.
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtual |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Tests wether a valid curve and twist are attached.
|
pure virtual |
Gives the Curve's idiosyncratic up direction transformed by the track's frame. Some curves maintain some idea about where they have their upside, either because of their form (e.g Helix) or because it is extra defined (e.g. for Line). Some curves maintain no such notion (e.g. Cubic).
| std::runtime_error | if the Curve has no notion of up. |
Finds overlapping areas for reservations.
A reservation for forID has to exist on the track, otherwise the result would always be an empty vector. The method will not self-overlap any reservation, but will deliver overlaps for different reservations even with the same id.
| std::exception | if the overlaps could not get collected. |
|
pure virtualnoexcept |
The range includes the last point of the interval.
|
pure virtual |
Reserves a parameter range on the track for a specified id.
If the range is outside the track's parameter range, the reservation request will be forwarded to the connected tracks according to the active connections, as determined by switches.
| range | The range to reserve in parameter space. A zero range will count as no reservation at all; the reservations carry direction according to their normalized state. A range completely outside the track will throw an exception. |
| forID | An idintifier to be stored with the reservation. If the reservations are used for trains, the IDs of trains or Railrunners in a collection would make a good candidate for the IDs of reservations. |
| std::range_error | If the range lays completely outside the track. |
|
pure virtualnoexcept |
Gets a shared pointer to this.
|
pure virtualnoexcept |
|
pure virtual |
Receives the TNB - Frame of the curve at the location.
The Frame received by the Transition() methods is aligned to Locations orientation on the tracks and a twisting of the line. For dynamic calculations the real geometry of the curve is needed.
| std::logic_error | if no proper curve is attached with the track. |
| std::range_error | if s is outside the [0,Length()] range. |
|
pure virtual |
| s | Parameter value 0 <= s <= Length() |
| std::logic_error | if no proper curve is attached with trhe track. |
| std::range_error | if s is outside the [0,Length()] range. |
|
pure virtualnoexcept |
Gives the Track coupled to this at the specified end.
| thisEnd | End of this track to get the coupled track for. |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Sets a pointer to user provided data.
Define TrackUserData to specify your data types.