GTS Library Reference Manual |
---|
#include <gts.h> #define GTS_EDGE_CLASS (klass) #define GTS_EDGE (obj) #define GTS_IS_EDGE (obj) struct GtsEdgeClass; struct GtsEdge; GtsEdgeClass* gts_edge_class (void); GtsEdge* gts_edge_new (GtsEdgeClass *klass, GtsVertex *v1, GtsVertex *v2); void gts_edge_replace (GtsEdge *e, GtsEdge *with); #define gts_edge_is_unattached (s) GtsEdge* gts_edge_is_duplicate (GtsEdge *e); GtsFace* gts_edge_has_parent_surface (GtsEdge *e, GtsSurface *surface); GtsFace* gts_edge_has_any_parent_surface (GtsEdge *e); GtsFace* gts_edge_is_boundary (GtsEdge *e, GtsSurface *surface);guint gts_edge_is_contact (GtsEdge *e);gboolean gts_edge_belongs_to_tetrahedron (GtsEdge *e);guint gts_edge_face_number (GtsEdge *e, GtsSurface *s);gboolean gts_edge_manifold_faces (GtsEdge *e, GtsSurface *s, GtsFace **f1, GtsFace **f2);gboolean (*GtsEncroachFunc) (GtsVertex *v, GtsEdge *e, GtsSurface *s,gpointer data); GtsVertex* gts_edge_is_encroached (GtsEdge *e, GtsSurface *s, GtsEncroachFunc encroaches,gpointer data);GList * gts_edges_merge (GList *edges);GSList * gts_edges_from_vertices (GSList *vertices, GtsSurface *parent); void gts_edge_swap (GtsEdge *e, GtsSurface *s);
#define GTS_EDGE_CLASS(klass)
Casts klass to GtsEdgeClass.
klass : | a descendant of GtsObjectClass. |
#define GTS_IS_EDGE(obj)
Evaluates to TRUE if obj is a GtsEdge, FALSE otherwise.
obj : | a pointer to test. |
struct GtsEdgeClass { GtsSegmentClass parent_class; };
The edge class. No virtual function associated.
struct GtsEdge { GtsSegment segment; GSList * triangles; };
The edge object.
GtsSegment segment | The parent object. |
triangles | List of GtsTriangle using this edge. |
GtsEdge* gts_edge_new (GtsEdgeClass *klass, GtsVertex *v1, GtsVertex *v2);
klass : | a GtsEdgeClass. |
v1 : | a GtsVertex. |
v2 : | a GtsVertex. |
Returns : | a new GtsEdge linking v1 and v2. |
void gts_edge_replace (GtsEdge *e, GtsEdge *with);
Replaces e with with. For each triangle which uses e as an edge, e is replaced with with. The with->triangles list is updated appropriately and the e->triangles list is freed and set to NULL.
e : | a GtsEdge. |
with : | a GtsEdge. |
#define gts_edge_is_unattached(s) ((s)->triangles == NULL ? TRUE : FALSE)
Evaluates to TRUE if no triangles uses s as an edge, FALSE otherwise.
s : | a GtsEdge. |
GtsEdge* gts_edge_is_duplicate (GtsEdge *e);
e : | a GtsEdge. |
Returns : | the first GtsEdge different from e which shares the same endpoints or NULL if there is none. |
GtsFace* gts_edge_has_parent_surface (GtsEdge *e, GtsSurface *surface);
e : | a GtsEdge. |
surface : | a GtsSurface. |
Returns : | a GtsFace of surface having e as an edge, NULL otherwise. |
GtsFace* gts_edge_has_any_parent_surface (GtsEdge *e);
e : | a GtsEdge. |
Returns : | NULL if e is not an edge of any triangle or if all the faces having e has an edge do not belong to any surface, a GtsFace belonging to a surface and having e as an edge. |
GtsFace* gts_edge_is_boundary (GtsEdge *e, GtsSurface *surface);
e : | a GtsEdge. |
surface : | a GtsSurface or NULL. |
Returns : | the unique GtsFace (which belongs to surface) and which has e as an edge (i.e. e is a boundary edge (of surface)) or NULL if there is more than one or no faces (belonging to surface) and with e as an edge. |
guint gts_edge_is_contact (GtsEdge *e);
e : | a GtsEdge. |
Returns : | the number of sets of connected triangles sharing e as a contact edge. |
gboolean gts_edge_belongs_to_tetrahedron (GtsEdge *e);
e : | a GtsEdge. |
Returns : | TRUE if e is used by faces forming a tetrahedron, FALSE otherwise. |
guint gts_edge_face_number (GtsEdge *e, GtsSurface *s);
e : | a GtsEdge. |
s : | a GtsSurface. |
Returns : | the number of faces using e and belonging to s. |
gboolean gts_edge_manifold_faces (GtsEdge *e, GtsSurface *s, GtsFace **f1, GtsFace **f2);
If e is a manifold edge of surface s, fills f1 and f2 with the faces belonging to s and sharing e.
e : | a GtsEdge. |
s : | a GtsSurface. |
f1 : | pointer for first face. |
f2 : | pointer for second face. |
Returns : | TRUE if e is a manifold edge, FALSE otherwise. |
gboolean (*GtsEncroachFunc) (GtsVertex *v, GtsEdge *e, GtsSurface *s,gpointer data);
v : | |
e : | |
s : | |
data : | |
Returns : |
|
GtsVertex* gts_edge_is_encroached (GtsEdge *e, GtsSurface *s, GtsEncroachFunc encroaches,gpointer data);
e : | a GtsEdge. |
s : | a GtsSurface describing a (constrained) Delaunay triangulation. |
encroaches : | |
data : | user data to be passed to encroaches. |
Returns : | a GtsVertex belonging to s and encroaching upon e (as defined by encroaches) or NULL if there is none. |
GList * gts_edges_merge (GList *edges);
For each edge in edges 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.
edges : | a list of GtsEdge. |
Returns : | the updated edges list. |
GSList * gts_edges_from_vertices (GSList *vertices, GtsSurface *parent);
vertices : | a list of GtsVertex. |
parent : | a GtsSurface. |
Returns : | a list of unique GtsEdge which have one of their vertices in vertices and are used by a face of parent. |
void gts_edge_swap (GtsEdge *e, GtsSurface *s);
Performs an "edge swap" on the two triangles sharing e and belonging to s.
e : | a GtsEdge. |
s : | a GtsSurface. |
<<< Segments | Triangles >>> |