Model Railroad System
2.2.1
|
Track Graph class, which encapsulates the track graphs. More...
#include <TrackGraph.h>
Classes | |
struct | CompressedEdgeValues |
Compressed graph edge values. More... | |
struct | CompressedNodeValues |
Compressed graph node values. More... | |
struct | EdgeValues |
Uncompressed graph edge values. More... | |
struct | NodeValues |
Uncompressed graph node values. More... | |
struct | Point |
Position structure. More... | |
class | Transform2D |
Two dimensional transform class. More... | |
Public Types | |
enum | NodeType { Undefined = -1, Track = 0, Turnout, Turntable, Block, SwitchMotor, Signal, Sensor, Control } |
Node types. More... | |
typedef std::pair< int, int > | CompressedEdgePair |
typedef std::vector< CompressedEdgePair > | CompressedEdgePairVector |
Public Member Functions | |
TrackGraph () | |
Constructor. More... | |
~TrackGraph () | |
Destructor. More... | |
void | InsertCurveTrack (int number, TrackBody *tb, float orgX, float orgY, float radius) |
Insert a (circular) curved piece of track. More... | |
void | InsertBezierTrack (int number, BezierBody *trb, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4) |
Insert a bezier curved piece of track. More... | |
void | InsertCornuTrack (int number, CornuBody *trb, float pos1x, float pos1y, float angle1, float radius1, float center1x, float center1y, float pos2x, float pos2y, float angle2, float radius2, float center2x, float center2y) |
Insert a cornu curved piece of track. More... | |
void | InsertStraightTrack (int number, TrackBody *tb) |
Insert a straight piece of track. More... | |
void | InsertJointTrack (int number, TrackBody *tb, float l0, float l1, float angle, float R, float L) |
Insert a (spiral) curved piece of track. More... | |
void | InsertTurnOut (int number, float orgX, float orgY, float orient, const char *name, TurnoutBody *trb) |
Insert a turnout or crossing. More... | |
void | InsertTurnTable (int number, float orgX, float orgY, float radius, TrackBody *tb) |
Insert a turntable. More... | |
void | InsertBlock (int number, char *_name, char *_script, IntegerList *_tracklist) |
Insert a Block. More... | |
void | InsertSwitchMotor (int number, int turnout, char *_name, char *_normal, char *_reverse, char *_pointsense) |
Insert a switch motor. More... | |
void | InsertSignal (int number, char *_name, float _origx, float _origy, float _angle, int _numheads, StringPairList *_aspects) |
Insert a signal. More... | |
void | InsertSensor (int number, char *_name, float _origx, float _origy, char *_sensescript) |
Insert a sensor. More... | |
void | InsertControl (int number, char *_name, float _origx, float _origy, char *_onscript, char *_offscript) |
Insert a control. More... | |
bool | IsNodeP (int nid) const |
Tests if a node id exists in the graph. More... | |
int | NumEdges (int nid) const |
Returns the number of edges for the specificed node id. More... | |
int | EdgeIndex (int nid, int edgenum) const |
Returns the node id of the specificed edge of the node. More... | |
float | EdgeX (int nid, int edgenum) const |
Returns the $X$ coordinate of the specificed edge of the node. More... | |
float | EdgeY (int nid, int edgenum) const |
Returns the $Y$ coordinate of the specificed edge of the node. More... | |
float | EdgeA (int nid, int edgenum) const |
Returns the angle of the specificed edge of the node. More... | |
float | EdgeLength (int nid, int edgenum) const |
Returns the length of an edge. More... | |
NodeType | TypeOfNode (int nid) const |
Returns the type of the node. More... | |
const TurnoutGraphic * | NodeTurnoutGraphic (int nid) const |
Returns the TurnoutGraphic of the node. More... | |
const TurnoutRoutelist * | NodeTurnoutRoutelist (int nid) const |
Returns the TurnoutRoutelist of the node. More... | |
float | LengthOfNode (int nid) const |
Return the track length of a node. More... | |
const IntegerList * | TrackList (int nid) const |
Return a block's tracklist. More... | |
int | TurnoutNumber (int nid) const |
Return a switchmotor's turnout number. More... | |
const char * | NameOfNode (int nid) const |
Return a block's or switchmotor's name. More... | |
const char * | SenseScript (int nid) const |
Return a block's or switchmotor's sense script. More... | |
const char * | NormalActionScript (int nid) const |
Return a switchmotor's normal action script. More... | |
const char * | ReverseActionScript (int nid) const |
Return a block's or switchmotor's reverse action script. More... | |
int | NumberOfHeads (int nid) const |
Return a Signal's number of heads. More... | |
const StringPairList * | SignalAspects (int nid) const |
Return a Signal's aspect list. More... | |
float | OrigX (int nid) const |
Return the $x$ coordinate of the signal base. More... | |
float | OrigY (int nid) const |
Return the $y$ coordinate of the signal base. More... | |
float | Angle (int nid) const |
Return the angle of the signal. More... | |
const char * | OnScript (int nid) const |
Return the on action script. More... | |
const char * | OffScript (int nid) const |
Return the off action script. More... | |
int | LowestNode () const |
Returns the lowest numbered node id. More... | |
int | HighestNode () const |
Returns the highest numbered node id. More... | |
void | CompressGraph () |
Create a compressed graph. More... | |
bool | IsCompressedNode (int cnid) const |
Is cid a node in the compressed graph? More... | |
int | CompressedEdgeCount (int cnid) const |
Number of compressed graph edges for node cnid. More... | |
float | CompressedEdgeLength (int cnid, int edgenum) const |
Length of a compressed graph edge. More... | |
int | CompressedEdgeNode (int cnid, int edgenum) const |
Next Edge node. More... | |
IntegerList * | CompressedNodeSegments (int cnid) const |
Raw nodes in a compressed graph node. More... | |
double | CompressedNodePositionX (int cnid) const |
X Coordinate of a Compressed Node position. More... | |
double | CompressedNodePositionY (int cnid) const |
X Coordinate of a Compressed Node position. More... | |
bool | IsCompressed () const |
Is the graph compressed? More... | |
const IntegerList * | Heads () |
Uncompressed graph heads. More... | |
const IntegerList * | Roots () |
Compressed graph roots. More... | |
void | CompressedGraphCircleLayout (double radius) |
Run the BGL circle_graph_layout for a given radius. More... | |
bool | CompressedGraphKamadaKawaiSpring (double sidelength) |
Run the BGL kamada_kawai_spring_layout for a given side length. More... | |
CompressedEdgePairVector | CompressedGraphKruskalMinimumSpanningTree () |
Run the kruskal_minimum_spanning_tree algorithm and return a vector of edge pairs. More... | |
CompressedEdgePairVector | CompressedGraphPrimMinimumSpanningTree () |
Run the prim_minimum_spanning_tree algorithm and return a Parent Vector. More... | |
Static Public Member Functions | |
static float | LengthOfStraight (float x1, float y1, float x2, float y2) |
Compute the length of a piece of straight track. More... | |
static float | LengthOfCurve (float radius, float a1, float a2) |
Compute the length of a (circular) curved piece of track. More... | |
static float | LengthOfJoint (float l0, float l1, float angle, float R, float L) |
Compute the length of a (spiral) curved piece of track. More... | |
Private Types | |
enum | RotationUnit { Degrees, Radians } |
Rotational units. More... | |
typedef adjacency_list< vecS, vecS, directedS, NodeValues, EdgeValues > | Graph |
Boost Graph type (adjacency_list). More... | |
typedef graph_traits< Graph >::vertex_descriptor | Node |
Vertex type. More... | |
typedef std::map< int, Node > | IdNodeMap |
Type of Node Id map. More... | |
typedef adjacency_list< vecS, vecS, undirectedS, CompressedNodeValues, CompressedEdgeValues > | CompressedGraph |
Boost Compressed Graph type (adjacency_list). More... | |
typedef graph_traits< CompressedGraph >::vertex_descriptor | CompressedNode |
Compressed Graph Vertex type. More... | |
typedef std::map< int, CompressedNode > | CompressedIdNodeMap |
Type of Node Id map. More... | |
typedef std::vector< graph_traits< CompressedGraph >::vertex_descriptor > | CompressedNodeVector |
Private Member Functions | |
Node | AddNewNode (int id, NodeType _type=Undefined, TurnoutGraphic *_tgr=NULL, TurnoutRoutelist *_tpo=NULL, float _length=0.0) |
Helper function to create a new node. More... | |
void | computeHeads () |
Compute uncompressed graph heads (calls strong_components). More... | |
CompressedNode | insertCompressedNode (Node rawnode) |
Insert a compressed graph node. More... | |
bool | IsNone (Node node) |
Check if node is the none node;. More... | |
void | traversePrimMST (CompressedEdgePairVector &result, CompressedNodeVector &parents, CompressedNode r) const |
Traverse a PrimMST, starting at root r, inserting EdgePairs into result. More... | |
Node | FindNode (int index) const |
Find a node in the hash table. More... | |
TurnoutGraphic * | MakeTurnoutGraphic (float orgX, float orgY, float orient, TurnoutBody *trb) |
Generate a turnout node's graphic. More... | |
TurnoutRoutelist * | MakeTurnoutRouteList (TurnoutBody *trb, const TurnoutGraphic *tgr, float &length) |
Generate a turnout node's route list. More... | |
bool | compressed_edge_exists (CompressedNode cnode1, CompressedNode cnode2) const |
Test if an edge already exists. More... | |
Node | FindBlock (Node node) const |
Find the block this (raw) nodeid is in. More... | |
Transform2D * | tr_translate (float x, float y) |
Construct a translation transform. More... | |
Transform2D * | tr_scale (float mag_factor) |
Construct a uniform scale transform. More... | |
Transform2D * | tr_scale (float xscale, float yscale) |
Construct a non-uniform scale transform. More... | |
Transform2D * | tr_rotate (float amount, RotationUnit measure) |
Construct a rotational transform. More... | |
Static Private Member Functions | |
static void | DeleteTurnoutGraphic (TurnoutGraphic *tgr) |
Free up the memory used by a turnout node's graphic. More... | |
static void | DeleteTurnoutRouteList (TurnoutRoutelist *tpo) |
Free up the memory used by a turnout node's route list. More... | |
static float | ComputeRouteLength (const TurnoutGraphic *tgr, const IntegerList *il) |
Compute the length of a route. More... | |
Private Attributes | |
Graph | nodes |
Graph adjacency_list. More... | |
IdNodeMap | idMap |
Node Id map. More... | |
IntegerList * | heads |
Uncompressed graph heads (strong components). More... | |
bool | valid_heads |
Flag to indicate if heads is valid. More... | |
Node | none |
Special node that is nowhere (where all unconnected trackage goes). More... | |
CompressedGraph | c_nodes |
Compressed Graph adjacency_list. More... | |
CompressedIdNodeMap | c_idMap |
Node Id map. More... | |
IntegerList * | c_roots |
Compressed Graph Roots. More... | |
bool | compressedP |
Is graph compressed? More... | |
bool | circleLayoutP |
Has CompressedGraphCircleLayout been run? More... | |
bool | KamadaKawaiSpringLayoutP |
Has CompressedGraphKamadaKawaiSpring been run? More... | |
std::map< Node, CompressedNode > | backpointers |
Backpointer map. More... | |
Friends | |
std::ostream & | operator<< (ostream &stream, TrackGraph &graph) |
Output operator. More... | |
Track Graph class, which encapsulates the track graphs.
Holds the two track graphs, an uncompressed, directed graph built from the layout file and a compressed, undirected graph where successive segments of plain trackage are collasped into a single node. Both graphs use the Boost Graph Library adjacency_list template class as the basic graph implementation class. All nodes in both graphs have a unique node id, which is the XTrkCad layout object number.
Several of the Boost Graph Library graph algorithms are implemented, including circle_graph_layout(), kamada_kawai_spring_layout(), kruskal_minimum_spanning_tree() and prim_minimum_spanning_tree(). In addition, the strong_components() algorithm is used to gather nodes into one or more connected groups, since sometimes model train layouts have disjoint sections of track. An example would be a regular main line and an isolated mining or logging railroad. Another example would be a regular main line and one (or more) mass transit (eg trolley) line(s). The head nodes of the collected groups are accessed with the member function Heads(), which returns a list of nodes that are the heads of each of the connected groups. The CompressGraph() function will compress each connected group into a separately compressed graph, with its own root node. The root nodes of each of the compressed sub-graphs are returned with the Roots() member function.
The compuation of connected groups and graph compression are implemented using a lazy eval methodolgy. The connected group collection process is not run until the member function Heads() is called to actually access the list of group heads. And the graph compression is not called until the member function Roots() is called. Calling the CompressGraph() member function (or the Roots() member function), will also call the connected group collection process if it is needed.
To help discover possible mainlines, two minimum spanning tree (MST) algorithms are provided, Kruskal's and Prim's, via the member functions CompressedGraphKruskalMinimumSpanningTree() and CompressedGraphPrimMinimumSpanningTree(), respectively. Both of these function return a list of edge pairs: a STL vector of STL pairs of compressed nodes.
Two graphical layout algorithms are also provided, circle graph layout and kamada kawai spring layout, via the two member functions, CompressedGraphCircleLayout() and CompressedGraphKamadaKawaiSpring(), respectively. Both set or update a pair of double values $(x,y)$ associated with every compressed node and which are accessed with the CompressedNodePositionX() and CompressedNodePositionY() member functions. CompressedGraphCircleLayout() sets these files and CompressedGraphKamadaKawaiSpring() updates them. CompressedGraphCircleLayout() should be called before CompressedGraphKamadaKawaiSpring(). CompressedGraphKamadaKawaiSpring() returns a boolean flag indicating if it was able to create a layout. Returning a false value indicates that the graph was disjoint – CompressedGraphKamadaKawaiSpring() cannot be used with a disjoint graph.
typedef std::pair< int, int > Parsers::TrackGraph::CompressedEdgePair |
typedef std::vector< CompressedEdgePair > Parsers::TrackGraph::CompressedEdgePairVector |
|
private |
Boost Compressed Graph type (adjacency_list).
|
private |
Type of Node Id map.
|
private |
Compressed Graph Vertex type.
|
private |
|
private |
Boost Graph type (adjacency_list).
|
private |
Type of Node Id map.
|
private |
Vertex type.
|
private |
Parsers::TrackGraph::TrackGraph | ( | ) |
Constructor.
Parsers::TrackGraph::~TrackGraph | ( | ) |
Destructor.
|
private |
Helper function to create a new node.
float Parsers::TrackGraph::Angle | ( | int | nid | ) | const |
Return the angle of the signal.
nid | The node to look at. |
Referenced by Parsers::LayoutFile::Angle().
|
private |
Test if an edge already exists.
int Parsers::TrackGraph::CompressedEdgeCount | ( | int | cnid | ) | const |
Number of compressed graph edges for node cnid.
Referenced by Parsers::LayoutFile::CompressedEdgeCount().
float Parsers::TrackGraph::CompressedEdgeLength | ( | int | cnid, |
int | edgenum | ||
) | const |
Length of a compressed graph edge.
Referenced by Parsers::LayoutFile::CompressedEdgeLength().
int Parsers::TrackGraph::CompressedEdgeNode | ( | int | cnid, |
int | edgenum | ||
) | const |
Next Edge node.
Referenced by Parsers::LayoutFile::CompressedEdgeNode().
void Parsers::TrackGraph::CompressedGraphCircleLayout | ( | double | radius | ) |
Run the BGL circle_graph_layout for a given radius.
Referenced by Parsers::LayoutFile::CompressedGraphCircleLayout().
bool Parsers::TrackGraph::CompressedGraphKamadaKawaiSpring | ( | double | sidelength | ) |
Run the BGL kamada_kawai_spring_layout for a given side length.
Referenced by Parsers::LayoutFile::CompressedGraphKamadaKawaiSpring().
CompressedEdgePairVector Parsers::TrackGraph::CompressedGraphKruskalMinimumSpanningTree | ( | ) |
Run the kruskal_minimum_spanning_tree algorithm and return a vector of edge pairs.
Referenced by Parsers::LayoutFile::CompressedGraphKruskalMinimumSpanningTree().
CompressedEdgePairVector Parsers::TrackGraph::CompressedGraphPrimMinimumSpanningTree | ( | ) |
Run the prim_minimum_spanning_tree algorithm and return a Parent Vector.
Referenced by Parsers::LayoutFile::CompressedGraphPrimMinimumSpanningTree().
double Parsers::TrackGraph::CompressedNodePositionX | ( | int | cnid | ) | const |
X Coordinate of a Compressed Node position.
Referenced by Parsers::LayoutFile::CompressedNodePositionX().
double Parsers::TrackGraph::CompressedNodePositionY | ( | int | cnid | ) | const |
X Coordinate of a Compressed Node position.
Referenced by Parsers::LayoutFile::CompressedNodePositionY().
IntegerList* Parsers::TrackGraph::CompressedNodeSegments | ( | int | cnid | ) | const |
Raw nodes in a compressed graph node.
Referenced by Parsers::LayoutFile::CompressedNodeSegments().
void Parsers::TrackGraph::CompressGraph | ( | ) |
Create a compressed graph.
Referenced by Parsers::LayoutFile::CompressGraph().
|
private |
Compute uncompressed graph heads (calls strong_components).
|
staticprivate |
Compute the length of a route.
|
staticprivate |
Free up the memory used by a turnout node's graphic.
|
staticprivate |
Free up the memory used by a turnout node's route list.
float Parsers::TrackGraph::EdgeA | ( | int | nid, |
int | edgenum | ||
) | const |
Returns the angle of the specificed edge of the node.
Referenced by Parsers::LayoutFile::EdgeA().
int Parsers::TrackGraph::EdgeIndex | ( | int | nid, |
int | edgenum | ||
) | const |
Returns the node id of the specificed edge of the node.
Referenced by Parsers::LayoutFile::EdgeIndex().
float Parsers::TrackGraph::EdgeLength | ( | int | nid, |
int | edgenum | ||
) | const |
Returns the length of an edge.
Referenced by Parsers::LayoutFile::EdgeLength().
float Parsers::TrackGraph::EdgeX | ( | int | nid, |
int | edgenum | ||
) | const |
Returns the $X$ coordinate of the specificed edge of the node.
Referenced by Parsers::LayoutFile::EdgeX().
float Parsers::TrackGraph::EdgeY | ( | int | nid, |
int | edgenum | ||
) | const |
Returns the $Y$ coordinate of the specificed edge of the node.
Referenced by Parsers::LayoutFile::EdgeY().
Find the block this (raw) nodeid is in.
node | The (raw) Node. |
|
private |
Find a node in the hash table.
|
inline |
Uncompressed graph heads.
Referenced by Parsers::LayoutFile::Heads().
int Parsers::TrackGraph::HighestNode | ( | ) | const |
Returns the highest numbered node id.
Referenced by Parsers::LayoutFile::HighestNode().
void Parsers::TrackGraph::InsertBezierTrack | ( | int | number, |
BezierBody * | trb, | ||
float | x1, | ||
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3, | ||
float | x4, | ||
float | y4 | ||
) |
Insert a bezier curved piece of track.
void Parsers::TrackGraph::InsertBlock | ( | int | number, |
char * | _name, | ||
char * | _script, | ||
IntegerList * | _tracklist | ||
) |
Insert a Block.
|
private |
Insert a compressed graph node.
void Parsers::TrackGraph::InsertControl | ( | int | number, |
char * | _name, | ||
float | _origx, | ||
float | _origy, | ||
char * | _onscript, | ||
char * | _offscript | ||
) |
Insert a control.
void Parsers::TrackGraph::InsertCornuTrack | ( | int | number, |
CornuBody * | trb, | ||
float | pos1x, | ||
float | pos1y, | ||
float | angle1, | ||
float | radius1, | ||
float | center1x, | ||
float | center1y, | ||
float | pos2x, | ||
float | pos2y, | ||
float | angle2, | ||
float | radius2, | ||
float | center2x, | ||
float | center2y | ||
) |
Insert a cornu curved piece of track.
void Parsers::TrackGraph::InsertCurveTrack | ( | int | number, |
TrackBody * | tb, | ||
float | orgX, | ||
float | orgY, | ||
float | radius | ||
) |
Insert a (circular) curved piece of track.
void Parsers::TrackGraph::InsertJointTrack | ( | int | number, |
TrackBody * | tb, | ||
float | l0, | ||
float | l1, | ||
float | angle, | ||
float | R, | ||
float | L | ||
) |
Insert a (spiral) curved piece of track.
void Parsers::TrackGraph::InsertSensor | ( | int | number, |
char * | _name, | ||
float | _origx, | ||
float | _origy, | ||
char * | _sensescript | ||
) |
Insert a sensor.
void Parsers::TrackGraph::InsertSignal | ( | int | number, |
char * | _name, | ||
float | _origx, | ||
float | _origy, | ||
float | _angle, | ||
int | _numheads, | ||
StringPairList * | _aspects | ||
) |
Insert a signal.
void Parsers::TrackGraph::InsertStraightTrack | ( | int | number, |
TrackBody * | tb | ||
) |
Insert a straight piece of track.
void Parsers::TrackGraph::InsertSwitchMotor | ( | int | number, |
int | turnout, | ||
char * | _name, | ||
char * | _normal, | ||
char * | _reverse, | ||
char * | _pointsense | ||
) |
Insert a switch motor.
void Parsers::TrackGraph::InsertTurnOut | ( | int | number, |
float | orgX, | ||
float | orgY, | ||
float | orient, | ||
const char * | name, | ||
TurnoutBody * | trb | ||
) |
Insert a turnout or crossing.
void Parsers::TrackGraph::InsertTurnTable | ( | int | number, |
float | orgX, | ||
float | orgY, | ||
float | radius, | ||
TrackBody * | tb | ||
) |
Insert a turntable.
|
inline |
Is the graph compressed?
Referenced by Parsers::LayoutFile::IsCompressed().
bool Parsers::TrackGraph::IsCompressedNode | ( | int | cnid | ) | const |
Is cid a node in the compressed graph?
Referenced by Parsers::LayoutFile::IsCompressedNode().
bool Parsers::TrackGraph::IsNodeP | ( | int | nid | ) | const |
Tests if a node id exists in the graph.
Referenced by Parsers::LayoutFile::IsNodeP().
|
inlineprivate |
Check if node is the none node;.
|
static |
Compute the length of a (circular) curved piece of track.
|
static |
Compute the length of a (spiral) curved piece of track.
float Parsers::TrackGraph::LengthOfNode | ( | int | nid | ) | const |
Return the track length of a node.
Referenced by Parsers::LayoutFile::LengthOfNode().
|
static |
Compute the length of a piece of straight track.
int Parsers::TrackGraph::LowestNode | ( | ) | const |
Returns the lowest numbered node id.
Referenced by Parsers::LayoutFile::LowestNode().
|
private |
Generate a turnout node's graphic.
|
private |
Generate a turnout node's route list.
const char* Parsers::TrackGraph::NameOfNode | ( | int | nid | ) | const |
Return a block's or switchmotor's name.
Referenced by Parsers::LayoutFile::NameOfNode().
const TurnoutGraphic* Parsers::TrackGraph::NodeTurnoutGraphic | ( | int | nid | ) | const |
Returns the TurnoutGraphic of the node.
Referenced by Parsers::LayoutFile::NodeTurnoutGraphic().
const TurnoutRoutelist* Parsers::TrackGraph::NodeTurnoutRoutelist | ( | int | nid | ) | const |
Returns the TurnoutRoutelist of the node.
Referenced by Parsers::LayoutFile::NodeTurnoutRoutelist().
const char* Parsers::TrackGraph::NormalActionScript | ( | int | nid | ) | const |
Return a switchmotor's normal action script.
Referenced by Parsers::LayoutFile::NormalActionScript().
int Parsers::TrackGraph::NumberOfHeads | ( | int | nid | ) | const |
Return a Signal's number of heads.
Referenced by Parsers::LayoutFile::NumberOfHeads().
int Parsers::TrackGraph::NumEdges | ( | int | nid | ) | const |
Returns the number of edges for the specificed node id.
Referenced by Parsers::LayoutFile::NumEdges().
const char* Parsers::TrackGraph::OffScript | ( | int | nid | ) | const |
Return the off action script.
nid | The node to look at. |
Referenced by Parsers::LayoutFile::OffScript().
const char* Parsers::TrackGraph::OnScript | ( | int | nid | ) | const |
Return the on action script.
nid | The node to look at. |
Referenced by Parsers::LayoutFile::OnScript().
float Parsers::TrackGraph::OrigX | ( | int | nid | ) | const |
Return the $x$ coordinate of the signal base.
nid | The node to look at. |
Referenced by Parsers::LayoutFile::OrigX().
float Parsers::TrackGraph::OrigY | ( | int | nid | ) | const |
Return the $y$ coordinate of the signal base.
nid | The node to look at. |
Referenced by Parsers::LayoutFile::OrigY().
const char* Parsers::TrackGraph::ReverseActionScript | ( | int | nid | ) | const |
Return a block's or switchmotor's reverse action script.
Referenced by Parsers::LayoutFile::ReverseActionScript().
|
inline |
Compressed graph roots.
Referenced by Parsers::LayoutFile::Roots().
const char* Parsers::TrackGraph::SenseScript | ( | int | nid | ) | const |
Return a block's or switchmotor's sense script.
Referenced by Parsers::LayoutFile::SenseScript().
const StringPairList* Parsers::TrackGraph::SignalAspects | ( | int | nid | ) | const |
Return a Signal's aspect list.
Referenced by Parsers::LayoutFile::SignalAspects().
|
private |
Construct a rotational transform.
|
private |
Construct a uniform scale transform.
|
private |
Construct a non-uniform scale transform.
|
private |
Construct a translation transform.
const IntegerList* Parsers::TrackGraph::TrackList | ( | int | nid | ) | const |
Return a block's tracklist.
Referenced by Parsers::LayoutFile::TrackList().
|
private |
Traverse a PrimMST, starting at root r, inserting EdgePairs into result.
int Parsers::TrackGraph::TurnoutNumber | ( | int | nid | ) | const |
Return a switchmotor's turnout number.
Referenced by Parsers::LayoutFile::TurnoutNumber().
NodeType Parsers::TrackGraph::TypeOfNode | ( | int | nid | ) | const |
Returns the type of the node.
Referenced by Parsers::LayoutFile::TypeOfNode().
|
friend |
Output operator.
|
private |
Backpointer map.
|
private |
Node Id map.
|
private |
Compressed Graph adjacency_list.
|
private |
Compressed Graph Roots.
|
private |
Has CompressedGraphCircleLayout been run?
|
private |
Is graph compressed?
|
private |
Uncompressed graph heads (strong components).
|
private |
Node Id map.
|
private |
Has CompressedGraphKamadaKawaiSpring been run?
|
private |
Graph adjacency_list.
|
private |
Special node that is nowhere (where all unconnected trackage goes).
|
private |
Flag to indicate if heads is valid.