pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include "gts.h"
Go to the source code of this file.
Data Structures | |
struct | tri_data_t |
struct | map_t |
struct | heap_t |
struct | min_key_t |
Defines | |
#define | PRINT_HEAP_ELEMENTS 0 |
Functions | |
static tri_data_t * | tri_data_new (GtsTriangle *t) |
static void | tri_data_destroy (tri_data_t *td) |
static guint | tri_data_num_unused_neighbors2 (const tri_data_t *td, const map_t *map) |
static GHashTable * | tri_data_unused_neighbors2 (const tri_data_t *td, const map_t *map) |
static map_t * | map_new (GtsSurface *s) |
static void | map_destroy (map_t *map) |
static tri_data_t * | map_lookup (const map_t *map, GtsTriangle *t) |
static heap_t * | heap_new (GtsSurface *s) |
static void | heap_destroy (heap_t *heap) |
static gboolean | heap_is_empty (const heap_t *heap) |
static GtsTriangle * | heap_top (const heap_t *heap) |
static void | heap_remove (heap_t *heap, GtsTriangle *t) |
static gboolean | vertices_are_unique (GtsVertex *v1, GtsVertex *v2, GtsVertex *v3) |
static gboolean | vertex_is_one_of (GtsVertex *v, GtsVertex *v1, GtsVertex *v2, GtsVertex *v3) |
static guint | num_shared_vertices (GtsVertex *u1, GtsVertex *u2, GtsVertex *u3, GtsVertex *v1, GtsVertex *v2, GtsVertex *v3) |
static gboolean | vertices_match (GtsVertex *v1, GtsVertex *v2, GtsVertex *v3, GtsVertex **v4, GtsVertex **v5, GtsVertex **v6) |
static GtsVertex * | non_shared_vertex1 (GtsVertex *u1, GtsVertex *u2, GtsVertex *u3, GtsVertex *v1, GtsVertex *v2, GtsVertex *v3) |
static void | match_vertex (GtsVertex *v, GtsVertex **v1, GtsVertex **v2, GtsVertex **v3) |
static void | copy_key_to_array (gpointer key, gpointer value, gpointer user_data) |
static gboolean | are_neighbors_unique (GHashTable *h) |
static gdouble | triangle_priority (gpointer item, gpointer data) |
static void | insert_entry_into_heap (gpointer key, gpointer value, gpointer user_data) |
static void | decrease_key (gpointer key, gpointer value, gpointer user_data) |
static gint | create_map_entry (gpointer item, gpointer data) |
static void | free_map_entry (gpointer key, gpointer value, gpointer user_data) |
static GtsTriangle * | find_min_neighbor (heap_t *heap, GtsTriangle *t) |
static GtsTriangle * | find_neighbor_forward (heap_t *heap, GtsTriangle *t, GtsVertex **v1, GtsVertex **v2, GtsVertex **v3, gboolean left_turn) |
static GtsTriangle * | find_neighbor_backward (heap_t *heap, GtsTriangle *t, GtsVertex **v1, GtsVertex **v2, GtsVertex **v3, gboolean left_turn) |
static GSList * | grow_strip_forward (heap_t *heap, GSList *strip, GtsTriangle *t, GtsVertex *v1, GtsVertex *v2, GtsVertex *v3) |
static GSList * | grow_strip_backward (heap_t *heap, GSList *strip, GtsTriangle *t, GtsVertex *v1, GtsVertex *v2, GtsVertex *v3) |
static gboolean | find_right_turn (GtsVertex **v1, GtsVertex **v2, GtsVertex **v3, GtsVertex **v4, GtsVertex **v5, GtsVertex **v6) |
GSList * | gts_surface_strip (GtsSurface *s) |
static gboolean are_neighbors_unique | ( | GHashTable * | h | ) | [static] |
Definition at line 232 of file stripe.c.
References copy_key_to_array(), FALSE, n, and TRUE.
Referenced by tri_data_unused_neighbors2().
static void copy_key_to_array | ( | gpointer | key, |
gpointer | value, | ||
gpointer | user_data | ||
) | [static] |
Definition at line 218 of file stripe.c.
Referenced by are_neighbors_unique().
static gint create_map_entry | ( | gpointer | item, |
gpointer | data | ||
) | [static] |
Definition at line 448 of file stripe.c.
References tri_data_new().
Referenced by map_new().
static void decrease_key | ( | gpointer | key, |
gpointer | value, | ||
gpointer | user_data | ||
) | [static] |
Definition at line 397 of file stripe.c.
References gts_eheap_decrease_key(), heap_t::heap, _GtsEHeapPair::key, heap_t::map, tri_data_t::pos, tri_data_num_unused_neighbors2(), and tri_data_t::used.
Referenced by heap_remove().
static GtsTriangle* find_min_neighbor | ( | heap_t * | heap, |
GtsTriangle * | t | ||
) | [static] |
Definition at line 507 of file stripe.c.
References _GtsEHeapPair::key, heap_t::map, map_lookup(), tri_data_t::neighbors, tri_data_t::pos, and tri_data_t::used.
Referenced by gts_surface_strip().
static GtsTriangle* find_neighbor_backward | ( | heap_t * | heap, |
GtsTriangle * | t, | ||
GtsVertex ** | v1, | ||
GtsVertex ** | v2, | ||
GtsVertex ** | v3, | ||
gboolean | left_turn | ||
) | [static] |
Definition at line 578 of file stripe.c.
References gts_triangle_vertices(), heap_t::map, map_lookup(), neighbor(), tri_data_t::neighbors, tri_data_t::used, vertices_are_unique(), and vertices_match().
Referenced by grow_strip_backward().
static GtsTriangle* find_neighbor_forward | ( | heap_t * | heap, |
GtsTriangle * | t, | ||
GtsVertex ** | v1, | ||
GtsVertex ** | v2, | ||
GtsVertex ** | v3, | ||
gboolean | left_turn | ||
) | [static] |
Definition at line 536 of file stripe.c.
References gts_triangle_vertices(), heap_t::map, map_lookup(), neighbor(), tri_data_t::neighbors, tri_data_t::used, vertices_are_unique(), and vertices_match().
Referenced by grow_strip_forward().
static gboolean find_right_turn | ( | GtsVertex ** | v1, |
GtsVertex ** | v2, | ||
GtsVertex ** | v3, | ||
GtsVertex ** | v4, | ||
GtsVertex ** | v5, | ||
GtsVertex ** | v6 | ||
) | [static] |
Definition at line 671 of file stripe.c.
References FALSE, match_vertex(), non_shared_vertex1(), num_shared_vertices(), TRUE, and vertices_are_unique().
Referenced by gts_surface_strip().
static void free_map_entry | ( | gpointer | key, |
gpointer | value, | ||
gpointer | user_data | ||
) | [static] |
Definition at line 461 of file stripe.c.
References tri_data_t::t, and tri_data_destroy().
Referenced by map_destroy().
static GSList* grow_strip_backward | ( | heap_t * | heap, |
GSList * | strip, | ||
GtsTriangle * | t, | ||
GtsVertex * | v1, | ||
GtsVertex * | v2, | ||
GtsVertex * | v3 | ||
) | [static] |
Definition at line 643 of file stripe.c.
References FALSE, find_neighbor_backward(), heap_remove(), TRUE, and vertices_are_unique().
Referenced by gts_surface_strip().
static GSList* grow_strip_forward | ( | heap_t * | heap, |
GSList * | strip, | ||
GtsTriangle * | t, | ||
GtsVertex * | v1, | ||
GtsVertex * | v2, | ||
GtsVertex * | v3 | ||
) | [static] |
Definition at line 618 of file stripe.c.
References find_neighbor_forward(), heap_remove(), TRUE, and vertices_are_unique().
Referenced by gts_surface_strip().
GSList* gts_surface_strip | ( | GtsSurface * | s | ) |
gts_surface_strip: : a GtsSurface.
Decompose into triangle strips for fast-rendering.
Returns: a list of triangle strips containing all the triangles of . A triangle strip is itself a list of successive triangles having one edge in common.
Definition at line 718 of file stripe.c.
References find_min_neighbor(), find_right_turn(), grow_strip_backward(), grow_strip_forward(), gts_triangle_vertices(), heap_destroy(), heap_is_empty(), heap_new(), heap_remove(), and heap_top().
static void heap_destroy | ( | heap_t * | heap | ) | [static] |
Definition at line 366 of file stripe.c.
References gts_eheap_destroy(), heap_t::heap, heap_t::map, and map_destroy().
static gboolean heap_is_empty | ( | const heap_t * | heap | ) | [static] |
Definition at line 375 of file stripe.c.
References gts_eheap_size(), and heap_t::heap.
static heap_t * heap_new | ( | GtsSurface * | s | ) | [static] |
Definition at line 349 of file stripe.c.
References gts_eheap_foreach(), gts_eheap_new(), heap_t::heap, map_t::ht, insert_entry_into_heap(), heap_t::map, map_new(), and triangle_priority().
Referenced by gts_surface_strip().
static void heap_remove | ( | heap_t * | heap, |
GtsTriangle * | t | ||
) | [static] |
Definition at line 425 of file stripe.c.
References decrease_key(), gts_eheap_remove(), heap_t::heap, heap_t::map, map_lookup(), tri_data_t::pos, tri_data_unused_neighbors2(), TRUE, and tri_data_t::used.
Referenced by grow_strip_backward(), grow_strip_forward(), and gts_surface_strip().
static GtsTriangle * heap_top | ( | const heap_t * | heap | ) | [static] |
Definition at line 387 of file stripe.c.
References gts_eheap_top(), and heap_t::heap.
Referenced by gts_surface_strip().
static void insert_entry_into_heap | ( | gpointer | key, |
gpointer | value, | ||
gpointer | user_data | ||
) | [static] |
Definition at line 336 of file stripe.c.
References gts_eheap_insert(), and tri_data_t::pos.
Referenced by heap_new().
static void map_destroy | ( | map_t * | map | ) | [static] |
Definition at line 483 of file stripe.c.
References free_map_entry(), and map_t::ht.
Referenced by heap_destroy().
static tri_data_t * map_lookup | ( | const map_t * | map, |
GtsTriangle * | t | ||
) | [static] |
Definition at line 492 of file stripe.c.
References map_t::ht, and tri_data_t::t.
Referenced by find_min_neighbor(), find_neighbor_backward(), find_neighbor_forward(), heap_remove(), tri_data_unused_neighbors2(), and triangle_priority().
static map_t * map_new | ( | GtsSurface * | s | ) | [static] |
Definition at line 473 of file stripe.c.
References create_map_entry(), gts_surface_foreach_face(), and map_t::ht.
Referenced by heap_new().
static void match_vertex | ( | GtsVertex * | v, |
GtsVertex ** | v1, | ||
GtsVertex ** | v2, | ||
GtsVertex ** | v3 | ||
) | [static] |
Definition at line 164 of file stripe.c.
References vertex_is_one_of().
Referenced by find_right_turn().
static GtsVertex* non_shared_vertex1 | ( | GtsVertex * | u1, |
GtsVertex * | u2, | ||
GtsVertex * | u3, | ||
GtsVertex * | v1, | ||
GtsVertex * | v2, | ||
GtsVertex * | v3 | ||
) | [static] |
Definition at line 131 of file stripe.c.
References num_shared_vertices(), u(), vertex_is_one_of(), and vertices_are_unique().
Referenced by find_right_turn().
static guint num_shared_vertices | ( | GtsVertex * | u1, |
GtsVertex * | u2, | ||
GtsVertex * | u3, | ||
GtsVertex * | v1, | ||
GtsVertex * | v2, | ||
GtsVertex * | v3 | ||
) | [static] |
Definition at line 77 of file stripe.c.
References n, vertex_is_one_of(), and vertices_are_unique().
Referenced by find_right_turn(), and non_shared_vertex1().
static void tri_data_destroy | ( | tri_data_t * | td | ) | [static] |
Definition at line 196 of file stripe.c.
References tri_data_t::neighbors.
Referenced by free_map_entry().
static tri_data_t * tri_data_new | ( | GtsTriangle * | t | ) | [static] |
Definition at line 183 of file stripe.c.
References FALSE, gts_triangle_neighbors(), tri_data_t::neighbors, tri_data_t::pos, tri_data_t::t, and tri_data_t::used.
Referenced by create_map_entry().
static guint tri_data_num_unused_neighbors2 | ( | const tri_data_t * | td, |
const map_t * | map | ||
) | [static] |
Definition at line 204 of file stripe.c.
References n, and tri_data_unused_neighbors2().
Referenced by decrease_key(), and triangle_priority().
static GHashTable * tri_data_unused_neighbors2 | ( | const tri_data_t * | td, |
const map_t * | map | ||
) | [static] |
Definition at line 261 of file stripe.c.
References are_neighbors_unique(), map_lookup(), tri_data_t::neighbors, and tri_data_t::used.
Referenced by heap_remove(), and tri_data_num_unused_neighbors2().
static gdouble triangle_priority | ( | gpointer | item, |
gpointer | data | ||
) | [static] |
Definition at line 304 of file stripe.c.
References map_lookup(), and tri_data_num_unused_neighbors2().
Referenced by heap_new().
static gboolean vertex_is_one_of | ( | GtsVertex * | v, |
GtsVertex * | v1, | ||
GtsVertex * | v2, | ||
GtsVertex * | v3 | ||
) | [static] |
Definition at line 68 of file stripe.c.
Referenced by match_vertex(), non_shared_vertex1(), and num_shared_vertices().
Definition at line 60 of file stripe.c.
Referenced by find_neighbor_backward(), find_neighbor_forward(), find_right_turn(), grow_strip_backward(), grow_strip_forward(), non_shared_vertex1(), num_shared_vertices(), and vertices_match().
static gboolean vertices_match | ( | GtsVertex * | v1, |
GtsVertex * | v2, | ||
GtsVertex * | v3, | ||
GtsVertex ** | v4, | ||
GtsVertex ** | v5, | ||
GtsVertex ** | v6 | ||
) | [static] |
Definition at line 100 of file stripe.c.
References TRUE, and vertices_are_unique().
Referenced by find_neighbor_backward(), and find_neighbor_forward().