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

A track system is the container for tracks. More...

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

Inheritance diagram for trax::TrackSystem:

Public Member Functions

virtual std::shared_ptr< TrackSystemThis () const noexcept=0
 Gets a shared pointer to this.
virtual IDType CreateCollection (IDType id=0)=0
 Creates a TrackCollection with the supplied id.
virtual void RemoveCollection (IDType id)=0
 Removes the TrackCollection with the specified id.
virtual void SetCollectionFrame (IDType id, const spat::Frame< Length, One > &frame)=0
 Sets the frame of reference for a TrackCollection.
virtual const spat::Frame< Length, One > & GetCollectionFrame (IDType id) const =0
 Gets the frame of reference for a TrackCollection.
virtual IDType SetActiveCollection (IDType id)=0
 Sets a TrackCollection to be the active one.
virtual IDType GetActiveCollection () const =0
virtual std::shared_ptr< TrackCollectionContainerSetTrackCollectionContainer (std::shared_ptr< TrackCollectionContainer > pTrackCollectionContainer)=0
virtual std::shared_ptr< TrackCollectionContainerGetCollectionContainer () const =0
virtual std::shared_ptr< ConnectorCollectionSetConnectorCollection (std::shared_ptr< ConnectorCollection > pConnectorCollection)=0
 Attaches a ConnectorCollection to the track system.
virtual ConnectorCollectionGetConnectorCollection () const =0
virtual std::shared_ptr< SensorGetSensor (IDType id, TrackLocation *pTrackLocation) const =0
virtual Length CalculateGapSize (const Track::End &theOne, const Track::End &theOther) const =0
virtual std::vector< Track::EndGetUncoupledIn (const spat::Sphere< Length > &area) const =0
 Searches for a free, uncoupled track end in the area.
virtual void Connection (Track::Coupling &coupling) const =0
 Completes the coupling.
virtual void Connection (const Track::End &end, Track::End &coupled) const =0
virtual void Connection (const Track::Coupling &couplings, Track::Coupling &active) const =0
 Writes the coupled tracks data of the trackends in couplings to active.
virtual void CoupleAll (Length maxDistance=1_m, Angle maxKink=pi, bool bSilent=true)=0
 Couples all open ends in the track system, if they are closer than maxDistance.
virtual void DeCoupleAll ()=0
 Uncouples all the Tracks in the TrackSystem from each other.
Couple

Couples two tracks that are members of this TrackSystem.

Parameters
trackEnd1Shared pointer to and end of track A.
trackEnd2Shared pointer to and end of track B.
bUncoupledOnlytrue if only loose ends should get connected, but existing connections stay untouched.
virtual void Couple (std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > trackEnd1, std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > trackEnd2) const =0
virtual void Couple (const Track::Coupling &coupling, bool bUncoupledOnly=false) const =0
Public Member Functions inherited from trax::Collection< TrackSystem, TrackBuilder >
virtual const char * TypeName () const noexcept=0
virtual bool IsValid () const noexcept=0
 Checks whether the elements in this collection are valid.
virtual IDType Add (std::shared_ptr< TrackBuilder > pValue_Type)=0
 Adds an element to the container and returns its index in the container.
virtual IDType AddRelaxed (std::shared_ptr< TrackBuilder > pTraxType)=0
 Adds an element to the container and returns its index in the container. Does not throw.
virtual bool Remove (TrackBuilder *pValue_Type, bool zeroIDs=false)=0
 Removes an element from this container.
virtual int Take (TrackSystem &collection_Type)=0
 Moves all the items from another container to this container.
virtual void Clear ()=0
 Removes all the elements from this container.
virtual int Count () const=0
virtual iterator begin ()=0
virtual const_iterator cbegin () const=0
virtual iterator end ()=0
virtual const_iterator cend () const=0
virtual std::shared_ptr< TrackBuilderGetFirst () const=0
virtual std::shared_ptr< TrackBuilderGetNext (const std::shared_ptr< TrackBuilder > &pValue_Type) const=0
virtual std::shared_ptr< TrackBuilderGetLast () const=0
virtual std::shared_ptr< TrackBuilderGetPrevious (const std::shared_ptr< TrackBuilder > &pValue_Type) const=0
virtual void PushActive (IDType id)=0
 Pushes an element on the activety stack.
virtual void PopActive ()=0
 Pops an element from the activity stack.
virtual std::shared_ptr< TrackBuilderGetActive () const=0
virtual void ShiftIDs (int offset)=0
 Adds an offset to all ids.
virtual IDType MaxID () const=0
virtual IDType MinID () const=0
 Collection (const Collection &)=delete
Collection & operator= (const Collection &)=delete
virtual std::shared_ptr< TrackBuilderGet (IDType id) const=0
virtual bool IsMember (const value_type &item) const=0
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.
Public Member Functions inherited from trax::Identified< TrackSystem >
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< TrackSystemMake () noexcept
 Makes a standard TrackSystem object.
static dclspc std::shared_ptr< TrackSystemMake (std::unique_ptr< TrackCollectionContainer > pTrackCollectionContainer) noexcept
static dclspc std::shared_ptr< TrackSystemMake (std::unique_ptr< TrackCollectionContainer > pTrackCollectionContainer, std::unique_ptr< ConnectorCollection > pConnectorCollection) noexcept

Additional Inherited Members

Public Types inherited from trax::Collection< TrackSystem, TrackBuilder >
using iterator
using const_iterator
using collection_type
using value_type
Protected Member Functions inherited from trax::Collection< TrackSystem, TrackBuilder >
virtual void SetDecorator (TrackSystem *pCollection_TypeDecorator)=0
Protected Attributes inherited from trax::Collection< TrackSystem, TrackBuilder >
friend Decorator< Collection_Type >

Detailed Description

A track system is the container for tracks.

The TrackSystem maintains TrackCollection objects that are used to group and locate tracks inside of a TrackSystem. A track will deliver module relative coordinates with its Transition() methods, taking into account the TrackCollection's frame of reference.

Member Function Documentation

◆ CalculateGapSize()

virtual Length trax::TrackSystem::CalculateGapSize ( const Track::End & theOne,
const Track::End & theOther ) const
pure virtual
Returns
the distance between the two track ends.

Implemented in trax::TrackSystemDecorator.

◆ Connection() [1/2]

virtual void trax::TrackSystem::Connection ( const Track::Coupling & couplings,
Track::Coupling & active ) const
pure virtual

Writes the coupled tracks data of the trackends in couplings to active.

Parameters
couplingsTwo track ends.
activeCoupled track end data for the track ends in couplings.

Implemented in trax::TrackSystemDecorator.

◆ Connection() [2/2]

virtual void trax::TrackSystem::Connection ( Track::Coupling & coupling) const
pure virtual

Completes the coupling.

Parameters
couplingA track coupling with one of its track ids set to 0. This will be completed by the correct connection.

Implemented in trax::TrackSystemDecorator.

◆ CoupleAll()

virtual void trax::TrackSystem::CoupleAll ( Length maxDistance = 1_m,
Angle maxKink = pi,
bool bSilent = true )
pure virtual

Couples all open ends in the track system, if they are closer than maxDistance.

Parameters
maxDistanceA threshold for the distance to search track ends around the to be coupled end.
maxKinkA threshold for the maximum allowed kink angle in T and B respectively.
bSilentIf true no log messages are emitted.

◆ CreateCollection()

virtual IDType trax::TrackSystem::CreateCollection ( IDType id = 0)
pure virtual

Creates a TrackCollection with the supplied id.

Parameters
idid for the new TrackCollection or 0 if one should be made automatically.
Returns
id of the new TrackCollection.

Implemented in trax::TrackSystemDecorator.

◆ DeCoupleAll()

virtual void trax::TrackSystem::DeCoupleAll ( )
pure virtual

Uncouples all the Tracks in the TrackSystem from each other.

This is needed since the coupled tracks hold shared pointer to each other.

Implemented in trax::TrackSystemDecorator.

◆ GetActiveCollection()

virtual IDType trax::TrackSystem::GetActiveCollection ( ) const
pure virtual
Returns
The id of the active TrackCollection.

Implemented in trax::TrackSystemDecorator.

◆ GetCollectionContainer()

virtual std::shared_ptr< TrackCollectionContainer > trax::TrackSystem::GetCollectionContainer ( ) const
pure virtual
Returns
A pointer to the TrackCollectionContainer object that holds the TrackCollection objects.

Implemented in trax::TrackSystemDecorator.

◆ GetCollectionFrame()

virtual const spat::Frame< Length, One > & trax::TrackSystem::GetCollectionFrame ( IDType id) const
pure virtual

Gets the frame of reference for a TrackCollection.

Implemented in trax::TrackSystemDecorator.

◆ GetConnectorCollection()

virtual ConnectorCollection * trax::TrackSystem::GetConnectorCollection ( ) const
pure virtual
Returns
A pointer to the ConnectorCollection attached to this TrackSystem.

Implemented in trax::TrackSystemDecorator.

◆ GetSensor()

virtual std::shared_ptr< Sensor > trax::TrackSystem::GetSensor ( IDType id,
TrackLocation * pTrackLocation ) const
pure virtual
Returns
a pointer to the sensor with the respective id.

Implemented in trax::TrackSystemDecorator.

◆ GetUncoupledIn()

virtual std::vector< Track::End > trax::TrackSystem::GetUncoupledIn ( const spat::Sphere< Length > & area) const
pure virtual

Searches for a free, uncoupled track end in the area.

Implemented in trax::TrackSystemDecorator.

◆ RemoveCollection()

virtual void trax::TrackSystem::RemoveCollection ( IDType id)
pure virtual

Removes the TrackCollection with the specified id.

Parameters
idof the TrackCollection to remove.

Implemented in trax::TrackSystemDecorator.

◆ SetActiveCollection()

virtual IDType trax::TrackSystem::SetActiveCollection ( IDType id)
pure virtual

Sets a TrackCollection to be the active one.

Implemented in trax::TrackSystemDecorator.

◆ SetCollectionFrame()

virtual void trax::TrackSystem::SetCollectionFrame ( IDType id,
const spat::Frame< Length, One > & frame )
pure virtual

Sets the frame of reference for a TrackCollection.

Implemented in trax::TrackSystemDecorator.

◆ SetConnectorCollection()

virtual std::shared_ptr< ConnectorCollection > trax::TrackSystem::SetConnectorCollection ( std::shared_ptr< ConnectorCollection > pConnectorCollection)
pure virtual

Attaches a ConnectorCollection to the track system.

Returns
The old attached connector collection.

Implemented in trax::TrackSystemDecorator.

◆ This()

virtual std::shared_ptr< TrackSystem > trax::TrackSystem::This ( ) const
pure virtualnoexcept

Gets a shared pointer to this.

Implemented in trax::TrackSystemDecorator.


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