pcb 4.1.1
An interactive printed circuit board layout editor.

edge.c File Reference

#include "gts.h"
Include dependency graph for edge.c:

Go to the source code of this file.

Defines

#define edge_use_vertex(e, v)

Functions

static void edge_destroy (GtsObject *object)
static void edge_clone (GtsObject *clone, GtsObject *object)
static void edge_class_init (GtsObjectClass *klass)
static void edge_init (GtsEdge *edge)
GtsEdgeClassgts_edge_class (void)
GtsEdgegts_edge_new (GtsEdgeClass *klass, GtsVertex *v1, GtsVertex *v2)
void gts_edge_remove (GtsEdge *edge)
void gts_edge_replace (GtsEdge *e, GtsEdge *with)
GtsFacegts_edge_has_parent_surface (GtsEdge *e, GtsSurface *surface)
GtsFacegts_edge_has_any_parent_surface (GtsEdge *e)
GtsFacegts_edge_is_boundary (GtsEdge *e, GtsSurface *surface)
GSList * gts_edges_from_vertices (GSList *vertices, GtsSurface *parent)
guint gts_edge_face_number (GtsEdge *e, GtsSurface *s)
GtsEdgegts_edge_is_duplicate (GtsEdge *e)
GList * gts_edges_merge (GList *edges)
static void triangle_vertices_edges (GtsTriangle *t, GtsEdge *e, GtsVertex **v, GtsEdge **ee1, GtsEdge **ee2)
gboolean gts_edge_belongs_to_tetrahedron (GtsEdge *e)
static GtsEdgenext_edge (GtsTriangle *t, GtsEdge *e1, GtsEdge *e)
static void triangle_next (GtsEdge *e1, GtsEdge *e)
guint gts_edge_is_contact (GtsEdge *e)
void gts_edge_swap (GtsEdge *e, GtsSurface *s)
gboolean gts_edge_manifold_faces (GtsEdge *e, GtsSurface *s, GtsFace **f1, GtsFace **f2)

Variables

gboolean gts_allow_floating_edges = FALSE

Define Documentation

#define edge_use_vertex (   e,
 
)
Value:
(GTS_SEGMENT(e)->v1 == v ||\
                               GTS_SEGMENT(e)->v2 == v)

Definition at line 408 of file edge.c.

Referenced by next_edge().


Function Documentation

static void edge_class_init ( GtsObjectClass klass) [static]

Definition at line 48 of file edge.c.

References _GtsObjectClass::clone, _GtsObjectClass::destroy, edge_clone(), and edge_destroy().

Referenced by gts_edge_class().

Here is the call graph for this function:

static void edge_clone ( GtsObject clone,
GtsObject object 
) [static]

Definition at line 40 of file edge.c.

References GTS_EDGE, gts_edge_class(), GTS_OBJECT_CLASS, and GTS_SEGMENT.

Referenced by edge_class_init().

Here is the call graph for this function:

static void edge_destroy ( GtsObject object) [static]

Definition at line 24 of file edge.c.

References edge, GTS_EDGE, gts_edge_class(), GTS_OBJECT_CLASS, gts_object_destroy(), and _GtsEdge::triangles.

Referenced by edge_class_init(), and gts_edge_remove().

Here is the call graph for this function:

static void edge_init ( GtsEdge edge) [static]

Definition at line 54 of file edge.c.

References _GtsEdge::triangles.

Referenced by gts_edge_class().

gboolean gts_edge_belongs_to_tetrahedron ( GtsEdge e)

gts_edge_belongs_to_tetrahedron: : a GtsEdge.

Returns: TRUE if is used by faces forming a tetrahedron, FALSE otherwise.

Definition at line 377 of file edge.c.

References FALSE, GTS_EDGE, GTS_IS_EDGE, gts_triangle_use_edges(), gts_vertices_are_connected(), triangle_vertices_edges(), _GtsEdge::triangles, and TRUE.

Referenced by gts_edge_collapse_is_valid().

Here is the call graph for this function:

GtsEdgeClass* gts_edge_class ( void  )

gts_edge_class:

Returns: the GtsEdgeClass.

Definition at line 64 of file edge.c.

References edge_class_init(), edge_init(), GTS_OBJECT_CLASS, gts_object_class_new(), and gts_segment_class().

Referenced by edge_clone(), edge_destroy(), gts_constraint_class(), gts_nedge_class(), gts_triangle_enclosing(), surface_init(), and toporouter_edge_class().

Here is the call graph for this function:

guint gts_edge_face_number ( GtsEdge e,
GtsSurface s 
)

gts_edge_face_number: : a GtsEdge. : a GtsSurface.

Returns: the number of faces using and belonging to .

Definition at line 256 of file edge.c.

References GTS_FACE, gts_face_has_parent_surface(), GTS_IS_FACE, and _GtsEdge::triangles.

Referenced by check_surface_edge(), closed_foreach_edge(), gts_edge_swap(), gts_psurface_new(), gts_surface_coarsen(), gts_surface_refine(), gts_vertex_principal_directions(), manifold_foreach_edge(), non_manifold_edges(), and stats_foreach_edge().

Here is the call graph for this function:

GtsFace* gts_edge_has_any_parent_surface ( GtsEdge e)

gts_edge_has_any_parent_surface: : a GtsEdge.

Returns: NULL if is not an edge of any triangle or if all the faces having has an edge do not belong to any surface, a GtsFace belonging to a surface and having as an edge.

Definition at line 167 of file edge.c.

References GTS_FACE, GTS_IS_FACE, and _GtsEdge::triangles.

GtsFace* gts_edge_has_parent_surface ( GtsEdge e,
GtsSurface surface 
)

gts_edge_has_parent_surface: : a GtsEdge. : a GtsSurface.

Returns: a GtsFace of having as an edge, NULL otherwise.

Definition at line 143 of file edge.c.

References gts_face_has_parent_surface(), GTS_IS_FACE, and _GtsEdge::triangles.

Referenced by gts_edges_from_vertices(), gts_vertex_neighbors(), split_encroached(), and stats_foreach_vertex().

Here is the call graph for this function:

GtsFace* gts_edge_is_boundary ( GtsEdge e,
GtsSurface surface 
)

gts_edge_is_boundary: : a GtsEdge. : a GtsSurface or NULL.

Returns: the unique GtsFace (which belongs to ) and which has as an edge (i.e. is a boundary edge (of )) or NULL if there is more than one or no faces (belonging to ) and with as an edge.

Definition at line 193 of file edge.c.

References f, gts_face_has_parent_surface(), GTS_IS_FACE, and _GtsEdge::triangles.

Referenced by build_list_boundary(), edge_boundary_cost(), gts_delaunay_remove_hull(), gts_edge_collapse_is_valid(), gts_surface_inter_boolean(), gts_vertex_is_boundary(), gts_volume_optimized_vertex(), next_compatible_face(), split_encroached(), surface_boundary(), surface_distance_foreach_boundary(), traverse_boundary(), and write_edge_oogl_boundary().

Here is the call graph for this function:

guint gts_edge_is_contact ( GtsEdge e)

gts_edge_is_contact: : a GtsEdge.

Returns: the number of sets of connected triangles sharing as a contact edge.

Definition at line 453 of file edge.c.

References GTS_OBJECT, gts_object_reset_reserved(), GTS_SEGMENT, gts_vertex_triangles(), next_edge(), triangle_next(), and _GtsEdge::triangles.

Referenced by edge_collapse().

Here is the call graph for this function:

GtsEdge* gts_edge_is_duplicate ( GtsEdge e)

gts_edge_is_duplicate: : a GtsEdge.

Returns: the first GtsEdge different from which shares the same endpoints or NULL if there is none.

Definition at line 281 of file edge.c.

References GTS_EDGE, GTS_IS_EDGE, GTS_SEGMENT, s, _GtsSegment::v1, and _GtsSegment::v2.

Referenced by edge_collapse(), gts_edges_merge(), and merge_duplicate().

gboolean gts_edge_manifold_faces ( GtsEdge e,
GtsSurface s,
GtsFace **  f1,
GtsFace **  f2 
)

gts_edge_manifold_faces: : a GtsEdge. : a GtsSurface. : pointer for first face. : pointer for second face.

If is a manifold edge of surface , fills and with the faces belonging to and sharing .

Returns: TRUE if is a manifold edge, FALSE otherwise.

Definition at line 560 of file edge.c.

References FALSE, gts_face_has_parent_surface(), GTS_IS_FACE, and _GtsEdge::triangles.

Here is the call graph for this function:

void gts_edge_remove ( GtsEdge edge)

Definition at line 99 of file edge.c.

References edge_destroy(), GTS_OBJECT, _GtsEdge::segment, _GtsVertex::segments, _GtsSegment::v1, and _GtsSegment::v2.

Here is the call graph for this function:

void gts_edge_replace ( GtsEdge e,
GtsEdge with 
)

gts_edge_replace: : a GtsEdge. : a GtsEdge.

Replaces with . For each triangle which uses as an edge, is replaced with . The ->triangles list is updated appropriately and the ->triangles list is freed and set to NULL.

Definition at line 116 of file edge.c.

References _GtsTriangle::e1, _GtsTriangle::e2, _GtsTriangle::e3, and _GtsEdge::triangles.

Referenced by edge_collapse(), gts_edges_merge(), merge_duplicate(), and unconstrain().

GSList* gts_edges_from_vertices ( GSList *  vertices,
GtsSurface parent 
)

gts_edges_from_vertices: : a list of GtsVertex. : a GtsSurface.

Returns: a list of unique GtsEdge which have one of their vertices in and are used by a face of .

Definition at line 222 of file edge.c.

References GTS_EDGE, gts_edge_has_parent_surface(), GTS_IS_EDGE, GTS_VERTEX, hash(), and s.

Here is the call graph for this function:

GList* gts_edges_merge ( GList *  edges)

gts_edges_merge: : a list of GtsEdge.

For each edge in check if it is duplicated (as returned by gts_edge_is_duplicate()). If it is replace it by its duplicate, destroy it and remove it from the list.

Returns: the updated list.

Definition at line 321 of file edge.c.

References FALSE, gts_allow_floating_edges, gts_edge_is_duplicate(), gts_edge_replace(), GTS_OBJECT, gts_object_destroy(), and TRUE.

Here is the call graph for this function:

static GtsEdge* next_edge ( GtsTriangle t,
GtsEdge e1,
GtsEdge e 
) [static]
static void triangle_next ( GtsEdge e1,
GtsEdge e 
) [static]

Definition at line 431 of file edge.c.

References GTS_OBJECT, next_edge(), and _GtsEdge::triangles.

Referenced by gts_edge_is_contact().

Here is the call graph for this function:

static void triangle_vertices_edges ( GtsTriangle t,
GtsEdge e,
GtsVertex **  v,
GtsEdge **  ee1,
GtsEdge **  ee2 
) [static]

Definition at line 346 of file edge.c.

References _GtsTriangle::e1, _GtsTriangle::e2, _GtsTriangle::e3, and GTS_SEGMENT.

Referenced by gts_edge_belongs_to_tetrahedron().


Variable Documentation