174#include "Configuration.h"
179#include "common/Interval.h"
180#include "spat/Frame.h"
181#include "spat/Matrix.h"
182#include "spat/VectorBundle.h"
183#include "spat/VectorBundle2.h"
184#include "spat/Vector2D.h"
252 virtual
bool IsFlat() const noexcept = 0;
348 Length epsilon_length = epsilon__length,
349 Angle epsilon_angle = epsilon__angle ) const = 0;
352 virtual ~Curve() = default;
353 Curve( Curve&& ) = delete;
354 Curve& operator=( const Curve& ) = delete;
355 Curve& operator=( Curve&& ) = delete;
358 Curve( const Curve& ) = default;
369 return common::dynamic_unique_cast<CurveType>(curve.Clone());
386 Length epsilon_length = epsilon__length,
387 Angle epsilon_angle = epsilon__angle );
397 Length epsilon_length = epsilon__length )
noexcept;
416 inline bool operator<(
const CurveSample& sample )
const noexcept{
420 bool dclspc Equals(
const CurveSample& sample,
Length epsilon_length = epsilon__length,
One epsilon_angle = epsilon__angle )
const noexcept;
439 b{25
_m * spat::Ex<One>},
440 c{-15
_m * spat::Ex<One> + 15
_m * spat::Ey<One>},
441 d{10
_m * spat::Ex<One> - 10
_m * spat::Ey<One>}
454 c{3
_1*(end.P - start.
P) - end.T - 2
_1*start.
T},
455 d{2
_1*(start.
P - end.P) + start.
T + end.T}
467 inline bool operator!=(
const CubicData& other )
const noexcept{
468 return a != other.a ||
481 inline spat::Vector<Length> CubicOvershootAtStart() const noexcept{
484 inline spat::Position<Length> CubicPositionAtEnd() const noexcept{
485 return a + b + c + d;
487 inline spat::Vector<Length> CubicOvershootAtEnd() const noexcept{
488 return b + 2
_1*c + 3
_1*d;
501 static dclspc std::unique_ptr<Line>
Make() noexcept;
514 static dclspc std::unique_ptr<LineP>
Make() noexcept;
586 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle );
605 static dclspc std::unique_ptr<Arc>
Make() noexcept;
649 bool dclspc
Equals( const
Arc::Data& A, const
Arc::Data& B,
Length epsilon_length = epsilon__length ) noexcept;
672 static dclspc std::unique_ptr<ArcP>
Make() noexcept;
688 Data(
Length radius )
noexcept{
788 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle );
815 static dclspc std::unique_ptr<Helix>
Make() noexcept;
839 constexpr One slope() const noexcept {
return b()/a(); };
906 static dclspc std::unique_ptr<HelixP>
Make() noexcept;
924 Data(
Length radius,
One slope ) noexcept
945 constexpr One Slope() const noexcept {
return b/a; };
1037 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle );
1070 static dclspc std::unique_ptr<Cubic>
Make() noexcept;
1157 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle ) noexcept;
1165 static dclspc std::unique_ptr<Spline>
Make() noexcept;
1183 using Data = std::vector<SegmentValueType>;
1384 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle ) noexcept;
1396 static dclspc std::unique_ptr<Clothoid>
Make() noexcept;
1508 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle );
1619 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle ) noexcept;
1634 static dclspc std::unique_ptr<RotatorChain>
Make() noexcept;
1678 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle ) noexcept;
1690 const Track* pTrack =
nullptr;
1703 virtual
Length OriginalParameterFrom(
Length sParallelParameter ) const noexcept = 0;
1705 virtual
Length ParallelParameterFrom(
Length sOriginalParameter ) const noexcept = 0;
1707 virtual
bool IsTrackRelative() const noexcept = 0;
1721 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle ) noexcept;
1747 static dclspc std::unique_ptr<PolygonalChain>
Make() noexcept;
1758 using Data = std::vector<SegmentValueType>;
1843 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle );
1859 static dclspc std::unique_ptr<SampledCurve>
Make() noexcept;
1925 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle ) noexcept;
1950 gc_Verdrillung{ 0 },
1951 gc_Laenge{ _cm(10_m) },
1953 m_FuehrungsVerdrehung{ 0 }
1955 m_AnfangsBein.Init();
2016 Length epsilon_length = epsilon__length,
Angle epsilon_angle = epsilon__angle) noexcept;
2160 struct CurvatureStrecher{
2165 static dclspc
const CurvatureStrecher* InterfaceFrom(
const Curve& curve )
noexcept;
2167 static dclspc CurvatureStrecher* InterfaceFrom(
Curve& curve )
noexcept;
Matrix template for arbitrary dimensions and value type.
Definition Matrix.h:63
Square matrix with nColumns == nRows.
Definition Matrix.h:278
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.
Namespace of common utility classes and methods.
Definition Helpers.h:43
constexpr bool operator!=(const Interval< Valtype > &i1, const Interval< Valtype > &i2) noexcept
Interval operator.
Definition Interval.h:701
constexpr bool operator==(const Interval< Valtype > &i1, const Interval< Valtype > &i2) noexcept
Interval operator.
Definition Interval.h:696
constexpr bool Equals(T a, T b, T epsilon) noexcept
Tests equality in the sense |a-b| < epsilon.
Definition Helpers.h:66
constexpr bool operator<(const Interval< Valtype > &i1, const Interval< Valtype > &i2) noexcept
Definition Interval.h:657
Value< Dimension< 2, 0, 0 > > Area
Area.
Definition DimensionedValues.h:325
constexpr Real _1(One one) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1186
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
constexpr Real _1Im(AnglePerLength a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1347
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
constexpr Angle pi
Circle number pi.
Definition DimensionedValues.h:1145
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
Value< Dimension<-1, 0, 0 > > AnglePerLength
Angle per length.
Definition DimensionedValues.h:321
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
constexpr Real epsilon
Marginal difference in calculations.
Definition DimensionedValues.h:344
constexpr Real _deg(Angle a) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1194
Value< Dimension< 0, 0, 0 > > Angle
Angle in radians.
Definition DimensionedValues.h:320
constexpr Value< Dimension< 0, 0, 0 > > tan(Value< Dimension< 0, 0, 0 > > a) noexcept
Dimensionated Values math function.
Definition DimensionedValues.h:702
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
constexpr Position< Valtype > Origin3D
Origin of coordinate system.
Definition Position.h:143
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
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)
dclspc Curve::CurveType CurveNameToType(const std::string &name) noexcept
Gets the type enumerator of a curve from its type name.
dclspc const char * TypeToName(Curve::CurveType ct)
Gets the type name of a curve from its type enumerator.
constexpr spat::Vector< One > Up
Vector pointing in the up direction with respect to gravity.
Definition Units.h:144
std::unique_ptr< Curve > dclspc CreateNonEEPCurve(const EEPCurve::Data &fromEEPCurveData)
Creates a matching Curve from the data that is not an EEPCurve.
Angle dclspc TotalAngle(const Curve &curve, common::Interval< Length > range, Angle accuracy=epsilon__angle)
std::unique_ptr< CurveType > Clone(const CurveType &curve) noexcept
Creates a clone of the given curve.
Definition Curve.h:368
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
A Frame ("TNBFrame") describes a location in 3d space and an orientation using a right handed coordin...
Definition Frame.h:52
Implements a 3D - position in cartesian coordinates.
Definition Position.h:46
Implements a 2D - vector in cartesian coordinates.
Definition Vector2D.h:46
Implements a tangential space bundle.
Definition VectorBundle2.h:43
Implements a Vector bundle.
Definition VectorBundle.h:42
Position< Valtype > P
Base space postion.
Definition VectorBundle.h:43
Vector< ValtypeT > T
Tangent vector or x-axis.
Definition VectorBundle.h:44
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48
Data definig the curve.
Definition Curve.h:613
AnglePerLength k
Curvature of the arc.
Definition Curve.h:614
Length radius() const noexcept
Radius of Arc.
Definition Curve.h:616
A plane arc.
Definition Curve.h:602
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
static dclspc std::unique_ptr< Arc > Make() noexcept
Makes a Arc object.
virtual common::Interval< Length > Create(const Data &data)=0
Create the curve from data set for which it is guaranteed, that no calculational drift will happen e....
virtual spat::Matrix< One, 2, 3 > Jacobian(Length s) const =0
Returns the partial derivatives of the position P to the curves radius r and parameter s in a matrix,...
Data definig the curve.
Definition Curve.h:681
spat::VectorBundle2< Length, One > vb2
Center point, tangent and normal of the arc. The curve radius is the length of vb2....
Definition Curve.h:696
A plane arc with owned parameters.
Definition Curve.h:669
static dclspc std::unique_ptr< ArcP > Make() noexcept
Makes a ArcP object.
virtual void Create(const spat::VectorBundle2< Length, One > ¢er)=0
Creates an Arc.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual Length Radius() const noexcept=0
virtual spat::Matrix< One, 2, 3 > Jacobian(Length s) const =0
Returns the partial derivatives of the position P-C to the curve radius r and parameter s in a matrix...
Data defining the curve.
Definition Curve.h:1405
Length a
Single parameter to specify a clothoid.
Definition Curve.h:1406
Curve with linear increasing curvature. Also called 'Euler Spiral'.
Definition Curve.h:1393
virtual common::Interval< Length > Create(Area a2)=0
Create a clothoid with a*a.
static Angle dclspc MaxAngle() noexcept
Gets a limiting angle value.
virtual spat::SquareMatrix< One, 2 > Jacobian(Length s) const =0
Returns the partial derivatives of the position P to the parameters a and s in a matrix,...
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
static dclspc std::unique_ptr< Clothoid > Make() noexcept
Makes a Clothoid object.
Data definig a cubic curve.
Definition Curve.h:434
spat::Vector< Length > c
Definition Curve.h:463
spat::Position< Length > a
Definition Curve.h:461
spat::Vector< Length > b
Definition Curve.h:462
spat::Vector< Length > d
Definition Curve.h:464
Cubic polynom curve.
Definition Curve.h:1067
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual common::Interval< Length > CreateBezier(const spat::Position< Length > &P0, const spat::Position< Length > &P1, const spat::Position< Length > &P2, const spat::Position< Length > &P3)=0
Cubic from Cubic Bezier control points.
virtual spat::Vector< Length > CubicOvershootAt(Length s) const noexcept=0
Gets the first derivative (with respect to the internal parameter u) of the Cubic function at arc len...
virtual common::Interval< Length > Create(const spat::VectorBundle< Length, Length > &start, const spat::VectorBundle< Length, Length > &end)=0
Create the Cubic.
CubicData Data
Data definig the curve.
Definition Curve.h:1073
static dclspc std::unique_ptr< Cubic > Make() noexcept
Makes a Cubic object.
virtual common::Interval< Length > Shorten(common::Interval< Length > toRange)=0
Transforms the Cubic to one with the given parameter range.
Interface for streching the curvature of a curve, by trying to reach an end point Z,...
Definition Curve.h:2160
virtual spat::Vector< One > Direction(Length s) const =0
Curves implement this interface that then can get attached to a track to define the tracks geometry.
Definition Curve.h:198
virtual AnglePerLength Torsion(Length s) const =0
virtual bool Mirror(const spat::VectorBundle< Length, One > &mirrorPlane)=0
Make a Curve with mirrored geometry (but of course one thet returns right handed frames).
virtual std::vector< Length > ZeroSet() const =0
Returns a list of parameters at which the normal vector flips from one side to the other.
virtual common::Interval< Length > Range() const =0
virtual bool IsValid() const noexcept=0
virtual spat::Frame< Length, One > GetCurveLocalTransformation() const =0
virtual std::unique_ptr< Curve > Clone() const =0
make an exact copy of this curve.
virtual bool IsFlat() const noexcept=0
virtual bool Equals(const Curve &toCurve, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) const =0
Comparison.
virtual spat::Vector< One > LocalUp() const =0
Gives the Curve's idiosyncratic up direction. Some curves maintain some idea about where they have th...
virtual CurveType GetCurveType() const noexcept=0
virtual AnglePerLength Curvature(Length s) const =0
virtual void Transition(Length s, spat::Position< Length > &pos) const =0
Copies the 3D Position at the specified location to pos.
CurveType
Curve type identification values.
Definition Curve.h:201
@ EEPAlternative
Definition Curve.h:221
@ EEPCurve
Definition Curve.h:218
@ EEPResidual
Arc length parametrized EEP curve, but only for u != 0, l!= 0 and k²+w² != 0.
Definition Curve.h:220
@ Rotator
A curve with linearly rotating tangent vector.
Definition Curve.h:212
@ RotatorWithOffset
A Rotator curve that starts with certain offset angles.
Definition Curve.h:213
virtual const char * TypeName() const noexcept=0
The dynamic data of a curve at one point.
Definition Curve.h:410
Data definig the curve.
Definition Curve.h:1944
Data() noexcept
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1947
Real gc_Laenge
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1978
Real gc_Windung
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1976
Real gc_Kurve
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1979
Data & operator=(const Data &) noexcept=default
data for EEPCurve. Lengthes in cm.
Real gc_Kruemmung
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1975
bool operator==(const Data &data) const noexcept
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1962
spat::Frame< Real > m_AnfangsBein
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1981
Real gc_Verdrillung
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1977
Data(const Data &) noexcept=default
data for EEPCurve. Lengthes in cm.
Real m_FuehrungsVerdrehung
data for EEPCurve. Lengthes in cm.
Definition Curve.h:1980
Idiosyncratic curve used in EEP up to version 16.
Definition Curve.h:1932
static dclspc std::unique_ptr< EEPCurve > Make(CurveType type=CurveType::EEPCurve) noexcept
Makes a EEPCurve object.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual common::Interval< Length > Create(const Data &data)=0
Create a curve from start and end point.
Data definig the curve.
Definition Curve.h:823
constexpr Length a() const noexcept
radius
Definition Curve.h:837
AnglePerLength k
Curvature of the helix.
Definition Curve.h:834
constexpr Length b() const noexcept
b == a * slope
Definition Curve.h:838
AnglePerLength t
Torsion of the helix.
Definition Curve.h:835
A three dimensional spiral.
Definition Curve.h:812
virtual common::Interval< Length > Create(const Data &data)=0
Create the Helix from data set for wich it is guaranteed, that no calculational drift will happen e....
static dclspc std::unique_ptr< Helix > Make() noexcept
Makes a Helix object.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual spat::SquareMatrix< One, 3 > Jacobian(Length s) const =0
Returns the partial derivatives of the position P to the parameters a, b and s in a matrix,...
Data definig the curve.
Definition Curve.h:915
Length a
radius (not curve radius)
Definition Curve.h:940
spat::VectorBundle2< Length, One > center
Definition Curve.h:938
Length b
b/a == tan(alpha) : slope
Definition Curve.h:941
A three dimensional spiral with owned parameters.
Definition Curve.h:903
virtual spat::VectorBundle2< Length, One > Center() const noexcept=0
static dclspc std::unique_ptr< HelixP > Make() noexcept
Makes a HelixP object.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual spat::SquareMatrix< One, 3 > Jacobian(Length s) const =0
Returns the partial derivatives of the position P to the parameters a, b and s in a matrix,...
virtual Length Radius() const noexcept=0
virtual One Slope() const noexcept=0
virtual void Create(const spat::Frame< Length, One > &start, AnglePerLength curvature, AnglePerLength torsion)=0
Create the Helix.
A straight line.
Definition Curve.h:498
static dclspc std::unique_ptr< Line > Make() noexcept
Makes a Line object.
Data definig the curve.
Definition Curve.h:523
spat::VectorBundle< Length, One > vb
Position of parameter s=0 and tangent of the line.
Definition Curve.h:534
spat::Vector< One > up
Up direction.
Definition Curve.h:535
A straight line with owned parameters.
Definition Curve.h:511
virtual common::Interval< Length > Create(const spat::Position< Length > &start, const spat::Position< Length > &end, const spat::Vector< One > &up=Up)=0
Creates a straight line.
virtual void Create(const spat::Position< Length > &start, const spat::Vector< One > &tan, const spat::Vector< One > &up=Up)=0
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
static dclspc std::unique_ptr< LineP > Make() noexcept
Makes a LineP object.
virtual common::Interval< Length > Create(const Data &data)=0
Creates a straight line.
virtual void Create(const spat::VectorBundle< Length, One > &start, const spat::Vector< One > &up=Up)=0
virtual void Create(const spat::Frame< Length, One > &start)=0
Creates a straight line.
virtual void Create(const spat::VectorBundle2< Length, One > &start)=0
Creates a straight line.
A Curve parallel to a given track.
Definition Curve.h:1688
virtual common::Interval< Length > Create(const Data &data)=0
Create the curve from data set for which it is guaranteed, that no calculational drift will happen e....
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
A series of samples of points and tangents that make up a curve.
Definition Curve.h:1744
virtual common::Interval< Length > Create(std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > originalCurve, Length maxDeviation, Length minPointDistance)=0
virtual common::Interval< Length > Create(const Curve &originalCurve, common::Interval< Length > range, Length maxDeviation, Length minPointDistance)=0
Creates a polygonal chain from an existing curve.
virtual Length GetParameter(int idx) const =0
virtual int UpperBound(Length s) const =0
The index of the polygonal vertex that is the first one to have greater parameter than s.
virtual common::Interval< Length > Create(const Data &data)=0
Create the curve from data set for which it is guaranteed, that no calculational drift will happen e....
static dclspc std::unique_ptr< PolygonalChain > Make() noexcept
Makes a PolygonalChain object.
virtual common::Interval< Length > Create(const std::vector< spat::Position< Length > > &samples, WrapTypes wrap=WrapTypes::nonperiodic)=0
Creates a polygonal chain from a list of sample points.
WrapTypes
Type of handling the ends:
Definition Curve.h:1751
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
spat::VectorBundle< Length, One > SegmentValueType
Type of the segments.
Definition Curve.h:1757
virtual common::Interval< Length > CreateCatmullRom(const std::vector< spat::Position< Length > > &samples, WrapTypes wrap=WrapTypes::nonperiodic)=0
Creates a polygonal chain from a list of sample points.
Data definig the curve.
Definition Curve.h:1580
Angle a0
Starting angle in the plain.
Definition Curve.h:1583
AnglePerLength b
Angular factor to rotate towards the up direction.
Definition Curve.h:1582
Angle b0
Starting angle.
Definition Curve.h:1584
AnglePerLength a
Angular factor to rotate in the plain.
Definition Curve.h:1581
A series of Rotator curves that continue each other.
Definition Curve.h:1631
std::vector< SegmentValueType > Data
Data defining the curve.
Definition Curve.h:1641
virtual common::Interval< Length > Create(const spat::Vector< Length > &advance)=0
Create a RotatorChain that starts and ends with the same tangent and advances by the given vector.
static dclspc std::unique_ptr< RotatorChain > Make() noexcept
Makes a RotatorChain object.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
Curve with evenly (with respect to arc length) rotating tangent vector.
Definition Curve.h:1568
virtual common::Interval< Length > Create(const Data &data)=0
Create the curve from data set for which it is guaranteed, that no calculational drift will happen e....
static dclspc std::unique_ptr< Rotator > Make(CurveType type=CurveType::Rotator) noexcept
Makes a Rotator object.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual spat::SquareMatrix< Real, 3 > Jacobian(Length s) const =0
Returns the partial derivatives of the position P to the parameters a, b and s in a matrix,...
A curve given by Fi,ki,ti,si samples of a real curveT.
Definition Curve.h:1856
virtual common::Interval< Length > Create(const Data &data)=0
Create the curve from data set for which it is guaranteed, that no calculational drift will happen e....
virtual int UpperBound(Length s) const =0
The index of the sample that is the first one to have greater parameter than s.
virtual common::Interval< Length > Create(const Curve &originalCurve, common::Interval< Length > range, Length maxDeviationLength=epsilon__length, Angle maxDeviationAngle=epsilon__angle, common::Interval< Length > sampleDistanceLimits={ epsilon__length, 20_m })=0
Creates a sampled curve from an existing curve.
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
static dclspc std::unique_ptr< SampledCurve > Make() noexcept
Makes a SampledCurve object.
virtual common::Interval< Length > Create(std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > originalCurve, Length maxDeviationLength=epsilon__length, Angle maxDeviationAngle=epsilon__angle, common::Interval< Length > sampleDistanceLimits={ epsilon__length, 20_m })=0
\ brief Cubic Hermite Spline.
Definition Curve.h:1162
virtual common::Interval< Length > Create(const Data &data)=0
Create the curve from data set for which it is guaranteed, that no calculational drift will happen,...
virtual common::Interval< Length > Create(const std::vector< spat::Position< Length > > &controlPoints)=0
Natural Cubic C2 - smooth Spline (points, tangent, normal and curvature of the segments match).
CubicData SegmentValueType
Definition Curve.h:1176
virtual common::Interval< Length > Create(const std::vector< spat::Position< Length > > &controlPoints, bool bClampedAtStart, const spat::Vector< Length > &startTangent, bool bClampedAtEnd, const spat::Vector< Length > &endTangent)=0
Clamped Cubic C2 - smooth Spline (points, tangent, normal and curvature of the segments match).
WrapTypes
Type of handling the ends:
Definition Curve.h:1169
std::vector< SegmentValueType > Data
Data definig the curve.
Definition Curve.h:1183
virtual common::Interval< Length > Create(const Curve &originalCurve, common::Interval< Length > range, Length maxDeviation=epsilon__length, common::Interval< Length > sampleDistanceLimits={ 1_m, 1000_m })=0
Creates a spline curve from an existing curve.
virtual common::Interval< Length > Shorten(common::Interval< Length > toRange)=0
Transforms the Spline to one with the given parameter range.
virtual common::Interval< Length > ResetControlPointAndTangent(int idx, const spat::VectorBundle< Length > &controlPointAndTangent)=0
Resets a control point.
virtual spat::VectorBundle< Length > GetControlPointAndTangent(int idx) const =0
static dclspc std::unique_ptr< Spline > Make() noexcept
Makes a Spline object.
virtual Length GetParameter(int idx) const =0
virtual bool HasGaps(Length epsilon=epsilon__length) const noexcept=0
Check smoothness of the curve at the control points.
virtual common::Interval< Length > CreateBezier(const std::vector< spat::Position< Length > > &controlPoints, WrapTypes wrap=WrapTypes::nonperiodic)=0
C0 Spline from Cubic Bezier control points.
virtual common::Interval< Length > CreateCatmullRom(const std::vector< spat::Position< Length > > &controlPoints, One tension=0.5f, WrapTypes wrap=WrapTypes::nonperiodic)=0
C1 Spline with Pi'th tangent being: tension * (Pi+1 - Pi-1).
virtual common::Interval< Length > CreateCatmullRom(const std::vector< spat::VectorBundle< Length, One > > &controlPoints, One tension=0.5f, WrapTypes wrap=WrapTypes::nonperiodic)=0
C1 Spline with Pi'th tangent being: tension * (Pi+1 - Pi-1).Length() * Ti.
virtual int UpperBound(Length s) const =0
The index of the control point that is the first one to have greater parameter than s.
virtual bool HasKinks(Angle epsilon=epsilon__angle) const noexcept=0
Check smoothness of the tangets of the curve at the control points.
virtual int CountControlPoints() const noexcept=0
virtual const Data & GetData() const noexcept=0
Retrieves the data to construct this curve type. A roundtrip is guaranteed to be invariant.
virtual common::Interval< Length > Create(std::pair< std::shared_ptr< const Curve >, common::Interval< Length > > originalCurve, Length maxDeviation=epsilon__length, common::Interval< Length > sampleDistanceLimits={ 1_m, 1000_m })=0
virtual common::Interval< Length > Create(const std::vector< spat::VectorBundle< Length > > &controlPointsAndTangents)=0
Creates a Cubic Hermite Spline, guaranteed to be C1 (points and tangents match).
Interface for a track used to calculate 3D positions.
Definition Track.h:275