17 #include <matrix/vlVector.h>
18 #include <matrix/coordTransform.h>
19 #include <vlpi/appearance.h>
30 #define DT_ROAD_SEGMENT_NO_LANE -1
33 #define CENTERLINE_EPSILON 0.001
61 virtual DtTrafficControlIndication currentIndication()
const;
62 virtual DtString indicationString(DtTrafficControlIndication ind)
const;
66 virtual void setCurrentIndication(
const DtTrafficControlIndication signal);
70 virtual bool isStatic()
const;
71 virtual void setIsStatic(
const bool isStatic);
77 virtual void setTrafficLightObject(
const DtVrfObject* trafficLight);
82 virtual double positionAlongLane()
const;
83 virtual void setPositionAlongLane(
const double p);
87 return app->powerPlantOn();
92 return app->flamesPresent();
97 return app->smokePlumePresent();
218 myRoadSegment = parent;
233 virtual void generateFirstHalfLanePoints(std::vector<DtVector>& pointList,
235 int pointsInCurve = 5);
244 virtual void generateSecondHalfLanePoints(std::vector<DtVector>& pointList,
246 int pointsInCurve = 5);
263 myConnectingDownstreamLane = lane;
268 myConnectingUpstreamLane = lane;
293 virtual double calculateInsideEntryCurveGeometry(
double headingChange,
294 double cosHeadingChange,
double sinHeadingChange,
301 virtual void calculateEntryCurveGeometry(
double segmentLeftEdgeRadius,
302 double headingChange,
336 virtual double calculateInsideExitCurveGeometry(
double segmentLeftEdgeRadius,
337 double headingChange,
338 double cosHeadingChange,
double sinHeadingChange,
345 virtual void calculateExitCurveGeometry(
double segmentLeftEdgeRadius,
346 double headingChange,
448 virtual bool initializeFromRailSegment(
DtRailSegment* railSegment,
479 virtual bool calculateTemporaryExitGeometry(
const double maxSmallBendRadius,
480 const double vehicleWidth,
const double headingChange,
481 const double cosHeadingChange,
const double sinHeadingChange,
496 virtual bool calculateTemporaryEntryGeometry(
const double headingChange,
497 const double cosHeadingChange,
const double sinHeadingChange,
519 virtual bool initializeExitCurve(
520 const double maxSmallBendTurnRadius,
const double vehicleWidth,
521 const double headingChange,
522 const double cosHeadingChange,
const double sinHeadingChange,
540 virtual bool initializeEntryCurve(
const double headingChange,
541 const double cosHeadingChange,
const double sinHeadingChange,
550 virtual void setExitCurvesForEndingLanes();
572 bool isDrivingOnLeft,
574 bool fillOpposingSegment =
true);
583 virtual void determineIfIntersectionApproach(
const DtRoadSegment* next);
594 myAllAltitudesDetermined = b;
608 const double positionAlongLane);
612 virtual double distanceFromLaneEnd(
const int laneN,
613 const double positionAlongLane);
617 virtual double evenPositionAlongLane(
const double positionAlongLaneA,
618 const int laneA,
const int laneB);
640 virtual bool localPositionFromLanePosition(
const int laneN,
641 const double positionAlongLane,
const double lateralOffset,
bool isDrivingOnLeft,
642 DtVector& localPosition,
double& headingOffset,
643 double& distanceBeyond)
const;
649 virtual bool lanePositionFromLocalPosition(
const DtVector localPosition,
650 const int laneN,
bool isDrivingOnLeft,
651 double &positionInLane,
double& laneOffset,
666 virtual int rightmostContinuingLane()
const;
678 virtual int findNearestContinuingLane(
const int laneN,
679 const double positionAlongLane,
const double lookAheadDistance,
bool debug =
false);
690 virtual bool laneContinuesForDistance(
const int laneN,
691 const double positionAlongLane,
const double lookDistance,
692 double & actualDistance,
bool & pathContinues,
bool debug =
false);
696 virtual int matchingLane(
const double offset);
703 virtual double heading()
const {
return myHeading;}
710 virtual double length()
const {
return myLength;}
730 mySegmentToLocal = xform;
733 virtual int numLanes()
const {
return myNumberLanes;}
734 virtual void setNumLanes(
const int nLanes) {myNumberLanes = nLanes;}
740 virtual void setIsOneWay(
const bool oneWay) {myIsOneWay = oneWay;}
774 virtual double defaultSpeedLimit(
const int numLanes);
789 myOpposingSegment = s;
800 virtual DtTmpGeometry* temporaryGeometry() ;
811 virtual void findRightMostAlignedLane(
DtRoadSegment* nextSegment,
812 int& rightMostLane,
int& nextSegmentRightMostLane,
813 int& numAlignedLanes);
819 virtual void findLeftMostAlignedLane(
DtRoadSegment* nextSegment,
820 int& leftMostLane,
int& nextSegmentLeftMostLane,
821 int& numAlignedLanes);
double myExitCurveStartOffset
Similarly, where the exit curve starts, relative to the end of the segment.
Definition: roadSegment.h:924
virtual bool hasYellowIndication(const DtAppearance *app) const
Definition: roadSegment.h:90
virtual bool isIntersectionApproach() const
Definition: roadSegment.h:760
virtual double freeFlowSpeed() const
Definition: roadSegment.h:776
virtual bool isOpposing() const
Definition: roadSegment.h:792
virtual void setExitCurveStartOffset(const double o)
Definition: roadSegment.h:758
virtual double minIntersectionBendAngle()
This defines how much of an angle between segments is required for the connection to be considered an...
Definition: roadSegment.h:845
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
virtual void setAllAltitudesDetermined(const bool b)
Definition: roadSegment.h:592
virtual double stopLineSetBack() const
Definition: roadSegment.h:763
double myDesiredLeftEdgeEntryRadius
Desired R for the segment left edge.
Definition: roadSegment.h:413
virtual int laneNumber() const
Definition: roadSegment.h:212
bool myEntryBendsRight
Refers to the connection from the upstream segment:
Definition: roadSegment.h:916
DtRoadSegment * myOpposingSegment
Only valid if not a one-way segment.
Definition: roadSegment.h:935
virtual double intrxThresholdAngleToConnectAllLanes()
This defines a threshold between segments at an intersection that determines whether all aligned lane...
Definition: roadSegment.h:874
int myConnectingUpstreamLane
Upstream connecting lane.
Definition: roadSegment.h:362
virtual void setRoadName(const DtString &name)
Definition: roadSegment.h:720
virtual void setParentRoadSegment(DtRoadSegment *parent)
Definition: roadSegment.h:216
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
virtual double speedLimit() const
Definition: roadSegment.h:766
virtual int connectingDownstreamLane() const
Definition: roadSegment.h:260
virtual double minimumLaneWidth()
The minimum lane width expected from the feature data.
Definition: roadSegment.h:892
virtual void setStopLineSetBack(const double sb)
Definition: roadSegment.h:764
DtTrafficControlIndication myTrafficControlIndication
Definition: roadSegment.h:104
double myLength
The length of the underlying road feature, ie the rail segment.
Definition: roadSegment.h:900
virtual const DtLaneSegment * lanes() const
Definition: roadSegment.h:737
Definition: roadSegment.h:382
Definition: roadSegment.h:380
bool myAllAltitudesDetermined
Definition: roadSegment.h:908
virtual DtRoadSegment * parentRoadSegment() const
Definition: roadSegment.h:215
virtual void setIsOpposing(const bool opposing)
Definition: roadSegment.h:793
double myStraightSectionLength
This is the length of the straight section between the entry and exit curves.
Definition: roadSegment.h:183
double myExitCurveLength
Definition: roadSegment.h:188
virtual double entryCurveEndOffset() const
Definition: roadSegment.h:754
virtual int numLanes() const
Definition: roadSegment.h:733
virtual void setOpposingSegment(DtRoadSegment *s)
Definition: roadSegment.h:787
double myMinExitCurveSpace
Definition: roadSegment.h:422
double myExitCurveStartOffset
This offset is normally negative, meaning that the curve starts before the end of the segment...
Definition: roadSegment.h:192
virtual void setLength(const double l)
Definition: roadSegment.h:711
double mySpeedLimit
If available; 0 indicates not set.
Definition: roadSegment.h:956
virtual DtLaneSegment * lanes()
Definition: roadSegment.h:736
Definition: roadSegment.h:50
DtRailSegment are segments entities can follow when using the rail movement system.
Definition: railSegment.h:23
virtual const DtCoordTransform & segmentToLocalTransform() const
Converts from a road-segment coordinate system to local database coordinates.
Definition: roadSegment.h:727
double myDesiredExitCurveSpace
Definition: roadSegment.h:421
Definition: roadSegment.h:51
virtual bool hasGreenIndication(const DtAppearance *app) const
Definition: roadSegment.h:95
int myNumberLanes
Definition: roadSegment.h:938
double myExitCurveRadius
Exit curve, at end of segment:
Definition: roadSegment.h:187
double myExitLaneIntersectSetback
Definition: roadSegment.h:420
int myConnectingDownstreamLane
What lane this connects to in the downstream segment.
Definition: roadSegment.h:359
int myExitInsideLaneNum
Ditto for exit curve.
Definition: roadSegment.h:419
virtual double length() const
This is the length of the associated rail segment.
Definition: roadSegment.h:710
int myEntryInsideLaneNum
The inside lane that connects, ie generates the radius constraint.
Definition: roadSegment.h:403
virtual void setNextRoadSegment(DtRoadSegment *s)
Definition: roadSegment.h:780
DtTrafficControlIndication
Definition: roadSegment.h:46
std::list< DtRoadSegment * > DtRoadSegmentList
Definition: roadSegment.h:373
virtual void setEntryCurveEndOffset(const double o)
Definition: roadSegment.h:755
double myEntryCurveRadius
Entry curve:Arc radius.
Definition: roadSegment.h:167
virtual void setNumLanes(const int nLanes)
Definition: roadSegment.h:734
A class to hold the initially computed geometry for the inside lane of each segment in the path; used...
Definition: roadSegment.h:397
bool myIsOpposing
Indicates that this segment goes in the opposite direction of the related rail segment.
Definition: roadSegment.h:972
double myMedianWidth
The width of the median in this (2-way) segment.
Definition: roadSegment.h:964
double myNextHeading
The segment downstream:
Definition: roadSegment.h:912
virtual void setPreviousRoadSegment(DtRoadSegment *s)
Definition: roadSegment.h:783
virtual double exitCurveStartOffset() const
Definition: roadSegment.h:757
double myPositionAlongLane
Definition: roadSegment.h:107
Definition: coordSystem.h:54
virtual double medianWidth() const
Width of the median.
Definition: roadSegment.h:715
double myStopLineSetback
Distance before end of straight segment where stop line is located.
Definition: roadSegment.h:953
virtual void setSpeedLimit(const double limit)
Definition: roadSegment.h:767
DtRoadSegment * myNextSegment
Definition: roadSegment.h:932
virtual void setMedianWidth(const double w)
Definition: roadSegment.h:716
virtual DtString roadName() const
Name of the road containing this segment.
Definition: roadSegment.h:719
virtual bool entryIsRightTurn() const
Indicates a positive heading change from the previous segment to this one, and that lanes to the righ...
Definition: roadSegment.h:751
virtual DtRoadSegment * opposingSegment() const
Definition: roadSegment.h:786
bool myIsOneWay
Definition: roadSegment.h:933
DtLaneGeometry myGeometry
Definition: roadSegment.h:352
double myWidth
Definition: roadSegment.h:195
virtual double intrxThresholdAngleToConnectEdgeLanes()
This defines a threshold between segments at an intersection that determines how lanes are connected...
Definition: roadSegment.h:861
virtual bool exitIsRightTurn() const
Definition: roadSegment.h:742
double myEntryLaneIntersectSetback
The offset (along the lane) from the start of the segment (straight part) that the inside lane inters...
Definition: roadSegment.h:406
virtual DtRoadSegment * nextRoadSegment() const
Definition: roadSegment.h:779
virtual void setIsOneWay(const bool oneWay)
Definition: roadSegment.h:740
Description of one lane of a DtRoadSegment.
Definition: roadSegment.h:114
Definition: roadSegment.h:381
virtual void setFreeFlowSpeed(const double ff)
Definition: roadSegment.h:777
virtual bool allAltitudesDetermined() const
This indicates that the altitude lookups needed to make the mySegmentToLocal transform (start and end...
Definition: roadSegment.h:591
double myEntryCurveEndOffset
The offset in X from the segment origin to the end of the entry arc; marks the beginning of the strai...
Definition: roadSegment.h:175
double myLaneOffsetDistance
This is the lateral offset (in y) from the segment origin to the centerline of this lane...
Definition: roadSegment.h:157
virtual int connectingUpstreamLane() const
Definition: roadSegment.h:265
double myMinEntryCurveSpace
Distance from lane intersection to the end of a curve of min radius.
Definition: roadSegment.h:410
virtual void setConnectingUpstreamLane(const int lane)
Definition: roadSegment.h:266
virtual void setExitIsRightTurn(const bool r)
Definition: roadSegment.h:743
virtual bool isOneWay() const
Definition: roadSegment.h:739
DtTrafficControlDevice * myTrafficSignal
Not currently used (future work); the traffic control device controlling traffic flow in the lane of ...
Definition: roadSegment.h:356
DtTmpGeometry myTmpGeometry
This information is used when constructing the road path to find modifications to the segments when t...
Definition: roadSegment.h:980
DtRoadSegmentPart
This enumeration is a convenience for indicating what part of the lane geometry a point is on...
Definition: roadSegment.h:377
DtRoadSegment * myRoadSegment
The road segment this lane belongs to.
Definition: roadSegment.h:365
double myEntryCurveEndOffset
TODO – the following two members aren't used.
Definition: roadSegment.h:921
Definition: roadSegment.h:49
Definition: roadSegment.h:52
virtual void setConnectingDownstreamLane(const int lane)
Definition: roadSegment.h:261
bool myIsStatic
True for fixed indications–none, Stop, Yield, blinkers.
Definition: roadSegment.h:103
virtual DtRoadSegment * previousRoadSegment() const
Definition: roadSegment.h:782
A traffic control device for intersection flow, ie stop and yield signs, traffic lights, etc.
Definition: roadSegment.h:37
DtString myRoadName
The name of the road.
Definition: roadSegment.h:967
virtual double heading() const
Definition: roadSegment.h:703
The geometry of the lane, especially the parameters of the circular arcs that define the entry and ex...
Definition: roadSegment.h:149
double myDesiredEntryCurveSpace
Distance from lane intersection to the end of the curve of desired radius.
Definition: roadSegment.h:408
Description of one segment of a road.
Definition: roadSegment.h:390
double myFreeFlowSpeed
This is the speed traffic flows on average, irrespective of the legal speed limit above...
Definition: roadSegment.h:961
const DtVrfObject * myTrafficLight
If and only if the TCD is not static, then consult this for indication:
Definition: roadSegment.h:106
Definition: roadSegment.h:54
virtual bool hasRedIndication(const DtAppearance *app) const
Definition: roadSegment.h:85
DtLaneSegment * myLanes
A vector of lanes, with lane 0 the right-most, and lane myNumberLanes-1 the left-most (or vice versa ...
Definition: roadSegment.h:943
Definition: roadSegment.h:379
virtual void setHeading(const double h)
Definition: roadSegment.h:704
virtual void setIsIntersectionApproach(const bool i)
Definition: roadSegment.h:761
double myDesiredLeftEdgeExitRadius
Definition: roadSegment.h:423
bool myExitBendsRight
Refers to the connection to the downstream segment:
Definition: roadSegment.h:914
int myLaneNumber
The array index of this lane in the road segment's array of lanes.
Definition: roadSegment.h:368
Definition: roadSegment.h:53
virtual void setEntryIsRightTurn(const bool r)
Definition: roadSegment.h:752
voidpf uLong offset
Definition: ioapi.h:42
virtual void setLaneNumber(const int lane)
Definition: roadSegment.h:213
DtCoordTransform mySegmentToLocal
Coordinate transformation from segment coordinates to local database coordinates. ...
Definition: roadSegment.h:906
DtRoadSegment * myPreviousSegment
These come directly from the rail path, thus there is a connection to only on other road segment befo...
Definition: roadSegment.h:931
double myHeading
Definition: roadSegment.h:910
bool myIsIntersectionApproach
Indicates that the connection at the downstream end is an intersection.
Definition: roadSegment.h:949
virtual double nonIntrxThresholdAngleToConnectEdgeLanes()
Same as above, but for segments that define a bend in a through street rather than an intersection...
Definition: roadSegment.h:887
Definition: roadSegment.h:48
virtual void setSegmentToLocalTransform(const DtCoordTransform &xform)
Definition: roadSegment.h:728
Definition: roadSegment.h:55
double myEntryCurveLength
This is the length of the arc from the midpoint of the turn to where it joins the straight part of th...
Definition: roadSegment.h:171