Model Railroad System  2.2.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Parsers::BezierBodyElt Class Reference

Bezier Body elements: T, E, S, and C lines are collected. More...

#include <BezierBody.h>

Classes

struct  Pos
 Position structure. More...
 

Public Types

enum  BezierBodyEltType { None, BezierEnd, BezierStraightSegment, BezierCurvedSegment }
 Element types. More...
 

Public Member Functions

 BezierBodyElt ()
 Constructor. More...
 
 ~BezierBodyElt ()
 Destructor. More...
 
BezierBodyEltType TheType () const
 Type accessor. More...
 
int GetStraightSegment (float &x1, float &y1, float &x2, float &y2) const
 Fetch straight segment data. More...
 
int GetCurveSegment (float &r, float &x, float &y, float &a0, float &a1) const
 Fetch curve segment data. More...
 

Static Public Member Functions

static void InitTSegId ()
 Segment count initializer. More...
 
static BezierBodyEltMakeTrackEnd (TrackBodyElt *tbe)
 Create an endpoint (T or E lines). More...
 
static BezierBodyEltMakeStraightSegment (float x1, float y1, float x2, float y2)
 Create a straight segment (S lines). More...
 
static BezierBodyEltMakeCurveSegment (float r, float x, float y, float a0, float a1)
 Create a curve segment (C lines). More...
 

Private Attributes

BezierBodyEltType theType
 Element type. More...
 
TrackBodyElttheEnd
 Pointer to T or E line data. More...
 
int segmentId
 Segment index (S or C lines). More...
 
Pos pos1
 First position. More...
 
Pos pos2
 Second position. More...
 
float radius
 A radius value. More...
 
float ang0
 An angle value. More...
 
float ang1
 Another angle value. More...
 

Static Private Attributes

static int segCount
 Counter for S and C segments. More...
 

Friends

class TrackGraph
 
class BezierBody
 

Detailed Description

Bezier Body elements: T, E, S, and C lines are collected.

others are discarded.

Author
Robert Heller <heller@deepsoft.com>

Member Enumeration Documentation

◆ BezierBodyEltType

Element types.

Enumerator
None 

Placeholder.

BezierEnd 

T or E line.

BezierStraightSegment 

S line.

BezierCurvedSegment 

C line.

Constructor & Destructor Documentation

◆ BezierBodyElt()

Parsers::BezierBodyElt::BezierBodyElt ( )
inline

Constructor.

◆ ~BezierBodyElt()

Parsers::BezierBodyElt::~BezierBodyElt ( )
inline

Destructor.

Member Function Documentation

◆ GetCurveSegment()

int Parsers::BezierBodyElt::GetCurveSegment ( float &  r,
float &  x,
float &  y,
float &  a0,
float &  a1 
) const
inline

Fetch curve segment data.

References Parsers::BezierBodyElt::Pos::x, and Parsers::BezierBodyElt::Pos::y.

◆ GetStraightSegment()

int Parsers::BezierBodyElt::GetStraightSegment ( float &  x1,
float &  y1,
float &  x2,
float &  y2 
) const
inline

Fetch straight segment data.

References Parsers::BezierBodyElt::Pos::x, and Parsers::BezierBodyElt::Pos::y.

◆ InitTSegId()

static void Parsers::BezierBodyElt::InitTSegId ( )
inlinestatic

Segment count initializer.

◆ MakeCurveSegment()

static BezierBodyElt* Parsers::BezierBodyElt::MakeCurveSegment ( float  r,
float  x,
float  y,
float  a0,
float  a1 
)
inlinestatic

Create a curve segment (C lines).

References ang0, ang1, pos1, radius, segmentId, theType, Parsers::BezierBodyElt::Pos::x, and Parsers::BezierBodyElt::Pos::y.

◆ MakeStraightSegment()

static BezierBodyElt* Parsers::BezierBodyElt::MakeStraightSegment ( float  x1,
float  y1,
float  x2,
float  y2 
)
inlinestatic

Create a straight segment (S lines).

References pos1, pos2, segmentId, theType, Parsers::BezierBodyElt::Pos::x, and Parsers::BezierBodyElt::Pos::y.

◆ MakeTrackEnd()

static BezierBodyElt* Parsers::BezierBodyElt::MakeTrackEnd ( TrackBodyElt tbe)
inlinestatic

Create an endpoint (T or E lines).

References theEnd, and theType.

◆ TheType()

BezierBodyEltType Parsers::BezierBodyElt::TheType ( ) const
inline

Type accessor.

Friends And Related Function Documentation

◆ BezierBody

friend class BezierBody
friend

◆ TrackGraph

friend class TrackGraph
friend

Member Data Documentation

◆ ang0

float Parsers::BezierBodyElt::ang0
private

An angle value.

Referenced by MakeCurveSegment().

◆ ang1

float Parsers::BezierBodyElt::ang1
private

Another angle value.

Referenced by MakeCurveSegment().

◆ pos1

Pos Parsers::BezierBodyElt::pos1
private

First position.

Referenced by MakeCurveSegment(), and MakeStraightSegment().

◆ pos2

Pos Parsers::BezierBodyElt::pos2
private

Second position.

Referenced by MakeStraightSegment().

◆ radius

float Parsers::BezierBodyElt::radius
private

A radius value.

Referenced by MakeCurveSegment().

◆ segCount

int Parsers::BezierBodyElt::segCount
staticprivate

Counter for S and C segments.

◆ segmentId

int Parsers::BezierBodyElt::segmentId
private

Segment index (S or C lines).

Referenced by MakeCurveSegment(), and MakeStraightSegment().

◆ theEnd

TrackBodyElt* Parsers::BezierBodyElt::theEnd
private

◆ theType

BezierBodyEltType Parsers::BezierBodyElt::theType
private