Name
Hierarchical surfaces -- extension of progressive surfaces allowing arbitrary sequences of vertex split or collapse.
Synopsis
#include <gts.h>
#define GTS_HSURFACE_CLASS (klass)
#define GTS_HSURFACE (obj)
#define GTS_IS_HSURFACE (obj)
struct GtsHSurfaceClass;
struct GtsHSurface;
GtsHSurfaceClass* gts_hsurface_class (void);
GtsHSurface* gts_hsurface_new (GtsHSurfaceClass *klass,
GtsHSplitClass *hsplit_class,
GtsPSurface *psurface,
GtsKeyFunc expand_key,
gpointer expand_data,
GtsKeyFunc collapse_key,
gpointer collapse_data);
void gts_hsurface_traverse (GtsHSurface *hsurface,
GTraverseType order,
gint depth,
GtsSplitTraverseFunc func,
gpointer data);
guint gts_hsurface_height (GtsHSurface *hsurface);
void gts_hsurface_foreach (GtsHSurface *hsurface,
GTraverseType order,
GtsFunc func,
gpointer data); |
Description
Hierarchical surfaces are used to manage sequences of vertex splits or collapses which can be different from the initial sequence described by the progressive surface. In this way different branches of the vertex split tree can be collapsed or expanded resulting in a level of detail varying across different parts of the surface. This is the fundamental mechanism of view-dependent level of detail.
Hierarchical surfaces maintain two priority heaps one containing the next vertices (GtsHSplit) ready to be expanded, the other the next vertices ready to be collapsed. By updating the priorities for these vertices as the view point changes and collapsing or expanding the top ones until a given criterium is verified, the level of detail can be dynamically adapted.
Details
GTS_HSURFACE_CLASS()
#define GTS_HSURFACE_CLASS(klass) |
Casts klass to GtsHSurfaceClass.
GTS_HSURFACE()
#define GTS_HSURFACE(obj) |
Casts obj to GtsHSurface.
GTS_IS_HSURFACE()
#define GTS_IS_HSURFACE(obj) |
Evaluates to TRUE if obj is a GtsHSurface.
struct GtsHSurfaceClass
The hierarchical surface class derived from GtsObjectClass.
struct GtsHSurface
struct GtsHSurface {
GtsObject object;
GtsSurface * s;
GSList * roots;
GtsEHeap * expandable;
GtsEHeap * collapsable;
GPtrArray * split;
guint nvertex;
}; |
The hierarchical surface object.
gts_hsurface_traverse ()
Traverses a hierarchical surface starting from its roots. It calls
the given function for each GtsHSplit visited.
See also gts_split_traverse().
gts_hsurface_foreach ()
void gts_hsurface_foreach (GtsHSurface *hsurface,
GTraverseType order,
GtsFunc func,
gpointer data); |
Starts by expanding all the GtsHSplit of hsurface. If order is
G_PRE_ORDER, calls func for each GtsHSplit and collapses it. If
order is G_POST_ORDER, collapses each GtsHSplit first and then
calls func. The traversal can be halted at any point by returning
TRUE from func.