本文整理汇总了C++中geom::Geometry::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::isEmpty方法的具体用法?C++ Geometry::isEmpty怎么用?C++ Geometry::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geom::Geometry
的用法示例。
在下文中一共展示了Geometry::isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
BufferResultMatcher::isBufferResultMatch(const geom::Geometry& actualBuffer,
const geom::Geometry& expectedBuffer,
double distance)
{
if (actualBuffer.isEmpty() && expectedBuffer.isEmpty())
return true;
/**
* MD - need some more checks here - symDiffArea won't catch
* very small holes ("tears")
* near the edge of computed buffers (which can happen
* in current version of JTS (1.8)).
* This can probably be handled by testing
* that every point of the actual buffer is at least a certain
* distance away from the geometry boundary.
*/
if (! isSymDiffAreaInTolerance(actualBuffer, expectedBuffer))
{
std::cerr << "isSymDiffAreaInTolerance failed" << std::endl;
return false;
}
if (! isBoundaryHausdorffDistanceInTolerance(actualBuffer,
expectedBuffer, distance))
{
std::cerr << "isBoundaryHasudorffDistanceInTolerance failed" << std::endl;
return false;
}
return true;
}
示例2: failed
bool
SingleSidedBufferResultMatcher::isBufferResultMatch(const geom::Geometry& actualBuffer,
const geom::Geometry& expectedBuffer,
double distance)
{
bool aEmpty = actualBuffer.isEmpty();
bool eEmpty = expectedBuffer.isEmpty();
// Both empty succeeds
if (aEmpty && eEmpty) return true;
// One empty and not the other is a failure
if (aEmpty || eEmpty)
{
std::cerr << "isBufferResultMatch failed (one empty and one not)" << std::endl;
return false;
}
// NOTE: we need to test hausdorff distance in both directions
if (! isBoundaryHausdorffDistanceInTolerance(actualBuffer,
expectedBuffer, distance))
{
std::cerr << "isBoundaryHasudorffDistanceInTolerance failed (actual,expected)" << std::endl;
return false;
}
if (! isBoundaryHausdorffDistanceInTolerance(expectedBuffer,
actualBuffer, distance))
{
std::cerr << "isBoundaryHasudorffDistanceInTolerance failed (expected,actual)" << std::endl;
return false;
}
return true;
}