Up: Home page for Qhull (local)
Up: Qhull manual: contents
Up: ProgramsOptionsOutputFormatsGeomviewPrintQhullPrecisionTraceFunctions (local)
Up: Qhull code
To: GeomGlobalIoMemMergePolyQhullSetStatUser


qset_r.c -- set data type and operations

Qhull's data structures are constructed from sets. The functions and macros in qset_r.c construct, iterate, and modify these sets. They are the most frequently called functions in Qhull. For this reason, efficiency is the primary concern.

In Qhull, a set is represented by an unordered array of pointers with a maximum size and a NULL terminator (setT). Most sets correspond to mathematical sets (i.e., the pointers are unique). Some sets are sorted to enforce uniqueness. Some sets are ordered. For example, the order of vertices in a ridge determine the ridge's orientation. If you reverse the order of adjacent vertices, the orientation reverses. Some sets are not mathematical sets. They may be indexed as an array and they may include NULL pointers.

The most common operation on a set is to iterate its members. This is done with a 'FOREACH...' macro. Each set has a custom macro. For example, 'FOREACHvertex_' iterates over a set of vertices. Each vertex is assigned to the variable 'vertex' from the pointer 'vertexp'.

Most sets are constructed by appending elements to the set. The last element of a set is either NULL or the index of the terminating NULL for a partially full set. If a set is full, appending an element copies the set to a larger array.

Copyright © 1995-2020 C.B. Barber


» Geom GlobalIoMemMergePolyQhullSetStatUser

Index to qset_r.c and qset_r.h

»Data types and constants

»FOREACH macros

»Access and size macros

»Internal macros

»address macros

»Allocation and deallocation functions

»Access and predicate functions

»Add functions

»Check and print functions

»Copy, compact, and zero functions

»Delete functions

»Temporary set functions


Up: Home page for Qhull (local)
Up: Qhull manual: contents
Up: ProgramsOptionsOutputFormatsGeomviewPrintQhullPrecisionTraceFunctions (local)
Up: Qhull code
To: GeomGlobalIoMemMergePolyQhullSetStatUser


The Geometry Center Home Page

Comments to: qhull@qhull.org
Created: May 2, 1997 --- Last modified: see top