本文整理汇总了C++中GEdge::geomType方法的典型用法代码示例。如果您正苦于以下问题:C++ GEdge::geomType方法的具体用法?C++ GEdge::geomType怎么用?C++ GEdge::geomType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GEdge
的用法示例。
在下文中一共展示了GEdge::geomType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: distanceToGeometry
double distanceToGeometry(GModel *gm, int dim, int tag, int distType,
double tol, int meshDiscr, int geomDiscr)
{
double maxDist = 0.;
if (dim == 2) {
GEdge *ge = gm->getEdgeByTag(tag);
if (ge->geomType() == GEntity::Line) return 0.;
for (unsigned int i = 0; i < ge->lines.size(); i++) {
double dist;
switch (distType) {
case CADDIST_TAYLOR:
dist = taylorDistanceEdge(ge->lines[i], ge);
break;
case CADDIST_FRECHET:
dist = discreteFrechetDistanceEdge(ge->lines[i], ge,
tol, meshDiscr, geomDiscr);
break;
case CADDIST_HAUSFAST:
dist = discreteHausdorffDistanceFastEdge(ge->lines[i], ge,
tol, meshDiscr, geomDiscr);
break;
case CADDIST_HAUSBRUTE:
dist = discreteHausdorffDistanceBruteEdge(ge->lines[i], ge,
tol, meshDiscr, geomDiscr);
break;
default:
Msg::Error("Wrong CAD distance type in distanceToGeometry");
return -1.;
break;
}
maxDist = std::max(dist, maxDist);
}
}
else if (dim == 3) {
if (distType == CADDIST_TAYLOR) {
GFace *gf = gm->getFaceByTag(tag);
if (gf->geomType() == GEntity::Plane) return 0.;
for (unsigned int i = 0; i < gf->triangles.size(); i++)
maxDist = std::max(taylorDistanceFace(gf->triangles[i], gf), maxDist);
for (unsigned int i = 0; i < gf->quadrangles.size(); i++)
maxDist = std::max(taylorDistanceFace(gf->quadrangles[i], gf), maxDist);
}
else {
Msg::Error("CAD distance type %i not implemented for surfaces", distType);
return -1.;
}
}
else {
Msg::Error("CAD distance cannot be computed for dimension %i", dim);
return -1.;
}
return maxDist;
}