本文整理汇总了C++中CurvePtr::getAncestor方法的典型用法代码示例。如果您正苦于以下问题:C++ CurvePtr::getAncestor方法的具体用法?C++ CurvePtr::getAncestor怎么用?C++ CurvePtr::getAncestor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurvePtr
的用法示例。
在下文中一共展示了CurvePtr::getAncestor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ceil
float WaterElevationLayer::WaterElevationCurveData::getCapLength(NodePtr p, vec2d q)
{
vec2d o = p->getPos();
float capLength = 0;
bool largeRiver = false;
for (int i = 0; i < p->getCurveCount(); ++i) {
CurvePtr ipath = p->getCurve(i);
if ((ipath->getAncestor()->getId() == id) == false) {
if (ipath->getType() == LAKE && ipath->getWidth() > 12) {
largeRiver = true;
}
vec2d r = ipath->getXY(p, 1);
if (abs(angle(q - o, r - o) - M_PI) < 0.01) {
continue;
}
float pw = flattenCurve->getType() == RIVER ? 2 * flattenCurve->getWidth() : flattenCurve->getWidth();
float ipw = ipath->getType() == RIVER ? 2 * ipath->getWidth() : ipath->getWidth();
vec2d corner = proland::corner(o, q, r, (double) pw, (double) ipw);
float dot = (q - o).dot(corner - o);
capLength = max((double) capLength, dot / (o - q).length());
}
}
if (largeRiver && flattenCurve->getType() == RIVER) {
capLength = (q - o).length();
}
return ceil(capLength);
}