29#include "Configuration.h"
32#include "common/Interval.h"
34#include "spat/Position2D.h"
35#include "spat/Vector2D.h"
48 virtual std::string
TypeName() const noexcept = 0;
90 SectionPoint() noexcept
96 SectionPoint(
const spat::Position2D<Length>& pt ) noexcept
102 SectionPoint(
const spat::Position2D<Length>& pt,
const spat::Vector2D<One>& d,
One tex ) noexcept
116 return Scale( scale, scale );
173 virtual
void Set(
int id, const
SectionPoint& pt,
bool bGaugeLeft = false,
bool bGaugeRight = false ) = 0;
187 virtual ~Section() = default;
188 Section( const Section& ) = delete;
189 Section( Section&& ) = delete;
190 Section& operator=( const Section& ) = delete;
191 Section& operator=( Section&& ) = delete;
Value< Dimension< 0, 0, 0 > > One
Dimensionless value.
Definition DimensionedValues.h:319
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
The namespace provides classes and methods for spatial computations.
Definition Box.h:32
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
An interval describes the area between two numbers. It is understood to contain the near one and exlu...
Definition Interval.h:42
Implements a 2D - position in cartesian coordinates.
Definition Position2D.h:45
Valtype x
cartesian x coordinate
Definition Position2D.h:48
Valtype y
cartesian y coordinate
Definition Position2D.h:49
Axis aligned rectangle.
Definition Rect.h:41
Implements a 2D - vector in cartesian coordinates.
Definition Vector2D.h:46
auto Normalize() noexcept -> decltype(Valtype{}/Valtype{})
Definition Vector2D.h:292
Valtype dy
cartesian y component.
Definition Vector2D.h:50
Valtype dx
cartesian x component.
Definition Vector2D.h:49
Point structure used to describe a section.
Definition Section.h:82
One t
Texture length along the profile. Used for texture coordinates.
Definition Section.h:85
spat::Position2D< Length > p
Position of profile point.
Definition Section.h:83
spat::Vector2D< One > n
Normal of profile point.
Definition Section.h:84
virtual Length Gauge() const noexcept=0
virtual void Set(int id, const SectionPoint &pt, bool bGaugeLeft=false, bool bGaugeRight=false)=0
Sets the section point with index id.
virtual Length PolygonChainLength() const noexcept=0
SpecialSections
Predefined cross sections.
Definition Section.h:52
@ eep_rack_railway
simple track with cogs in the center
Definition Section.h:61
@ square
four points profile
Definition Section.h:70
@ eep_simple3
very simple epp track. high embankment.
Definition Section.h:68
@ eep_simple2
very simple epp track. high embankment.
Definition Section.h:67
@ eepv7_grooved_convextread
section with grooved rods and convex shaped top
Definition Section.h:58
@ eepv7_track1000
high embankment narrow track narrow rod plus convex shaped top
Definition Section.h:66
@ eep_concrete_roadway
rods fixed in concrete
Definition Section.h:60
@ eep_simple
very simple epp track
Definition Section.h:63
@ eep_grooved_convextread
section with grooved rods and convex shaped top
Definition Section.h:64
@ eep_flatballast_rods
flat ballast with rods
Definition Section.h:69
@ custom
section with no name but generated by custom code
Definition Section.h:55
@ eep_embankment_simple
very simple track and high embankment
Definition Section.h:59
@ eep7_track1435
high embankment narrow rod plus convex shaped top
Definition Section.h:62
@ pipeline
round profile.
Definition Section.h:72
@ vignol_UIC60
vignol UIC60
Definition Section.h:57
@ empty
section with no points in it.
Definition Section.h:54
@ standard
simple section
Definition Section.h:56
@ eep_flatballast
flat ballast without rods
Definition Section.h:65
@ hexagon
six points profile
Definition Section.h:71
virtual std::string TypeName() const noexcept=0
Name for the object type that implements this interface.
virtual void CalculateTextureCoordinates()=0
Calculates the texture coordinate t from positions of the points automatically.
virtual void SetCntPoints(int cnt)=0
Sets the total number of profile points.
virtual common::Interval< One > TextureExtent() const =0
Gives the maximum difference between the t values of any two SectionPoints.
virtual void Create(SpecialSections specialSection)=0
Creates a special section, creates the section points if applicable.
virtual void Scale(One x_scale, One y_scale)=0
Scales all the points and normals by factors.
virtual const SectionPoint & Get(int id) const =0
virtual int CountPoints() const =0
virtual void CalculateNormals() noexcept=0
Calculates the normals from positions of the points automatically.
virtual spat::Rect< Length > Clearance() const noexcept=0
static dclspc std::unique_ptr< Section > Make(SpecialSections special=SpecialSections::empty) noexcept
Makes a Section object.