本文整理汇总了C++中geom::Geometry::getEnvelopeInternal方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::getEnvelopeInternal方法的具体用法?C++ Geometry::getEnvelopeInternal怎么用?C++ Geometry::getEnvelopeInternal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geom::Geometry
的用法示例。
在下文中一共展示了Geometry::getEnvelopeInternal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visitor
bool
RectangleIntersects::intersects(const geom::Geometry& geom)
{
if (!rectEnv.intersects(geom.getEnvelopeInternal()))
return false;
// test envelope relationships
EnvelopeIntersectsVisitor visitor(rectEnv);
visitor.applyTo(geom);
if (visitor.intersects()) return true;
// test if any rectangle corner is contained in the target
ContainsPointVisitor ecpVisitor(rectangle);
ecpVisitor.applyTo(geom);
if (ecpVisitor.containsPoint())
return true;
// test if any lines intersect
LineIntersectsVisitor liVisitor(rectangle);
liVisitor.applyTo(geom);
if (liVisitor.intersects())
return true;
return false;
}
示例2: visit
void visit(const geom::Geometry &geom)
{
using GEOMETRY::algorithm::locate::SimplePointInAreaLocator;
const geom::Polygon *poly;
if ( !(poly=dynamic_cast<const geom::Polygon *>(&geom)) ) {
return;
}
const geom::Envelope &elementEnv = *(geom.getEnvelopeInternal());
if ( !rectEnv.intersects(elementEnv) ) {
return;
}
// test each corner of rectangle for inclusion
for (int i=0; i<4; i++)
{
const geom::Coordinate &rectPt=rectSeq.getAt(i);
if ( !elementEnv.contains(rectPt) ) {
continue;
}
// check rect point in poly (rect is known not to
// touch polygon at this point)
if ( SimplePointInAreaLocator::containsPointInPolygon(rectPt, poly) )
{
containsPointVar=true;
return;
}
}
}
示例3:
/*public static*/
double
GeometrySnapper::computeSizeBasedSnapTolerance(const geom::Geometry& g)
{
const Envelope* env = g.getEnvelopeInternal();
double minDimension = (std::min)(env->getHeight(), env->getWidth());
double snapTol = minDimension * snapPrecisionFactor;
return snapTol;
}