Description
A GtsSurface is defined as a collection of GtsFace. No topological constraint is imposed: the surface may or may not be manifold, closed or orientable.
When destroying a GtsSurface, all the faces not used by another surface are also destroyed. This default behaviour can be changed punctually by setting the global variable gts_allow_floating_faces to TRUE. You must not forget to set this variable back to FALSE as all the algorithms of GTS assume the default behaviour.
Details
GTS_SURFACE_CLASS()
#define GTS_SURFACE_CLASS(klass) |
Casts klass to GtsSurfaceClass.
GTS_IS_SURFACE()
#define GTS_IS_SURFACE(obj) |
Evaluates to TRUE if obj is a GtsSurface, FALSE otherwise.
struct GtsSurfaceClass
The surface class. No virtual function is defined.
struct GtsSurface
struct GtsSurface {
GtsObject object;
#ifdef USE_SURFACE_BTREE
GTree * faces;
#else /* not USE_SURFACE_BTREE */
GHashTable * faces;
#endif /* not USE_SURFACE_BTREE */
GtsFaceClass * face_class;
GtsEdgeClass * edge_class;
GtsVertexClass * vertex_class;
gboolean keep_faces;
}; |
The surface structure derived from GtsObject.
This structure should only be accessed through the following functions.
gts_surface_add_face ()
Adds face f to surface s.
gts_surface_remove_face ()
Removes face f from surface s.
gts_surface_copy ()
Add a copy of all the faces, edges and vertices of s2 to s1.
gts_surface_merge ()
Adds all the faces of with which do not already belong to s
to s.
gts_surface_read ()
Add to surface the data read from f. The format of the file pointed to
by f is as described in gts_surface_write().
gts_surface_is_manifold ()
gts_surface_is_orientable ()
gboolean gts_surface_is_orientable (GtsSurface *s); |
gts_surface_vertex_number ()
gts_surface_edge_number ()
gts_surface_face_number ()
gts_surface_boundary ()
GSList* gts_surface_boundary (GtsSurface *surface); |
struct GtsSurfaceStats
struct GtsSurfaceStats {
guint n_faces;
guint n_incompatible_faces;
guint n_duplicate_faces;
guint n_duplicate_edges;
guint n_boundary_edges;
guint n_non_manifold_edges;
GtsRange edges_per_vertex, faces_per_edge;
GtsSurface * parent;
}; |
Connectivity statistics.
struct GtsSurfaceQualityStats
struct GtsSurfaceQualityStats {
GtsRange face_quality;
GtsRange face_area;
GtsRange edge_length;
GtsRange edge_angle;
GtsSurface * parent;
}; |
Quality and geometry statistics.
gts_surface_stats ()
Fills stats with the statistics relevant to surface s.
gts_surface_quality_stats ()
Fills stats with quality statistics relevant to surface s.
gts_surface_print_stats ()
void gts_surface_print_stats (GtsSurface *s,
FILE *fptr); |
Writes in the file pointed to by fptr the statistics for surface s.
gts_surface_write ()
void gts_surface_write (GtsSurface *s,
FILE *fptr); |
Writes in the file fptr an ASCII representation of s. The file
format is as follows.
All the lines beginning with GTS_COMMENTS are ignored. The first line
contains three unsigned integers separated by spaces. The first
integer is the number of vertices, nv, the second is the number of
edges, ne and the third is the number of faces, nf.
Follows nv lines containing the x, y and z coordinates of the
vertices. Follows ne lines containing the two indices (starting
from one) of the vertices of each edge. Follows nf lines containing
the three ordered indices (also starting from one) of the edges of
each face.
The format described above is the least common denominator to all
GTS files. Consistent with an object-oriented approach, the GTS
file format is extensible. Each of the lines of the file can be
extended with user-specific attributes accessible through the
read() and write() virtual methods of each of the objects written
(surface, vertices, edges or faces). When read with different
object classes, these extra attributes are just ignored.
gts_surface_write_oogl ()
void gts_surface_write_oogl (GtsSurface *s,
FILE *fptr); |
Writes in the file fptr an OOGL (Geomview) representation of s.
gts_surface_write_oogl_boundary ()
void gts_surface_write_oogl_boundary (GtsSurface *s,
FILE *fptr); |
Writes in the file fptr an OOGL (Geomview) representation of the
boundary of s.
GtsFunc ()
gint (*GtsFunc) (gpointer item,
gpointer data); |
A user function called for each item of a collection.
gts_surface_foreach_vertex ()
Calls func once for each vertex of s.
gts_surface_foreach_edge ()
Calls func once for each edge of s.
gts_surface_foreach_face ()
Calls func once for each face of s.
gts_surface_foreach_face_remove ()
Calls func once for each face of s. If func returns TRUE the
corresponding face is removed from s (and destroyed if it does not
belong to any other surface and gts_allow_floating_faces is set to
FALSE).
struct GtsSurfaceTraverse
struct GtsSurfaceTraverse; |
gts_surface_traverse_new ()
gts_surface_traverse_next ()
gts_surface_traverse_destroy ()
Frees all the memory allocated for t.
gts_surface_strip ()
Decompose s into triangle strips for fast-rendering.