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

A twist with values at control points and either none or linear interpolation for the points in between. More...

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

Inheritance diagram for trax::PiecewiseTwist:

Public Types

using SegmentValueType = std::pair<Length, Angle>
using Data = std::vector<SegmentValueType>
Public Types inherited from trax::RoadwayTwist
enum class  TwistType : char {
  Unknown = -2 , None = -1 , Zero = 0 , Constant ,
  Linear , Piecewise , PiecewiseLinear , PiecewiseCircular ,
  PiecewiseDirectional , Directional , Positional , Combined ,
  Parallel
}

Public Member Functions

virtual void Add (Length s, const Angle &twist)=0
 Add a control point to the Twist.
virtual void Add (const std::pair< Length, Angle > &pair)=0
 Add a control point to the Twist.
virtual int CntTwistValues () const =0
virtual std::pair< Length, AngleTwist (int idx) const =0
virtual void Create (const Data &data)=0
virtual const Data & GetData () const noexcept=0
virtual Angle Twist (Length s) const=0
Public Member Functions inherited from trax::RoadwayTwist
virtual const char * TypeName () const noexcept=0
 Name for the object type that implements this interface.
virtual TwistType GetTwistType () const noexcept=0
virtual std::unique_ptr< RoadwayTwist > Clone () const =0
 Make a clone from this object.
virtual bool IsValid () const noexcept=0
virtual AnglePerLength D1 (Length s) const =0
virtual bool ZeroFlip (bool bActive) noexcept=0
virtual void Flip () noexcept=0
 Flips the effect of the twist along the track. After calling this function, the Twist() and D1() methods will give pi - Twist(Track::GetLength() - s) and -D1(Track::GetLength() - s). Calling Flip() a second time will nullify the effect.
virtual void Mirror () noexcept=0
 Multiplies all twist angle by -1.
virtual bool Offset (Angle offset) noexcept=0
 Adds a global offset angle to the Twist.
virtual bool IsDynamic () const noexcept=0
 A twist is dynamic if it relates to geometry global to the track.
virtual bool IsDirectionalConstant () const noexcept=0
 Find wether the twist is directional only offsetted by a constant.
virtual bool IsConstant () const noexcept=0
virtual void Freeze (bool bFreeze=true) noexcept=0
 Freezes the twist, so that dynamic twists like DirectionalTwist don't update anymore.
virtual bool IsFrozen () const noexcept=0
virtual bool IsNull () const noexcept=0
virtual bool Equals (const RoadwayTwist &toTwist, Angle epsilon_angle=epsilon__angle) const noexcept=0
 Comparison.
virtual void OnAttach (const TrackBuilder &track) noexcept=0
 Called on attachment to a track.
virtual void OnDetach () noexcept=0
 Called on detachment from a track.
virtual Angle DoTwist (Length) const =0
virtual AnglePerLength DoD1 (Length) const =0
 RoadwayTwist (RoadwayTwist &&)=delete
RoadwayTwist & operator= (const RoadwayTwist &)=delete
RoadwayTwist & operator= (RoadwayTwist &&)=delete

Static Public Member Functions

static dclspc std::unique_ptr< PiecewiseTwistMake (TwistType type=TwistType::Piecewise) noexcept
 Makes a PiecewiseTwist object.
static dclspc std::unique_ptr< PiecewiseTwistMake (TwistType type, const RoadwayTwist &fromTwist) noexcept
 Makes a PiecewiseTwist object from another twist.
Static Public Member Functions inherited from trax::RoadwayTwist
static dclspc std::unique_ptr< RoadwayTwist > Make (TwistType type) noexcept
 Makes a RoadwayTwist object.
static dclspc std::unique_ptr< RoadwayTwist > Make (TwistType type, const RoadwayTwist &fromTwist) noexcept
 Makes a RoadwayTwist object from another twist.

Additional Inherited Members

Protected Member Functions inherited from trax::RoadwayTwist
 RoadwayTwist (const RoadwayTwist &)=default

Detailed Description

A twist with values at control points and either none or linear interpolation for the points in between.

Member Function Documentation

◆ CntTwistValues()

virtual int trax::PiecewiseTwist::CntTwistValues ( ) const
pure virtual
Returns
the number of added control points

◆ Twist() [1/2]

virtual std::pair< Length, Angle > trax::PiecewiseTwist::Twist ( int idx) const
pure virtual
Parameters
idxZero based index of control point.
Returns
A control point.

◆ Twist() [2/2]

virtual Angle trax::RoadwayTwist::Twist ( Length s) const
virtual
Parameters
strack parameter to get the twist for [0,Track::GetLength()].
Returns
Twisting angle in radiants.

Implements trax::RoadwayTwist.


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