本文整理汇总了C++中NBNode::getLinkState方法的典型用法代码示例。如果您正苦于以下问题:C++ NBNode::getLinkState方法的具体用法?C++ NBNode::getLinkState怎么用?C++ NBNode::getLinkState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NBNode
的用法示例。
在下文中一共展示了NBNode::getLinkState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessError
void
GNELane::drawLane2LaneConnections() const {
glPushMatrix();
glPushName(0);
glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape
std::vector<NBEdge::Connection> connections = myParentEdge.getNBEdge()->getConnectionsFromLane(myIndex);
NBNode* node = myParentEdge.getNBEdge()->getToNode();
const Position& startPos = getShape()[-1];
for (std::vector<NBEdge::Connection>::iterator it = connections.begin(); it != connections.end(); it++) {
const LinkState state = node->getLinkState(
myParentEdge.getNBEdge(), it->toEdge, it->fromLane, it->toLane, it->mayDefinitelyPass, it->tlID);
switch (state) {
case LINKSTATE_TL_OFF_NOSIGNAL:
glColor3d(1, 1, 0);
break;
case LINKSTATE_TL_OFF_BLINKING:
glColor3d(0, 1, 1);
break;
case LINKSTATE_MAJOR:
glColor3d(1, 1, 1);
break;
case LINKSTATE_MINOR:
glColor3d(.4, .4, .4);
break;
case LINKSTATE_STOP:
glColor3d(.7, .4, .4);
break;
case LINKSTATE_EQUAL:
glColor3d(.7, .7, .7);
break;
case LINKSTATE_ALLWAY_STOP:
glColor3d(.7, .7, 1);
case LINKSTATE_ZIPPER:
glColor3d(.75, .5, 0.25);
break;
default:
throw ProcessError("Unexpected LinkState '" + toString(state) + "'");
}
const Position& endPos = it->toEdge->getLaneShape(it->toLane)[0];
glBegin(GL_LINES);
glVertex2f(startPos.x(), startPos.y());
glVertex2f(endPos.x(), endPos.y());
glEnd();
GLHelper::drawTriangleAtEnd(startPos, endPos, (SUMOReal) 1.5, (SUMOReal) .2);
}
glPopName();
glPopMatrix();
}