Graphviz 13.0.0~dev.20241220.2304
|
trapezoidation More...
#include "config.h"
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <math.h>
#include <common/geom.h>
#include <common/types.h>
#include <ortho/trap.h>
#include <util/alloc.h>
Go to the source code of this file.
Data Structures | |
struct | qnode_t |
struct | qnodes_t |
an array of qnodes More... | |
Macros | |
#define | T_X 1 |
#define | T_Y 2 |
#define | T_SINK 3 |
#define | FIRSTPT 1 /* checking whether pt. is inserted */ |
#define | LASTPT 2 |
#define | S_LEFT 1 /* for merge-direction */ |
#define | S_RIGHT 2 |
#define | INF 1<<30 |
#define | CROSS(v0, v1, v2) |
Functions | |
static int | newnode (qnodes_t *qs) |
static int | newtrap (traps_t *tr) |
static void | _max (pointf *yval, pointf *v0, pointf *v1) |
static void | _min (pointf *yval, pointf *v0, pointf *v1) |
static bool | _greater_than_equal_to (pointf *v0, pointf *v1) |
static bool | _less_than (pointf *v0, pointf *v1) |
static int | init_query_structure (int segnum, segment_t *seg, traps_t *tr, qnodes_t *qs) |
static bool | is_left_of (int segnum, segment_t *seg, pointf *v) |
static bool | inserted (int segnum, segment_t *seg, int whichpt) |
static int | locate_endpoint (pointf *v, pointf *vo, int r, segment_t *seg, qnodes_t *qs) |
static void | merge_trapezoids (int segnum, int tfirst, int tlast, int side, traps_t *tr, qnodes_t *qs) |
static void | update_trapezoid (segment_t *s, segment_t *seg, traps_t *tr, int t, int tn) |
static void | add_segment (int segnum, segment_t *seg, traps_t *tr, qnodes_t *qs) |
static void | find_new_roots (int segnum, segment_t *seg, traps_t *tr, qnodes_t *qs) |
static int | math_logstar_n (int n) |
static int | math_N (int n, int h) |
traps_t | construct_trapezoids (int nseg, segment_t *seg, int *permute) |
See Fast polygon triangulation based on Seidel's algorithm
Definition in file trapezoid.c.
#define CROSS | ( | v0, | |
v1, | |||
v2 | |||
) |
Definition at line 45 of file trapezoid.c.
#define FIRSTPT 1 /* checking whether pt. is inserted */ |
Definition at line 37 of file trapezoid.c.
#define INF 1<<30 |
Definition at line 43 of file trapezoid.c.
#define LASTPT 2 |
Definition at line 38 of file trapezoid.c.
#define S_LEFT 1 /* for merge-direction */ |
Definition at line 40 of file trapezoid.c.
#define S_RIGHT 2 |
Definition at line 41 of file trapezoid.c.
#define T_SINK 3 |
Definition at line 35 of file trapezoid.c.
#define T_X 1 |
Definition at line 33 of file trapezoid.c.
#define T_Y 2 |
Definition at line 34 of file trapezoid.c.
Definition at line 109 of file trapezoid.c.
References C_EPS, pointf_s::x, and pointf_s::y.
Referenced by _less_than(), add_segment(), and merge_trapezoids().
Definition at line 119 of file trapezoid.c.
References _greater_than_equal_to().
Referenced by add_segment().
Definition at line 78 of file trapezoid.c.
References C_EPS, FP_EQUAL, pointf_s::x, and pointf_s::y.
Referenced by init_query_structure().
Definition at line 94 of file trapezoid.c.
References C_EPS, FP_EQUAL, pointf_s::x, and pointf_s::y.
Referenced by init_query_structure().
Definition at line 486 of file trapezoid.c.
References _equal_to, _greater_than, _greater_than_equal_to(), _less_than(), trap_t::d0, trap_t::d1, traps_t::data, qnodes_t::data, FIRSTPT, FP_EQUAL, trap_t::hi, inserted(), segment_t::is_inserted, is_left_of(), LASTPT, qnode_t::left, trap_t::lo, locate_endpoint(), trap_t::lseg, merge_trapezoids(), newnode(), newtrap(), segment_t::next, qnode_t::nodetype, qnode_t::parent, segment_t::prev, qnode_t::right, trap_t::rseg, S_LEFT, S_RIGHT, qnode_t::segnum, trap_t::sink, ST_VALID, trap_t::state, T_SINK, T_X, T_Y, qnode_t::trnum, trap_t::u0, trap_t::u1, update_trapezoid(), trap_t::usave, trap_t::uside, pointf_s::x, pointf_s::y, and qnode_t::yval.
Referenced by construct_trapezoids().
Definition at line 924 of file trapezoid.c.
References add_segment(), qnodes_t::data, find_new_roots(), free(), gv_calloc(), init_query_structure(), traps_t::length, qnodes_t::length, math_logstar_n(), and math_N().
Referenced by partition().
Definition at line 888 of file trapezoid.c.
References traps_t::data, locate_endpoint(), and trap_t::sink.
Referenced by construct_trapezoids().
Definition at line 138 of file trapezoid.c.
References _max(), _min(), trap_t::d0, trap_t::d1, traps_t::data, qnodes_t::data, trap_t::hi, INF, qnode_t::left, trap_t::lo, trap_t::lseg, newnode(), newtrap(), qnode_t::nodetype, qnode_t::parent, qnode_t::right, trap_t::rseg, qnode_t::segnum, trap_t::sink, ST_VALID, trap_t::state, T_SINK, T_X, T_Y, qnode_t::trnum, trap_t::u0, trap_t::u1, pointf_s::x, pointf_s::y, and qnode_t::yval.
Referenced by construct_trapezoids().
|
static |
Definition at line 280 of file trapezoid.c.
References FIRSTPT, segment_t::is_inserted, segment_t::next, and segment_t::prev.
Referenced by add_segment().
Definition at line 230 of file trapezoid.c.
References _greater_than, CROSS, FP_EQUAL, pointf_s::x, and pointf_s::y.
Referenced by add_segment(), locate_endpoint(), and update_trapezoid().
|
static |
Definition at line 292 of file trapezoid.c.
References _equal_to, _greater_than, qnodes_t::data, FP_EQUAL, is_left_of(), qnode_t::left, locate_endpoint(), qnode_t::nodetype, qnode_t::right, qnode_t::segnum, T_SINK, T_X, T_Y, qnode_t::trnum, segment_t::v0, segment_t::v1, pointf_s::x, pointf_s::y, and qnode_t::yval.
Referenced by add_segment(), find_new_roots(), and locate_endpoint().
|
static |
Definition at line 901 of file trapezoid.c.
Referenced by construct_trapezoids().
|
static |
Definition at line 912 of file trapezoid.c.
Referenced by construct_trapezoids().
|
static |
Definition at line 350 of file trapezoid.c.
References _greater_than_equal_to(), trap_t::d0, trap_t::d1, traps_t::data, qnodes_t::data, qnode_t::left, trap_t::lo, trap_t::lseg, qnode_t::parent, qnode_t::right, trap_t::rseg, S_LEFT, trap_t::sink, ST_INVALID, trap_t::state, trap_t::u0, and trap_t::u1.
Referenced by add_segment().
|
static |
Definition at line 64 of file trapezoid.c.
References qnodes_t::data, gv_recalloc(), and qnodes_t::length.
Referenced by add_segment(), and init_query_structure().
|
static |
Definition at line 71 of file trapezoid.c.
References traps_t::data, gv_recalloc(), and traps_t::length.
Referenced by add_segment(), and init_query_structure().
Definition at line 413 of file trapezoid.c.
References trap_t::d0, trap_t::d1, traps_t::data, is_left_of(), trap_t::rseg, S_LEFT, trap_t::u0, trap_t::u1, trap_t::usave, and trap_t::uside.
Referenced by add_segment().