VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
DtRailSegment Class Reference

DtRailSegment are segments entities can follow when using the rail movement system. More...

Inheritance diagram for DtRailSegment:
Inheritance graph
[legend]

Public Member Functions

 DtRailSegment ()
 DtRailSegment (const DtVector &start, const DtVector &end)
virtual ~DtRailSegment ()
 DtRailSegment (const DtRailSegment &orig)
DtRailSegmentoperator= (const DtRailSegment &orig)
virtual DtRailSegmentclone ()
virtual double laneCenterOffset (int lane) const
virtual std::list< int > availableLanes () const
virtual double length () const
 When length is called it will recompute and cache the new length if the endpoints have changed.
virtual void setStartPoint (const DtVector &start)
 The first point of the segment.
virtual const DtVectorstartPoint () const
 The first point of the segment.
virtual void setEndPoint (const DtVector &end)
 The last point of the segment.
virtual const DtVectorendPoint () const
 The last point of the segment.
virtual void setSegmentSpeed (double speed)
 The speed that is recommend along this segment.
virtual double segmentSpeed () const
 The speed that is recommend along this segment.
virtual void setLaneWidth (double width)
 The lane width of the segment lanes.
virtual double laneWidth () const
 The lane width of the segment lanes.
virtual void setNumberOfLanes (unsigned int lanes)
 How many lanes are contained in the segment.
virtual unsigned int numberOfLanes () const
 How many lanes are contained in the segment.
virtual int leftLaneOfLane (unsigned lane) const
 Gets the lane to the left of the lane specified.
virtual int rightLaneOfLane (unsigned lane) const
 Gets the lane to the left of the lane specified.
virtual double findLaneShift (const int fromLane, const int toLane) const
 This finds the distance between the 2 lanes.
virtual double laneOffset (int lanePos) const
 lane offset is the width of all the lanes between the lanePos and the center line Lanes are designated from (number of lanes)/2 -(number of lanes)/2 from the centerline oriented from the segment's start to end point.
virtual void setIsOneWay (bool way)
 Directionality of the segment, whether it is one way or not.
virtual bool isOneWay () const
 Directionality of the segment, whether it is one way or not.
virtual void setSpecificationID (const DtSpecificationID id)
 The specification id of the feature data or route this segment is based from.
virtual const DtSpecificationID specificationID () const
 The specification id of the feature data or route this segment is based from.
virtual void setPathId (const unsigned int id)
 The path id is a simple way of keeping track of when we turn if we are just at a curve in the path in which case the two connecting segments will have the same id or if an intersection has been reached and the connecting segments will have different path ids.
virtual const unsigned int pathId () const
 The path id is a simple way of keeping track of when we turn if we are just at a curve in the path in which case the two connecting segments will have the same id or if an intersection has been reached and the connecting segments will have different path ids.
virtual void setSegmentSurfaceConditions (DtVrfWeatherPrecipitationType condition)
 Enviromental Condition of segment.
virtual
DtVrfWeatherPrecipitationType 
segmentSurfaceConditions () const
 Enviromental Condition of segment.

Static Public Member Functions

static unsigned int nextPathId ()

Protected Attributes

DtVector myStartPoint
DtVector myEndPoint
double mySpeed
 Default is 50 m/s.
double myLaneWidth
 Default is 3.66m. This is U.S. Highway standard.
unsigned int myNumberOfLanes
 Default is 2 allowing a lane for each direction of traffic.
bool myIsOneWay
 Default is false. Allowing traffic in each direction.
unsigned int myPathId
 Keep track of if this segment is just a continuation of the current road.
DtSpecificationID mySpecId
 Default is 0. It will be set based on whatever feature it was created from.
DtVrfWeatherPrecipitationType mySurfaceCondition
 Default is 0–No percipitation.
double myLength
 These values are calculated when needed and cached.
bool myRecomputeLength

Static Protected Attributes

static unsigned int theNextPathId

Detailed Description

DtRailSegment are segments entities can follow when using the rail movement system.

End User Description: DtRailSegments are segments with attributes that entities follow. Currently these are only generated by the DtRailPathPlanner however future components can generate them if they desire an entity to follow along a collections of segments with defined speeds and heading. Other attributes can be added that can affect how an entity moves along it. These are not tied to ground entities. One can make rail segments that represent merchant marine lanes in the sea.

Constructor & Destructor Documentation

DtRailSegment::DtRailSegment ( )
DtRailSegment::DtRailSegment ( const DtVector start,
const DtVector end 
)
virtual DtRailSegment::~DtRailSegment ( )
virtual
DtRailSegment::DtRailSegment ( const DtRailSegment orig)

Member Function Documentation

DtRailSegment& DtRailSegment::operator= ( const DtRailSegment orig)

Reimplemented in DtRwRailSegment.

virtual DtRailSegment* DtRailSegment::clone ( )
virtual
virtual void DtRailSegment::setStartPoint ( const DtVector start)
virtual

The first point of the segment.

virtual const DtVector& DtRailSegment::startPoint ( ) const
virtual

The first point of the segment.

virtual void DtRailSegment::setEndPoint ( const DtVector end)
virtual

The last point of the segment.

virtual const DtVector& DtRailSegment::endPoint ( ) const
virtual

The last point of the segment.

virtual void DtRailSegment::setSegmentSpeed ( double  speed)
virtual

The speed that is recommend along this segment.

The Rail Movement Controller will check this speed and cap the entity's speed if it's speed exceeds the segment speed. no speeding.

virtual double DtRailSegment::segmentSpeed ( ) const
virtual

The speed that is recommend along this segment.

The Rail Movement Controller will check this speed and cap the entity's speed if it's speed exceeds the segment speed. no speeding.

virtual void DtRailSegment::setLaneWidth ( double  width)
virtual

The lane width of the segment lanes.

virtual double DtRailSegment::laneWidth ( ) const
virtual

The lane width of the segment lanes.

virtual void DtRailSegment::setNumberOfLanes ( unsigned int  lanes)
virtual

How many lanes are contained in the segment.

virtual unsigned int DtRailSegment::numberOfLanes ( ) const
virtual

How many lanes are contained in the segment.

virtual int DtRailSegment::leftLaneOfLane ( unsigned  lane) const
virtual

Gets the lane to the left of the lane specified.

For countries that are reversed from the US, you should call the opposite function. For instance, in the UK, if you want the lane to the left of your current, you should call rightLaneOfLane() instead.

virtual int DtRailSegment::rightLaneOfLane ( unsigned  lane) const
virtual

Gets the lane to the left of the lane specified.

For countries that are reversed from the US, you should call the opposite function. For instance, in the UK, if you want the lane to the left of your current, you should call rightLaneOfLane() instead.

virtual double DtRailSegment::findLaneShift ( const int  fromLane,
const int  toLane 
) const
virtual

This finds the distance between the 2 lanes.

virtual double DtRailSegment::laneOffset ( int  lanePos) const
virtual

lane offset is the width of all the lanes between the lanePos and the center line Lanes are designated from (number of lanes)/2 -(number of lanes)/2 from the centerline oriented from the segment's start to end point.

So for person traveling from start to end on a 4 lane road, 1 is the far most right lane and the lane offset for that lane position would be one lane width. 2 and -2 would have no offset since they are in the lanes adjacent to the center line and 1/-1 would have one lane width.

virtual double DtRailSegment::laneCenterOffset ( int  lane) const
virtual
Returns
The number of meters to the right of the segment centerline to the centerline of the specified lane. May return negative value if the specified lane is left of the segment centerline.
virtual void DtRailSegment::setIsOneWay ( bool  way)
virtual

Directionality of the segment, whether it is one way or not.

virtual bool DtRailSegment::isOneWay ( ) const
virtual

Directionality of the segment, whether it is one way or not.

virtual std::list<int> DtRailSegment::availableLanes ( ) const
virtual
Returns
A list of available lane numbers on this segment.
virtual void DtRailSegment::setSpecificationID ( const DtSpecificationID  id)
virtual

The specification id of the feature data or route this segment is based from.

This can be used to lookup more information about the type of segment in the DtSpecificationManager if so desired. DtSpecificationID is just an unsigned int. They correspond the DFAD codes which are used to identify a feature–is it a bridge, a gravel road, a canal.......

virtual const DtSpecificationID DtRailSegment::specificationID ( ) const
virtual

The specification id of the feature data or route this segment is based from.

This can be used to lookup more information about the type of segment in the DtSpecificationManager if so desired. DtSpecificationID is just an unsigned int. They correspond the DFAD codes which are used to identify a feature–is it a bridge, a gravel road, a canal.......

virtual void DtRailSegment::setPathId ( const unsigned int  id)
virtual

The path id is a simple way of keeping track of when we turn if we are just at a curve in the path in which case the two connecting segments will have the same id or if an intersection has been reached and the connecting segments will have different path ids.

virtual const unsigned int DtRailSegment::pathId ( ) const
virtual

The path id is a simple way of keeping track of when we turn if we are just at a curve in the path in which case the two connecting segments will have the same id or if an intersection has been reached and the connecting segments will have different path ids.

virtual void DtRailSegment::setSegmentSurfaceConditions ( DtVrfWeatherPrecipitationType  condition)
virtual

Enviromental Condition of segment.

Rainy, sandstorm, high sea state... These are defined in vrfWeatherStateEnums.h

virtual DtVrfWeatherPrecipitationType DtRailSegment::segmentSurfaceConditions ( ) const
virtual

Enviromental Condition of segment.

Rainy, sandstorm, high sea state... These are defined in vrfWeatherStateEnums.h

virtual double DtRailSegment::length ( ) const
virtual

When length is called it will recompute and cache the new length if the endpoints have changed.

The same will happen for the length.

static unsigned int DtRailSegment::nextPathId ( )
static

Member Data Documentation

DtVector DtRailSegment::myStartPoint
protected
DtVector DtRailSegment::myEndPoint
protected
double DtRailSegment::mySpeed
protected

Default is 50 m/s.

Make it high so default is to not interfere with driving and let user choose speed to travel at.

double DtRailSegment::myLaneWidth
protected

Default is 3.66m. This is U.S. Highway standard.

unsigned int DtRailSegment::myNumberOfLanes
protected

Default is 2 allowing a lane for each direction of traffic.

bool DtRailSegment::myIsOneWay
protected

Default is false. Allowing traffic in each direction.

unsigned int DtRailSegment::myPathId
protected

Keep track of if this segment is just a continuation of the current road.

Upon reaching an intersection and turning, the ids will be different.

DtSpecificationID DtRailSegment::mySpecId
protected

Default is 0. It will be set based on whatever feature it was created from.

DtVrfWeatherPrecipitationType DtRailSegment::mySurfaceCondition
protected

Default is 0–No percipitation.

double DtRailSegment::myLength
mutableprotected

These values are calculated when needed and cached.

bool DtRailSegment::myRecomputeLength
mutableprotected
unsigned int DtRailSegment::theNextPathId
staticprotected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)