本文整理汇总了C++中EDGEPT::IsChopPt方法的典型用法代码示例。如果您正苦于以下问题:C++ EDGEPT::IsChopPt方法的具体用法?C++ EDGEPT::IsChopPt怎么用?C++ EDGEPT::IsChopPt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDGEPT
的用法示例。
在下文中一共展示了EDGEPT::IsChopPt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vertical_projection_point
/**
* @name vertical_projection_point
*
* For one point on the outline, find the corresponding point on the
* other side of the outline that is a likely projection for a split
* point. This is done by iterating through the edge points until the
* X value of the point being looked at is greater than the X value of
* the split point. Ensure that the point being returned is not right
* next to the split point. Return the edge point in *best_point as
* a result, and any points that were newly created are also saved on
* the new_points list.
*/
void Wordrec::vertical_projection_point(EDGEPT *split_point, EDGEPT *target_point,
EDGEPT** best_point,
EDGEPT_CLIST *new_points) {
EDGEPT *p; /* Iterator */
EDGEPT *this_edgept; /* Iterator */
EDGEPT_C_IT new_point_it(new_points);
int x = split_point->pos.x; /* X value of vertical */
int best_dist = LARGE_DISTANCE;/* Best point found */
if (*best_point != nullptr)
best_dist = edgept_dist(split_point, *best_point);
p = target_point;
/* Look at each edge point */
do {
if (((p->pos.x <= x && x <= p->next->pos.x) ||
(p->next->pos.x <= x && x <= p->pos.x)) &&
!same_point(split_point->pos, p->pos) &&
!same_point(split_point->pos, p->next->pos) &&
!p->IsChopPt() &&
(*best_point == nullptr || !same_point((*best_point)->pos, p->pos))) {
if (near_point(split_point, p, p->next, &this_edgept)) {
new_point_it.add_before_then_move(this_edgept);
}
if (*best_point == nullptr)
best_dist = edgept_dist (split_point, this_edgept);
this_edgept =
pick_close_point(split_point, this_edgept, &best_dist);
if (this_edgept)
*best_point = this_edgept;
}
p = p->next;
}
while (p != target_point);
}