Definition at line 757 of file NBEdge.h.
Public Types | |
| enum | Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD } |
| enum of possible directions More... | |
Public Member Functions | |
| bool | empty () const |
| bool | includes (Direction d) const |
| MainDirections (const std::vector< NBEdge * > &outgoing, NBEdge *parent, NBNode *to) | |
| constructor | |
| ~MainDirections () | |
| destructor | |
Data Fields | |
| std::vector< Direction > | myDirs |
Private Member Functions | |
| MainDirections (const MainDirections &) | |
| Invalidated copy constructor. | |
| MainDirections & | operator= (const MainDirections &) |
| Invalidated assignment operator. | |
enum of possible directions
Definition at line 760 of file NBEdge.h.
00760 { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
| NBEdge::MainDirections::MainDirections | ( | const std::vector< NBEdge * > & | outgoing, | |
| NBEdge * | parent, | |||
| NBNode * | to | |||
| ) |
constructor
Definition at line 97 of file NBEdge.cpp.
References DIR_FORWARD, DIR_LEFTMOST, DIR_RIGHTMOST, NBEdge::getJunctionPriority(), NBNode::getMMLDirection(), MMLDIR_STRAIGHT, and myDirs.
00098 { 00099 if (outgoing.size()==0) { 00100 return; 00101 } 00102 // check whether the right turn has a higher priority 00103 assert(outgoing.size()>0); 00104 if (outgoing[0]->getJunctionPriority(to)==1) { 00105 myDirs.push_back(MainDirections::DIR_RIGHTMOST); 00106 } 00107 // check whether the left turn has a higher priority 00108 if (outgoing.back()->getJunctionPriority(to)==1) { 00109 // ok, the left turn belongs to the higher priorised edges on the junction 00110 // let's check, whether it has also a higher priority (lane number/speed) 00111 // than the current 00112 std::vector<NBEdge*> tmp(outgoing); 00113 sort(tmp.begin(), tmp.end(), NBContHelper::edge_similar_direction_sorter(parent)); 00114 if (outgoing.back()->getPriority()>tmp[0]->getPriority()) { 00115 myDirs.push_back(MainDirections::DIR_LEFTMOST); 00116 } else { 00117 if (outgoing.back()->getNoLanes()>tmp[0]->getNoLanes()) { 00118 myDirs.push_back(MainDirections::DIR_LEFTMOST); 00119 } 00120 } 00121 } 00122 // check whether the forward direction has a higher priority 00123 // try to get the forward direction 00124 std::vector<NBEdge*> tmp(outgoing); 00125 sort(tmp.begin(), tmp.end(), NBContHelper::edge_similar_direction_sorter(parent)); 00126 NBEdge *edge = *(tmp.begin()); 00127 // check whether it has a higher priority and is going straight 00128 if (edge->getJunctionPriority(to)==1 && to->getMMLDirection(parent, edge)==MMLDIR_STRAIGHT) { 00129 myDirs.push_back(MainDirections::DIR_FORWARD); 00130 } 00131 }
| NBEdge::MainDirections::~MainDirections | ( | ) |
| NBEdge::MainDirections::MainDirections | ( | const MainDirections & | ) | [private] |
Invalidated copy constructor.
| bool NBEdge::MainDirections::empty | ( | ) | const |
returns the information whether no following street has a higher priority
Definition at line 138 of file NBEdge.cpp.
References myDirs.
Referenced by NBEdge::preparePriorities().
00138 { 00139 return myDirs.empty(); 00140 }
returns the information whether the street in the given direction has a higher priority
Definition at line 144 of file NBEdge.cpp.
References myDirs.
Referenced by NBEdge::preparePriorities().
| MainDirections& NBEdge::MainDirections::operator= | ( | const MainDirections & | ) | [private] |
Invalidated assignment operator.
| std::vector<Direction> NBEdge::MainDirections::myDirs |
list of the main direction within the following junction relative to the edge
Definition at line 764 of file NBEdge.h.
Referenced by empty(), includes(), and MainDirections().
1.5.6