Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax Namespace Reference

Namespace of all the trax track libraries classes and methods. More...

Classes

struct  Collection
class  CollectionDecorator
 A decorator for trax collections. More...
struct  ConnectorCollection
 Collection to hold a set of Connector objects. More...
class  ConnectorCollectionDecorator
 A decorator for ConnectorCollections. More...
struct  IndicatorCollection
 Collection to hold a set of Indicator objects. More...
class  IndicatorCollectionDecorator
 A decorator for IndicatorCollection. More...
class  Decorator
 The base for decorator implementations. Needed as BaseDecorator to combine other decorator implementers. More...
class  ObjectIDDecorator
 A decorator for identification part of trax objects. More...
class  PoseDecorator
 A decorator for pose part of trax objects. More...
struct  PulseCounterCollection
struct  SignalCollection
 Collection to hold a set of Signal objects. More...
class  SignalCollectionDecorator
 A decorator for SignalCollection. More...
class  TrackSystemReader
struct  TimerCollection
struct  TrackCollection
 Collection to hold a set of Track objects. More...
class  TrackCollectionDecorator
 A decorator for TrackCollection. More...
struct  TrackCollectionContainer
 Collection to hold a set of TrackCollection objects. More...
class  TrackCollectionContainerDecorator
 A decorator for TrackCollectionContainer. More...
struct  TrackSystem
 A track system is the container for tracks. More...
class  TrackSystemDecorator
 A decorator for TrackSystems. More...
struct  TrackSystemParser
class  ReportVerbosityGuard
struct  Connector
 A Connector rearranges the connections between several track ends. More...
struct  Curve
 Curves implement this interface that then can get attached to a track to define the tracks geometry. More...
struct  CurveSample
 The dynamic data of a curve at one point. More...
struct  CubicData
 Data definig a cubic curve. More...
struct  Line
 A straight line. More...
struct  LineP
 A straight line with owned parameters. More...
struct  Arc
 A plane arc. More...
struct  ArcP
 A plane arc with owned parameters. More...
struct  Helix
 A three dimensional spiral. More...
struct  HelixP
 A three dimensional spiral with owned parameters. More...
struct  Cubic
 Cubic polynom curve. More...
struct  Spline
 \ brief Cubic Hermite Spline. More...
struct  Clothoid
 Curve with linear increasing curvature. Also called 'Euler Spiral'. More...
struct  Rotator
 Curve with evenly (with respect to arc length) rotating tangent vector. More...
struct  RotatorChain
 A series of Rotator curves that continue each other. More...
struct  PointToPointParallel
 A Curve parallel to a given track. More...
struct  PolygonalChain
 A series of samples of points and tangents that make up a curve. More...
struct  SampledCurve
 A curve given by Fi,ki,ti,si samples of a real curveT. More...
struct  EEPCurve
 Idiosyncratic curve used in EEP up to version 16. More...
struct  CurvatureStrecher
 Interface for streching the curvature of a curve, by trying to reach an end point Z, while keeping the starting point local, if possible. More...
class  Curve_Imp
 Implements a Curve that is parametrized by its arc length. More...
class  CurveTInterpolator_Imp
 This calculates the normal vector, curvature and torsion numerically using the relations derived from the Frenet-Serret formulas: More...
class  CurveArcLength_Imp
 If the curve function happens to be parameterized by arc length, this implementation for a curve can be used. More...
class  Reparametrization
 Reparametrizes a Function to 0 - 1. More...
class  CurvatureStrecher_Imp
struct  Event
struct  EventFilter
 An event is sent to a sensor if it gets triggered. More...
struct  Identified
 Interface for identifying objects by ID or reference values. More...
struct  IDType
 Type used for IDs in the trax library. More...
class  Pose_Imp
class  Container_Imp
struct  Indicator
 Interface for objects that indicates system states somehow. More...
struct  BinaryIndicator
 An Indicator with two states. More...
struct  TrackData
 Full geometrical data at a point on a track. More...
class  TrackJoint
 Physics engine agnostic part of track joint logic. More...
struct  Jack
 A jack a plug can get connected with. More...
class  Jack_Imp
struct  JackEnumerator
 Interface for enumerating the Jacks an object provides. More...
class  JackIterator
class  Location
 A Location specifies a position on a track system by referencing a track and a TrackLocation on it. More...
struct  Lockable
 Interface for locking and unlocking an object. More...
struct  PulseCounter
 A counter can be incremented or decremented by pulses. It will itself issue a pulse every time a certain threshold value is reached. More...
class  ObjectID_Imp
struct  Orientation
 Provides two values for orientation. More...
struct  ParallelizableTrack
 Track that can be the original to parallel tracks. More...
class  Parser
struct  Plug
 A Plug of some object can get plugged into a jack of some object, specific to a certain event. More...
struct  PlugEnumerator
 Interface for enumerating the Plugs an object provides. More...
class  PlugIterator
struct  MultiPlug
 A MultiPlug provides a variable number of actual Plugs to one input slot. More...
class  Plug_Imp
class  Plug_Imp_Parent
class  Plug_Imp_ParentPointer
 Implementation for a plug that calls an objects member function on pulse. More...
struct  Body
 A dynamic object in physical space. More...
struct  MovableTrackAutoConnecting
struct  SceneCollection
struct  Geom
 A Geom is used for collision detection. It differs from a Shape in that it defines the most simple elements of a shape. A Shape is a collection of Geoms and itself a Geom. More...
struct  GeomCuboid
 Rectangular cuboid shape. More...
struct  GeomCylinder
 Cylinder shaped Geom. More...
struct  GeomCapsule
 A Capsule is a Cylinder with round caps. More...
struct  GeomSphere
 A sphere shaped Geom. More...
struct  GeomHeightField
struct  GeomMesh
struct  Gestalt
 A Gestalt is a Body with a Shape. More...
struct  Joint
struct  HingeJoint
struct  SliderJoint
struct  BallAndSocketJoint
struct  DistanceJoint
struct  Material
struct  Materials
struct  Frustum
 Projective frustum. More...
struct  Camera
 Base Camera interface. More...
struct  AnimatedCamera
 Interface for movable cameras. More...
struct  BodyCam
 Interface for cameras that can get attached to a Body. More...
struct  DollyCam
 Interface for Cameras movable along tracks. More...
struct  CameraCollection
 Collection to store cameras. More...
struct  Module
 A module is a chunck of railroad stuff that is all located in one rectangular volume. More...
struct  ModuleCollection
 A collection of modules. More...
class  AnlReader
struct  MovableTrack
 Track that can get attached to a moving body. More...
struct  Scene
 A physical simulation scene for running a simulation and creating physical objects in the scene. More...
struct  Shape
 A Shape is a collection of Geoms. More...
struct  Simulator
 Interface for the physics simulator. More...
struct  StaticTrack
class  TrackJointFeeder
 Class with minimal functionality to support a track joint on a track system. More...
class  TrackJointFeederMotorModel
 Class with functionality to support a track joint on a track system. Provides a model for friction, brake and drive. More...
class  TrackJointFeeder_Imp
 implementation for a specific value type. More...
struct  TrackJointLimits
 The maximum forces and spatial deviations of a WheelFrame used by physics calculations. More...
struct  TractionForceCharacteristic
 Function that defines the characteristic behaviour of a motor to change its maximum available tracktion force with velocity. More...
struct  Bogie
 A Bogie is a RailRunner that can be attached to another Bogie by a swivel and can be coupled to another Bogie by a coupling. More...
struct  Cargo
struct  CargoCollection
struct  Fleet
 A Fleet holds Trains and (topmost) Bogies via their common interface RailRunner. More...
struct  RailRunner
 Interface for train and rolling stock that can be railed on a track and might provide brakes and power engines. More...
struct  RollingStock
 A RollingStock is a RailRunner that manages one or more connected Bogies. More...
class  RollingStockParser
class  TrainParser
class  FleetParser
class  RollingStockCreator
class  FileReader
 Base class for file readers. More...
class  RollingStockFileReader_Base
class  RollingStockFileReader
class  TrainCreator
class  TrainFileReader
class  TrainFileReferenceReader
struct  Train
 A Train is a collection of TrainComponents that are coupled in a row. More...
struct  TrainComponent
 A TrainComponent is a part of a Train. More...
struct  WheelFrame
 A WheelFrame is a Bogie that hosts Wheelsets and a TrackJoint and therefore can directly get attached to a track. It also is responsible for managing a TractionForceCharacteristic and feeding the TrackJoint with data. More...
struct  VelocitySensor
 A sensor that detects, wether a wheelframe passing by does this within certain velocity limits. More...
struct  WeighSensor
 A sensor that detects wether the weight of a passing railrunner falls into certain limits. More...
struct  IntervalSensor
 A sensor that detects, wether a wheelframe passing by does this with some value like weight, velocity or traction in certain limits. More...
struct  Wheelset
 Describing data of a wheelset. More...
struct  RoadwayTwist
 A RoadwayTwist is used to define the actual rotating angle around the tangent at a curve to get the correct alignment to the lane. More...
struct  ConstantTwist
 A twist that stays constant over the whole track range. More...
struct  LinearTwist
 A twist that varies linearly between two values. More...
struct  PiecewiseTwist
 A twist with values at control points and either none or linear interpolation for the points in between. More...
struct  DirectionalTwist
 A twist that rotates the frame arount T in a way that B is nearest a certain direction. More...
struct  PiecewiseDirectionalTwist
 A twist that works like a DirectionalTwist but interpolates (linearly) two neighbouring attractors according to arc length and uses the resulting attractor. More...
struct  CombinedTwist
 Combines the effect of two twists by adding them. More...
struct  Section
 A profile of a track. More...
struct  SectionTrack
struct  Sensor
 A Sensor can get attached to a track and be triggerd when a Location runs over it. More...
class  Sensor_Imp
struct  Signal
 A Signal is positioned along a track and is submitted to a Train if it runs over it. More...
struct  VelocityControl
 Interface for signals that control the velocity of trains. More...
struct  JumpSite
 A Signal that triggers a Train to jump to a jump site. More...
struct  TrackEndTransition
 A Signal that can be placed at track couplings to signal that a Train runs over the coupling between two tracks. More...
struct  SignalTarget
 Target for signal notification. More...
struct  SignalAligned
struct  Simulated
 A simulated object. Register the object with a scene to get called back for Update, Pause, Resume and Stop. More...
class  SimulatedDecorator
struct  SocketRegistry
 Interface for a registry that reconnects Plugs and Jacks according to their IDs. More...
struct  NarrowSwitch
 Common interface for switch types that maintain an incomming (narrow) track, an outgoing straight track and an arbitrary number of outgoing diverging tracks. More...
struct  Switch
 A Switch rearranges the connections between three track ends. More...
struct  ThreeWaySwitch
 A switch that is connecting one narrow end to three outgoing track ends. More...
struct  SingleSlipSwitch
 A single slip switch is made from five tracks that form a crossing with the possibility to divert the route to connect the two narrow (incoming) tracks. There are two narrowing (incoming) tracks, two crossing tracks and one diverting track, connecting the two narrowing ones. The two narrow '\','/' and two straight tracks 'X' - the straight tracks are expected to cross each other - and a diverging track ')' (ignore the dots). More...
struct  DoubleSlipSwitch
 A double slip switch is made from eight tracks that form a crossing with the possibility to divert the route to connect two of the narrowing (incoming) tracks pairwise. There are four narrowing (incoming) tracks, two crossing tracks and two diverting tracks, connecting two narrowing ones each. The two straight tracks 'X', are crossing each other; two incoming narrowing tracks, two outgoing narrowing tracks - all four connecting to the straight track ends - and two diverging tracks ')' and '(', connecting incoming and outgoing tracks (ignore the dots): More...
struct  SwitchAligned
struct  Timer
 A timer to meassure time lapses. More...
struct  Track
 Interface for a track used to calculate 3D positions. More...
struct  TrackBuilder
 Interface for making and shaping tracks. More...
struct  TrackLocation
 A TrackLocation ist a location on a single track. More...
struct  TrackLocationRef
 A track location, referencing the track by id. More...
struct  TrackRange
 An interval on a track, referenced by an id. More...
class  TrackPainter
 Base class for painting tracks as a series of short straight pieces. More...
class  SectionPainter
 Paints a track by taking a cross section as a profile. More...
class  BufferedPainter_Base
 Paints data to buffers. More...
class  BufferedPainter
class  BufferedPainter< spat::Position< Length > >
class  BufferedPainter< std::pair< spat::VectorBundle< Length, One >, spat::Position2D< One > > >
class  BufferedPainter< std::pair< spat::VectorBundle2< Length, One >, spat::Position2D< One > > >
class  Version
 Class for versioning the trax library. More...
class  BufferedUSDTrackPainter
class  USDExporter
 Trax writer for USD prims. More...
class  USDFileExporter
class  USDFileReader
class  USDReader
 Trax reader for a USD stage. More...
class  UsdTraxTokenTypes
 Token identifiers for trax USD Schema definitions. More...

Enumerations

enum class  Verbosity : char {
  unknown = 0 , silent , error , normal ,
  detailed , verbose
}
 Verbosity scale of trax library messages.
enum class  ConnectorType {
  unknown = -1 , none = 0 , NarrowSwitch , TwoWaySwitch ,
  ThreeWaySwitch , SingleSlipSwitch , DoubleSlipSwitch , count
}
enum class  GeomType : char {
  unknown = -1 , none = 0 , box , cylinder ,
  capsule , sphere , heightField , convexMesh ,
  triangleMesh
}
 Type of a geom.
enum class  CameraType {
  cam_basic , cam_firstperson , cam_orbiter , cam_terrainconfined ,
  cam_dolly , cam_cabin
}
 Type of the camera. More...

Functions

template<class DecoratorPointerType, class InterfaceType>
DecoratorPointerType decorator_cast (InterfaceType *pInterface) noexcept
 Cast to a decorator type in the decorator chain or to the component itself.
std::vector< std::tuple< std::shared_ptr< TrackBuilder >, Track::EndType, Length > > dclspc FindTrackEnds (const TrackCollection &collection, const spat::Sphere< Length > &area, bool sort=false)
 Finds all track ends in the area.
std::vector< std::pair< Location, Length > > dclspc FindTrackLocations (const TrackCollection &collection, const spat::Sphere< Length > &area, bool sort=false)
 Finds all tracks that run trough an area.
std::vector< std::pair< Location, Length > > dclspc FindTrackLocations (const TrackCollection &collection, const spat::VectorBundle< Length, One > &ray, Length gauge, bool sort=false)
 Finds all tracks that got hit by a ray.
std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > dclspc Snap (const TrackCollection &collection, TrackBuilder &track, Track::EndType endType, Length maxDistance, bool bUncoupled=true)
 Moves a track so that one of it's ends aligns to another track end in a collection.
std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > dclspc Couple (const TrackCollection &collection, TrackBuilder &track, Track::EndType endType, Length maxDistance=1_m, Angle maxKink=pi, bool bSilent=true)
 Searches open track ends inside an area around a given track end and couples to the closest.
std::vector< std::tuple< std::shared_ptr< TrackBuilder >, Track::EndType, Length > > dclspc FindTrackEnds (const TrackSystem &system, const spat::Sphere< Length > &area, bool sort=false)
 Finds all track ends in the area.
std::vector< std::pair< Location, Length > > dclspc FindTrackLocations (const TrackSystem &system, const spat::Sphere< Length > &area, bool sort=false)
 Finds all tracks that run trough an area.
Location dclspc FindTrackLocation (const TrackSystem &system, const spat::Sphere< Length > &area)
std::vector< std::pair< Location, Length > > dclspc FindTrackLocations (const TrackSystem &system, const spat::VectorBundle< Length, One > &ray, Length gauge=0_m, bool sort=false)
 Finds all tracks that got hit by a ray.
bool dclspc ParseTrackSystem (std::basic_istream< char > &stream, TrackSystemParser &callback) noexcept(false)
bool dclspc ParseTrackSystem (std::string filePath, TrackSystemParser &callback) noexcept(false)
bool dclspc ParseTrackSystem (const TrackSystem &trackSystem, TrackSystemParser &callback) noexcept(false)
dclspc std::string ToString (Verbosity type)
dclspc Verbosity ToVerbosity (const std::string &type) noexcept
dclspc void SetReportVerbosity (Verbosity verbosity) noexcept
dclspc Verbosity GetReportVerbosity () noexcept
dclspc std::ostream & operator<< (std::ostream &stream, Verbosity verbosity)
dclspc void Couple (std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > trackEndA, std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > trackEndB, int slotA=-1, int slotB=-1, bool connectAnyway=false)
 Connect two track ends by inserting them into Connectors, if available.
dclspc void DeCouple (TrackBuilder &track, Track::EndType trackEnd, int ownerSlot=-1)
 Uncouples a track end by clearing any Connectors.
dclspc spat::Vector< LengthDistanceToOtherEnd (const Connector &connector, int fromSlot)
dclspc std::string ToString (ConnectorType ct)
 Gets the type name of a curve from its type enumerator.
dclspc ConnectorType ToConnectorType (const std::string &name) noexcept
 Gets the type enumerator of a curve from its type name.
template<class CurveType>
std::unique_ptr< CurveType > Clone (const CurveType &curve) noexcept
 Creates a clone of the given curve.
bool dclspc Equals (const std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > &A, const std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > &B, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle)
bool dclspc Equals (const Curve &A, const Curve &B, common::Interval< Length > range, Length epsilon_length=epsilon__length) noexcept
dclspc const char * TypeToName (Curve::CurveType ct)
 Gets the type name of a curve from its type enumerator.
dclspc Curve::CurveType CurveNameToType (const std::string &name) noexcept
 Gets the type enumerator of a curve from its type name.
bool operator< (Length s, const CurveSample &sample) noexcept
bool dclspc Equals (const LineP::Data &A, const LineP::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle)
bool dclspc Equals (const Arc::Data &A, const Arc::Data &B, Length epsilon_length=epsilon__length) noexcept
 Comparison of two Arcs.
bool dclspc Equals (const ArcP::Data &A, const ArcP::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle)
 Comparison of two Arcs.
bool dclspc Equals (const Helix::Data &A, const Helix::Data &B, Length epsilon_length=epsilon__length) noexcept
 Comparison of two Helix.
bool dclspc Equals (const HelixP::Data &A, const HelixP::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle)
 Comparison of two HelixP.
bool dclspc Equals (const Cubic::Data &A, const Cubic::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison of two Cubics.
bool dclspc Equals (const Spline::Data &A, const Spline::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison of two Splines.
bool dclspc Equals (const Clothoid::Data &A, const Clothoid::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle)
 Comparison of two Clothoids.
bool dclspc Equals (const Rotator::Data &A, const Rotator::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison of two Rotators.
bool dclspc Equals (const PointToPointParallel::Data &A, const PointToPointParallel::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison of two PointToPointParallels.
bool dclspc Equals (const SampledCurve::Data &A, const SampledCurve::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison of two sampled curves.
bool dclspc Equals (const EEPCurve::Data &A, const EEPCurve::Data &B, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison of two EEPCurves.
std::unique_ptr< Curve > dclspc CreateNonEEPCurve (const EEPCurve::Data &fromEEPCurveData)
 Creates a matching Curve from the data that is not an EEPCurve.
std::pair< std::unique_ptr< Curve >, common::Interval< Length > > dclspc CreateCurve (const spat::Position< Length > &start, const spat::Position< Length > &end, const spat::Vector< One > &up)
 Will create a Line. Guarantees start and end.
std::pair< std::unique_ptr< Curve >, common::Interval< Length > > dclspc CreateCurve (spat::VectorBundle< Length, One > start, const spat::Position< Length > &end, const spat::Vector< One > &up, Length e_length=epsilon__length)
 Will create a Line, an Arc or a Helix. Guarantees start for Line; guarantees start.T to be perpendicular to start.T % up for Arc and Helix. end.P will be in the margin of e_length.
std::pair< std::unique_ptr< Curve >, common::Interval< Length > > dclspc CreateCurve (const spat::Position< Length > &start, spat::VectorBundle< Length, One > end, const spat::Vector< One > &up, Length e_length=epsilon__length)
 Will create a Line, an Arc or a Helix. Guarantees end for Line. Guarantees end.T to be perpendicular to end.T % up for Arc and Helix. end.P will be in the margin of e_length.
std::pair< std::unique_ptr< Curve >, common::Interval< Length > > dclspc CreateCurve (const spat::VectorBundle< Length, One > &start, const spat::VectorBundle< Length, One > &end, const spat::Vector< One > &up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle)
 Will create a Line, an Arc, a Helix or a Cubic.
std::pair< std::unique_ptr< Curve >, common::Interval< Length > > dclspc CreateCurve (Curve::CurveType type, std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > fromCurve)
std::pair< std::unique_ptr< Curve >, common::Interval< Length > > dclspc CreateCurve (Curve::CurveType type, const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Line >, common::Interval< Length > > dclspc CreateLine (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< LineP >, common::Interval< Length > > dclspc CreateLineP (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Arc >, common::Interval< Length > > dclspc CreateArc (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< ArcP >, common::Interval< Length > > dclspc CreateArcP (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Helix >, common::Interval< Length > > dclspc CreateHelix (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< HelixP >, common::Interval< Length > > dclspc CreateHelixP (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Cubic >, common::Interval< Length > > dclspc CreateCubic (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Spline >, common::Interval< Length > > dclspc CreateSpline (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Clothoid >, common::Interval< Length > > dclspc CreateClothoid (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Rotator >, common::Interval< Length > > dclspc CreateRotator (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< Rotator >, common::Interval< Length > > dclspc CreateRotatorWithOffset (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< RotatorChain >, common::Interval< Length > > dclspc CreateRotatorChain (const Curve &fromCurve, common::Interval< Length > range)
std::pair< std::unique_ptr< PolygonalChain >, common::Interval< Length > > dclspc CreatePolygonalChain (const Curve &fromCurve, common::Interval< Length > range)
template<class ContainerType>
bool IsValid_Imp (const ContainerType &container)
dclspc std::string ToString (Indicator::Type type)
 Converts a TrackType to readable string.
dclspc std::string ToString (Indicator::Status status)
 Makes a string from the status.
dclspc Indicator::Status ToIndicatorStatus (const std::string &status)
 Makes a status value from a status string.
dclspc Indicator::Status IndicatorStatusFrom (const std::string &socketName)
JackIterator< JackEnumeratorbegin (JackEnumerator &jackEnumerator)
JackIterator< const JackEnumerator, const Jack *, const Jack & > begin (const JackEnumerator &jackEnumerator)
JackIterator< JackEnumeratorend (JackEnumerator &jackEnumerator)
JackIterator< const JackEnumerator, const Jack *, const Jack & > end (const JackEnumerator &jackEnumerator)
bool operator== (const Location &locationA, const Location &locationB) noexcept
bool operator!= (const Location &locationA, const Location &locationB) noexcept
dclspc Length ParameterDistanceFrom3DDistance (const Location &location, Length distanceIn3D, Length maxParameter, Length _epsilon=epsilon__length)
 Calculate parameter for given 3D distance.
dclspc std::tuple< std::shared_ptr< const Track >, Track::EndType, LengthEndOfLine (const Location &location, Length maxDistance, bool bDeadConnectorOnly=false)
 Gets the end of a line.
template<class ResultType, class F, typename Valtype>
ResultType finite_difference_derivative6 (const F f, Valtype t)
template<class ResultType, class F, typename Valtype>
ResultType finite_difference_derivative8 (const F f, Valtype t)
template<class ContainerType, typename Valtype, typename IteratorToPositionConverterType>
void DouglasPeucker (ContainerType &data, typename ContainerType::iterator start, typename ContainerType::iterator end, Valtype maxDeviation, IteratorToPositionConverterType P)
bool operator== (const Orientation &a, const Orientation &b)
bool operator!= (const Orientation &a, const Orientation &b)
bool operator== (const Orientation::Value &a, const Orientation &b)
bool operator!= (const Orientation::Value &a, const Orientation &b)
Orientation operator+ (const Orientation &a, const Orientation &b) noexcept
Orientationoperator+= (Orientation &a, const Orientation &b) noexcept
 Assigns to a the absolute orientation of b if it is understood relative to a.
dclspc std::string ToString (Orientation orient)
dclspc Orientation ToOrientation (const std::string &orient)
dclspc const PlugGetFirstNonZeroIDPlugInChain (const Plug &plug)
PlugIterator< PlugEnumeratorbegin (PlugEnumerator &plugEnumerator)
PlugIterator< const PlugEnumerator, const Plug *, const Plug & > begin (const PlugEnumerator &plugEnumerator)
PlugIterator< PlugEnumeratorend (PlugEnumerator &plugEnumerator)
PlugIterator< const PlugEnumerator, const Plug *, const Plug & > end (const PlugEnumerator &plugEnumerator)
dclspc std::string ToString (Geom::Filters filter)
dclspc Geom::Filters GeomFilter (const std::string &filter)
dclspc unsigned int CollisionFilterFor (Geom::Filters filter) noexcept
constexpr bool IsTrigger (unsigned int filter) noexcept
dclspc std::string ToString (GeomType type)
dclspc GeomType ToGeomType (const std::string &type)
Material::Type operator++ (Material::Type &material) noexcept
dclspc std::string ToString (Material::Type type)
dclspc Material::Type MaterialType (const std::string &string)
const char * From (CameraType type) noexcept
CameraType CameraTypeFrom (const std::string &name)
dclspc void Write (const ModuleCollection &moduleSet, const std::filesystem::path &path)
dclspc void Write (const Module &modul, const std::filesystem::path &path)
dclspc spat::Box< LengthGetBoxFor (const TrackBuilder &track, const Section *pSection=nullptr)
 Get an axis aligned box that completely contains the track.
dclspc bool Couple (std::pair< Bogie &, RailRunner::EndType > a, std::pair< Bogie &, RailRunner::EndType > b) noexcept
dclspc bool AreCoupled (const Bogie &a, const Bogie &b) noexcept
dclspc Length GetCouplingDistance (std::pair< const Bogie &, RailRunner::EndType > a, std::pair< const Bogie &, RailRunner::EndType > b) noexcept
RailRunner::EndType operator! (RailRunner::EndType end) noexcept
 Gets the opposite end type.
dclspc std::string ToString (RailRunner::EndType end)
 Makes a string from the status.
dclspc RailRunner::EndType ToRailRunnerEndType (const std::string &endtype)
 Makes a end type value from a string.
void dclspc ParseRollingStock (std::basic_istream< char > &stream, RollingStockParser &callback) noexcept(false)
void dclspc ParseRollingStock (const std::filesystem::path &filePath, RollingStockParser &callback) noexcept(false)
void dclspc ParseRollingStock (const Bogie &rollingStock, RollingStockParser &callback) noexcept(false)
void dclspc ParseTrain (const unsigned char *bufferStart, const unsigned char *bufferEnd, TrainParser &callback) noexcept(false)
void dclspc ParseTrain (std::basic_istream< char > &stream, TrainParser &callback) noexcept(false)
void dclspc ParseTrain (const std::filesystem::path &filePath, TrainParser &callback) noexcept(false)
void dclspc ParseTrain (const Train &train, TrainParser &callback) noexcept(false)
bool dclspc ParseFleet (std::basic_istream< char > &stream, FleetParser &callback) noexcept(false)
bool dclspc ParseFleet (const std::filesystem::path &filePath, FleetParser &callback) noexcept(false)
bool dclspc ParseFleet (const Fleet &fleet, FleetParser &callback) noexcept(false)
dclspc bool Couple (const TrainComponent::Coupling &coupling) noexcept
 Couples two TrainComponents.
dclspc TrainCommonParent (const TrainComponent &a, const TrainComponent &b) noexcept
bool dclspc Equals (const RoadwayTwist &twistA, const RoadwayTwist &twistB, Angle epsilon_angle=epsilon__angle) noexcept
 Comparison.
dclspc const char * TypeToName (RoadwayTwist::TwistType type)
 Gets the type name of a twist from its type enumerator.
dclspc RoadwayTwist::TwistType TwistNameToType (const std::string &name) noexcept
 Gets the type enumerator of a twist from its type name.
template dclspc const ConstantTwistFindTwist< ConstantTwist > (const RoadwayTwist &twist) noexcept
template dclspc const LinearTwistFindTwist< LinearTwist > (const RoadwayTwist &twist) noexcept
template dclspc const PiecewiseTwistFindTwist< PiecewiseTwist > (const RoadwayTwist &twist) noexcept
template dclspc const DirectionalTwistFindTwist< DirectionalTwist > (const RoadwayTwist &twist) noexcept
template dclspc const CombinedTwistFindTwist< CombinedTwist > (const RoadwayTwist &twist) noexcept
template dclspc ConstantTwistFindTwist< ConstantTwist > (RoadwayTwist &twist) noexcept
template dclspc LinearTwistFindTwist< LinearTwist > (RoadwayTwist &twist) noexcept
template dclspc PiecewiseTwistFindTwist< PiecewiseTwist > (RoadwayTwist &twist) noexcept
template dclspc DirectionalTwistFindTwist< DirectionalTwist > (RoadwayTwist &twist) noexcept
template dclspc CombinedTwistFindTwist< CombinedTwist > (RoadwayTwist &twist) noexcept
dclspc std::string ToString (Section::SpecialSections specialSection)
dclspc Section::SpecialSections SpecialSection (const std::string &string)
dclspc constexpr bool IsVelocityStatus (Signal::Status status)
dclspc std::string ToString (Signal::Status status)
 Makes a string from the status.
dclspc Signal::Status ToSignalStatus (const std::string &status)
 Makes a status value from a status string.
dclspc Signal::Status SignalStatusFrom (const std::string &socketName)
template<typename ValueType>
std::istream & StreamInVector (std::istream &is, std::vector< ValueType > &vector)
dclspc std::string ToString (NarrowSwitch::Status status)
 Makes a string from the status.
dclspc NarrowSwitch::Status ToNarrowSwitchStatus (const std::string &status)
 Makes a status value from a status string.
dclspc NarrowSwitch::Status NarrowSwitchStatusFrom (const std::string &socketName)
dclspc std::string ToString (SingleSlipSwitch::Status status)
 Makes a string from the status.
dclspc SingleSlipSwitch::Status ToSingleSlipSwitchStatus (const std::string &status)
 Makes a status value from a status string.
dclspc SingleSlipSwitch::Status SingleSlipSwitchStatusFrom (const std::string &socketName)
dclspc std::string ToString (DoubleSlipSwitch::Status status)
 Makes a string from the status.
dclspc DoubleSlipSwitch::Status ToDoubleSlipSwitchStatus (const std::string &status)
 Makes a status value from a status string.
dclspc DoubleSlipSwitch::Status DoubleSlipSwitchStatusFrom (const std::string &socketName)
dclspc const char * ToString (Track::TrackType type)
 Converts a TrackType to readable string.
dclspc Track::TrackType TrackType (const std::string &type) noexcept
 Finds TrackType for string.
bool operator== (const Track::End &theone, const Track::End &theother) noexcept
 Tests for equality.
bool operator!= (const Track::End &theone, const Track::End &theother) noexcept
 Tests for inequality.
bool operator== (const Track::Coupling &theone, const Track::Coupling &theother) noexcept
 Tests for equality.
bool operator!= (const Track::Coupling &theone, const Track::Coupling &theother) noexcept
 Tests for inequality.
bool operator== (const Track::Overlap &a, const Track::Overlap &b) noexcept
bool operator< (const Track::Overlap &a, const Track::Overlap &b) noexcept
dclspc std::string ToString (Track::EndType end)
 Makes a string from the status.
dclspc Track::EndType ToEndType (const std::string &end)
 Makes a status value from a status string.
Track::EndType operator! (Track::EndType end) noexcept
dclspc Length Segment (const Track &track, Length s, Length e, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false)
 Calculates a segment length ds so that the visible failure in a track would become smaller than some marginal distance of e.
dclspc Length Segment (const Track &track, Length s, Length e, Length w, Length h, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false)
 Works like the first overload, but takes the dimensions of the track model into account.
dclspc Length Segment_Checked (const Track &track, Length s, Length e, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false)
 Works like Segment(), but checks the result and shrinks it if necessary.
dclspc Length Segment_Checked (const Track &track, Length s, Length e, Length w, Length h, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false)
 Works like the first overload, but takes the dimensions of the track model into account.
dclspc Length Segment_TotallyChecked (const Track &track, Length s, Length e, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false)
 Works like Segment(), but checks the result.
dclspc Length Segment_TotallyChecked (const Track &track, Length s, Length e, Length w, Length h, common::Interval< Length > segmentLimits, bool ignoreCuvesTorsion=false)
 Works like the first overload, but takes the dimensions of the track model. into account.
dclspc std::pair< bool, LengthFoot (const spat::Position< Length > &ofPoint, const Track &toTrack)
 Foot for point in space.
dclspc std::pair< bool, LengthFoot (const spat::Position< Length > &ofPoint, const Track &toTrack, Length bestGuess)
dclspc std::pair< bool, LengthFoot (const spat::Position< Length > &ofPoint, const Track &toTrack, Length bestGuess, common::Interval< Length > inRange)
dclspc std::pair< bool, LengthFoot (const spat::VectorBundle< Length, One > &ofRay, const Track &toTrack)
 Foot for a ray in space.
dclspc std::pair< bool, LengthFoot (const spat::VectorBundle< Length, One > &ofRay, const Track &toTrack, Length bestGuess)
dclspc std::pair< bool, LengthFoot (const spat::VectorBundle< Length, One > &ofRay, const Track &toTrack, Length bestGuess, common::Interval< Length > inRange)
dclspc Length Closest (const spat::Position< Length > &toPoint, const Track &onTrack, bool includeEndpoints=true)
 Closest point on a track to a point in space.
dclspc Length Closest (const spat::VectorBundle< Length, One > &toRay, const Track &onTrack, bool includeEndpoints=true)
 Closest point on a track to a ray in space.
dclspc void Couple (std::pair< std::shared_ptr< Track >, Track::EndType > trackA, std::pair< std::shared_ptr< Track >, Track::EndType > trackB)
 Couple this trackA at endA with trackB at endB.
dclspc Length DistanceOf (Track::cTrackEnd trackEndA, Track::cTrackEnd trackEndB)
dclspc Length DistanceToCoupled (const Track &track, Track::EndType atEnd)
dclspc Angle KinkToCoupled (const Track &track, Track::EndType atEnd)
dclspc Angle TwistToCoupled (const Track &track, Track::EndType atEnd)
bool dclspc SetFrame (TrackBuilder &track, const spat::Frame< Length, One > &start, Length s) noexcept
 Same as track.SetFrame( start, s ), but does not throw.
void dclspc TransformToNonEEPCurve (TrackBuilder &track)
 Creates a matching Curve, Twist and Frame from an EEPCurve.
bool dclspc Mirror (TrackBuilder &track, const spat::VectorBundle< Length, One > mirrorPlane, bool bTest=false)
 Mirrors the track's geometry on a plane.
bool dclspc Normalize (TrackBuilder &track, bool bTest=false)
 Normalizes the attached Curve's projected parameter length to the 0_m to track.GetLength() range.
void dclspc StraightenUp (TrackBuilder &track, const spat::Vector< One > &up=Up)
 Some curves maintain a local up direction. It might be pleasing for the user to have his curve straightended up in the sense that this direction alignes with what he thinks is being 'up'.
bool dclspc Simplify (TrackBuilder &track) noexcept
 Simplifies the track's curve.
std::vector< std::shared_ptr< TrackBuilder > > dclspc CloseGap (spat::Frame< Length, One > start, spat::Frame< Length, One > end, common::Interval< Length > limits, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle, bool cloneCurve=false)
 Creates a series of new tracks that close the gap between start and end.
void operator+= (TrackLocation &tl, Length dp) noexcept
 Moves the TrackLocation by dp, obeying its orientation.
void operator-= (TrackLocation &tl, Length dp) noexcept
 Moves the TrackLocation by -dp, obeying its orientation.
bool CheckVersion ()
 Compares the version identifiers returned by the library dll with the header file's version identifiers, compiled with the client.
bool CheckRuntime ()
template<class GfVect3Type>
GfVect3Type From (const spat::Position< Length > &p, Real usdStageMetersPerUnit)
pxr::GfVec3f From (const spat::Position< One > &rotAngles)
pxr::GfVec3f From (const spat::Vector< One > &rot)
pxr::GfQuatf CalculateQuaternionFromAxis (const pxr::GfVec3f &axis, float angle)
pxr::GfQuatf From (const spat::Rotation< One > &rot)
dclspc Location GetFarEndLocation (const Connector &connector, int slotID)
dclspc Location GetEndLocation (const Connector &connector, int slotID)
Total Angle

The total angle is the sum of all rotations of the tangent vector according to the curvature. It is the curve integral over the curvature. The total angle divided by the total length would be some kind of 'average curvature'. Since k(s) always is >= 0, the total angle will always add up the rotations, they do not cancel out: e.g a curve that starts and ends with the same tangent but makes some curve inbetween would have a total angle > 0. Only a Line would have a total angle of 0. The method tends to be expensive.

Angle dclspc TotalAngle (const Curve &curve, common::Interval< Length > range, Angle accuracy=epsilon__angle)
Angle dclspc TotalAngle (std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > curve, Angle accuracy=epsilon__angle)
dclspc spat::SquareMatrix< Area, 3 > SpecificInertiaTensorFor (const spat::Box< Length > &box)
 Calculates the specific inertia tensor for a special shape.
dclspc spat::SquareMatrix< Area, 3 > SpecificInertiaTensorFor (const spat::Sphere< Length > &sphere)
 Calculates the specific inertia tensor for a special shape.
dclspc spat::SquareMatrix< Area, 3 > SpecificInertiaTensorForCylinder (Length radius, Length length)
 Calculates the specific inertia tensor for a special shape.
End Helpers
RailRunner::EndType Front (Orientation orientation) noexcept
 Get the front end of an oriented element.
RailRunner::EndType Back (Orientation orientation) noexcept
 Get the back end of an oriented element.
RailRunner::EndType Front (const TrainComponent &trainComponent) noexcept
 Get the front end of a TrainComponent according to its orientation in its Train.
RailRunner::EndType Back (const TrainComponent &trainComponent) noexcept
 Get the back end of a TrainComponent according to its orientation in its Train.
FindTwist

In a tree of combined twists finds a twist of a certain type.

Template Parameters
TwistTypeType of twist to find.
Parameters
twistTwist to start with.
Returns
Pointer to found twist or nullptr.
template<class TwistType>
const TwistType * FindTwist (const RoadwayTwist &twist) noexcept
template<class TwistType>
TwistType * FindTwist (RoadwayTwist &twist) noexcept
Streaming functions for trax objects

Streams data out and in.

std::ostream & operator<< (std::ostream &os, const Track::EndType &endType)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Track::EndType &endType)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Track::End &end)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Track::End &end)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, const Location &location)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, const TrackLocation &location)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, const TrackLocationRef &location)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, const TrackRange &range)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, const Orientation &orient)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, const Orientation::Value &orient)
 Streams trax objects.
std::ostream & operator<< (std::ostream &ost, NarrowSwitch::Status status)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const LineP::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Arc::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const ArcP::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Helix::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const HelixP::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Cubic::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Spline::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Clothoid::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Rotator::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, LineP::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Arc::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, ArcP::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Helix::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, HelixP::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, CubicData &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Spline::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Clothoid::Data &data)
 Streams trax objects.
std::istream & operator>> (std::istream &is, Rotator::Data &data)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const EventFilter::Type &type)
 Streams trax objects.
std::istream & operator>> (std::istream &is, EventFilter::Type &type)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const JackEnumerator &jackenumerator)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Jack &jack)
 Streams trax objects.
std::ostream & operator<< (std::ostream &os, const Plug &plug)
 Streams trax objects.
Equip a track by a streched curve.

Creates a most simple curve for the track, so that the endpoints get connected.

A new curve will get created and applied to the track, to make the geometry of the track fit the demand. The different overloads differ in what values of the track ends will be preserved. The methods give the strong guarantee, i.e. they will either succeed or keep the curve of the track untouched.

Parameters
trackTrack to change the curve for.
startstarting position and tangent of the track; length of tangent varies the curve by an overshoot value.
bKeepStartTangentPreserve the start tangent. In this case the cubic overshoot values have to be provided, because a Cubic might get created.
cubicOvershootStartcubic overshoot value at starting point.
cubicOvershootEndcubic overshoot value at ending point.
endending position and tangent of the track; length of tangent varies the curve by an overshoot value.
bKeepEndTangentPreserve the end tangent. In this case the cubic overshoot values have to
length_limitsSpecifies a lower and an upper limit for the track length. If exceeded, the track remains unchanged.
overshoot_limitsSpecifies a lower and an upper limit for the cubic overshoots at the ends of the track. If exceeded, the track remains unchanged.
upVector pointing in up direction. Must be of unit length.
e_lengtherror margin for the positional values.
e_angleerror margin for the directional values. be provided, because a Cubic might get created.
Returns
true if the track was successfully modified, false if streching within the limits for length, overshoot, positional and angular epsilon was not possible.
Exceptions
std::invalid_argumentif no curve could get created, e.g. because start and end are collocated.
bool dclspc Strech (TrackBuilder &track, spat::VectorBundle< Length, One > start, spat::VectorBundle< Length, One > end, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle)
bool dclspc StrechStart (TrackBuilder &track, spat::Position< Length > start, common::Interval< Length > length_limits={0_m,+infinite__length}, const spat::Vector< One > &up=Up, Length e_length=epsilon__length)
bool dclspc StrechStart (TrackBuilder &track, spat::Position< Length > start, bool bKeepStartTangent, Length cubicOvershootStart, Length cubicOvershootEnd, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle)
bool dclspc StrechStart (TrackBuilder &track, spat::VectorBundle< Length, One > start, Length cubicOvershootEnd, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle)
bool dclspc StrechEnd (TrackBuilder &track, spat::Position< Length > end, common::Interval< Length > length_limits={0_m,+infinite__length}, const spat::Vector< One > &up=Up, Length e_length=epsilon__length)
bool dclspc StrechEnd (TrackBuilder &track, spat::Position< Length > end, bool bKeepEndTangent, Length cubicOvershootStart, Length cubicOvershootEnd, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle)
bool dclspc StrechEnd (TrackBuilder &track, spat::VectorBundle< Length, One > end, Length cubicOvershootStart, common::Interval< Length > length_limits={0_m,+infinite__length}, common::Interval< Length > overshoot_limits={ 0_m,+infinite__length }, const spat::Vector< One > &up=Up, Length e_length=epsilon__length, Angle e_angle=epsilon__angle)
Copying Tracks

Creates a new track with the parameter range copyRange and the same geometry as a template track has inside this range.

The copyRange gets clipped to the original track's range. The first method creates a new track; the second one takes an existing one to make it the copy. This can be used to change the track type (e.g. to movable or paralleizable track).

Parameters
originalTracktemplate track to create the track piece for.
copyTracktarget track to become the track piece.
copyRangeRange of the track to copy. Must have an intersection with the original track's range.
cloneCurveIf true, the copy track gets its own cloned curve, otherwise it shares the original curve.
Returns
the track copy or nullptr if copying was not possible.
std::shared_ptr< TrackBuilder > dclspc CopyTrack (const TrackBuilder &originalTrack, TrackBuilder &copyTrack, bool cloneCurve=false)
 Creates a new track from a template track.
std::shared_ptr< TrackBuilder > dclspc CopyTrack (const TrackBuilder &originalTrack, bool cloneCurve=false)
 Creates a new track from a template track.
std::shared_ptr< TrackBuilder > dclspc CopyTrack (const TrackBuilder &originalTrack, TrackBuilder &copyTrack, common::Interval< Length > copyRange, bool cloneCurve=false)
 Creates a new track from a template track.
std::shared_ptr< TrackBuilder > dclspc CopyTrack (const TrackBuilder &originalTrack, common::Interval< Length > copyRange, bool cloneCurve=false)
 Creates a new track from a template track.
Splitting Tracks

Creates new tracks that follow the same path of a given track.

The tracks will have all the length track.GetLength()/numPieces.

Parameters
tracktemplate track to create the track pieces for.
numPieceshow many new tracks to create.
atParameterParameter value along the track to split at.
cloneCurveIf true, each track gets its own cloned curve, otherwise all the tracks share the original curve.
factoryFactory to be used to create the new tracks.
Returns
a list with newly created consecutive tracks.
std::vector< std::shared_ptr< TrackBuilder > > dclspc SplitTrack (const TrackBuilder &track, int numPieces=2, bool cloneCurve=false)
std::vector< std::shared_ptr< TrackBuilder > > dclspc SplitTrack (const TrackBuilder &track, Length atParameter, bool cloneCurve=false)
Parallel points and tangents to track

Parallel to twisted track.

/// Cp = Fw.P + h * Fw.N + v * Fw.B
/// D1 = dCp(s)/ds = (1 + k * (v*sin(w) - h*cos(w))) * Fw.T - (t + dw/ds) * (v*Fw.N - h*Fw.B);
/// 

where s is the arc length parameter of the original curve, not of the parallel. See traxBook Appendix C.

Returns
A vector bundle, with P being the position on the parallel curve, T being the D1 of the parallel at that point with T.Length() * ds == Parallel_ds (for small ds) and T/T.Length() being the unit tangent of the parallel. N gives the up vector of the original track at s.
spat::VectorBundle2< Length, One > dclspc Parallel (const TrackBuilder &originalTrack, Length s, spat::Vector2D< Length > shift)
 Parallel with respect to some plane, defined by an up-direction.
spat::VectorBundle2< Length, One > dclspc ParallelToUp (const TrackBuilder &originalTrack, Length s, spat::Vector2D< Length > shift, spat::Vector< One > up=Up)
 Parallel with respect to some plane, defined by an up-direction.
Parallel Tracks

Make a parallel track.

Parameters
originalTrackthe original track to make a parallel for.
rangethe range on the original track, to make a parallel for.
shiftthe distance of the parallel to the original. If shift == spat::Null2D it returns a copy of the original track.
bShiftRelativeToTwistOrUpmode of parallelity
minPointDistanceminimum distance for the polygonal or spline vertices along the parallel curve. This might get smaller for the last two segments.
maxDeviationLengthmaximum distance between the true parallel and the polygonal approximation.
upPlane defining vector for plane oriented parallelity mode.
sampleDistanceLimitsThe minimum and maximum distance between the sample points
Returns
The parallel track or nullptr, if it couldn't be built.
Exceptions
std::invalid_argumentif the original track is not valid.
std::runtime_errorif the parallel track could not be built.
std::shared_ptr< TrackBuilder > dclspc MakeParallelTrack (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift=spat::Null2D< trax::Length >, bool bShiftRelativeToTwistOrUp=true, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, Angle maxDeviationAngle=epsilon__angle)
 Makes a parallel track by trying Line, Arc and Helix first. If that does not apply it returns nullptr.
std::shared_ptr< TrackBuilder > dclspc MakeParallelTrackWithPolygonalChain (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift=spat::Null2D< trax::Length >, bool bShiftRelativeToTwistOrUp=true, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, common::Interval< Length > sampleDistanceLimits={ 1_m, 10_m })
 Parallel approximation by Polygonal Chain.
std::shared_ptr< TrackBuilder > dclspc MakeParallelTrackWithSampledCurve (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift=spat::Null2D< trax::Length >, bool bShiftRelativeToTwistOrUp=true, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, Angle maxDeviationAngle=epsilon__angle, common::Interval< Length > sampleDistanceLimits={ epsilon__length, 20_m })
 Parallel approximation by SampledCurve.
std::shared_ptr< TrackBuilder > dclspc MakeParallelTrackWithSpline (const TrackBuilder &originalTrack, common::Interval< Length > range, spat::Vector2D< Length > shift, bool bShiftRelativeToTwistOrUp, spat::Vector< One > up=Up, Length maxDeviationLength=epsilon__length, common::Interval< Length > sampleDistanceLimits={ 1_m, 1000_m })
 Parallel approximation by Spline.
Dimensionated Values boost math tools.
template<class F, typename DomainType, typename Tol>
common::Interval< DomainType > bracket_and_solve_root (F f, const DomainType &guess, const One &factor, bool rising, Tol tol, boost::uintmax_t &max_iter)
template<class F, typename DomainType>
DomainType newton_raphson_iterate (F f, DomainType guess, common::Interval< DomainType > limits, int digits, boost::uintmax_t &max_iter)

Variables

constexpr IDType anyID
template<class Base>
std::vector< char const * > ObjectID_Imp< Base >::sm_ReferenceNames
template<class Base>
const std::string ObjectID_Imp< Base >::m_Empty
template<typename Valtype>
const Valtype TrackJoint< Valtype >::maxval = infinite
constexpr Time attention_span = 3_s
 The maximum time, a user is expected to concentrate on one single apect of the simulation.
constexpr Velocity maximum__velocity = 500_kmIh
constexpr Acceleration g {-9.81f * units_per_meter}
 Acceleration due to gravity.
constexpr Velocity bolt = 100_m / 9.58_s
 fastest man in the world
constexpr Length default_derailing_distance = 1.435_m / 4
 A default value for the acceptable distance between a track position and something beeing still considered as railed.
constexpr Length earth_radius = 6.371e6_m
constexpr Real steps_per_second = 60
constexpr Time fixed_timestep = 1_s / steps_per_second
 The fixed timestep to use with the simulation.
constexpr spat::Vector< OneUp = spat::Ez<One>
 Vector pointing in the up direction with respect to gravity.
constexpr spat::Vector< AccelerationG = g * Up
constexpr AnglePerLength epsilon__curvature = 1 / earth_radius
 Marginal curvature is earth's curvature.
dclspc pxr::TfStaticData< UsdTraxTokenTypesUsdTraxTokens

Detailed Description

Namespace of all the trax track libraries classes and methods.

///             ptree::front()                                  ptree::end()    
///                 |                                                   |
///                 v                                                   v
///              ptree
///             /     \                     \               |           
///         key         ptree                ptree          ...         
///                     /    \              /     |
///                 key         ptree      key     ...
///                             /    |
///                         key         ...
/// 

Enumeration Type Documentation

◆ CameraType

enum class trax::CameraType
strong

Type of the camera.

The type of the camera specifies its behaviour.

Function Documentation

◆ Clone()

template<class CurveType>
std::unique_ptr< CurveType > trax::Clone ( const CurveType & curve)
inlinenoexcept

Creates a clone of the given curve.

Template Parameters
CurveTypeThe type of the curve to clone.
Parameters
curveThe curve to clone.
Returns
A unique_ptr to the cloned curve with the same type as the input curve.

◆ CloseGap()

std::vector< std::shared_ptr< TrackBuilder > > dclspc trax::CloseGap ( spat::Frame< Length, One > start,
spat::Frame< Length, One > end,
common::Interval< Length > limits,
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length,
Angle e_angle = epsilon__angle,
bool cloneCurve = false )

Creates a series of new tracks that close the gap between start and end.

Parameters
startThe start point of the gap including tangent and twisted normal.
endThe end point of the gap including tangent and twisted normal.
limitsThe limits for the length of the new tracks.
upThe up vector to use for the new tracks. If not set, the default Up vector is used.
e_lengthThe error margin for the length of the new tracks.
e_angleThe error margin for the angle of the new tracks.
cloneCurveIf true, the new tracks will have their own cloned curves, otherwise a common curve might be shared.

◆ CommonParent()

dclspc Train * trax::CommonParent ( const TrainComponent & a,
const TrainComponent & b )
noexcept
Returns
the first common Train parent if the two TrainComponents have one.

◆ Couple() [1/3]

std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > dclspc trax::Couple ( const TrackCollection & collection,
TrackBuilder & track,
Track::EndType endType,
Length maxDistance = 1_m,
Angle maxKink = pi,
bool bSilent = true )

Searches open track ends inside an area around a given track end and couples to the closest.

Parameters
collectionThe track collection to search track ends in.
trackThe track to couple.
endTypeThe track's end to couple
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.
Returns
The other track end, the track was coupled to, or { nullptr, Track::EndType::none } if no suitable track end was found.
Exceptions
std::invalid_argumentIf the end type is not recocnised.

◆ Couple() [2/3]

dclspc void trax::Couple ( std::pair< std::shared_ptr< Track >, Track::EndType > trackA,
std::pair< std::shared_ptr< Track >, Track::EndType > trackB )

Couple this trackA at endA with trackB at endB.

Couples two tracks at the specified ends together so that a Location transitions between them respectively. There is exactly one coupling per end; use Points to reconnect tracks and by that build switches. There is no need for the specified track ends to be adjacent in a spatial sense, but with physics engines in general trains will derail if the gap becomes too large. Be aware that tracks coupled to each other will hold cyclic strong references, so they will produce a memory leak if not uncoupled. For this reason make tracks members of a TrackSystem.

Parameters
trackAshared pointer and track end.
trackBtrack and end trackA is to be coupled with.
Exceptions
std::invalid_argumentIf the end type is not recocnised.
std::logic_errorIf the track end could not coupled, e.g. because of self coupling.

◆ Couple() [3/3]

dclspc void trax::Couple ( std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > trackEndA,
std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > trackEndB,
int slotA = -1,
int slotB = -1,
bool connectAnyway = false )

Connect two track ends by inserting them into Connectors, if available.

The two given track ends will get coupled by the function. If one end is populating a Connector's slot, the other is inserted to a slot of that Connector first. The slot would be the one designated by slotA for a switch found with trackEndA or slotB for a switch found with trackEndB, or the next free slot index, if slotA/B happens to be -1. In the former case any other track in that slot would be freed. After inserting or if both track ends are members of the same Connector already, the Connector is used to connect the ends, resulting in an exception thrown if the Connector is not able to do this. This behaviour can be overriden by setting the connectAnyway flag; the two switches then would be allowed to deal with the track end concurrently.

Parameters
trackEndAdenotes a track's end to get coupled and inserted into a Connector's slot.
trackEndBdenotes another track's end to get coupled and inserted into a Connector's slot.
slotADetermines the slot index of a Connector found with trackEndA, trackEndB is inserted to, if only one track end is member of a Connector or connectAnyway is set. If -1, the next empty slot with the lowest index number would be choosen.
slotBDetermines the slot index of a Connector found with trackEndB, trackEndA is inserted to, if only one track end is member of a Connector or connectAnyway is set. If -1, the next empty slot with the lowest index number would be choosen.
connectAnywayIf both track ends are already members of different Connectors, a std::runtime_error will get thrown if this flag is false. If it is true, both connectors gain control over the track ends simultaneously, but Track::GetConnector() will continue to return the original connector.
Exceptions
std::runtime_errorif the track ends are members of different Connectors. throws std::out_of_range, if the slot does not exist.
std::logic_error,ifthe two ends can not get connected by the Connector.
std::inalid_argumentIf one of the tracks is not valid or both are the same, or slot is not existing.

◆ CreateNonEEPCurve()

std::unique_ptr< Curve > dclspc trax::CreateNonEEPCurve ( const EEPCurve::Data & fromEEPCurveData)

Creates a matching Curve from the data that is not an EEPCurve.

Returns
Pointer to created curve or nullptr.
Exceptions
std::invalid_argumentif curve creation is not possible due to invalid data.

◆ decorator_cast()

template<class DecoratorPointerType, class InterfaceType>
DecoratorPointerType trax::decorator_cast ( InterfaceType * pInterface)
noexcept

Cast to a decorator type in the decorator chain or to the component itself.

Parameters
pInterfaceAn interface type. Supposed not to be a decorator type but the decorated interface.

◆ DeCouple()

dclspc void trax::DeCouple ( TrackBuilder & track,
Track::EndType trackEnd,
int ownerSlot = -1 )

Uncouples a track end by clearing any Connectors.

The track end gets decoupled and is removed from any Connector.

Parameters
trackThe track to decouple an end of.
trackEndThe track end to decouple.
ownerSlotA slot type that is seen as the owner of the connector, so the track end will not get removed from it.

◆ DistanceOf()

dclspc Length trax::DistanceOf ( Track::cTrackEnd trackEndA,
Track::cTrackEnd trackEndB )
Returns
the 3D distance between two track ends. If the distance can not be calculated, +infinite_length is returned.
Exceptions
std::invalid_argumentif any of the track ends is invalid.

◆ DistanceToCoupled()

dclspc Length trax::DistanceToCoupled ( const Track & track,
Track::EndType atEnd )
Returns
The 3D distance of the coupled track, if any.
Exceptions
std::invalid_argumentif any of the track ends is invalid.
std::logic_errorif the track end is not coupled.

◆ DistanceToOtherEnd()

dclspc spat::Vector< Length > trax::DistanceToOtherEnd ( const Connector & connector,
int fromSlot )
Parameters
connectorConnector to investigate.
fromSlotSlot to evaluate the track's end distance for.
Returns
A Vector, signifying the distance from the branching point of the switch to the tracks others end, that is not assigned to the slot.
Exceptions
std::runtime_error,ifthe slot is empty.

◆ DoubleSlipSwitchStatusFrom()

dclspc DoubleSlipSwitch::Status trax::DoubleSlipSwitchStatusFrom ( const std::string & socketName)
Returns
The status a specific socket is related with.

◆ DouglasPeucker()

template<class ContainerType, typename Valtype, typename IteratorToPositionConverterType>
void trax::DouglasPeucker ( ContainerType & data,
typename ContainerType::iterator start,
typename ContainerType::iterator end,
Valtype maxDeviation,
IteratorToPositionConverterType P )

/brief Simplifies a polygonal chain, by the Douglas-Peucker algorithm

https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm.

◆ EndOfLine()

dclspc std::tuple< std::shared_ptr< const Track >, Track::EndType, Length > trax::EndOfLine ( const Location & location,
Length maxDistance,
bool bDeadConnectorOnly = false )

Gets the end of a line.

A line is a continuous passable path on a track system. This might be a section from a switch or dead end to another switch or dead end (bDeadConnectorOnly = false) or from a dead switch or dead end to another dead switch or dead end (bDeadConnectorOnly = true), meaning correctly passable switches are included into the line. Since lines are of potentially unlimited length, a maximum length has to be provided.

Parameters
locationLocation to start the search from.
maxDistanceA maximum distance to search for. Pick the value in a responsible manner.
bDeadConnectorOnlyIf true the search does not stop on a connector that can get passed propperly.
Returns
If an end of the line is found in the range of maxDistance, the track and its end is returned. These represent the end of the line. With Track::GetConnector, a Connector can be retrieved, if any. If the maxDistance is exceeded the track pointer would be nullptr and the returned length would equal maxDistance.

◆ Equals()

bool dclspc trax::Equals ( const RoadwayTwist & twistA,
const RoadwayTwist & twistB,
Angle epsilon_angle = epsilon__angle )
noexcept

Comparison.

Two twists of different types are considered not equal.

Returns
true if the twists are equal up to the given thresholds.
Parameters
twistAtwist to compare.
twistBtwist to compare with.
epsilon_anglemaximum vector rotational deviation.

◆ FindTrackEnds() [1/2]

std::vector< std::tuple< std::shared_ptr< TrackBuilder >, Track::EndType, Length > > dclspc trax::FindTrackEnds ( const TrackCollection & collection,
const spat::Sphere< Length > & area,
bool sort = false )

Finds all track ends in the area.

Parameters
collectionTrack collection with tracks to evaluate.
areaSpherical area to detect track ends in.
sortIf true the list gets sorted by distance to the center of the area (closest first).
Returns
A list with track ends as well as their distance from the area center. If both track ends are inside the area, the track will be listed twice.

◆ FindTrackEnds() [2/2]

std::vector< std::tuple< std::shared_ptr< TrackBuilder >, Track::EndType, Length > > dclspc trax::FindTrackEnds ( const TrackSystem & system,
const spat::Sphere< Length > & area,
bool sort = false )

Finds all track ends in the area.

Parameters
systemTrack system with tracks to evaluate.
areaSpherical area to detect track ends in.
sortIf true the list gets sorted by distance to the center of the area (closest first).
Returns
A list with track ends as well as their distance from the area center. If both track ends are inside the area, the track will be listed twice.

◆ FindTrackLocations() [1/4]

std::vector< std::pair< Location, Length > > dclspc trax::FindTrackLocations ( const TrackCollection & collection,
const spat::Sphere< Length > & area,
bool sort = false )

Finds all tracks that run trough an area.

Parameters
collectionTrack collection with tracks to evaluate.
areaSpherical area to detect tracks in.
sortIf true the list gets sorted by distance to the center of the area (closest first).
Returns
A list with track Locations as well as their distance from the area center.

◆ FindTrackLocations() [2/4]

std::vector< std::pair< Location, Length > > dclspc trax::FindTrackLocations ( const TrackCollection & collection,
const spat::VectorBundle< Length, One > & ray,
Length gauge,
bool sort = false )

Finds all tracks that got hit by a ray.

Parameters
collectionTrack collection with tracks to evaluate.
rayA line starting at ray.P and running in the ray.T direction ad infinitum.
gaugeIf this is > 0_m it is used as the width of a ribbon to hit, also defined by the track's up direction.
sortIf true the list gets sorted by distance to ray.P (closest first).
Returns
A list with track Locations as well as their distance from the ray's starting point.

◆ FindTrackLocations() [3/4]

std::vector< std::pair< Location, Length > > dclspc trax::FindTrackLocations ( const TrackSystem & system,
const spat::Sphere< Length > & area,
bool sort = false )

Finds all tracks that run trough an area.

Parameters
systemTrack system with tracks to evaluate.
areaSpherical area to detect tracks in.
sortIf true the list gets sorted by distance to the center of the area (closest first).
Returns
A list with track Locations as well as their distance from the area center.

◆ FindTrackLocations() [4/4]

std::vector< std::pair< Location, Length > > dclspc trax::FindTrackLocations ( const TrackSystem & system,
const spat::VectorBundle< Length, One > & ray,
Length gauge = 0_m,
bool sort = false )

Finds all tracks that got hit by a ray.

Parameters
systemTrack system with tracks to evaluate.
rayA line starting at ray.P and running in the ray.T direction ad infinitum.
gaugeIf this is > 0_m it is used as the width of a ribbon to hit, also defined by the track's up direction. If <= 0_m the track's Section gauge is evaluated for a width of the track.
sortIf true the list gets sorted by distance to ray.P (closest first).
Returns
A list with track Locations as well as their distance from the ray's starting point.

◆ GetBoxFor()

dclspc spat::Box< Length > trax::GetBoxFor ( const TrackBuilder & track,
const Section * pSection = nullptr )

Get an axis aligned box that completely contains the track.

It is guaranteed that the section points are contained in the box as well as every position returned by the Track::Transition() methods.

Parameters
trackTrack to calculate a box for.
pSectionOptional section to calculate the box for. If nullptr, the box will be calculated for the center line..
Returns
An axis aligned box containing the track.

◆ GetEndLocation()

dclspc Location trax::GetEndLocation ( const Connector & connector,
int slotID )

A location on a connected track. The Location will be oriented away from the connected track end and sit on that track's end that is not connected by the connector in slotID.

Parameters
connectorConnector to investigate.
slotIDID of the connectors slot.
Returns
A Location sitting on the connected track's far end or nullptr, if the slot is not populated.

◆ GetFarEndLocation()

dclspc Location trax::GetFarEndLocation ( const Connector & connector,
int slotID )

A location on a connected track. The Location will be oriented away from the connected track end and sit on that track's end that is not connected by the connector in slotID.

Parameters
connectorConnector to investigate.
slotIDID of the connectors slot.
Returns
A Location sitting on the connected track's far end or nullptr, if the slot is not populated.

◆ KinkToCoupled()

dclspc Angle trax::KinkToCoupled ( const Track & track,
Track::EndType atEnd )
Returns
The angle of the tangent of the coupled track, if any.
Exceptions
std::invalid_argumentif any of the track ends is invalid.
std::logic_errorif the track end is not coupled.

◆ Mirror()

bool dclspc trax::Mirror ( TrackBuilder & track,
const spat::VectorBundle< Length, One > mirrorPlane,
bool bTest = false )

Mirrors the track's geometry on a plane.

Parameters
trackThe track to be changed.
mirrorPlaneA normal vector for the plane and one point on the plane to be used as a mirror.
bTestIf true the track will not be changed, but the return value would signal, wether a mirror operation can get performed for real.
Returns
true if the track was mirrored correctly, false if for some reason the track can not get mirrored and therefore stayed untouched.

◆ NarrowSwitchStatusFrom()

dclspc NarrowSwitch::Status trax::NarrowSwitchStatusFrom ( const std::string & socketName)
Returns
The status a specific socket is related with.

◆ Normalize()

bool dclspc trax::Normalize ( TrackBuilder & track,
bool bTest = false )

Normalizes the attached Curve's projected parameter length to the 0_m to track.GetLength() range.

The operation keeps the track unchanged, but only recalculates the curve and its relationship to the track. This will only be possible for symmetric curves. If this is not the case, the track remains unchanged and the method returns false.

Parameters
trackThe track to get normalized.
bTestIf true the track will not be changed, but the return value would signal, wether a normalization operation can get performed for real.
Returns
true if the track could get normalized, false if not.

◆ operator!()

Track::EndType trax::operator! ( Track::EndType end)
inlinenoexcept
Returns
The other end.

◆ operator!=() [1/2]

bool trax::operator!= ( const Orientation & a,
const Orientation & b )
inlinenoexcept
Returns
true if the two orientations are inequal, otherwise false.

◆ operator!=() [2/2]

bool trax::operator!= ( const Orientation::Value & a,
const Orientation & b )
inlinenoexcept
Returns
true if the two orientations are inequal, otherwise false.

◆ operator+()

Orientation trax::operator+ ( const Orientation & a,
const Orientation & b )
inlinenoexcept
Returns
The absolute orientation of b if it is understood relative to a.

◆ operator+=()

Orientation & trax::operator+= ( Orientation & a,
const Orientation & b )
inlinenoexcept

Assigns to a the absolute orientation of b if it is understood relative to a.

Returns
A reference to a.

◆ operator==() [1/2]

bool trax::operator== ( const Orientation & a,
const Orientation & b )
inlinenoexcept
Returns
true if the two orientations are equal, otherwise false.

◆ operator==() [2/2]

bool trax::operator== ( const Orientation::Value & a,
const Orientation & b )
inlinenoexcept
Returns
true if the two orientations are equal, otherwise false.

◆ Parallel()

spat::VectorBundle2< Length, One > dclspc trax::Parallel ( const TrackBuilder & originalTrack,
Length s,
spat::Vector2D< Length > shift )

Parallel with respect to some plane, defined by an up-direction.

The parallel relative to the plane that can be gotten by rotating the frame to the Up vector, like a directional twist does, and then moving the corresponding point along Fw.N and Up:

/// Cp = F.P(s) + h * Fw.N(s) + v * Up;
/// D1 = (1-k*h*cos(w)) * F.T - (dw/ds+t)*h*sin(w) * F.N + (dw/ds+t)*h*cos(w) * F.B;
/// (dw/ds+t) = k * Up*T/Up*B / (1 + pow<2>(Up*N/Up*B))
/// 
Returns
A vector bundle, with P being the position on the parallel curve, T being the D1 of the parallel at that point with T.Length() * ds == Parallel_ds (for small ds) and T/T.Length() being the unit tangent of the parallel. N gives the up vector of the original track at s.

◆ ParallelToUp()

spat::VectorBundle2< Length, One > dclspc trax::ParallelToUp ( const TrackBuilder & originalTrack,
Length s,
spat::Vector2D< Length > shift,
spat::Vector< One > up = Up )

Parallel with respect to some plane, defined by an up-direction.

The parallel relative to the plane that can be gotten by rotating the frame to the Up vector, like a directional twist does, and then moving the corresponding point along Fw.N and Up:

/// Cp = F.P(s) + h * Fw.N(s) + v * Up;
/// D1 = (1-k*h*cos(w)) * F.T - (dw/ds+t)*h*sin(w) * F.N + (dw/ds+t)*h*cos(w) * F.B;
/// (dw/ds+t) = k * Up*T/Up*B / (1 + pow<2>(Up*N/Up*B))
/// 
Returns
A vector bundle, with P being the position on the parallel curve, T being the D1 of the parallel at that point with T.Length() * ds == Parallel_ds (for small ds) and T/T.Length() being the unit tangent of the parallel. N gives the up vector of the original track at s.

◆ ParameterDistanceFrom3DDistance()

dclspc Length trax::ParameterDistanceFrom3DDistance ( const Location & location,
Length distanceIn3D,
Length maxParameter,
Length _epsilon = epsilon__length )

Calculate parameter for given 3D distance.

Parameters
locationstarting location.
distanceIn3Dtarget distance in space between the two locations on track. Negative values would return negative result values.
maxParametermaximum parameter to return. Specify a reasonable value to prevent infinite recursion in cases no result can be found.
_epsilonaccuracy to yield for the result.
Returns
The parameter, the location has to be moved, to yield a certain 3D distance or maxParameter if no solution was found.

◆ SetFrame()

bool dclspc trax::SetFrame ( TrackBuilder & track,
const spat::Frame< Length, One > & start,
Length s )
noexcept

Same as track.SetFrame( start, s ), but does not throw.

Returns
true on success, false if the frame could not be set.

◆ Simplify()

bool dclspc trax::Simplify ( TrackBuilder & track)
noexcept

Simplifies the track's curve.

For some curves it is possible to pick simpler ones, while keeping the geometry of the track. This method will exchange the LineP, ArcP, HelixP curves by the simpler Line, Arc, Helix curves.

Parameters
trackThe track to simplify.
Returns
true if the track was simplified, false if not.

◆ SingleSlipSwitchStatusFrom()

dclspc SingleSlipSwitch::Status trax::SingleSlipSwitchStatusFrom ( const std::string & socketName)
Returns
The status a specific socket is related with.

◆ Snap()

std::pair< std::shared_ptr< TrackBuilder >, Track::EndType > dclspc trax::Snap ( const TrackCollection & collection,
TrackBuilder & track,
Track::EndType endType,
Length maxDistance,
bool bUncoupled = true )

Moves a track so that one of it's ends aligns to another track end in a collection.

Parameters
collectionThe track collection to search track ends in.
trackThe track to snap.
endTypeThe track's end to snap.
maxDistanceA threshold for the distance to search track ends around the to be snapped end.
bUncoupledIf true only uncoupled track ends are taken into consideration.
Returns
The other track end, the track was snapped to, or { nullptr, Track::EndType::none } if no suitable track end was found.

◆ SpecificInertiaTensorFor() [1/2]

dclspc spat::SquareMatrix< Area, 3 > trax::SpecificInertiaTensorFor ( const spat::Box< Length > & box)

Calculates the specific inertia tensor for a special shape.

Returns
the inertial tensor for a shape of mass 1. This can be used with the Body interface.

◆ SpecificInertiaTensorFor() [2/2]

dclspc spat::SquareMatrix< Area, 3 > trax::SpecificInertiaTensorFor ( const spat::Sphere< Length > & sphere)

Calculates the specific inertia tensor for a special shape.

Returns
the inertial tensor for a shape of mass 1. This can be used with the Body interface.

◆ SpecificInertiaTensorForCylinder()

dclspc spat::SquareMatrix< Area, 3 > trax::SpecificInertiaTensorForCylinder ( Length radius,
Length length )

Calculates the specific inertia tensor for a special shape.

Returns
the inertial tensor for a shape of mass 1. This can be used with the Body interface.

◆ StraightenUp()

void dclspc trax::StraightenUp ( TrackBuilder & track,
const spat::Vector< One > & up = Up )

Some curves maintain a local up direction. It might be pleasing for the user to have his curve straightended up in the sense that this direction alignes with what he thinks is being 'up'.

Manipulates the track's frame, so that the curves direction shows up in global coordinates.

Parameters
trackThe track to get straightened up.
upThe direction to align the curves up direction with.
Exceptions
std::invalid_argumentif the track is not valid.
std::runtime_erroif the curve does not have an up direction.

◆ Strech()

bool dclspc trax::Strech ( TrackBuilder & track,
spat::VectorBundle< Length, One > start,
spat::VectorBundle< Length, One > end,
common::Interval< Length > length_limits = {0_m,+infinite__length},
common::Interval< Length > overshoot_limits = { 0_m,+infinite__length },
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length,
Angle e_angle = epsilon__angle )

Will create a Line, an Arc, a Helix or a Cubic.

◆ StrechEnd() [1/3]

bool dclspc trax::StrechEnd ( TrackBuilder & track,
spat::Position< Length > end,
bool bKeepEndTangent,
Length cubicOvershootStart,
Length cubicOvershootEnd,
common::Interval< Length > length_limits = {0_m,+infinite__length},
common::Interval< Length > overshoot_limits = { 0_m,+infinite__length },
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length,
Angle e_angle = epsilon__angle )

Keeps the start position and - if bKeepEndTangent is set true - the end tangent. Will create a Line, an Arc, a Helix or - if bKeepEndTangent is set true - a Cubic.

◆ StrechEnd() [2/3]

bool dclspc trax::StrechEnd ( TrackBuilder & track,
spat::Position< Length > end,
common::Interval< Length > length_limits = {0_m,+infinite__length},
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length )

Keeps the start position and the direction of the start tangent perpendicular to the Up direction. Will create a Line, an Arc or a Helix.

◆ StrechEnd() [3/3]

bool dclspc trax::StrechEnd ( TrackBuilder & track,
spat::VectorBundle< Length, One > end,
Length cubicOvershootStart,
common::Interval< Length > length_limits = {0_m,+infinite__length},
common::Interval< Length > overshoot_limits = { 0_m,+infinite__length },
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length,
Angle e_angle = epsilon__angle )

Keeps the start position and tangent Will create a Line, an Arc, a Helix or a Cubic.

◆ StrechStart() [1/3]

bool dclspc trax::StrechStart ( TrackBuilder & track,
spat::Position< Length > start,
bool bKeepStartTangent,
Length cubicOvershootStart,
Length cubicOvershootEnd,
common::Interval< Length > length_limits = {0_m,+infinite__length},
common::Interval< Length > overshoot_limits = { 0_m,+infinite__length },
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length,
Angle e_angle = epsilon__angle )

Keeps the end position and - if bKeepStartTangent is set true - the start tangent. Will create a Line, an Arc, a Helix or - if bKeepStartTangent is set true - a Cubic.

◆ StrechStart() [2/3]

bool dclspc trax::StrechStart ( TrackBuilder & track,
spat::Position< Length > start,
common::Interval< Length > length_limits = {0_m,+infinite__length},
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length )

Keeps the end position and the direction of the end tangent perpendicular to the Up direction. Will create a Line, an Arc or a Helix.

◆ StrechStart() [3/3]

bool dclspc trax::StrechStart ( TrackBuilder & track,
spat::VectorBundle< Length, One > start,
Length cubicOvershootEnd,
common::Interval< Length > length_limits = {0_m,+infinite__length},
common::Interval< Length > overshoot_limits = { 0_m,+infinite__length },
const spat::Vector< One > & up = Up,
Length e_length = epsilon__length,
Angle e_angle = epsilon__angle )

Keeps the end position and tangent Will create a Line, an Arc, a Helix or a Cubic.

◆ ToDoubleSlipSwitchStatus()

dclspc DoubleSlipSwitch::Status trax::ToDoubleSlipSwitchStatus ( const std::string & status)

Makes a status value from a status string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ ToEndType()

dclspc Track::EndType trax::ToEndType ( const std::string & end)

Makes a status value from a status string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ ToIndicatorStatus()

dclspc Indicator::Status trax::ToIndicatorStatus ( const std::string & status)

Makes a status value from a status string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ ToNarrowSwitchStatus()

dclspc NarrowSwitch::Status trax::ToNarrowSwitchStatus ( const std::string & status)

Makes a status value from a status string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ ToRailRunnerEndType()

dclspc RailRunner::EndType trax::ToRailRunnerEndType ( const std::string & endtype)

Makes a end type value from a string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ ToSignalStatus()

dclspc Signal::Status trax::ToSignalStatus ( const std::string & status)

Makes a status value from a status string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ ToSingleSlipSwitchStatus()

dclspc SingleSlipSwitch::Status trax::ToSingleSlipSwitchStatus ( const std::string & status)

Makes a status value from a status string.

Exceptions
std::invalid_argumentif the string was not recognized.

◆ TotalAngle() [1/2]

Angle dclspc trax::TotalAngle ( const Curve & curve,
common::Interval< Length > range,
Angle accuracy = epsilon__angle )
Parameters
curvereference to curve and range to evaluate.
rangethe curve shall be evaluated at.
accuracythe result shall divert no more from the exact solution than accuracy.
Returns
S k(s) ds over curve
Exceptions
std::invalid_argumentif accuracynot > 0 or curve.first is nullptr or curve is not valid.
std::domain_error.

◆ TotalAngle() [2/2]

Angle dclspc trax::TotalAngle ( std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > curve,
Angle accuracy = epsilon__angle )
Parameters
curvereference to curve and range to evaluate.
accuracythe result shall divert no more from the exact solution than accuracy.
Returns
S k(s) ds over curve
S k(s) ds over curve
Exceptions
std::invalid_argumentif accuracynot > 0 or curve.first is nullptr or curve is not valid.
std::domain_error.

◆ TransformToNonEEPCurve()

void dclspc trax::TransformToNonEEPCurve ( TrackBuilder & track)

Creates a matching Curve, Twist and Frame from an EEPCurve.

If the track has a EEPCurve it gets substituted by closest matching non EEPCurve. If the track has not an EEPCurve the function does nothing.

Exceptions
std::logic_errorif no conversion was possible.

◆ TwistToCoupled()

dclspc Angle trax::TwistToCoupled ( const Track & track,
Track::EndType atEnd )
Returns
The angle of the binormal of the coupled track, if any.
Exceptions
std::invalid_argumentif any of the track ends is invalid.
std::logic_errorif the track end is not coupled.

Variable Documentation

◆ Up

spat::Vector<One> trax::Up = spat::Ez<One>
constexpr

Vector pointing in the up direction with respect to gravity.

Should not be Ex<One>! Curve

◆ UsdTraxTokens

dclspc pxr::TfStaticData<UsdTraxTokenTypes> trax::UsdTraxTokens
extern

A global variable with static, efficient TfTokens for use in all public USD API.

See also
UsdGeomTokensType