GTS Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# Faces

## Name

Faces -- face object and related functions.

## Synopsis

    #include <gts.h>

    #define     GTS_FACE_CLASS                  (klass)
    #define     GTS_FACE                        (obj)
    #define     GTS_IS_FACE                     (obj)
    struct      GtsFaceClass;
    struct      GtsFace;

    GtsFaceClass* gts_face_class                (void);
    GtsFace*    gts_face_new                    (GtsFaceClass *klass,
                                                 GtsEdge *e1,
                                                 GtsEdge *e2,
                                                 GtsEdge *e3);
    gboolean    gts_face_has_parent_surface     (GtsFace *f,
                                                 GtsSurface *s);
    guint       gts_face_neighbor_number        (GtsFace *f,
                                                 GtsSurface *s);
    GSList*     gts_face_neighbors              (GtsFace *f,
                                                 GtsSurface *s);
    void        gts_face_foreach_neighbor       (GtsFace *f,
                                                 GtsSurface *s,
                                                 GtsFunc func,
                                                 gpointer data);
    GSList*     gts_faces_from_edges            (GSList *edges,
                                                 GtsSurface *s);

## Description

Faces are derived from GtsTriangle. A collection of faces defined a GtsSurface.

## Details

### GTS_FACE_CLASS()

    #define     GTS_FACE_CLASS(klass)

Casts `klass` to GtsFaceClass.

`klass` : | a descendant of GtsFaceClass.

### GTS_FACE()

    #define     GTS_FACE(obj)

Casts `obj` to GtsFace.

`obj` : | a descendant of GtsFace.

### GTS_IS_FACE()

    #define     GTS_IS_FACE(obj)

Evaluates to `TRUE` if `obj` is a GtsFace, `FALSE` otherwise.

`obj` : | a pointer to test.

### struct GtsFaceClass

    struct GtsFaceClass;

The face class derived from GtsTriangleClass.

### struct GtsFace

    struct GtsFace {
      GtsTriangle triangle;

      GSList * surfaces;
    };

The face object.

GtsTriangle `triangle` | The parent object.
GSList *`surfaces` | A list of GtsSurface using this face.

### gts_face_class ()

    GtsFaceClass* gts_face_class                (void);

Returns : | the GtsFaceClass.

### gts_face_new ()

    GtsFace*    gts_face_new                    (GtsFaceClass *klass,
                                                 GtsEdge *e1,
                                                 GtsEdge *e2,
                                                 GtsEdge *e3);

`klass` : | a GtsFaceClass.
`e1` : | a GtsEdge.
`e2` : | a GtsEdge.
`e3` : | a GtsEdge.
Returns : | a new GtsFace using `e1`, `e2` and `e3` as edges.

### gts_face_has_parent_surface ()

    gboolean    gts_face_has_parent_surface     (GtsFace *f,
                                                 GtsSurface *s);

`f` : | a GtsFace.
`s` : | a GtsSurface.
Returns : | `TRUE` if `f` belongs to `s`, `FALSE` otherwise.

### gts_face_neighbor_number ()

    guint       gts_face_neighbor_number        (GtsFace *f,
                                                 GtsSurface *s);

`f` : | a GtsFace.
`s` : | a GtsSurface or `NULL`.
Returns : | the number of faces neighbors of `f` and belonging to `s`.

### gts_face_neighbors ()

    GSList*     gts_face_neighbors              (GtsFace *f,
                                                 GtsSurface *s);

`f` : | a GtsFace.
`s` : | a GtsSurface or `NULL`.
Returns : | a list of unique GtsFace neighbors of `f` and belonging to `s`.

### gts_face_foreach_neighbor ()

    void        gts_face_foreach_neighbor       (GtsFace *f,
                                                 GtsSurface *s,
                                                 GtsFunc func,
                                                 gpointer data);

Calls `func` for each neighbor of `f` belonging to `s` (if not `NULL`).

`f` : | a GtsFace.
`s` : | a GtsSurface or `NULL`.
`func` : | a GtsFunc.
`data` : | user data to pass to `func`.

### gts_faces_from_edges ()

    GSList*     gts_faces_from_edges            (GSList *edges,
                                                 GtsSurface *s);

Builds a list of unique faces which belong to `s` and have one of their edges in `edges`.

`edges` : | a list of GtsEdge.
`s` : | a GtsSurface or `NULL`.
Returns : | the list of faces.

<<< Previous Page | Home | Up | Next Page >>>
Triangles | Surfaces