![]() |
Trax3 3.1.0
trax track library
|
Curves implement this interface that then can get attached to a track to define the tracks geometry. More...
#include <C:/Trend/Development/Trax3/Code/trax/Curve.h>

Public Types | |
| enum class | CurveType { none = 0 , Line , Arc , Helix , LineP , ArcP , HelixP , Clothoid , Cubic , Spline , Rotator , RotatorWithOffset , RotatorChain , PolygonalChain , SampledCurve , Parallel , EEPCurve , EEPResidual , EEPAlternative , Unknown , UserDefined } |
| Curve type identification values. More... | |
Public Member Functions | |
| virtual const char * | TypeName () const noexcept=0 |
| virtual CurveType | GetCurveType () const noexcept=0 |
| virtual bool | IsValid () const noexcept=0 |
| virtual AnglePerLength | Curvature (Length s) const =0 |
| virtual AnglePerLength | Torsion (Length s) const =0 |
| virtual bool | IsFlat () const noexcept=0 |
| virtual void | Transition (Length s, spat::Position< Length > &pos) const =0 |
| Copies the 3D Position at the specified location to pos. | |
| virtual void | Transition (Length s, spat::Vector< One > &tan) const =0 |
| Copies the 3D tangential vector at the specified location to tan. | |
| virtual void | Transition (Length s, spat::VectorBundle< Length, One > &bundle) const =0 |
| Copies the 3D Position and tangential vector at the specified location to bundle. | |
| virtual void | Transition (Length s, spat::VectorBundle2< Length, One > &bundle) const =0 |
| Copies the 3D Position and tangential and normal vectors at the specified location to bundle. | |
| virtual void | Transition (Length s, spat::Frame< Length, One > &frame) const =0 |
| Copies the 3D TBN-Frame at the specified location to frame. | |
| 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 spat::Vector< One > | LocalUp () const =0 |
| Gives the Curve's idiosyncratic up direction. Some curves maintain some idea about where they have their upside, either because of their form (e.g Helix) or because it is extra defined (e.g. for Line). Some curves maintain no such notion (e.g. many Cubics). | |
| 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 | Mirror (const spat::VectorBundle< Length, One > &mirrorPlane)=0 |
| Make a Curve with mirrored geometry (but of course one thet returns right handed frames). | |
| virtual bool | Equals (const Curve &toCurve, common::Interval< Length > range, Length epsilon_length=epsilon__length, Angle epsilon_angle=epsilon__angle) const =0 |
| Comparison. | |
| Curve (Curve &&)=delete | |
| Curve & | operator= (const Curve &)=delete |
| Curve & | operator= (Curve &&)=delete |
Protected Member Functions | |
| Curve (const Curve &)=default | |
Curves implement this interface that then can get attached to a track to define the tracks geometry.
The curve has to be parametrized by its arc length to give correct results for train movement. Depending on the type of curve generally the parameter s might run from infinite negative to infinite positive value. A concrete curve has to get initialized by a create method and will not return usefull results until after calling the create method.
|
strong |
Curve type identification values.
| Enumerator | |
|---|---|
| Line | A straight line. |
| Arc | A circle circumferrence. |
| Helix | A helix curve. |
| LineP | A straight line with owned parameters. |
| ArcP | A circle circumferrence with owned parameters. |
| HelixP | A helix curve with owned parameters. |
| Clothoid | An Euler spiral. |
| Cubic | The solution for the curve given starting and ending points and tangent vectors. |
| Spline | A series of cubics, generated from control points and tangents, also called 'Cubic Hermite Spline'. |
| Rotator | A curve with linearly rotating tangent vector. |
| RotatorWithOffset | A Rotator curve that starts with certain offset angles. |
| RotatorChain | A series of connected Rotator curves. |
| PolygonalChain | An ordered list of vertices with tangents. |
| SampledCurve | An ordered list of F,k,t,s samples coming from a real curve that are used to numerically interpolate between them. |
| Parallel | A Curve that is parallel to a given track. |
| EEPCurve | The idiosyncratic curve type used by EEP. The parametrization of the curve is like in EEP, but in general it is not the arc length. (Produces the same wrong results as in EEP). |
| EEPResidual | Arc length parametrized EEP curve, but only for u != 0, l!= 0 and k²+w² != 0. |
| EEPAlternative | Alternative curve shape, but directly parametreized by arc length. Only for u != 0, l!= 0 and k²+w² != 0. For w == 0 this curves becomes identical to EEPResidual. |
|
pure virtual |
make an exact copy of this curve.
| std::bad_alloc | on memory exhaustion. |
|
pure virtual |
| s | Arc length parameter along the curve |
|
pure virtual |
Comparison.
Two curves of different types are considered not equal.
| toCurve | curve to compare with. |
| range | Parameter interval to compare at. |
| epsilon_length | maximum acceptable positional deviation. |
| epsilon_angle | maximum vector rotational deviation. |
|
pure virtual |
If there is a definition of a 'standard curve' of the given type, e.g. defined as starting (s==0) in the origin with a tangent parallel to Ex<One> and a normal pointing in Ey<One> direction, this function returns the transformation from that standard curve to the real values returned by this curve. GetCurveLocalTransformation().FromParent() transforms this curve to the standard curve. The above mentioned standard curve is just an example (Transion( 0_m) would deliver the frame), the actual standard curve might be defined deifferently, e.g. for a helix it is an angle 'slope' between Ex<One> and the tangent.
|
pure virtualnoexcept |
|
pure virtualnoexcept |
|
pure virtualnoexcept |
Tests wether the curve was properly created.
|
pure virtual |
Gives the Curve's idiosyncratic up direction. Some curves maintain some idea about where they have their upside, either because of their form (e.g Helix) or because it is extra defined (e.g. for Line). Some curves maintain no such notion (e.g. many Cubics).
| std::runtime_error | if the Curve has no notion of up. |
|
pure virtual |
Make a Curve with mirrored geometry (but of course one thet returns right handed frames).
|
pure virtual |
Some curves can only get evaluated at a certain parameter range. This is returned by the function, or {-infinite,infinite} if there is no intrinsic limit to the parameter value.
| std::runtime_error | if the curve was not created yet. |
|
pure virtual |
| s | Arc length parameter along the curve |
|
pure virtual |
Copies the 3D TBN-Frame at the specified location to frame.
| s | Arc length parameter along the curve |
| frame | TBN-Frame on curve at parameter s |
| std::out_of_range | if s is not in the valid range of the curve. |
|
pure virtual |
|
pure virtual |
Copies the 3D tangential vector at the specified location to tan.
| s | Arc length parameter along the curve |
| tan | Tangent on curve at parameter s |
| std::out_of_range | if s is not in the valid range of the curve. |
|
pure virtual |
Copies the 3D Position and tangential and normal vectors at the specified location to bundle.
| s | Arc length parameter along the curve |
| bundle | VectorBundle on curve at parameter s |
| std::out_of_range | if s is not in the valid range of the curve. |
|
pure virtual |
Copies the 3D Position and tangential vector at the specified location to bundle.
| s | Arc length parameter along the curve |
| bundle | VectorBundle on curve at parameter s |
| std::out_of_range | if s is not in the valid range of the curve. |
|
pure virtualnoexcept |
|
pure virtual |
Returns a list of parameters at which the normal vector flips from one side to the other.
In general for a curve the curvature might become zero. If this results in a rotation of the normal by pi, the parameter ist listed in the returned vector. No parameter is returned if the curvature gets zero without flipping the normal (e.g. for a straight line) The values are sorted by size.
| std::runtime_error | if the curve was not created yet. |