GTS Library Reference Manual |
---|
#include <gts.h> #define GTS_EDGE_CLASS (klass) #define GTS_EDGE (obj) #define GTS_IS_EDGE (obj) GtsEdgeClass; 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. |
typedef struct { GtsSegmentClass parent_class; } GtsEdgeClass;
The edge class. No virtual function associated.
typedef struct { GtsSegment segment; GSList * triangles; } GtsEdge;
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 |
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 |
GtsFace* gts_edge_has_parent_surface (GtsEdge *e, GtsSurface *surface);
e : | a GtsEdge. |
surface : | a GtsSurface. |
Returns : | a GtsFace of |
GtsFace* gts_edge_has_any_parent_surface (GtsEdge *e);
e : | a GtsEdge. |
Returns : | NULL if |
GtsFace* gts_edge_is_boundary (GtsEdge *e, GtsSurface *surface);
e : | a GtsEdge. |
surface : | a GtsSurface or NULL. |
Returns : | the unique GtsFace (which belongs to |
guint gts_edge_is_contact (GtsEdge *e);
e : | a GtsEdge. |
Returns : | the number of sets of connected triangles sharing |
gboolean gts_edge_belongs_to_tetrahedron (GtsEdge *e);
e : | a GtsEdge. |
Returns : | TRUE if |
guint gts_edge_face_number (GtsEdge *e, GtsSurface *s);
e : | a GtsEdge. |
s : | a GtsSurface. |
Returns : | the number of faces using |
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 |
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 |
Returns : | a GtsVertex belonging to |
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 |
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
|
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 >>> |