Up: Home page for Qhull
Up: Qhull manual: Table of Contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace
Up: Qhull code
To: Qhull files
To: Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

# Qhull functions, macros, and data structures

> The following sections provide an overview and index to Qhull's functions, macros, and data structures. Each section starts with an introduction. Also see Calling Qhull from C programs and Calling Qhull from C++ programs.

> Qhull uses the following conventions:

> > - in code, global variables start with "qh "
> > - in documentation, global variables start with 'qh.'
> > - constants start with an upper case word
> > - important globals include an '_'
> > - functions, macros, and constants start with "qh_"
> > - data types end in "T"
> > - macros with arguments end in "_"
> > - iterators are macros that use local variables
> > - iterators for sets start with "FOREACH"
> > - iterators for lists start with "FORALL"
> > - qhull options are in single quotes (e.g., 'Pdn')
> > - lists are sorted alphabetically
> > - preprocessor directives on left margin for older compilers

> When reading the code, please note that the global data structure, 'qh', is a macro. It either expands to "qh_qh." or to "qh_qh->". The later is used for applications which run concurrent calls to qh_qhull().

> When reading code with an editor, a search for "procedure will locate the header of qh_procedure. A search for * procedure will locate the tail of qh_procedure.

> A useful starting point is libqhull.h. It defines most of Qhull data structures and top-level functions. Search for 'PFn' to determine the corresponding constant in Qhull. Search for 'Fp' to determine the corresponding qh_PRINT... constant. Search io.c to learn how the print function is implemented.

> If your web browser loads .c and .h files with an external application, change the MIME type of .c and .h files to "text/html". Opera does not always work since it treats '<' characters as HTML tags.

> Please report documentation and link errors to qhull-bug@qhull.org.

> Brad Barber, Cambridge MA, June 1, 2002

Copyright © 1997-2010 C.B. Barber

## »Qhull files

> This sections lists the .c and .h files for Qhull. Please refer to these files for detailed information.

> > libqhull.h
> >   Include file for the Qhull library, `qhull.a`. Data structures are documented under Poly. Global variables are documented under Global. Other data structures and variables are documented under Qhull or Geom.
> > Geom, geom.h, geom.c, geom2.c, random.c, random.h
> >   Geometric routines. These routines implement mathematical functions such as Gaussian elimination and geometric routines needed for Qhull. Frequently used routines are in `geom.c` while infrequent ones are in `geom2.c`.
> > Global, global.c, libqhull.h
> >   Global routines. Qhull uses a global data structure, `qh`, to store globally defined constants, lists, sets, and variables. `global.c` initializes and frees these structures.
> > Io, io.h, io.c
> >   Input and output routines. Qhull provides a wide range of input and output options.
> > Mem, mem.h, mem.c
> >   Memory routines. Qhull provides memory allocation and deallocation. It uses quick-fit allocation.
> > Merge, merge.h, merge.c
> >   Merge routines. Qhull handles precision problems by merged facets or joggled input. These routines merge simplicial facets, merge non-simplicial facets, merge cycles of facets, and rename redundant vertices.
> > Poly, poly.h, poly.c, poly2.c, libqhull.h
> >   Polyhedral routines. Qhull produces a polyhedron as a list of facets with vertices, neighbors, ridges, and geometric information. `Qhull.h` defines the main data structures. Frequently used routines are in `poly.c` while infrequent ones are in `poly2.c`.
> > Qhull, libqhull.c, libqhull.h, qhull_a.h, unix.c , qconvex.c , qdelaun.c , qhalf.c , qvoronoi.c
> >   Top-level routines. The Quickhull algorithm is implemented by `libqhull.c`. `qhull_a.h` includes all header files.
> > Set, qset.h, qset.c
> >   Set routines. Qhull implements its data structures as sets. A set is an array of pointers that is expanded as needed. This is a separate package that may be used in other applications.
> > Stat, stat.h, stat.c
> >   Statistical routines. Qhull maintains statistics about its implementation.
> > User, user.h, user.c, user_eg.c, qhull_interface.cpp
> >   User-defined routines. Qhull allows the user to configure the code with defined constants and specialized routines.

Up: Home page for Qhull
Up: Qhull manual: Table of Contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace
Up: Qhull code: Table of Contents
To: Qhull files
To: Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

The Geometry Center Home Page

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