Using vertex clusters and vertex cluster grids it is easy to design out-of-core algorithms for surface simplification. This approach has been detailed in a recent paper by Lindstrom and Turk ("Out-of-core simplification of large polygonal models", 2000).
Vertex clusters are just groups of vertices collapsed into a single vertex. The position of this single representative vertex can be derived with different techniques. The default GTS implementation GtsCluster just takes the average of the positions of the vertices in a given cluster as the representative position. Clusters are created using gts_cluster_new(). The cluster is initially empty and the position of the representative vertex is set to the origin. Vertices are added using gts_cluster_add() which calls the add() virtual method of GtsClusterClass. Once all the vertices have been added gts_cluster_update() computes the position of the representative vertex.
Clusters are grouped using the GtsClusterGrid object which is just an implementation of the hash-table based regular grid of Lindstrom and Turk. This regular grid is created using gts_cluster_grid_new(). Once created triangles of the surface to be simplified can be added using gts_cluster_grid_add_triangle() which adds the vertices of the triangle to the GtsCluster they belong to and adds the corresponding faces to the simplified surface. After all the triangles of the original surface have been added the position of the representative vertex of all the vertex clusters is computed using gts_cluster_grid_update(). The simplified surface is then complete and the cluster grid can be destroyed using gts_object_destroy().
Evaluates to TRUE if obj is a GtsCluster, FALSE otherwise.
obj :
a pointer to test.
struct GtsClusterClass
struct GtsClusterClass;
The cluster class derived from GtsClusterClass. Virtual function add adds point p to the cluster while passing user-data data. Virtual function update computes the position of the representative vertex.