VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Attributes
DtLaneSegment Class Reference

Description of one lane of a DtRoadSegment.

Classes

struct  DtLaneGeometry
 

Public Member Functions

 DtLaneSegment ()
 
virtual ~DtLaneSegment ()
 
 DtLaneSegment (const DtLaneSegment &orig)
 
DtLaneSegmentoperator= (const DtLaneSegment &orig)
 
virtual DtLaneSegmentclone ()
 
virtual DtLaneGeometrylaneGeometry ()
 
virtual const DtLaneGeometrylaneGeometry () const
 
virtual DtTrafficControlDevicetrafficControlDevice ()
 
virtual void setTrafficControlDevice (DtTrafficControlDevice *device)
 
virtual int laneNumber () const
 
virtual void setLaneNumber (const int lane)
 
virtual DtRoadSegmentparentRoadSegment () const
 
virtual void setParentRoadSegment (DtRoadSegment *parent)
 
Visualization Support

Get some vertices in local coordinates defining the lane, for the purposes of visualizing it.

virtual void generateFirstHalfLanePoints (std::vector< DtVector > &pointList, bool drivingOnLeft, int pointsInCurve=5)
 
virtual void generateSecondHalfLanePoints (std::vector< DtVector > &pointList, bool drivingOnLeft, int pointsInCurve=5)
 
Connecting Lane Access

Access connecting lanes. This is the lane in the downstream or upstream segment that this lane connects to. Note that roadSegment convention is used, so lane numbers start at 0 and go to # lanes-1.

If this value is -1, the lane does not connect to the next segment (this can happen if a 2-lane segment connects to a 1-lane segment for example, or in the future if each segment approaching an intersection connects to multiple downstream segments but not all lanes connect to all segments).

virtual int connectingDownstreamLane () const
 
virtual void setConnectingDownstreamLane (const int lane)
 
virtual int connectingUpstreamLane () const
 
virtual void setConnectingUpstreamLane (const int lane)
 
Geometry Calculation
virtual double calculateInsideEntryCurveGeometry (double headingChange, double cosHeadingChange, double sinHeadingChange, bool debug=false)
 
virtual void calculateEntryCurveGeometry (double segmentLeftEdgeRadius, double headingChange, bool debug=false)
 
virtual double calculateInsideExitCurveGeometry (double segmentLeftEdgeRadius, double headingChange, double cosHeadingChange, double sinHeadingChange, bool debug=false)
 
virtual void calculateExitCurveGeometry (double segmentLeftEdgeRadius, double headingChange, bool debug=false)
 

Protected Attributes

DtLaneGeometry myGeometry
 
DtTrafficControlDevicemyTrafficSignal
 
int myConnectingDownstreamLane
 
int myConnectingUpstreamLane
 
DtRoadSegmentmyRoadSegment
 
int myLaneNumber
 

Constructor & Destructor Documentation

DtLaneSegment::DtLaneSegment ( )
virtual DtLaneSegment::~DtLaneSegment ( )
virtual
DtLaneSegment::DtLaneSegment ( const DtLaneSegment orig)

Member Function Documentation

DtLaneSegment& DtLaneSegment::operator= ( const DtLaneSegment orig)
virtual DtLaneSegment* DtLaneSegment::clone ( )
virtual
virtual DtLaneGeometry& DtLaneSegment::laneGeometry ( )
virtual

Accessor for lane geometry. Geometry is changed by accessing this structure and changing fields.

virtual const DtLaneGeometry& DtLaneSegment::laneGeometry ( ) const
virtual
virtual DtTrafficControlDevice* DtLaneSegment::trafficControlDevice ( )
virtual

Not currently used (future work). Access traffic control device.

virtual void DtLaneSegment::setTrafficControlDevice ( DtTrafficControlDevice device)
virtual

Not currently used (future work).

virtual int DtLaneSegment::laneNumber ( ) const
inlinevirtual
virtual void DtLaneSegment::setLaneNumber ( const int  lane)
inlinevirtual
virtual DtRoadSegment* DtLaneSegment::parentRoadSegment ( ) const
inlinevirtual
virtual void DtLaneSegment::setParentRoadSegment ( DtRoadSegment parent)
inlinevirtual
virtual void DtLaneSegment::generateFirstHalfLanePoints ( std::vector< DtVector > &  pointList,
bool  drivingOnLeft,
int  pointsInCurve = 5 
)
virtual

Generate the entry curve and a point halfway down the lane. Points are generated in the right-most lane that continues from the previous segment.

Parameters
pointListA vector of points in local coordinates. This function adds new points to the end.
pointsInCurveis the number of points to use to approximate the entry and exit curves.
virtual void DtLaneSegment::generateSecondHalfLanePoints ( std::vector< DtVector > &  pointList,
bool  drivingOnLeft,
int  pointsInCurve = 5 
)
virtual

Generate a point halfway down the lane and the exit curve. Points are generated in the right-most lane that continues to the next segment.

Parameters
pointListA vector of points in local coordinates. This function adds new points to the end.
pointsInCurveis the number of points to use to approximate the entry and exit curves.
virtual int DtLaneSegment::connectingDownstreamLane ( ) const
inlinevirtual
virtual void DtLaneSegment::setConnectingDownstreamLane ( const int  lane)
inlinevirtual
virtual int DtLaneSegment::connectingUpstreamLane ( ) const
inlinevirtual
virtual void DtLaneSegment::setConnectingUpstreamLane ( const int  lane)
inlinevirtual
virtual double DtLaneSegment::calculateInsideEntryCurveGeometry ( double  headingChange,
double  cosHeadingChange,
double  sinHeadingChange,
bool  debug = false 
)
virtual

Calculate the entry curve geometry for the inside lane–that is, the lane that connects to the inside lane of the upstream segment. Inside lane means the one with the smallest arc radius. The radius of the curve is taken from the upstream lane info, since that was based on space available in this segment.

The function fills in elements of the myGeometry member.

Parameters
headingChangeThe change in heading from the previous segment, in radians (+ to the right). If driving on the left of the road, this value should be negated from the true rail segment geometry.
cosHeadingChangecos of heading change. A parameter to avoid repeated calculation.
sinHeadingChangesin of headingChange
debugA flag to generate verbose output on the sim console (DtWarn)
Returns
The corrected value of the segment left edge radius–it may be reduced from DtRoadSegment tmpGeometry due to space constraints for the curve. If the upstream exit curve has radius 0, the return value will be 0.
virtual void DtLaneSegment::calculateEntryCurveGeometry ( double  segmentLeftEdgeRadius,
double  headingChange,
bool  debug = false 
)
virtual

Calculate the geometry of the entry curve for all lanes besides the inside lane. See calculateInsideEntryCurveGeometry.

The function fills in elements of the myGeometry member.

virtual double DtLaneSegment::calculateInsideExitCurveGeometry ( double  segmentLeftEdgeRadius,
double  headingChange,
double  cosHeadingChange,
double  sinHeadingChange,
bool  debug = false 
)
virtual

Calculate the exit curve geometry for the inside lane.

This computes the actual radius of the curve and the offset–the distance before the end of the segment (the straight segment defined by the original rail segment) that the curve must begin. The offset is determined both by the radius of the curve and by the location of the intersection of the lane with the downstream lane.

The function compares this offset to the space available in this segment and the next and reduces the curve radius if necessary (even below the design vehicle minimum radius) to accommodate the space available. If there is zero space or less–possible if a segment is short relative to the width of the road–a zero radius will be used, resulting in the vehicle jumping to the next lane when it reaches the end of the segment.

The function uses values in the DtRoadSegment::DtTmpGeometry structure.

The function fills in elements of the myGeometry member.

Parameters
segmentLeftEdgeRadiusThe radius of a curve connecting the left edges of this segment and the next; assumed to have been calculated from constraints on the inside lane.
headingChangeThe change in heading to the next segment, in radians (+ to the right). If driving on the left of the road, this value should be negated from the true rail segment geometry.
cosHeadingChangecos of heading change. A parameter to avoid repeated calculation.
sinHeadingChangesin of headingChange
debugA flag to generate verbose output on the sim console (DtWarn)
Returns
The corrected value of the segment left edge radius–it may be reduced due to space constraints for the curve.
virtual void DtLaneSegment::calculateExitCurveGeometry ( double  segmentLeftEdgeRadius,
double  headingChange,
bool  debug = false 
)
virtual

Calculate the geometry of the exit curve for all lanes besides the inside lane. See calculateInsideExitCurveGeometry.

The function fills in elements of the myGeometry member.

Member Data Documentation

DtLaneGeometry DtLaneSegment::myGeometry
protected
DtTrafficControlDevice* DtLaneSegment::myTrafficSignal
protected

Not currently used (future work); the traffic control device controlling traffic flow in the lane of the segment. May be static, e.g. a stop sign.

int DtLaneSegment::myConnectingDownstreamLane
protected

What lane this connects to in the downstream segment. RoadSegment lanes, ie 0-based numbering.

int DtLaneSegment::myConnectingUpstreamLane
protected

Upstream connecting lane.

DtRoadSegment* DtLaneSegment::myRoadSegment
protected

The road segment this lane belongs to.

int DtLaneSegment::myLaneNumber
protected

The array index of this lane in the road segment's array of lanes.


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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)