40 #include "config_auto.h" 66 point_heap->
Push(&pair);
69 #ifndef GRAPHICS_DISABLED 94 vector1.
x = point2->
pos.
x - point1->
pos.
x;
95 vector1.
y = point2->
pos.
y - point1->
pos.
y;
96 vector2.
x = point3->
pos.
x - point2->
pos.
x;
97 vector2.
y = point3->
pos.
y - point2->
pos.
y;
99 float length = std::sqrt(static_cast<float>(
LENGTH(vector1)) *
LENGTH(vector2));
100 if ((
int) length == 0)
102 angle =
static_cast<int>(floor(asin(
CROSS (vector1, vector2) /
103 length) / M_PI * 180.0 + 0.5));
106 if (
SCALAR (vector1, vector2) < 0)
125 EDGEPT *best_point =
nullptr;
130 found_better =
FALSE;
132 this_distance =
edgept_dist (critical_point, vertical_point);
133 if (this_distance <= *best_dist) {
139 *best_dist = this_distance;
140 best_point = vertical_point;
145 vertical_point = vertical_point->
next;
147 while (found_better ==
TRUE);
162 EDGEPT *local_min =
nullptr;
163 EDGEPT *local_max =
nullptr;
165 this_point = outline->
loop;
166 local_min = this_point;
167 local_max = this_point;
169 if (this_point->
vec.
y < 0) {
171 if (local_max !=
nullptr)
176 local_min = this_point->
next;
178 else if (this_point->
vec.
y > 0) {
180 if (local_min !=
nullptr)
185 local_max = this_point->
next;
189 if (local_max !=
nullptr) {
193 local_max = this_point->
next;
200 local_min = this_point->
next;
206 this_point = this_point->
next;
208 while (this_point != outline->
loop);
274 EDGEPT_CLIST *new_points) {
277 EDGEPT_C_IT new_point_it(new_points);
278 int x = split_point->
pos.
x;
281 if (*best_point !=
nullptr)
287 if (((p->
pos.
x <= x && x <= p->next->pos.x) ||
288 (p->
next->
pos.
x <= x && x <= p->pos.x)) &&
292 (*best_point ==
nullptr || !
same_point((*best_point)->pos, p->
pos))) {
295 new_point_it.add_before_then_move(this_edgept);
298 if (*best_point ==
nullptr)
299 best_dist =
edgept_dist (split_point, this_edgept);
304 *best_point = this_edgept;
309 while (p != target_point);
void add_point_to_list(PointHeap *point_heap, EDGEPT *point)
#define edgept_dist(p1, p2)
int direction(EDGEPT *point)
bool near_point(EDGEPT *point, EDGEPT *line_pt_0, EDGEPT *line_pt_1, EDGEPT **near_pt)
PRIORITY point_priority(EDGEPT *point)
EDGEPT * pick_close_point(EDGEPT *critical_point, EDGEPT *vertical_point, int *best_dist)
void mark_outline(EDGEPT *edgept)
void prioritize_points(TESSLINE *outline, PointHeap *points)
void vertical_projection_point(EDGEPT *split_point, EDGEPT *target_point, EDGEPT **best_point, EDGEPT_CLIST *new_points)
void new_min_point(EDGEPT *local_min, PointHeap *points)
#define same_point(p1, p2)
#define is_exterior_point(edge, point)
int angle_change(EDGEPT *point1, EDGEPT *point2, EDGEPT *point3)
void new_max_point(EDGEPT *local_max, PointHeap *points)
bool is_inside_angle(EDGEPT *pt)