本文整理汇总了C++中getShape函数的典型用法代码示例。如果您正苦于以下问题:C++ getShape函数的具体用法?C++ getShape怎么用?C++ getShape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getShape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getShape
void
GNELane::updateGeometry() {
myShapeRotations.clear();
myShapeLengths.clear();
//SUMOReal length = myParentEdge.getLength(); // @todo see ticket #448
// may be different from length
int segments = (int) getShape().size() - 1;
if (segments >= 0) {
myShapeRotations.reserve(segments);
myShapeLengths.reserve(segments);
for (int i = 0; i < segments; ++i) {
const Position& f = getShape()[i];
const Position& s = getShape()[i + 1];
myShapeLengths.push_back(f.distanceTo2D(s));
myShapeRotations.push_back((SUMOReal) atan2((s.x() - f.x()), (f.y() - s.y())) * (SUMOReal) 180.0 / (SUMOReal) PI);
}
}
// Update geometry of additionals vinculated with this lane
for(AdditionalVector::iterator i = myAdditionals.begin(); i != myAdditionals.end(); i++) {
(*i)->updateGeometry();
}
// Update geometry of additionalSets vinculated to this lane
for (AdditionalSetVector::iterator i = myAdditionalSets.begin(); i != myAdditionalSets.end(); ++i) {
(*i)->updateGeometry();
}
}
示例2: createBall
void BreakoutMainScene::createBall()
{
// Create Ball
cocos2d::log("Create Ball");
// Tao qua bong va thiet lap khung vat ly cho no
ball = Sprite::create("breakout_img/breakout_ball.png");
ball->setAnchorPoint(Vec2::ANCHOR_MIDDLE);
ball->setPosition(Vec2(WINSIZE.width/2 , WINSIZE.height/2 + 50));
auto ballBody = PhysicsBody::createCircle(ball->getContentSize().width/2 , PHYSICSBODY_MATERIAL_DEFAULT);
ballBody->getShape(0)->setDensity(1.0f); // trong luc
ballBody->getShape(0)->setFriction(0.0f);
ballBody->getShape(0)->setRestitution(1.0f);
ballBody->setDynamic(true);
ballBody->setContactTestBitmask(0x00000001);
ballBody->setGravityEnable(false); // Khong set gia toc
// Tao 1 luc tac dong
Vect force = Vect(900000.0f, -900000.0f);
ballBody->applyImpulse(force);
ball->setPhysicsBody(ballBody);
ball->setTag(Tag::T_Ball);
this->addChild(ball);
}
示例3: gravity
Scene* GameScene24::createScene() {
auto scene = Scene::createWithPhysics();
Vect gravity(0,0);
scene->getPhysicsWorld()->setGravity(gravity);
//开启测试模式
//scene->getPhysicsWorld()->setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);
//创建一个世界
Size visibleSize = Director::getInstance()->getVisibleSize();
//创建一个空心盒子刚体,作为我们游戏世界的边界(避免游戏内的物体跑出屏幕)
//参数分别是刚体大小。材质(其实就是我们一些预设的数据)、边线厚度
auto body = PhysicsBody::createEdgeBox(Size(visibleSize.width,visibleSize.height),PHYSICSBODY_MATERIAL_DEFAULT,3);
body->getShape(0)->setFriction(0.0f);
body->getShape(0)->setRestitution(1.001f);
body->getShape(0)->setDensity(1.0f);
//创建一个节点用于承载刚体,这样刚体就能参与到游戏的物理世界
auto node = Node::create();
node->setPosition(visibleSize.width/2,visibleSize.height/2);
node->setPhysicsBody(body);
scene->addChild(node);
auto layer = GameScene24::create();
scene->addChild(layer);
return scene;
}
示例4: glPushMatrix
void
GUILane::drawCrossties(const GUIVisualizationSettings& s, SUMOReal scale) const {
glPushMatrix();
glPushName(0);
if (!MSGlobals::gUseMesoSim) {
setColor(s);
}
// draw on top of of the white area between the rails
glTranslated(0, 0, 0.1);
int e = (int) getShape().size() - 1;
for (int i = 0; i < e; ++i) {
glPushMatrix();
glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1);
glRotated(myShapeRotations[i], 0, 0, 1);
for (SUMOReal t = 0; t < myShapeLengths[i]; t += 1) {
glBegin(GL_QUADS);
glVertex2d(-1 * scale, -t);
glVertex2d(-1 * scale, -t - 0.3);
glVertex2d(1.0 * scale, -t - 0.3);
glVertex2d(1.0 * scale, -t);
glEnd();
}
glPopMatrix();
}
glPopMatrix();
glPopName();
}
示例5: getLinkNumber
void
GUILaneWrapper::drawArrows() const {
unsigned int noLinks = getLinkNumber();
if (noLinks == 0) {
return;
}
// draw all links
const Position& end = getShape().back();
const Position& f = getShape()[-2];
SUMOReal rot = (SUMOReal) atan2((end.x() - f.x()), (f.y() - end.y())) * (SUMOReal) 180.0 / (SUMOReal) PI;
glPushMatrix();
glPushName(0);
glColor3d(1, 1, 1);
glTranslated(end.x(), end.y(), 0);
glRotated(rot, 0, 0, 1);
for (unsigned int i = 0; i < noLinks; ++i) {
LinkDirection dir = getLane().getLinkCont()[i]->getDirection();
LinkState state = getLane().getLinkCont()[i]->getState();
if (state == LINKSTATE_TL_OFF_NOSIGNAL || dir == LINKDIR_NODIR) {
continue;
}
switch (dir) {
case LINKDIR_STRAIGHT:
GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 4), Position(0, 1)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_TURN:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05);
GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0.5, 2.5), Position(0.5, 4)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_LEFT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_RIGHT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_PARTLEFT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_PARTRIGHT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
break;
default:
break;
}
}
glPopMatrix();
glPopName();
}
示例6: getShape
void
GUILane::drawArrows() const {
if (myLinks.size() == 0) {
return;
}
// draw all links
const Position& end = getShape().back();
const Position& f = getShape()[-2];
const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
glPushMatrix();
glPushName(0);
glColor3d(1, 1, 1);
glTranslated(end.x(), end.y(), 0);
glRotated(rot, 0, 0, 1);
for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
LinkDirection dir = (*i)->getDirection();
LinkState state = (*i)->getState();
if (state == LINKSTATE_TL_OFF_NOSIGNAL || dir == LINKDIR_NODIR) {
continue;
}
switch (dir) {
case LINKDIR_STRAIGHT:
GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 4), Position(0, 1)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_TURN:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05);
GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0.5, 2.5), Position(0.5, 4)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_LEFT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_RIGHT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_PARTLEFT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
break;
case LINKDIR_PARTRIGHT:
GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
break;
default:
break;
}
}
glPopMatrix();
glPopName();
}
示例7: GUIGLObjectPopupMenu
GUIGLObjectPopupMenu*
GNELane::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) {
GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
buildPopupHeader(ret, app);
buildCenterPopupEntry(ret);
new FXMenuCommand(ret, "Copy edge name to clipboard", 0, ret, MID_COPY_EDGE_NAME);
buildNameCopyPopupEntry(ret);
buildSelectionPopupEntry(ret);
buildPositionCopyEntry(ret, false);
const int editMode = parent.getVisualisationSettings()->editMode;
myTLSEditor = 0;
if (editMode != GNE_MODE_CONNECT && editMode != GNE_MODE_TLS && editMode != GNE_MODE_CREATE_EDGE) {
new FXMenuCommand(ret, "Split edge here", 0, &parent, MID_GNE_SPLIT_EDGE);
new FXMenuCommand(ret, "Split edges in both direction here", 0, &parent, MID_GNE_SPLIT_EDGE_BIDI);
new FXMenuCommand(ret, "Reverse edge", 0, &parent, MID_GNE_REVERSE_EDGE);
new FXMenuCommand(ret, "Add reverse direction", 0, &parent, MID_GNE_ADD_REVERSE_EDGE);
new FXMenuCommand(ret, "Set geometry endpoint here", 0, &parent, MID_GNE_SET_EDGE_ENDPOINT);
new FXMenuCommand(ret, "Restore geometry endpoint", 0, &parent, MID_GNE_RESET_EDGE_ENDPOINT);
if (gSelected.isSelected(GLO_LANE, getGlID())) {
new FXMenuCommand(ret, "Straighten selected Edges", 0, &parent, MID_GNE_STRAIGHTEN);
} else {
new FXMenuCommand(ret, "Straighten edge", 0, &parent, MID_GNE_STRAIGHTEN);
}
if (gSelected.isSelected(GLO_LANE, getGlID())) {
new FXMenuCommand(ret, "Duplicate selected lanes", 0, &parent, MID_GNE_DUPLICATE_LANE);
} else {
new FXMenuCommand(ret, "Duplicate lane", 0, &parent, MID_GNE_DUPLICATE_LANE);
}
} else if (editMode == GNE_MODE_TLS) {
myTLSEditor = static_cast<GNEViewNet&>(parent).getViewParent()->getTLSEditorFrame();
if (myTLSEditor->controlsEdge(myParentEdge)) {
new FXMenuCommand(ret, "Select state for all links from this edge:", 0, 0, 0);
const std::vector<std::string> names = GNEInternalLane::LinkStateNames.getStrings();
for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); it++) {
FXuint state = GNEInternalLane::LinkStateNames.get(*it);
FXMenuRadio* mc = new FXMenuRadio(ret, (*it).c_str(), this, FXDataTarget::ID_OPTION + state);
mc->setSelBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state)));
mc->setBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state)));
}
}
} else {
FXMenuCommand* mc = new FXMenuCommand(ret, "Additional options available in 'Inspect Mode'", 0, 0, 0);
mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), 0);
}
// buildShowParamsPopupEntry(ret, false);
new FXMenuSeparator(ret);
const SUMOReal pos = getShape().nearest_offset_to_point2D(parent.getPositionInformation());
const SUMOReal height = getShape().positionAtOffset2D(getShape().nearest_offset_to_point2D(parent.getPositionInformation())).z();
new FXMenuCommand(ret, ("Shape pos: " + toString(pos)).c_str(), 0, 0, 0);
new FXMenuCommand(ret, ("Length pos: " + toString(getPositionRelativeToShapeLenght(pos))).c_str(), 0, 0, 0);
new FXMenuCommand(ret, ("Height: " + toString(height)).c_str(), 0, 0, 0);
// new FXMenuSeparator(ret);
// buildPositionCopyEntry(ret, false);
// let the GNEViewNet store the popup position
(dynamic_cast<GNEViewNet&>(parent)).markPopupPosition();
return ret;
}
示例8: getShape
void ShapeControlPainter::_paintVertices(QPainter *painter, const QList<int>& selectedVertices)
{
qreal zoomFactor = _shapeItem->getCanvas()->getZoomFactor();
qreal selectRadius = MM::VERTEX_SELECT_RADIUS / zoomFactor;
qreal strokeWidth = MM::VERTEX_SELECT_STROKE_WIDTH / zoomFactor;
for (int i=0; i<getShape()->nVertices(); i++)
Util::drawControlsVertex(painter, getShape()->getVertex(i), selectedVertices.contains(i), selectRadius, strokeWidth);
}
示例9: updatePos
void CircleGameObject::updatePos() {
PhysicsObject::updatePos();
if (getShape() != NULL) {
float lowerBound = -Context::getInstance()->getH();
if (getShape()->getCenter().y() < lowerBound) {
setDeleted(true);
}
}
}
示例10: getShape
void ShapeControlPainter::_paintVertices(QPainter *painter, MapperGLCanvas* canvas, const QList<int>& selectedVertices)
{
qreal zoomFactor = canvas->getZoomFactor();
qreal selectRadius = (getShape()->isLocked() ? MM::VERTEX_LOCKED_RADIUS : MM::VERTEX_SELECT_RADIUS) / zoomFactor;
qreal strokeWidth = MM::VERTEX_SELECT_STROKE_WIDTH / zoomFactor;
for (int i=0; i<getShape()->nVertices(); i++)
Util::drawControlsVertex(painter, getShape()->getVertex(i), selectedVertices.contains(i), getShape()->isLocked(), selectRadius, strokeWidth);
}
示例11: getShape
void SelectedItem::updateGeometry(int, int)
{
if (hasShape())
{
getShape()->setInnerSize(selectedItem_->width(), selectedItem_->height());
QPointF pos = QPointF( getShape()->contentLeft(), getShape()->contentTop() );
setPos(selectedItem_->mapToScene(0,0) - pos);
}
}
示例12: init
// on "init" you need to initialize your instance
bool GameScene::init()
{
//////////////////////////////
// 1. super init first
if (!Layer::init())
{
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
auto backgroundSprite = Sprite::create("Background.png");
backgroundSprite->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));
this->addChild(backgroundSprite);
//borders collision
auto edgeBody = PhysicsBody::createEdgeBox(visibleSize, PHYSICSBODY_MATERIAL_DEFAULT, 3);
edgeBody->getShape(0)->setRestitution(1.0f);
edgeBody->getShape(0)->setFriction(0.0f);
edgeBody->getShape(0)->setDensity(1.0f);
auto edgeNode = Node::create();
edgeNode->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));
edgeBody->setCollisionBitmask(WALL_COLLISION_BITMASK);
edgeNode->setPhysicsBody(edgeBody);
this->addChild(edgeNode);
edgeNode->setTag(0);
paddle = new Paddle(this);
ball = new Ball(this);
int arrbrick[50];
GameScene::spawnBricks();
auto contactListener = EventListenerPhysicsContact::create();
contactListener->onContactBegin = CC_CALLBACK_1(GameScene::onContactBegin, this);
Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(contactListener, this);
auto listener = EventListenerTouchOneByOne::create();
listener->setSwallowTouches(true);
listener->onTouchBegan = CC_CALLBACK_2(GameScene::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(GameScene::onTouchMoved, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
score = 0;
__String *tempScore = __String::createWithFormat("%i", score);
scoreLabel = Label::createWithTTF(tempScore->getCString(), "fonts/Marker Felt.ttf", visibleSize.height * SCORE_FONT_SIZE);
scoreLabel->setColor(Color3B::WHITE);
scoreLabel->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height * 0.75 + origin.y));
this->addChild(scoreLabel, 10000);
this->scheduleUpdate();
return true;
}
示例13: assert
void CollisionObject::update(Real t, Matrix4& m)
{
assert(is_attached);
mForcedUpdate = true; ///FIXME Blah. Do we really need this?
if(mForcedUpdate)
{
mNeedsUpdating = true;
}
else
{
Vector3 p0(old_matrix[0][3], old_matrix[1][3], old_matrix[2][3]);
Vector3 v0(new_matrix[0][3], new_matrix[1][3], new_matrix[2][3]);
Vector3 moved = p0 - v0;
bool hasMoved = (moved != Vector3::ZERO);
mNeedsUpdating = hasMoved;
}
//if(mNeedsUpdating)
//{
// getShape()->computeIceABB();
//}
old_matrix = new_matrix;
old_pos = new_pos;
new_matrix = m;
new_pos = getShape()->getParentSceneNode()->_getDerivedPosition();
// Get center in world space.
Vector3 lMin,lMax;
getShape()->getMinMax(lMin,lMax);
lMax-=lMin;
mRadius = lMax.length()*0.5;
old_minv = minv;
old_maxv = maxv;
getShape()->getMinMax(minv,maxv);
// if old_matrix etc are not yet valid,
// initialize with the current values, to prevent "startup popping"
bool oldValsInvalid = (m_tdelta <= 0.0);
if (oldValsInvalid)
{
old_matrix = new_matrix;
old_pos = new_pos;
old_minv = minv;
old_maxv = maxv;
}
m_tdelta = t;
}
示例14: createPips
void GameLayer::createPips() {
for (int i = 0; i < 2; i++) {
auto pipeUp = Sprite::createWithSpriteFrame(
AtlasLoader::getInstance()->getSpriteFrameByName("pipe_up"));
auto pipeDown = Sprite::createWithSpriteFrame(
AtlasLoader::getInstance()->getSpriteFrameByName("pipe_down"));
pipeUp->setPosition(Vec2(0, -(PIPE_HEIGHT + PIPE_DISTANCE) / 2));
pipeDown->setPosition(Vec2(0, (PIPE_HEIGHT + PIPE_DISTANCE) / 2));
//创建物理属性
auto pipeUpBody = PhysicsBody::createBox(pipeUp->getContentSize(), PHYSICSSHAPE_MATERIAL_DEFAULT, Vec2::ZERO);
//设置为静态刚体
pipeUpBody->setDynamic(false);
pipeUpBody->getShape(0)->setRestitution(0.0f);
//设置刚体密度
pipeUpBody->getShape(0)->setDensity(1.0f);
pipeUpBody->setCategoryBitmask(OBST_MASK);
pipeUpBody->setCollisionBitmask(BIRD_MASK | OBST_MASK);
pipeUpBody->setContactTestBitmask(BIRD_MASK | OBST_MASK);
pipeUp->setPhysicsBody(pipeUpBody);
auto pipeDownBody = PhysicsBody::createBox(pipeDown->getContentSize(), PHYSICSSHAPE_MATERIAL_DEFAULT, Vec2::ZERO);
//设置为静态刚体
pipeDownBody->setDynamic(false);
pipeDownBody->getShape(0)->setRestitution(0.0f);
pipeDownBody->getShape(0)->setDensity(1.0f);
//设置碰撞掩码
pipeDownBody->setCategoryBitmask(OBST_MASK);
pipeDownBody->setCollisionBitmask(BIRD_MASK | OBST_MASK);
pipeDownBody->setContactTestBitmask(BIRD_MASK | OBST_MASK);
pipeDown->setPhysicsBody(pipeDownBody);
auto singlePipe = Node::create();
singlePipe->addChild(pipeUp);
singlePipe->addChild(pipeDown);
if (i == 0) {
singlePipe->setPosition(Vec2(SCREEN_WIDTH * 2 + PIPE_WIDHT / 2, 250));
} else {
singlePipe->setPosition(Vec2(SCREEN_WIDTH * 2.5f + PIPE_WIDHT, this->getRandomHeight()));
}
singlePipe->setTag(PIPE_NEW);
this->addChild(singlePipe);
this->pipes.pushBack(singlePipe);
}
}
示例15: switch
SUMOReal
GNELane::getColorValue(size_t activeScheme) const {
const SVCPermissions myPermissions = myParentEdge.getNBEdge()->getPermissions(myIndex);
switch (activeScheme) {
case 0:
switch (myPermissions) {
case SVC_PEDESTRIAN:
return 1;
case SVC_BICYCLE:
return 2;
case 0:
return 3;
case SVC_SHIP:
return 4;
default:
break;
}
if ((myPermissions & SVC_PASSENGER) != 0 || isRailway(myPermissions)) {
return 0;
} else {
return 5;
}
case 1:
return gSelected.isSelected(getType(), getGlID()) ||
gSelected.isSelected(GLO_EDGE, dynamic_cast<GNEEdge*>(&myParentEdge)->getGlID());
case 2:
return (SUMOReal)myPermissions;
case 3:
return myParentEdge.getNBEdge()->getLaneSpeed(myIndex);
case 4:
return myParentEdge.getNBEdge()->getNumLanes();
case 5: {
return myParentEdge.getNBEdge()->getLoadedLength() / myParentEdge.getNBEdge()->getLength();
}
// case 6: by angle (functional)
case 7: {
return myParentEdge.getNBEdge()->getPriority();
}
case 8: {
// color by z of first shape point
return getShape()[0].z();
}
// case 9: by segment height
case 10: {
// color by incline
return (getShape()[-1].z() - getShape()[0].z()) / myParentEdge.getNBEdge()->getLength();
}
}
return 0;
}