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 Member Functions | Protected Attributes
DtRoadSegment Class Reference

Description of one segment of a road.

Derived from information in a DtRailSegment. A road segment is information for traffic in one direction, and is linked to another DtRoadSegment for traffic in the other direction.

Classes

class  DtTmpGeometry
 

Public Member Functions

 DtRoadSegment ()
 
virtual ~DtRoadSegment ()
 
 DtRoadSegment (const DtRoadSegment &orig)
 
DtRoadSegmentoperator= (const DtRoadSegment &orig)
 
virtual DtRoadSegmentclone ()
 
Initialization functions.

These functions compute the geometry of the lanes in the road segment.

virtual bool initializeFromRailSegment (DtRailSegment *railSegment, const Coordinate_System *localCoordinateSystem, bool isDrivingOnLeft, DtRoadSegment *opposingSegment, bool debug=false)
 
virtual bool calculateTemporaryExitGeometry (const double maxSmallBendRadius, const double vehicleWidth, const double headingChange, const double cosHeadingChange, const double sinHeadingChange, bool debug)
 
virtual bool calculateTemporaryEntryGeometry (const double headingChange, const double cosHeadingChange, const double sinHeadingChange, bool debug)
 
virtual bool initializeExitCurve (const double maxSmallBendTurnRadius, const double vehicleWidth, const double headingChange, const double cosHeadingChange, const double sinHeadingChange, bool debug=false)
 
virtual bool initializeEntryCurve (const double headingChange, const double cosHeadingChange, const double sinHeadingChange, bool debug=false)
 
virtual void setExitCurvesForEndingLanes ()
 
virtual void connectWithNext (DtRoadSegment *nextSegment, bool isDrivingOnLeft, bool debug, bool fillOpposingSegment=true)
 
virtual void determineIfIntersectionApproach (const DtRoadSegment *next)
 
virtual bool allAltitudesDetermined () const
 
virtual void setAllAltitudesDetermined (const bool b)
 
Lane Position Functions

These functions perform computations from a one-dimensional position along the centerline of a lane.

virtual DtRoadSegmentPart segmentPart (const int laneN, const double positionAlongLane)
 
virtual double distanceFromLaneEnd (const int laneN, const double positionAlongLane)
 
virtual double evenPositionAlongLane (const double positionAlongLaneA, const int laneA, const int laneB)
 
virtual bool localPositionFromLanePosition (const int laneN, const double positionAlongLane, const double lateralOffset, bool isDrivingOnLeft, DtVector &localPosition, double &headingOffset, double &distanceBeyond) const
 
virtual bool lanePositionFromLocalPosition (const DtVector localPosition, const int laneN, bool isDrivingOnLeft, double &positionInLane, double &laneOffset, bool debug)
 
Multi-Segment Lane Functions

These functions examine whether a lane continues downstream through multiple segments in the path.

virtual int rightmostContinuingLane () const
 
virtual int findNearestContinuingLane (const int laneN, const double positionAlongLane, const double lookAheadDistance, bool debug=false)
 
virtual bool laneContinuesForDistance (const int laneN, const double positionAlongLane, const double lookDistance, double &actualDistance, bool &pathContinues, bool debug=false)
 
virtual int matchingLane (const double offset)
 
Set and Get Functions for Members
virtual double heading () const
 
virtual void setHeading (const double h)
 
virtual double length () const
 
virtual void setLength (const double l)
 
virtual double medianWidth () const
 
virtual void setMedianWidth (const double w)
 
virtual DtString roadName () const
 
virtual void setRoadName (const DtString &name)
 
virtual const DtCoordTransform & segmentToLocalTransform () const
 
virtual void setSegmentToLocalTransform (const DtCoordTransform &xform)
 
virtual int numLanes () const
 
virtual void setNumLanes (const int nLanes)
 
virtual DtLaneSegmentlanes ()
 
virtual const DtLaneSegmentlanes () const
 
virtual bool isOneWay () const
 
virtual void setIsOneWay (const bool oneWay)
 
virtual bool exitIsRightTurn () const
 
virtual void setExitIsRightTurn (const bool r)
 
virtual bool entryIsRightTurn () const
 
virtual void setEntryIsRightTurn (const bool r)
 
virtual double entryCurveEndOffset () const
 
virtual void setEntryCurveEndOffset (const double o)
 
virtual double exitCurveStartOffset () const
 
virtual void setExitCurveStartOffset (const double o)
 
virtual bool isIntersectionApproach () const
 
virtual void setIsIntersectionApproach (const bool i)
 
virtual double stopLineSetBack () const
 
virtual void setStopLineSetBack (const double sb)
 
virtual double speedLimit () const
 
virtual void setSpeedLimit (const double limit)
 
virtual double defaultSpeedLimit (const int numLanes)
 
virtual double freeFlowSpeed () const
 
virtual void setFreeFlowSpeed (const double ff)
 
virtual DtRoadSegmentnextRoadSegment () const
 
virtual void setNextRoadSegment (DtRoadSegment *s)
 
virtual DtRoadSegmentpreviousRoadSegment () const
 
virtual void setPreviousRoadSegment (DtRoadSegment *s)
 
virtual DtRoadSegmentopposingSegment () const
 
virtual void setOpposingSegment (DtRoadSegment *s)
 
virtual bool isOpposing () const
 
virtual void setIsOpposing (const bool opposing)
 
virtual DtTmpGeometrytemporaryGeometry ()
 
Road Design Constants

These functions return constants used to build the road path. They define how some of the geometry of the road features are interpreted as roads. They can be overridden to produce different road interpretations.

virtual double minIntersectionBendAngle ()
 
virtual double intrxThresholdAngleToConnectEdgeLanes ()
 
virtual double intrxThresholdAngleToConnectAllLanes ()
 
virtual double nonIntrxThresholdAngleToConnectEdgeLanes ()
 
virtual double minimumLaneWidth ()
 

Protected Member Functions

virtual void findRightMostAlignedLane (DtRoadSegment *nextSegment, int &rightMostLane, int &nextSegmentRightMostLane, int &numAlignedLanes)
 
virtual void findLeftMostAlignedLane (DtRoadSegment *nextSegment, int &leftMostLane, int &nextSegmentLeftMostLane, int &numAlignedLanes)
 

Protected Attributes

double myLength
 
DtCoordTransform mySegmentToLocal
 
bool myAllAltitudesDetermined
 
double myHeading
 
double myNextHeading
 
bool myExitBendsRight
 
bool myEntryBendsRight
 
double myEntryCurveEndOffset
 
double myExitCurveStartOffset
 
int myNumberLanes
 
DtLaneSegmentmyLanes
 
bool myIsIntersectionApproach
 
double myStopLineSetback
 
double mySpeedLimit
 
double myFreeFlowSpeed
 
double myMedianWidth
 
DtString myRoadName
 
bool myIsOpposing
 
DtTmpGeometry myTmpGeometry
 
DtRoadSegmentmyPreviousSegment
 
DtRoadSegmentmyNextSegment
 
bool myIsOneWay
 
DtRoadSegmentmyOpposingSegment
 

Constructor & Destructor Documentation

DtRoadSegment::DtRoadSegment ( )
virtual DtRoadSegment::~DtRoadSegment ( )
virtual
DtRoadSegment::DtRoadSegment ( const DtRoadSegment orig)

Member Function Documentation

DtRoadSegment& DtRoadSegment::operator= ( const DtRoadSegment orig)
virtual DtRoadSegment* DtRoadSegment::clone ( )
virtual
virtual bool DtRoadSegment::initializeFromRailSegment ( DtRailSegment railSegment,
const Coordinate_System localCoordinateSystem,
bool  isDrivingOnLeft,
DtRoadSegment opposingSegment,
bool  debug = false 
)
virtual

Fills in values for lane width, number of lanes, median width, and so forth from the rail segment. Computes a tentative coordinate transform from road segment to local coordinates.

Parameters
opposingSegmentIf this is null, then this function first creates a segment for traffic going the same direction as the rail begin-end direction, then calls itself recursively to create an opposing segment–a segment for traffic going the opposite direction to the rail segment begin-end direction.
Returns
true if setup was successful.
virtual bool DtRoadSegment::calculateTemporaryExitGeometry ( const double  maxSmallBendRadius,
const double  vehicleWidth,
const double  headingChange,
const double  cosHeadingChange,
const double  sinHeadingChange,
bool  debug 
)
virtual

Do the calculations for the curves connecting segments to determine the ideal and limiting values, and put into the tmpGeometry for the segment. (This will be used to find and adjust segments that are too short.)

Parameters
maxSmallBendRadiusWhen there is only a small angle between adjacent segments, a circular arc connecting them would have a really large radius. This would extend the curve into each segment really far and cause various problems. This parameter is a max radius limit to use in these cases.

Called in DtRoadPathFunctions::calculatePathTemporaryGeometry as part of setupRoadFromRailPath.

Parameters
vehicleWidthThis is width of a design vehicle. The radius of the curve between segments is kept small enough to prevent a vehicle of this width from moving over the lane edge on the inside of the turn. Except that
  1. Vehicles will often extend over the lane edge on the outside anyway.
  2. The radius is kept at least as large as the minimum design radius, which may mean that the vehicle will cut the corner.
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 (see initializeEntryCurve() )
sinHeadingChangesin of headingChange
debugA flag to generate verbose output on the sim console (DtWarn)
virtual bool DtRoadSegment::calculateTemporaryEntryGeometry ( const double  headingChange,
const double  cosHeadingChange,
const double  sinHeadingChange,
bool  debug 
)
virtual

Do the calculations for the curves connecting segments to determine the ideal and limiting values, and put into the tmpGeometry for the segment. (This will be used to find and adjust segments that are too short.)

Parameters
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 (see initializeEntryCurve() )
sinHeadingChangesin of headingChange
debugA flag to generate verbose output on the sim console (DtWarn)
Returns
True if everything goes well, false if there is an error.
virtual bool DtRoadSegment::initializeExitCurve ( const double  maxSmallBendTurnRadius,
const double  vehicleWidth,
const double  headingChange,
const double  cosHeadingChange,
const double  sinHeadingChange,
bool  debug = false 
)
virtual

Initializes the exit curve geometry in this segment.

Calls calculateInsideExitCurveGeometry to get the geometry of the constraining lane, then calls calculateExitCurveGeometry on the other lanes.

Assumes the next- and previous road segment pointers have been set already. Assumes the entry curve has already been created.

Parameters
maxSmallBendTurnRadiusNot used, will be removed
vehicleWidthNot used, will be removed.
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 (see initializeEntryCurve() )
sinHeadingChangesin of headingChange
debugA flag to generate verbose output on the sim console (DtWarn)
Returns
True if everything goes well, false if there is an error.
virtual bool DtRoadSegment::initializeEntryCurve ( const double  headingChange,
const double  cosHeadingChange,
const double  sinHeadingChange,
bool  debug = false 
)
virtual

Initializes the entry curve geometry in the segment. Assumes that the next- and previous road segment pointers have been set already, and that the lanes have been connected. Uses a pre-computed turn radius for the left edge line of the segment–which comes from the exit curve of the previous segment. This assumes that the left edge of the previous segment connects to the left edge of this segment (the normal case).

Parameters
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 (see initializeEntryCurve() )
sinHeadingChangesin of headingChange
debugA flag to generate verbose output on the sim console (DtWarn)
Returns
True if everything goes well, false if there is an error.
virtual void DtRoadSegment::setExitCurvesForEndingLanes ( )
virtual

Set the exit curve geometry and straight section length for lanes that don't connect downstream. The function finds the lane that connects that has the biggest (negative) offset for its exit curve, and uses that to set the end point of the lanes that don't connect. The exit curve offset will be set to this biggest offset, and the exit curve length will be set to zero.

virtual void DtRoadSegment::connectWithNext ( DtRoadSegment nextSegment,
bool  isDrivingOnLeft,
bool  debug,
bool  fillOpposingSegment = true 
)
virtual

Connects the next and previous segment pointers between this segment and the next one and connects the appropriate lanes via their connecting-upstream and -downstream lane members.

This function uses several parameters to guess which lanes should be connected. In general, if the bend is slight, then lanes in the two segments that are aligned with each other are connected. If the road bends more than nonIntrxThresholdAngleToConnectEdgeLanes, then the right-most lanes are connected instead.

If the connection between segments is a roadway intersection, then intrxThresholdAngleToConnectEdgeLanes is used for the threshold angle. A connection between segments is judged to be an intersection if determineIfIntersectionApproach is true (see that function).

If isDrivingOnLeft is true, then the choice of connected lanes is based on the negation of the bend angle between segments. ie, if the bend angle is 90 degrees to the left, but isDrivingOnLeft is true, then the rightmost lane will be connected to the downstream segment.

virtual void DtRoadSegment::determineIfIntersectionApproach ( const DtRoadSegment next)
virtual

Determine if the downstream connection is an intersection. In this base function, the connection is an intersection if the two connecting segments have different names (attributes of the road feature), if they have different one-way properties, or if the angle to the next segment is greater than minIntersectionBendAngle. If this is an intersection, then only the outer edge, "turn" lane is connected to the next segment.

virtual bool DtRoadSegment::allAltitudesDetermined ( ) const
inlinevirtual

This indicates that the altitude lookups needed to make the mySegmentToLocal transform (start and end points of the rail segment) and the slopes above (right edge points even with the start and end) have been found. If this is false, then the altitudes haven't been found yet, possibly because streaming terrain wasn't yet loaded. This is only used when creating the road path.

virtual void DtRoadSegment::setAllAltitudesDetermined ( const bool  b)
inlinevirtual

Fills in values for lane width, number of lanes, median width, and so forth from the rail segment. Computes a tentative coordinate transform from road segment to local coordinates.

Parameters
opposingSegmentIf this is null, then this function first creates a segment for traffic going the same direction as the rail begin-end direction, then calls itself recursively to create an opposing segment–a segment for traffic going the opposite direction to the rail segment begin-end direction.
Returns
true if setup was successful.
virtual DtRoadSegmentPart DtRoadSegment::segmentPart ( const int  laneN,
const double  positionAlongLane 
)
virtual

Computes road segment part from lane position. LaneN is a 0-based lane number.

virtual double DtRoadSegment::distanceFromLaneEnd ( const int  laneN,
const double  positionAlongLane 
)
virtual

Determines how far the position is from the end of the lane, including the exit curve.

virtual double DtRoadSegment::evenPositionAlongLane ( const double  positionAlongLaneA,
const int  laneA,
const int  laneB 
)
virtual

Determines the position along laneB that is even with the position along laneA. Uses 0-based lane numbers.

virtual bool DtRoadSegment::localPositionFromLanePosition ( const int  laneN,
const double  positionAlongLane,
const double  lateralOffset,
bool  isDrivingOnLeft,
DtVector localPosition,
double headingOffset,
double distanceBeyond 
) const
virtual

Determine the position in local coordinates from the linear position along the lane and a lateral offset.

Parameters
laneNThe 0-based lane number.
positionAlongLaneThe linear position from the beginning of the entry curve arc.
lateralOffsetThe distance to the right from the centerline. Note that this is actually the distance toward the outside of the road, so if driving on the left this is the distance to the left of the centerline.
isDrivingOnLeftTrue if roads are set up to drive on left. This causes the position and heading to be mirrored about the line from segment start point to end point.
localPositionThe corresponding position in local coordinates (output).
headingOffsetThe offset from local "north" (1, 0, 0) of the position. This is based on the position along the entry or exit arc. (output)
distanceBeyondIf the position is not on the road segment, this output will indicate how far beyond the end of the segment the position is.
Returns
True normally, but false if the position is beyond this segment.
virtual bool DtRoadSegment::lanePositionFromLocalPosition ( const DtVector  localPosition,
const int  laneN,
bool  isDrivingOnLeft,
double positionInLane,
double laneOffset,
bool  debug 
)
virtual

Compute the position of the given local position in the given lane of the segment.

Returns
false if the point is not within the segment, true otherwise. If false, the positionInLane is just the
virtual int DtRoadSegment::rightmostContinuingLane ( ) const
virtual

Finds the lane number (0-base) of the right-most lane that connects to the downstream road segment. If no lanes have a connecting downstream lane, then 0 (the right lane) is returned.

virtual int DtRoadSegment::findNearestContinuingLane ( const int  laneN,
const double  positionAlongLane,
const double  lookAheadDistance,
bool  debug = false 
)
virtual

Looks downstream to see if the current lane connects through to the downstream segments. If so, returns the number of the current lane (laneN). If not, returns the lane number of a lane that connects. If there are more than one lanes that connect, it returns the nearest lane. If no lane in the current segment connects through for lookAheadDistance, then the nearest lane that connects to the next segment is returned. If there is no next segment, then the current laneN is returned. Checks segments downstream at least to a lookAheadDistance ahead. Lane numbers are 0-based.

virtual bool DtRoadSegment::laneContinuesForDistance ( const int  laneN,
const double  positionAlongLane,
const double  lookDistance,
double actualDistance,
bool pathContinues,
bool  debug = false 
)
virtual

Checks to see if the given lane continues downstream, connecting to lanes in downstream links, for at least lookDistance. If so, returns true. If not, returns false. If the path(connected segments) ends before the lookDistance, the function will return false; however, pathContinues will also be set to false. Puts the distance the lane does continue in actualDistance.

Parameters
laneNis the current lane; 0-based.
virtual int DtRoadSegment::matchingLane ( const double  offset)
virtual

Find the lane whose centerline offset best matches the given offset. Returns a 0-based lane number (ie right lane is 0).

virtual double DtRoadSegment::heading ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setHeading ( const double  h)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::length ( void  ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setLength ( const double  l)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::medianWidth ( ) const
inlinevirtual

Width of the median. Only applies to 2-way segments. The lanes are offset half this width from the segment left edge.

virtual void DtRoadSegment::setMedianWidth ( const double  w)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual DtString DtRoadSegment::roadName ( ) const
inlinevirtual

Name of the road containing this segment.

virtual void DtRoadSegment::setRoadName ( const DtString name)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual const DtCoordTransform& DtRoadSegment::segmentToLocalTransform ( ) const
inlinevirtual

Converts from a road-segment coordinate system to local database coordinates. The road segment coordinate system has +x in the direction from the start point to the end, +y to the right, and +z down. The y direction is the same whether driving on the left or not, so code that uses this transformation has to manually negate the y coordinate and the heading if driving on the left.

virtual void DtRoadSegment::setSegmentToLocalTransform ( const DtCoordTransform &  xform)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual int DtRoadSegment::numLanes ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setNumLanes ( const int  nLanes)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual DtLaneSegment* DtRoadSegment::lanes ( )
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual const DtLaneSegment* DtRoadSegment::lanes ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual bool DtRoadSegment::isOneWay ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setIsOneWay ( const bool  oneWay)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual bool DtRoadSegment::exitIsRightTurn ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setExitIsRightTurn ( const bool  r)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual bool DtRoadSegment::entryIsRightTurn ( ) const
inlinevirtual

Indicates a positive heading change from the previous segment to this one, and that lanes to the right (outside) of the road have a shorter turn radius. Note that if driving on the left, this function returns the opposite, i.e. it is true if the road turned left on entry into this segment. In that case though the outside lane still has the shorter turn radius.

virtual void DtRoadSegment::setEntryIsRightTurn ( const bool  r)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::entryCurveEndOffset ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setEntryCurveEndOffset ( const double  o)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::exitCurveStartOffset ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setExitCurveStartOffset ( const double  o)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual bool DtRoadSegment::isIntersectionApproach ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setIsIntersectionApproach ( const bool  i)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::stopLineSetBack ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setStopLineSetBack ( const double  sb)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::speedLimit ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setSpeedLimit ( const double  limit)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual double DtRoadSegment::defaultSpeedLimit ( const int  numLanes)
virtual

Provides the default speed limit for (any) road segment based on number of lanes. Used when the road segment is initialized from a rail segment, when the rail segment's speed is just a default value. Uses the constants defined in DtRoadConstants.

Parameters
numLanesis the number of lanes in one direction.
virtual double DtRoadSegment::freeFlowSpeed ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setFreeFlowSpeed ( const double  ff)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual DtRoadSegment* DtRoadSegment::nextRoadSegment ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setNextRoadSegment ( DtRoadSegment s)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual DtRoadSegment* DtRoadSegment::previousRoadSegment ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setPreviousRoadSegment ( DtRoadSegment s)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual DtRoadSegment* DtRoadSegment::opposingSegment ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setOpposingSegment ( DtRoadSegment s)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual bool DtRoadSegment::isOpposing ( ) const
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual void DtRoadSegment::setIsOpposing ( const bool  opposing)
inlinevirtual

This is the length of the associated rail segment. This is the same as the length of the straight part of the road segment if the entry and exit curves had 0 setback.

virtual DtTmpGeometry* DtRoadSegment::temporaryGeometry ( )
virtual

Get/set the temporary geometry computed from the input rail path; used to identify segments that are too short and remove or realign them so that the resulting path is physically feasible. This function accesses the structure without the const qualifier so that callers may change individual members.

virtual void DtRoadSegment::findRightMostAlignedLane ( DtRoadSegment nextSegment,
int rightMostLane,
int nextSegmentRightMostLane,
int numAlignedLanes 
)
protectedvirtual

Finds the rightmost lane that is aligned with a lane in the downstream segment, assuming they are collinear. Returns the lane number (0-based), the corresponding lane number in the downstream lane, and the number of aligned lanes.

virtual void DtRoadSegment::findLeftMostAlignedLane ( DtRoadSegment nextSegment,
int leftMostLane,
int nextSegmentLeftMostLane,
int numAlignedLanes 
)
protectedvirtual

Finds the leftmost lane that is aligned with a lane in the downstream segment, assuming they are collinear. Returns the lane number (0-based), the corresponding lane number in the downstream lane, and the number of aligned lanes.

virtual double DtRoadSegment::minIntersectionBendAngle ( )
inlinevirtual

This defines how much of an angle between segments is required for the connection to be considered an intersection. Default value 0.7854.

If it is an intersection, then usually only the outer, "turn" lane is connected to the downstream segment (see parameter below). In radians. Note 45 degrees = 0.7854 radians. Note that if the path changes from two-way to one-way or vice versa, it is considered an intersection. TODO– this will be replaced with other information to determine whether there is an intersection.

virtual double DtRoadSegment::intrxThresholdAngleToConnectEdgeLanes ( )
inlinevirtual

This defines a threshold between segments at an intersection that determines how lanes are connected. Default value 0.3.

When the bend is less than this angle, a lane is connected to the downstream lane that it aligns with most closely. E.g. if there is one lane in the upstream segment and two in the downstream, the best connection from the single lane will be to the left lane in the downstream segment, because they are closely aligned. However, when the bend is greater than the threshold, the single lane should be connected to the rightmost downstream lane (for right bends, and vice versa for left). This threshold is normally fairly small because the expected case is that the edge lanes are connected at an intersection.

virtual double DtRoadSegment::intrxThresholdAngleToConnectAllLanes ( )
inlinevirtual

This defines a threshold between segments at an intersection that determines whether all aligned lanes should be connected, vs only the inside lane. Default value 0.2.

Intersections can be defined by one-way properties changing, or by the name changing, even if there isn't a bend in the road. If the intersection is fairly straight, then all lanes are aligned. If the bend is less than this angle (radians), all lanes will be connected. This should be less than the above threshold.

virtual double DtRoadSegment::nonIntrxThresholdAngleToConnectEdgeLanes ( )
inlinevirtual

Same as above, but for segments that define a bend in a through street rather than an intersection. Default value 0.7854.

This is expected to be a higher threshold because the usual case should be for aligned lanes to connect; only when there is a significant bend are the lanes matched up from the right (left) edge inward. Making this = max-straight-road-bend-angle means that if a path doesn't bend enough to be an intersection, then the aligned lanes will be connected.

virtual double DtRoadSegment::minimumLaneWidth ( )
inlinevirtual

The minimum lane width expected from the feature data. Default value 2.0.

Member Data Documentation

double DtRoadSegment::myLength
protected

The length of the underlying road feature, ie the rail segment.

DtCoordTransform DtRoadSegment::mySegmentToLocal
protected

Coordinate transformation from segment coordinates to local database coordinates. Segment coordinates have the origin at the rail segment start point and are oriented with x toward the end point, y to the right, and z perpendicular to x and y.

bool DtRoadSegment::myAllAltitudesDetermined
protected
double DtRoadSegment::myHeading
protected
double DtRoadSegment::myNextHeading
protected

The segment downstream:

bool DtRoadSegment::myExitBendsRight
protected

Refers to the connection to the downstream segment:

bool DtRoadSegment::myEntryBendsRight
protected

Refers to the connection from the upstream segment:

double DtRoadSegment::myEntryCurveEndOffset
protected

TODO – the following two members aren't used. See comment above. Where the entry curve ends and the straight section begins, relative to the segment start X.

double DtRoadSegment::myExitCurveStartOffset
protected

Similarly, where the exit curve starts, relative to the end of the segment.

DtRoadSegment* DtRoadSegment::myPreviousSegment
protected

These come directly from the rail path, thus there is a connection to only on other road segment before and after. (Future implementation might be of a road network, thuse there would be multiple connections at intersections.)

DtRoadSegment* DtRoadSegment::myNextSegment
protected

These come directly from the rail path, thus there is a connection to only on other road segment before and after. (Future implementation might be of a road network, thuse there would be multiple connections at intersections.)

bool DtRoadSegment::myIsOneWay
protected

These come directly from the rail path, thus there is a connection to only on other road segment before and after. (Future implementation might be of a road network, thuse there would be multiple connections at intersections.)

DtRoadSegment* DtRoadSegment::myOpposingSegment
protected

Only valid if not a one-way segment.

int DtRoadSegment::myNumberLanes
protected
DtLaneSegment* DtRoadSegment::myLanes
protected

A vector of lanes, with lane 0 the right-most, and lane myNumberLanes-1 the left-most (or vice versa for drive-on-the-left roads). This is offset by 1 from the railSegment convention, but matches the array index.

bool DtRoadSegment::myIsIntersectionApproach
protected

Indicates that the connection at the downstream end is an intersection. Set in determineIfIntersectionApproach(). Affects whether all lanes are connected to the downstream segment, or just the edge lane.

double DtRoadSegment::myStopLineSetback
protected

Distance before end of straight segment where stop line is located. (Note: in VRF 4.5 – not used yet.)

double DtRoadSegment::mySpeedLimit
protected

If available; 0 indicates not set.

double DtRoadSegment::myFreeFlowSpeed
protected

This is the speed traffic flows on average, irrespective of the legal speed limit above. (Note: in VRF 4.5 – not used yet.)

double DtRoadSegment::myMedianWidth
protected

The width of the median in this (2-way) segment.

DtString DtRoadSegment::myRoadName
protected

The name of the road.

bool DtRoadSegment::myIsOpposing
protected

Indicates that this segment goes in the opposite direction of the related rail segment. The opposing segments are filled out in the current implementation (4.5), but are not used.

DtTmpGeometry DtRoadSegment::myTmpGeometry
protected

This information is used when constructing the road path to find modifications to the segments when they are physically impossible to connect together, ie because they are too short and change direction too quickly. These values are for the inner lane in the bend between segments– ie the lane that is constrained the most by geometry.


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)