VR-Forces 4.1 Class Documentation
railMovementDriver.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
14 #include <matrix/vlVector.h>
15 
16 class DtRailSegment;
19 class DtVrfObject;
20 
24 
26 #include "railObstructionFinder.h"
27 #include "railObstructionInfo.h"
30 {
31 public:
32 
35  DtRailMovementDriver(DtRailMovementController * parentController,bool drivingOnLeft, bool allowPassing,
36  double lookAhead, double hitTime);
37 
39  virtual ~DtRailMovementDriver();
40 
41  virtual void setEntityState(DtVrfMovingObjectStateRepository* state);
42 
45  virtual double findDrivingSpeed(bool useAcceleration, DtVrfObject* convoyTgt = 0, const double followDist = 0.0, const bool useCatchUpSpeed = true);
46 
47  virtual double calculateCurrentBrakingDistance() const;
48 
49  virtual void setCurrentSegment(DtRailSegment * seg);
50  virtual DtRailSegment* currentSegment();
51 
52  virtual void setTurnSpeed(const double speed);
53  virtual const double turnSpeed() const;
54 
56  virtual double determineSpeedGivenObs(const double drivingSpeed,
57  const double hitTime, const DtRailObstructionPtr& obs) const;
58 
59 
60  virtual bool isSwitchingLeft(const int current, const int passing) const;
61  virtual bool isSwitchingRight(const int current, const int passing) const;
62 
64  virtual int findClosestLaneToDrivingLane(const int current, const int driving, const DtRailSegment* road) const;
65 
66  virtual bool isObstructionConvoyTarget(const int lane, DtRailObstructionPtr &anObstruction, DtString convoyTgt) const;
67 
71  virtual bool isLaneObstructed(const int lane, DtRailObstructionAnalyzer &analyzer,
72  bool checkForwardOnly = false) const;
73 
74  virtual bool isObstructionStoppedOrSlow(double speed, DtRailObstructionPtr& obs) const;
75 
76  virtual bool isDrivingLane(const int current, const int driving) const;
77 
78 
79  virtual int findOpenLeftLane(const int lane, const DtRailSegment* road, DtRailObstructionAnalyzer &analyzer) const;
80 
81  virtual int findOpenRightLane(const int lane, const DtRailSegment* road, DtRailObstructionAnalyzer &analyzer) const;
82 
93  virtual int findOpenLane(const int lane, const int passing, const DtRailSegment* road,
94  DtRailObstructionAnalyzer &analyzer, bool checkOpposite = false) const;
95 
97  virtual bool isTooCloseToObs(const DtRailObstructionPtr &nextObs, double bvRadiusSq ) const;
98 
99  virtual bool allowPassing()
100  {
101  return myAllowPassing;
102  }
103 
104 protected:
105 
108 
111  const DtRailMovementDriver& orig);
112 
114  DtRailMovementDriver& operator=(
115  const DtRailMovementDriver& orig);
116 
117 protected:
118 
121 
124  double myTurnSpeed;
125  double myHitTime;
127 
131 };
132 
133 

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)