VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

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.

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 defaultSegmentSpeedLimit () const
 
virtual double laneCenterOffset (int lane) const
 
virtual std::list< intavailableLanes () const
 
virtual double length () const
 
virtual void setStartPoint (const DtVector &start)
 
virtual const DtVectorstartPoint () const
 
virtual void setEndPoint (const DtVector &end)
 
virtual const DtVectorendPoint () const
 
virtual void setSegmentSpeed (double speed)
 
virtual double segmentSpeed () const
 
virtual void setLaneWidth (double width)
 
virtual double laneWidth () const
 
virtual void setNumberOfLanes (unsigned int lanes)
 
virtual unsigned int numberOfLanes () const
 
virtual int leftLaneOfLane (int lane) const
 
virtual int rightLaneOfLane (int lane) const
 
virtual double findLaneShift (const int fromLane, const int toLane) const
 
virtual double laneOffset (int lanePos) const
 
virtual void setIsOneWay (bool way)
 
virtual bool isOneWay () const
 
virtual void setSpecificationID (const DtSpecificationID id)
 
virtual const DtSpecificationID specificationID () const
 
virtual void setPathId (const unsigned int id)
 
virtual const unsigned int pathId () const
 
virtual void setSegmentSurfaceConditions (DtVrfWeatherPrecipitationType condition)
 
virtual
DtVrfWeatherPrecipitationType 
segmentSurfaceConditions () const
 
virtual void setMedianWidth (const double width)
 
virtual double medianWidth () const
 
virtual void setRoadName (const DtString name)
 
virtual DtString roadName () const
 

Static Public Member Functions

static unsigned int nextPathId ()
 

Protected Attributes

DtVector myStartPoint
 
DtVector myEndPoint
 
double mySpeed
 
double myLaneWidth
 
unsigned int myNumberOfLanes
 
bool myIsOneWay
 
unsigned int myPathId
 
DtSpecificationID mySpecId
 
DtVrfWeatherPrecipitationType mySurfaceCondition
 
double myMedianWidth
 
DtString myRoadName
 
double myLength
 
bool myRecomputeLength
 

Static Protected Attributes

static unsigned int theNextPathId
 

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)
virtual DtRailSegment* DtRailSegment::clone ( )
virtual
virtual void DtRailSegment::setStartPoint ( const DtVector start)
virtual

The first point of the segment. (Local coordinates)

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

The first point of the segment. (Local coordinates)

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 double DtRailSegment::defaultSegmentSpeedLimit ( ) const
virtual

The default speed limit used when none is provided in feature data or otherwise set. Always returns 50.0.

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 ( int  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 ( int  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 centerlines of 2 lanes in the segment.

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 to -(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

Environmental Condition of segment. Rainy, sandstorm, high sea state... These are defined in vrfWeatherStateEnums.h.

virtual DtVrfWeatherPrecipitationType DtRailSegment::segmentSurfaceConditions ( ) const
virtual

Environmental Condition of segment. Rainy, sandstorm, high sea state... These are defined in vrfWeatherStateEnums.h.

virtual void DtRailSegment::setMedianWidth ( const double  width)
virtual

In a two-way segment, the width of the median (impassable area) down the center.

virtual double DtRailSegment::medianWidth ( ) const
virtual

In a two-way segment, the width of the median (impassable area) down the center.

virtual void DtRailSegment::setRoadName ( const DtString  name)
virtual

The name of the road this segment is a part of (or empty)

virtual DtString DtRailSegment::roadName ( ) const
virtual

The name of the road this segment is a part of (or empty)

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 precipitation.

double DtRailSegment::myMedianWidth
protected

In a two-way segment, the width of the median (impassable area) down the center.

DtString DtRailSegment::myRoadName
protected

The name, if present.

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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)