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

Track that can be the original to parallel tracks. More...

#include <C:/Trend/Development/Trax3/Code/trax/ParallelTrack.h>

Inheritance diagram for trax::ParallelizableTrack:

Classes

struct  Data

Public Member Functions

virtual std::shared_ptr< TrackBuilderAddParallel (const spat::Vector2D< Length > &shift, bool bTrackRelative)=0
 Adds a parallel to this track.
virtual void RemoveParallel (const TrackBuilder &parallelTrack)=0
 Removes the parallel track with index idx.
virtual bool IsParallel (const TrackBuilder &parallelTrack) const noexcept=0
virtual void Clear ()=0
 Removes all parallel tracks.
virtual int CountTracks () const =0
virtual int ParallelIdx (const TrackBuilder &parallelTrack) const =0
virtual std::shared_ptr< TrackBuilderGetParallel (int idx) const =0
virtual const DataGetParallelData (int idx) const =0
virtual Length ParallelParameterFrom (int idx, Length sOriginalParameter) const =0
virtual Length OriginalParameterFrom (int idx, Length sParallelParameter) const =0
Public Member Functions inherited from trax::TrackBuilder
virtual const spat::Frame< Length, One > & GetFrame () const noexcept=0
 Gets the pose of the track relative to its parent TrackCollection.
virtual const spat::Frame< Length, One > & GetAbsoluteFrame () const noexcept=0
 Gets the frame relative to the Module, this track is attached to. I.e. the TrackCollection's transformation.
virtual void Couple (std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > thisEnd, std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > othersEnd)=0
 Couple this track at thisend with pOtherTrack at othersend.
virtual void DeCouple (EndType thisEnd=EndType::any, bool oneSided=false)=0
 Remove coupling from this end.
virtual void Flip (bool flipAttached=false)=0
 Exchanges start and end of the track, but keeps geometry.
virtual void CreateEndTransitionSignal (EndType atend)=0
 Creates an internal Signal at the end of the track, so that a SignalTarget receives a message if it enters the track.
virtual void DestroyEndTransitionSignal (EndType atend)=0
 Destroys the internal transition Signal.
virtual void SetFrame (const spat::Frame< Length, One > &frame) noexcept=0
 Sets the frame directly.
virtual void SetFrame (const spat::Frame< Length, One > &start, Length s, bool bAllowTwistOffset=true)=0
 Sets the frame so that Transition(s,start) will give start.
virtual void Attach (std::shared_ptr< const Curve > pCurve, common::Interval< Length > curveSegment={0_m,+infinite__length})=0
 Attaches a Curve to the track.
virtual void Attach (std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > curve)=0
 Attaches a Curve to the track.
virtual void Attach (std::pair< std::unique_ptr< const Curve >, common::Interval< Length > > &curve)=0
 Attaches a Curve to the track.
virtual std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > DetachCurve () noexcept=0
 Detaches the Curve from the track.
virtual std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > GetCurve () const noexcept=0
virtual void Attach (std::unique_ptr< RoadwayTwist > pTwist)=0
virtual std::unique_ptr< RoadwayTwistDetachTwist ()=0
 Detaches the current Twist from the track.
virtual RoadwayTwistGetTwist () const noexcept=0
virtual void Attach (std::shared_ptr< Sensor > pSensor, const TrackLocation &tracklocation)=0
 Attaches a Sensor at the specified location to this track. If already attached, the Sensor will be detached from its previous location.
virtual bool Attached (const Sensor &sensor, TrackLocation *pTrackLocation=nullptr) const =0
 Gets information about an attached Sensor.
virtual void Detach (const Sensor &sensor) noexcept=0
 Detaches a Sensor from the track.
virtual std::shared_ptr< SensorGetSensor (int idx) const noexcept=0
virtual int CountSensors () const =0
virtual void Attach (std::shared_ptr< Signal > pSignal, const common::Interval< Length > &trackRange)=0
 Attaches a Signal to the specified range to this track.
virtual void Attach (std::shared_ptr< Signal > pSignal, const TrackLocation &location)=0
 Attaches a Signal to the specified location to this track.
virtual bool Attached (const Signal &signal, TrackRange *pTrackRange=nullptr) const =0
 Gets information about an attached Signal.
virtual void Detach (const Signal &signal)=0
 Detaches a Signal from the track and all adjacent tracks.
Public Member Functions inherited from trax::Track
virtual const char * TypeName () const noexcept=0
virtual TrackType GetTrackType () const noexcept=0
virtual std::shared_ptr< const BodyGetBody () const noexcept=0
virtual bool IsValid () const noexcept=0
virtual Length GetLength () const noexcept=0
virtual common::Interval< LengthRange () 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< OneLocalUp () 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 SignalGetSignal (const TrackLocation &loc) const noexcept=0
 Gets the first Signal in the direction given by loc.
virtual ConnectorGetConnector (EndType atend) const noexcept=0
 retreives a connector (e.g. a Switch) at the respective track end.
virtual ConnectorGetConnector (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 TrackBuilderThis () const noexcept=0
 Gets a shared pointer to this.
virtual std::shared_ptr< TrackBuilderThis () noexcept=0
virtual std::shared_ptr< const MovableTrackGetMovableTrack () const noexcept=0
virtual std::shared_ptr< MovableTrackGetMovableTrack () noexcept=0
virtual std::shared_ptr< const ParallelizableTrackGetParallelizableTrack () const noexcept=0
virtual std::shared_ptr< ParallelizableTrackGetParallelizableTrack () noexcept=0
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.
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< OverlapOverlaps (IDType forID) const =0
 Finds overlapping areas for reservations.
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

Static Public Member Functions

static dclspc std::shared_ptr< ParallelizableTrackMake () noexcept
 Makes a ParallelizableTrack object.
Static Public Member Functions inherited from trax::TrackBuilder
static dclspc std::shared_ptr< TrackBuilderMake (TrackType type=TrackType::standard) noexcept
 Makes a standard Track object.

Additional Inherited Members

Public Types inherited from trax::Track
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 >, EndTypeTrackEnd
typedef std::pair< std::shared_ptr< const Track >, const EndTypecTrackEnd
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.

Detailed Description

Track that can be the original to parallel tracks.

Member Function Documentation

◆ AddParallel()

virtual std::shared_ptr< TrackBuilder > trax::ParallelizableTrack::AddParallel ( const spat::Vector2D< Length > & shift,
bool bTrackRelative )
pure virtual

Adds a parallel to this track.

Parameters
shiftthe displacement of the parallel track.
bTrackRelativeSpecifies whether the shift is meant relative to the track's twisted frame, or to a frame relative to the world's up direction.
Returns
A shared pointer to the newly created track

◆ Clear()

virtual void trax::ParallelizableTrack::Clear ( )
pure virtual

Removes all parallel tracks.

The call will also remove the tracks from any TrackCollection.

◆ CountTracks()

virtual int trax::ParallelizableTrack::CountTracks ( ) const
pure virtual
Returns
the number of parallel tracks.

◆ GetParallel()

virtual std::shared_ptr< TrackBuilder > trax::ParallelizableTrack::GetParallel ( int idx) const
pure virtual
Returns
the parallel track with index idx or nullptr if idx is invalid.

◆ GetParallelData()

virtual const Data & trax::ParallelizableTrack::GetParallelData ( int idx) const
pure virtual
Returns
a reference to the parallel's data for index idx.
Exceptions
std::invalid_argumentif idx is out of range.

◆ IsParallel()

virtual bool trax::ParallelizableTrack::IsParallel ( const TrackBuilder & parallelTrack) const
pure virtualnoexcept
Returns
true if the track is a parallel to this one. false if not.

◆ OriginalParameterFrom()

virtual Length trax::ParallelizableTrack::OriginalParameterFrom ( int idx,
Length sParallelParameter ) const
pure virtual
Returns
The parameter of the point on the original track, that corresponds with the point at sParallelParameter on the parallel track.
Exceptions
std::invalid_argumentif idx is out of range.

◆ ParallelIdx()

virtual int trax::ParallelizableTrack::ParallelIdx ( const TrackBuilder & parallelTrack) const
pure virtual
Returns
the index if the track is a parallel to this one. -1 if not.

◆ ParallelParameterFrom()

virtual Length trax::ParallelizableTrack::ParallelParameterFrom ( int idx,
Length sOriginalParameter ) const
pure virtual
Returns
The parameter of the point on the parallel track, that corresponds with the point at sOriginalParameter on the original track.
Exceptions
std::invalid_argumentif idx is out of range.

◆ RemoveParallel()

virtual void trax::ParallelizableTrack::RemoveParallel ( const TrackBuilder & parallelTrack)
pure virtual

Removes the parallel track with index idx.

The call will also remove the track from any TrackCollection. It also invalidates all track indices bigger than the one for parallelTrack.


The documentation for this struct was generated from the following file: