本文整理汇总了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));
}
示例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;
}
示例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);
}