Up: Home page for Qhull (local)
Up: Qhull manual: contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace • Functions (local)
Up: Qhull code
To: Qhull files
To: Geom • Global • Io • Mem • Merge • Poly • Qhull • Set • Stat • User

# Reentrant Qhull functions, macros, and data structures

> The following sections provide an overview and index to reentrant Qhull's functions, macros, and data structures. Each section starts with an introduction. See also 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

> Reentrant Qhull is nearly the same as non-reentrant Qhull. In reentrant Qhull, the qhT data structure is the first parameter to most functions. Qhull accesses this data structure with 'qh->...'. In non-reentrant Qhull, the global data structure is either a struct (qh_QHpointer==0) or a pointer (qh_QHpointer==1). The non-reentrant code looks different because this data structure is accessed via the 'qh' macro. This macro expands to 'qh_qh.' or 'qh_qh->' (resp.).

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

> A useful starting point is libqhull_r.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_r.c to learn how the print function is implemented.

> If your web browser is configured for .c and .h files, the function, macro, and data type links go to the corresponding source location.

> - Internet Explorer -- OK for web access but not for file access
> - Chrome -- OK for web access but not for file access
> - Firefox -- OK for web access but not for file access

>       # .htaccess on web server with NL line endings
>       AddType text/html .c .h

> - Opera 12.10
>   1. In Tools > Preferences > Advanced > Downloads
>   2. Uncheck 'Hide file types opened with Opera'
>   3. Quick find 'html'
>   4. Select 'text/html' > Edit
>   5. Add File extensions 'c,h,'
>   6. Click 'OK'

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

Copyright © 1997-2020 C.B. Barber

## »Qhull files

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

> > Makefile, CMakeLists.txt
> >   `Makefile` is preconfigured for gcc. `CMakeLists.txt` supports multiple platforms with CMake. Qhull includes project files for Visual Studio and Qt.
> > libqhull_r.h
> >   Include file for the Qhull library (`libqhull.so`, `qhull.dll`, `libqhullstatic.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_r.h, geom_r.c, geom2_r.c, random_r.c, random_r.h
> >   Geometric routines. These routines implement mathematical functions such as Gaussian elimination and geometric routines needed for Qhull. Frequently used routines are in `geom_r.c` while infrequent ones are in `geom2_r.c`.
> > Global, global_r.c, libqhull_r.h
> >   Global routines. Qhull uses a global data structure, `qh`, to store globally defined constants, lists, sets, and variables. `global_r.c` initializes and frees these structures.
> > Io, io_r.h, io_r.c
> >   Input and output routines. Qhull provides a wide range of input and output options.
> > Mem, mem_r.h, mem_r.c
> >   Memory routines. Qhull provides memory allocation and deallocation. It uses quick-fit allocation.
> > Merge, merge_r.h, merge_r.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_r.h, poly_r.c, poly2_r.c, libqhull_r.h
> >   Polyhedral routines. Qhull produces a polyhedron as a list of facets with vertices, neighbors, ridges, and geometric information. `libqhull_r.h` defines the main data structures. Frequently used routines are in `poly_r.c` while infrequent ones are in `poly2_r.c`.
> > Qhull, libqhull_r.c, libqhull_r.h, qhull_ra.h, unix_r.c , qconvex_r.c , qdelaun_r.c , qhalf_r.c , qvoronoi_r.c
> >   Top-level routines. The Quickhull algorithm is implemented by `libqhull_r.c`. `qhull_ra.h` includes all header files.
> > Set, qset_r.h, qset_r.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_r.h, stat_r.c
> >   Statistical routines. Qhull maintains statistics about its implementation.
> > User, user_r.h, user_r.c, user_eg_r.c, user_eg2_r.c, user_eg3_r.cpp,
> >   User-defined routines. Qhull allows the user to configure the code with defined constants and specialized routines.

Up: Home page for Qhull (local)
Up: Qhull manual: contents
Up: Programs • Options • Output • Formats • Geomview • Print • Qhull • Precision • Trace • Functions (local)
Up: Qhull code
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