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

A profile of a track. More...

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

Classes

struct  SectionPoint
 Point structure used to describe a section. More...

Public Types

enum class  SpecialSections {
  unknown = -1 , empty = 0 , custom , standard ,
  vignol_UIC60 , eepv7_grooved_convextread , eep_embankment_simple , eep_concrete_roadway ,
  eep_rack_railway , eep7_track1435 , eep_simple , eep_grooved_convextread ,
  eep_flatballast , eepv7_track1000 , eep_simple2 , eep_simple3 ,
  eep_flatballast_rods , square , hexagon , pipeline
}
 Predefined cross sections. More...

Public Member Functions

virtual std::string TypeName () const noexcept=0
 Name for the object type that implements this interface.
virtual SpecialSections GetSectionType () const noexcept=0
virtual void Create (SpecialSections specialSection)=0
 Creates a special section, creates the section points if applicable.
virtual int CountPoints () const =0
virtual void SetCntPoints (int cnt)=0
 Sets the total number of profile points.
virtual const SectionPointGet (int id) const =0
virtual common::Interval< OneTextureExtent () const =0
 Gives the maximum difference between the t values of any two SectionPoints.
virtual Length PolygonChainLength () const noexcept=0
virtual Length Gauge () const noexcept=0
virtual spat::Rect< LengthClearance () 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 void Scale (One x_scale, One y_scale)=0
 Scales all the points and normals by factors.
virtual void CalculateNormals () noexcept=0
 Calculates the normals from positions of the points automatically.
virtual void CalculateTextureCoordinates ()=0
 Calculates the texture coordinate t from positions of the points automatically.
 Section (const Section &)=delete
 Section (Section &&)=delete
Section & operator= (const Section &)=delete
Section & operator= (Section &&)=delete

Static Public Member Functions

static dclspc std::unique_ptr< Section > Make (SpecialSections special=SpecialSections::empty) noexcept
 Makes a Section object.

Detailed Description

A profile of a track.

Section specifies a vertical section through a track to define its profile. Special sections are available for commonly used track profiles.

Member Enumeration Documentation

◆ SpecialSections

enum class trax::Section::SpecialSections
strong

Predefined cross sections.

Enumerator
empty 

section with no points in it.

custom 

section with no name but generated by custom code

standard 

simple section

vignol_UIC60 

vignol UIC60

eepv7_grooved_convextread 

section with grooved rods and convex shaped top

eep_embankment_simple 

very simple track and high embankment

eep_concrete_roadway 

rods fixed in concrete

eep_rack_railway 

simple track with cogs in the center

eep7_track1435 

high embankment narrow rod plus convex shaped top

eep_simple 

very simple epp track

eep_grooved_convextread 

section with grooved rods and convex shaped top

eep_flatballast 

flat ballast without rods

eepv7_track1000 

high embankment narrow track narrow rod plus convex shaped top

eep_simple2 

very simple epp track. high embankment.

eep_simple3 

very simple epp track. high embankment.

eep_flatballast_rods 

flat ballast with rods

square 

four points profile

hexagon 

six points profile

pipeline 

round profile.

Member Function Documentation

◆ Clearance()

virtual spat::Rect< Length > trax::Section::Clearance ( ) const
pure virtualnoexcept
Returns
A axis aligned rect that contains all the points of the section.

◆ CountPoints()

virtual int trax::Section::CountPoints ( ) const
pure virtual
Returns
Total number of profile points.

◆ Gauge()

virtual Length trax::Section::Gauge ( ) const
pure virtualnoexcept
Returns
The gauge the segment represents.

◆ Get()

virtual const SectionPoint & trax::Section::Get ( int id) const
pure virtual
Parameters
idzero based index of SectionPoint.
Returns
the section point with index id.

◆ PolygonChainLength()

virtual Length trax::Section::PolygonChainLength ( ) const
pure virtualnoexcept
Returns
The total length of the profile along the segment points.

◆ Set()

virtual void trax::Section::Set ( int id,
const SectionPoint & pt,
bool bGaugeLeft = false,
bool bGaugeRight = false )
pure virtual

Sets the section point with index id.

Parameters
idzero based index of SectionPoint.
ptValue to set the point to.
bGaugeLeftThis point represents the inner face of the load-bairing rail on the left.
bGaugeRightThis point represents the inner face of the load-bairing rail on the right.

◆ TextureExtent()

virtual common::Interval< One > trax::Section::TextureExtent ( ) const
pure virtual

Gives the maximum difference between the t values of any two SectionPoints.

Returns
the width of the texture value along the segment.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/Section.h