当前位置: 首页>>代码示例>>C++>>正文


C++ Boundary::add方法代码示例

本文整理汇总了C++中Boundary::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Boundary::add方法的具体用法?C++ Boundary::add怎么用?C++ Boundary::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Boundary的用法示例。


在下文中一共展示了Boundary::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NIVissimConnectionCluster

void
NIVissimNodeDef_Edges::searchAndSetConnections() {
    std::vector<int> connections;
    std::vector<int> edges;
    Boundary boundary;
    for (NIVissimNodeParticipatingEdgeVector::const_iterator i = myEdges.begin(); i != myEdges.end(); i++) {
        NIVissimNodeParticipatingEdge* edge = *i;
        NIVissimConnection* c =
            NIVissimConnection::dictionary(edge->getID());
        NIVissimEdge* e =
            NIVissimEdge::dictionary(edge->getID());
        if (c != 0) {
            connections.push_back(edge->getID());
            boundary.add(c->getFromGeomPosition());
            boundary.add(c->getToGeomPosition());
            c->setNodeCluster(myID);
        }
        if (e != 0) {
            edges.push_back(edge->getID());
            boundary.add(e->getGeomPosition(edge->getFromPos()));
            boundary.add(e->getGeomPosition(edge->getToPos()));
        }
    }
    NIVissimConnectionCluster* c =
        new NIVissimConnectionCluster(connections, boundary, myID, edges);
    for (std::vector<int>::iterator j = edges.begin(); j != edges.end(); j++) {
        NIVissimEdge* edge = NIVissimEdge::dictionary(*j);
        edge->myConnectionClusters.push_back(c);
    }
}
开发者ID:namnatulco,项目名称:sumo-complete,代码行数:30,代码来源:NIVissimNodeDef_Edges.cpp

示例2:

Boundary
GUIEdge::getBoundary() const {
    Boundary ret;
    if (getPurpose() != MSEdge::EDGEFUNCTION_DISTRICT) {
        for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
            ret.add((*i)->getShape().getBoxBoundary());
        }
    } else {
        // take the starting coordinates of all follower edges and the endpoints
        // of all successor edges
        for (MSEdgeVector::const_iterator it = mySuccessors.begin(); it != mySuccessors.end(); ++it) {
            const std::vector<MSLane*>& lanes = (*it)->getLanes();
            for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
                ret.add((*it_lane)->getShape().front());
            }
        }
        for (MSEdgeVector::const_iterator it = myPredecessors.begin(); it != myPredecessors.end(); ++it) {
            const std::vector<MSLane*>& lanes = (*it)->getLanes();
            for (std::vector<MSLane*>::const_iterator it_lane = lanes.begin(); it_lane != lanes.end(); ++it_lane) {
                ret.add((*it_lane)->getShape().back());
            }
        }
    }
    ret.grow(10);
    return ret;
}
开发者ID:planetsumo,项目名称:sumo,代码行数:26,代码来源:GUIEdge.cpp

示例3:

Boundary
GUILane::getCenteringBoundary() const {
    Boundary b;
    b.add(myShape[0]);
    b.add(myShape[-1]);
    b.grow(20);
    return b;
}
开发者ID:p1tt1,项目名称:sumo,代码行数:8,代码来源:GUILane.cpp

示例4: throw

Boundary
GUILaneWrapper::getCenteringBoundary() const throw() {
    Boundary b;
    b.add(myShape[0]);
    b.add(myShape[-1]);
    b.grow(20);
    return b;
}
开发者ID:NeziheSozen,项目名称:sumo,代码行数:8,代码来源:GUILaneWrapper.cpp

示例5: Boundary

void
NIVissimConnection::computeBounding() {
    Boundary *bound = new Boundary();
    bound->add(myFromDef.getGeomPosition());
    bound->add(myToDef.getGeomPosition());
    assert(myBoundary==0);
    myBoundary = bound;
}
开发者ID:NeziheSozen,项目名称:sumo,代码行数:8,代码来源:NIVissimConnection.cpp

示例6: Boundary

/* Test the method 'add' with multiple calls*/
TEST(Boundary, test_method_add_multiple) {
	Boundary *bound = new Boundary();
    bound->add(-1,-2);
	bound->add(3,5);
	bound->add(5,8);
	EXPECT_DOUBLE_EQ(bound->xmax(), 5);
	EXPECT_DOUBLE_EQ(bound->xmin(), -1);
	EXPECT_DOUBLE_EQ(bound->ymax(), 8);
	EXPECT_DOUBLE_EQ(bound->ymin(), -2);
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例7:

/* Test the method 'add' with multiple calls*/
TEST(Boundary, test_method_add_multiple) {
    Boundary bound;
    bound.add(-1,-2);
    bound.add(3,5);
    bound.add(5,8);
    EXPECT_DOUBLE_EQ(bound.xmax(), 5);
    EXPECT_DOUBLE_EQ(bound.xmin(), -1);
    EXPECT_DOUBLE_EQ(bound.ymax(), 8);
    EXPECT_DOUBLE_EQ(bound.ymin(), -2);
}
开发者ID:behrisch,项目名称:sumo,代码行数:11,代码来源:BoundaryTest.cpp

示例8: assert

void
NIVissimDisturbance::computeBounding() {
    assert(myBoundary == 0);
    Boundary* bound = new Boundary();
    if (NIVissimAbstractEdge::dictionary(myEdge.getEdgeID()) != nullptr) {
        bound->add(myEdge.getGeomPosition());
    }
    if (NIVissimAbstractEdge::dictionary(myDisturbance.getEdgeID()) != nullptr) {
        bound->add(myDisturbance.getGeomPosition());
    }
    myBoundary = bound;
    assert(myBoundary != 0 && myBoundary->xmax() >= myBoundary->xmin());
}
开发者ID:behrisch,项目名称:sumo,代码行数:13,代码来源:NIVissimDisturbance.cpp

示例9: getObjectsInBoundary

std::vector<GUIGlID>
GUISUMOAbstractView::getObjectsAtPosition(Position pos, SUMOReal radius) {
    Boundary selection;
    selection.add(pos);
    selection.grow(radius);
    const std::vector<GUIGlID> ids = getObjectsInBoundary(selection);
    std::vector<GUIGlID> result;
    // Interpret results
    for (std::vector<GUIGlID>::const_iterator it = ids.begin(); it != ids.end(); it++) {
        GUIGlID id = *it;
        GUIGlObject* o = GUIGlObjectStorage::gIDStorage.getObjectBlocking(id);
        if (o == 0) {
            continue;
        }
        if (o->getGlID() == 0) {
            continue;
        }
        //std::cout << "point selection hit " << o->getMicrosimID() << "\n";
        GUIGlObjectType type = o->getType();
        if (type != 0) {
            result.push_back(id);
        }
        GUIGlObjectStorage::gIDStorage.unblockObject(id);
    }
    return result;
}
开发者ID:kbleeck,项目名称:customSumo26,代码行数:26,代码来源:GUISUMOAbstractView.cpp

示例10:

Boundary
GUIPolygon::getCenteringBoundary() const {
    Boundary b;
    b.add(myShape.getBoxBoundary());
    b.grow(10);
    return b;
}
开发者ID:nnaren1902,项目名称:Secure-Vehicle-Platoon,代码行数:7,代码来源:GUIPolygon.cpp

示例11:

Boundary
PositionVector::getBoxBoundary() const {
    Boundary ret;
    for (const_iterator i = begin(); i != end(); i++) {
        ret.add(*i);
    }
    return ret;
}
开发者ID:RamonHPSilveira,项目名称:urbansim,代码行数:8,代码来源:PositionVector.cpp

示例12: getVehicleType

Boundary
GUIPerson::getCenteringBoundary() const {
    Boundary b;
    // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
    b.add(getPosition());
    b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
    return b;
}
开发者ID:planetsumo,项目名称:sumo,代码行数:8,代码来源:GUIPerson.cpp

示例13: y

Boundary
GUIPointOfInterest::getCenteringBoundary() const {
    Boundary b;
    b.add(x(), y());
    b.growWidth(myHalfImgWidth);
    b.growHeight(myHalfImgHeight);
    return b;
}
开发者ID:RamonHPSilveira,项目名称:urbansim,代码行数:8,代码来源:GUIPointOfInterest.cpp

示例14: initDetectors

void
GUINet::initGUIStructures() {
    // initialise detector storage for gui
    initDetectors();
    // initialise the tl-map
    initTLMap();
    // initialise edge storage for gui
    GUIEdge::fill(myEdgeWrapper);
    // initialise junction storage for gui
    size_t size = myJunctions->size();
    myJunctionWrapper.reserve(size);
    const std::map<std::string, MSJunction*> &junctions = myJunctions->getMyMap();
    for (std::map<std::string, MSJunction*>::const_iterator i=junctions.begin(); i!=junctions.end(); ++i) {
        myJunctionWrapper.push_back(new GUIJunctionWrapper(GUIGlObjectStorage::gIDStorage, *(*i).second));
    }
    // build the visualization tree
    float *cmin = new float[2];
    float *cmax = new float[2];
    for (std::vector<GUIEdge*>::iterator i=myEdgeWrapper.begin(); i!=myEdgeWrapper.end(); ++i) {
        GUIEdge *edge = *i;
        Boundary b;
        const std::vector<MSLane*> &lanes = edge->getLanes();
        for (std::vector<MSLane*>::const_iterator j=lanes.begin(); j!=lanes.end(); ++j) {
            b.add((*j)->getShape().getBoxBoundary());
        }
        b.grow(2.);
        cmin[0] = b.xmin();
        cmin[1] = b.ymin();
        cmax[0] = b.xmax();
        cmax[1] = b.ymax();
        myGrid->Insert(cmin, cmax, edge);
        myBoundary.add(b);
    }
    for (std::vector<GUIJunctionWrapper*>::iterator i=myJunctionWrapper.begin(); i!=myJunctionWrapper.end(); ++i) {
        GUIJunctionWrapper *junction = *i;
        Boundary b = junction->getBoundary();
        b.grow(2.);
        cmin[0] = b.xmin();
        cmin[1] = b.ymin();
        cmax[0] = b.xmax();
        cmax[1] = b.ymax();
        myGrid->Insert(cmin, cmax, junction);
        myBoundary.add(b);
    }
    const std::vector<GUIGlObject_AbstractAdd*> &a = GUIGlObject_AbstractAdd::getObjectList();
    for (std::vector<GUIGlObject_AbstractAdd*>::const_iterator i=a.begin(); i!=a.end(); ++i) {
        GUIGlObject_AbstractAdd *o = *i;
        Boundary b = o->getCenteringBoundary();
        cmin[0] = b.xmin();
        cmin[1] = b.ymin();
        cmax[0] = b.xmax();
        cmax[1] = b.ymax();
        myGrid->Insert(cmin, cmax, o);
    }
    delete[] cmin;
    delete[] cmax;
    myGrid->add(myBoundary);
}
开发者ID:sagarc,项目名称:Indian_traffic_control,代码行数:58,代码来源:GUINet.cpp

示例15:

Boundary
GUIEdge::getBoundary() const {
    Boundary ret;
    for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
        ret.add((*i)->getShape().getBoxBoundary());
    }
    ret.grow(10);
    return ret;
}
开发者ID:RamonHPSilveira,项目名称:urbansim,代码行数:9,代码来源:GUIEdge.cpp


注:本文中的Boundary::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。