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


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

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


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

示例1: Boundary

/* Test the method 'partialWithin'*/
TEST(Boundary, test_method_partialWithin) {
	Boundary *bound = new Boundary(1,2,3,6);
	EXPECT_TRUE(bound->partialWithin(Boundary(1,2,1,2)));
	EXPECT_FALSE(bound->partialWithin(Boundary(10,17,13,16)));
	EXPECT_TRUE(bound->partialWithin(Boundary(1,2,3,6)));	
	EXPECT_TRUE(bound->partialWithin(Boundary(4,2,5,7),1));
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例2:

bool
PCPolyContainer::insert(const std::string& id, Polygon* poly,
                        int layer, bool ignorePruning) {
    // check whether the polygon lies within the wished area
    //  - if such an area was given
    if (myDoPrune && !ignorePruning) {
        Boundary b = poly->getShape().getBoxBoundary();
        if (!b.partialWithin(myPruningBoundary)) {
            delete poly;
            return false;
        }
    }
    // check whether the polygon was named to be a removed one
    if (find(myRemoveByNames.begin(), myRemoveByNames.end(), id) != myRemoveByNames.end()) {
        delete poly;
        return false;
    }
    //
    PolyCont::iterator i = myPolyCont.find(id);
    if (i != myPolyCont.end()) {
        WRITE_ERROR("Polygon '" + id + "' could not be added.");
        delete poly;
        return false;
    }
    myPolyCont[id] = poly;
    myPolyLayerMap[poly] = layer;
    return true;
}
开发者ID:namnatulco,项目名称:sumo-complete,代码行数:28,代码来源:PCPolyContainer.cpp

示例3: add

bool
PCPolyContainer::add(SUMOPolygon* poly, bool ignorePruning) {
    // check whether the polygon lies within the wished area
    //  - if such an area was given
    if (myDoPrune && !ignorePruning) {
        Boundary b = poly->getShape().getBoxBoundary();
        if (!b.partialWithin(myPruningBoundary)) {
            delete poly;
            return false;
        }
    }
    // check whether the polygon was named to be a removed one
    if (find(myRemoveByNames.begin(), myRemoveByNames.end(), poly->getID()) != myRemoveByNames.end()) {
        delete poly;
        return false;
    }
    return ShapeContainer::add(poly);
}
开发者ID:behrisch,项目名称:sumo,代码行数:18,代码来源:PCPolyContainer.cpp


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