Model Railroad System 2.2.2
|
Turnout body elements: T, E, P, S, C, and J lines are collected. More...
#include <TurnoutBody.h>
Classes | |
struct | Pos |
Position structure. More... | |
Public Types | |
enum | TurnoutBodyEltType { None , TurnoutEnd , TurnoutRoute , TurnoutStraightSegment , TurnoutCurveSegment , TurnoutJointSegment } |
Element types. More... | |
Public Member Functions | |
TurnoutBodyElt () | |
Constructor. More... | |
~TurnoutBodyElt () | |
Destructor. More... | |
TurnoutBodyEltType | TheType () const |
Type accessor. More... | |
void | GetTurnoutRoute (char *&pName, IntegerList *&cList) const |
Fetch turnout route data. More... | |
int | GetTurnoutStraightSegment (float &x1, float &y1, float &x2, float &y2) const |
Fetch turnout straight segment data. More... | |
int | GetTurnoutCurveSegment (float &r, float &x, float &y, float &a0, float &a1) const |
Fetch turnout curve segment data. More... | |
int | GetTurnoutJointSegment (float &x, float &y, float &a, float &l0, float &l1, float &r, float &l) const |
Fetch turnout joint segment data. More... | |
Static Public Member Functions | |
static void | InitTSegId () |
Segment count initializer. More... | |
static TurnoutBodyElt * | MakeTurnoutEnd (TrackBodyElt *tbe) |
Create an endpoint (T or E lines). More... | |
static TurnoutBodyElt * | MakeTurnoutRoute (char *pName, IntegerList *cList) |
Create a turnout route (P lines). More... | |
static TurnoutBodyElt * | MakeTurnoutStraightSegment (float x1, float y1, float x2, float y2) |
Create a turnout straight segment (S lines). More... | |
static TurnoutBodyElt * | MakeTurnoutCurveSegment (float r, float x, float y, float a0, float a1) |
Create a turnout curve segment (C lines). More... | |
static TurnoutBodyElt * | MakeTurnoutJointSegment (float x, float y, float a, float l0, float l1, float r, float l) |
Create a turnout joint segment (J lines). More... | |
Private Attributes | |
TurnoutBodyEltType | theType |
Element type. More... | |
TrackBodyElt * | theEnd |
Pointer to T or E line data. More... | |
char * | RouteName |
Route name (P lines). More... | |
IntegerList * | routeList |
Segment list (P Lines). More... | |
int | segmentId |
Segment index (S, C, or J 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... | |
float | R |
$R$ value (for J lines). More... | |
float | L |
$L$ value (for J lines). More... | |
Static Private Attributes | |
static int | segCount |
Counter for S, C, and J segments. More... | |
Friends | |
class | TrackGraph |
class | TurnoutBody |
Turnout body elements: T, E, P, S, C, and J lines are collected.
others are discarded.
|
inline |
Constructor.
References None, routeList, RouteName, theEnd, and theType.
Referenced by MakeTurnoutCurveSegment(), MakeTurnoutEnd(), MakeTurnoutJointSegment(), MakeTurnoutRoute(), and MakeTurnoutStraightSegment().
|
inline |
Destructor.
|
inline |
Fetch turnout curve segment data.
References ang0, ang1, pos1, radius, segmentId, Parsers::TurnoutBodyElt::Pos::x, and Parsers::TurnoutBodyElt::Pos::y.
|
inline |
Fetch turnout joint segment data.
References angle, L, len0, len1, pos1, R, segmentId, Parsers::TurnoutBodyElt::Pos::x, and Parsers::TurnoutBodyElt::Pos::y.
|
inline |
|
inline |
Fetch turnout straight segment data.
References pos1, pos2, segmentId, Parsers::TurnoutBodyElt::Pos::x, and Parsers::TurnoutBodyElt::Pos::y.
|
inlinestatic |
Segment count initializer.
References segCount.
|
inlinestatic |
Create a turnout curve segment (C lines).
References ang0, ang1, pos1, radius, segCount, segmentId, theType, TurnoutBodyElt(), TurnoutCurveSegment, Parsers::TurnoutBodyElt::Pos::x, and Parsers::TurnoutBodyElt::Pos::y.
|
inlinestatic |
Create an endpoint (T or E lines).
References theEnd, theType, TurnoutBodyElt(), and TurnoutEnd.
|
inlinestatic |
Create a turnout joint segment (J lines).
References L, pos1, R, segCount, segmentId, theType, TurnoutBodyElt(), TurnoutJointSegment, Parsers::TurnoutBodyElt::Pos::x, and Parsers::TurnoutBodyElt::Pos::y.
|
inlinestatic |
Create a turnout route (P lines).
References routeList, RouteName, theType, TurnoutBodyElt(), and TurnoutRoute.
|
inlinestatic |
Create a turnout straight segment (S lines).
References pos1, pos2, segCount, segmentId, theType, TurnoutBodyElt(), TurnoutStraightSegment, Parsers::TurnoutBodyElt::Pos::x, and Parsers::TurnoutBodyElt::Pos::y.
|
inline |
Type accessor.
References theType.
|
friend |
|
friend |
|
private |
An angle value.
Referenced by GetTurnoutCurveSegment(), and MakeTurnoutCurveSegment().
|
private |
Another angle value.
Referenced by GetTurnoutCurveSegment(), and MakeTurnoutCurveSegment().
|
private |
$L$ value (for J lines).
Referenced by GetTurnoutJointSegment(), and MakeTurnoutJointSegment().
|
private |
First position.
Referenced by GetTurnoutCurveSegment(), GetTurnoutJointSegment(), GetTurnoutStraightSegment(), MakeTurnoutCurveSegment(), MakeTurnoutJointSegment(), and MakeTurnoutStraightSegment().
|
private |
Second position.
Referenced by GetTurnoutStraightSegment(), and MakeTurnoutStraightSegment().
|
private |
$R$ value (for J lines).
Referenced by GetTurnoutJointSegment(), and MakeTurnoutJointSegment().
|
private |
A radius value.
Referenced by GetTurnoutCurveSegment(), and MakeTurnoutCurveSegment().
|
private |
Segment list (P Lines).
Referenced by GetTurnoutRoute(), MakeTurnoutRoute(), and TurnoutBodyElt().
|
private |
Route name (P lines).
Referenced by GetTurnoutRoute(), MakeTurnoutRoute(), and TurnoutBodyElt().
|
staticprivate |
Counter for S, C, and J segments.
Referenced by InitTSegId(), MakeTurnoutCurveSegment(), MakeTurnoutJointSegment(), and MakeTurnoutStraightSegment().
|
private |
Segment index (S, C, or J lines).
Referenced by GetTurnoutCurveSegment(), GetTurnoutJointSegment(), GetTurnoutStraightSegment(), MakeTurnoutCurveSegment(), MakeTurnoutJointSegment(), and MakeTurnoutStraightSegment().
|
private |
Pointer to T or E line data.
Referenced by Parsers::TurnoutBody::CleanUpElement(), MakeTurnoutEnd(), TurnoutBodyElt(), and Parsers::TurnoutBody::TurnoutEnds().
|
private |
Element type.
Referenced by Parsers::TurnoutBody::CleanUpElement(), MakeTurnoutCurveSegment(), MakeTurnoutEnd(), MakeTurnoutJointSegment(), MakeTurnoutRoute(), MakeTurnoutStraightSegment(), TheType(), TurnoutBodyElt(), Parsers::TurnoutBody::TurnoutEnds(), Parsers::TurnoutBody::TurnoutRouteCount(), and Parsers::TurnoutBody::TurnoutSegmentCount().