Spring Cleaning

* removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this.
* removed deprecated solid physics library, sumo integrations and qhull, a dependency
* removed ODE, was no longer being build or supported
* remove BEOS and AMIGA defines and references in Makefiles.
This commit is contained in:
Campbell Barton 2009-06-21 16:18:38 +00:00
parent de77b4a9b3
commit 8ead648fd1
289 changed files with 28 additions and 65823 deletions

View File

@ -285,9 +285,7 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_SDL'] = False
target_env_defs['WITH_BF_JPEG'] = False
target_env_defs['WITH_BF_PNG'] = False
target_env_defs['WITH_BF_ODE'] = False
target_env_defs['WITH_BF_BULLET'] = False
target_env_defs['WITH_BF_SOLID'] = False
target_env_defs['WITH_BF_BINRELOC'] = False
target_env_defs['BF_BUILDINFO'] = False
target_env_defs['BF_NO_ELBEEM'] = True

View File

@ -141,20 +141,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=True
WITH_BF_PLAYER=True
WITH_BF_ODE = False
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = '${BF_ODE}/include'
BF_ODE_LIB = '${BF_ODE}/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

View File

@ -74,20 +74,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE='false'
WITH_BF_ODE = 'false'
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = 'true'
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
#WITH_BF_NSPR = 'true'
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

View File

@ -77,20 +77,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_ODE = False
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

View File

@ -74,20 +74,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = False
WITH_BF_ODE = True
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'

View File

@ -61,20 +61,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False
WITH_BF_ODE = False
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = '${BF_ODE}/include'
BF_ODE_LIB = '${BF_ODE}/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

View File

@ -69,20 +69,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE=False
WITH_BF_ODE = False
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
#WITH_BF_NSPR = True
#BF_NSPR = $(LIBDIR)/nspr
#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr

View File

@ -77,20 +77,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = False
WITH_BF_ODE = True
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'

View File

@ -90,20 +90,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = True
WITH_BF_ODE = True
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'

View File

@ -93,20 +93,11 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False
WITH_BF_ODE = True
BF_ODE = LIBDIR + '/ode'
BF_ODE_INC = BF_ODE + '/include'
BF_ODE_LIB = BF_ODE + '/lib/libode.a'
WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src'
BF_BULLET_INC = '${BF_BULLET}'
BF_BULLET_LIB = 'extern_bullet'
BF_SOLID = '#extern/solid'
BF_SOLID_INC = '${BF_SOLID}'
BF_SOLID_LIB = 'extern_solid'
BF_WINTAB = LIBDIR + '/wintab'
BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'

View File

@ -24,11 +24,6 @@
#
# ***** END GPL LICENSE BLOCK *****
IF(WITH_GAMEENGINE)
ADD_SUBDIRECTORY(qhull)
ADD_SUBDIRECTORY(solid)
ENDIF(WITH_GAMEENGINE)
IF(WITH_BULLET)
ADD_SUBDIRECTORY(bullet2)
ENDIF(WITH_BULLET)

2
extern/Makefile vendored
View File

@ -30,7 +30,7 @@ include nan_definitions.mk
SOURCEDIR = extern
DIR = $(OCGDIR)/extern
DIRS = qhull/src solid glew/src
DIRS = glew/src
ifeq ($(WITH_FFMPEG), true)
ifeq ($(NAN_FFMPEG), $(LCGDIR)/ffmpeg)

4
extern/SConscript vendored
View File

@ -4,10 +4,6 @@ Import('env')
SConscript(['glew/SConscript'])
if env['WITH_BF_GAMEENGINE']:
if env['WITH_BF_SOLID']:
SConscript(['qhull/SConscript', 'solid/SConscript'])
if env['WITH_BF_BULLET']:
SConscript(['bullet2/src/SConscript'])

View File

@ -1,45 +0,0 @@
# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
SET(INC include src)
SET(SRC
src/geom.c
src/geom2.c
src/global.c
src/io.c
src/mem.c
src/merge.c
src/poly.c
src/poly2.c
src/qhull.c
src/qset.c
src/stat.c
src/user.c
)
BLENDERLIB(extern_qhull "${SRC}" "${INC}")
#, libtype=['game2','player'], priority=[50, 85]

View File

@ -1,37 +0,0 @@
Qhull, Copyright (c) 1993-2002
The National Science and Technology Research Center for
Computation and Visualization of Geometric Structures
(The Geometry Center)
University of Minnesota
400 Lind Hall
207 Church Street S.E.
Minneapolis, MN 55455 USA
email: qhull@geom.umn.edu
This software includes Qhull from The Geometry Center. Qhull is
copyrighted as noted above. Qhull is free software and may be obtained
via http from www.geom.umn.edu. It may be freely copied, modified,
and redistributed under the following conditions:
1. All copyright notices must remain intact in all files.
2. A copy of this text file must be distributed along with any copies
of Qhull that you redistribute; this includes copies that you have
modified, or copies of programs or other software products that
include Qhull.
3. If you modify Qhull, you must include a notice giving the
name of the person performing the modification, the date of
modification, and the reason for such modification.
4. When distributing modified versions of Qhull, or other software
products that include Qhull, you must provide notice that the original
source code may be obtained as noted above.
5. There is no warranty or other guarantee of fitness for Qhull, it is
provided solely "as is". Bug reports or fixes may be sent to
qhull_bug@geom.umn.edu; the authors may or may not act on them as
they desire.

View File

@ -1,318 +0,0 @@
Name
qhull, rbox 2002.1 August 20, 2002
Convex hull, Delaunay triangulation, Voronoi diagrams, Halfspace intersection
Documentation:
html/index.htm
Available from:
<http://www.geom.umn.edu/software/qhull>
<http://savannah.gnu.org/projects/qhull>
<http://www.thesa.com/software/qhull>
Version 1 (simplicial only):
<http://www.geom.umn.edu/software/qhull/qhull-1.0.tar.gz>
<http://www.geom.umn.edu/software/qhull/qhull.sit.hqx>
News and a paper:
<http://www.geom.umn.edu/~bradb/qhull-news.html>
<http://www.geom.umn.edu/software/qhull/qhull-96.ps>
Purpose
Qhull is a general dimension convex hull program that reads a set
of points from stdin, and outputs the smallest convex set that contains
the points to stdout. It also generates Delaunay triangulations, Voronoi
diagrams, furthest-site Voronoi diagrams, and halfspace intersections
about a point.
Rbox is a useful tool in generating input for Qhull; it generates
hypercubes, diamonds, cones, circles, simplices, spirals,
lattices, and random points.
Qhull produces graphical output for Geomview. This helps with
understanding the output. <http://www.geomview.org>
Environment requirements
Qhull and rbox should run on all 32-bit and 64-bit computers. Use
an ANSI C or C++ compiler to compile the program. The software is
self-contained.
Qhull is copyrighted software. Please read COPYING.txt and REGISTER.txt
before using or distributing Qhull.
To contribute to Qhull
Qhull is on Savannah, http://savannah.gnu.org/projects/qhull/
Qhull on Windows 95, 98, ME, NT, 2000, XP
The zip file contains rbox.exe, qhull.exe, qconvex.exe, qdelaunay.exe,
qhalf.exe, qvoronoi.exe, documentation files, and source files.
To install Qhull:
- Unzip the files into a directory. You may use WinZip32 <www.hotfiles.com>
- Open a DOS window for the directory.
- In Windows 95, the DOS window needs improvement.
- Double-click on qhull\eg\qhull-go.bat to call doskey (arrow keys).
- Increase the size of the screen font to 8x12.
- If the text is too dim, fix the screen colors with shareware (e.g., crt.exe)
- If you use qhull a lot, consider using the Cygwin Unix shell,
Cygwin tools (http://sources.redhat.com/cygwin/)
- Execute 'qconvex' for a synopsis and examples.
- Execute 'rbox 10 | qconvex' to compute the convex hull of 10 random points.
- Execute 'rbox 10 | qconvex i TO file' to write results to 'file'.
- If an error occurs, Windows 95 sends the error to stdout instead of stderr
- use 'TO xxx' to send normal output to xxx and error output to stdout
- Browse the documentation: qhull\html\index.htm
Compiling for Unix
The gzip file, qhull.tgz, contains documentation and source files for
qhull and rbox.
To unpack the gzip file
- tar zxf qhull.tgz
- cd qhull
Compiling with the Debian Make:[R. Laboissiere]
- cd src
- ./Make-config.sh
- cd ..
- configure
- make
Compiling with Makefile (i.e., Makefile.txt)
- cd src
- in Makefile, check the CC, CCOPTS1, PRINTMAN, and PRINTC defines
- the defaults are gcc and enscript
- CCOPTS1 should include the ANSI flag. It defines __STDC__
- in user.h, check the definitions of qh_SECticks and qh_CPUclock.
- use '#define qh_CLOCKtype 2' for timing runs longer than 1 hour
- type: make
- this builds: qhull qconvex qdelaunay qhalf qvoronoi rbox libqhull.a
- type: make doc
- this prints the man page
- See also qhull/html/index.htm
- if your compiler reports many errors, it is probably not a ANSI C compiler
- you will need to set the -ansi switch or find another compiler
- if your compiler warns about missing prototypes for fprintf() etc.
- this is ok, your compiler should have these in stdio.h
- if your compiler warns about missing prototypes for memset() etc.
- include memory.h in qhull_a.h
- if your compiler is gcc-2.95.1, you need to set flag -fno-strict-aliasing.
- This flag is set by default for other versions [Karas, Krishnaswami]
- if your compiler reports "global.c: storage size of 'qh_qh' isn't known"
- delete the initializer "={0}" in global.c, stat.c and mem.c
- if your compiler warns about "stat.c: improper initializer"
- this is ok, the initializer is not used
- if you have trouble building libqhull.a with 'ar'
- try 'make -f Makefile.txt qhullx'
- if the code compiles, the qhull test case will automatically execute
- if an error occurs, there's an incompatibility between machines
- For gcc-2.95.1, you need to set flag -fno-strict-aliasing.
It is set by default for other versions of gcc [Karas, Krishnaswami]
- If you can, try a different compiler
- You can turn off the Qhull memory manager with qh_NOmem in mem.h
- You can turn off compiler optimization (-O2 in Makefile)
- If you find the source of the problem, please let us know
- if you have Geomview (www.geomview.org)
- try 'rbox 100 | qconvex G >a' and load 'a' into Geomview
- run 'q_eg' for Geomview examples of Qhull output (see qh-eg.htm)
- to install the programs and their man pages:
- define MANDIR and BINDIR
- type 'make install'
Compiling for Windows NT, 2000, XP with cygwin (www.cygwin.com)
- install cygwin with gcc, make, ar, and ln
- cd qhull/src
- make -f Makefile.txt
Compiling for Windows 95, 98, NT, 2000, XP
Qhull compiles as a console application in Visual C++ 5.0 at warning
level 3.
Visual C++ quickstart for qhull.exe:
- create a "Win32 console application" called "qhull"
- add the following files:
geom.c geom2.c global.c io.c mem.c merge.c poly.c poly2.c qhull.c
qset.c stat.c unix.c user.c
- create a "Win32 console application" called "rbox"
- add rbox.c
Visual C++ quickstart for qhull library, qconvex.exe, etc.
- To simplify setting up lots of projects,
- create a temporary "Win32 console application" called "source"
- add all .c files from .../src/...
- In Tools::Options::Tab
Set tab size to 8 and indent size to 2
- create a "Win32 console application" called "rbox"
- move rbox.c from "qhull source"
- for Project:Settings..., Link
you only need the default libraries
- build the project
- create a "Win32 static library" called "library"
- move these files from "qhull source"
geom.c geom2.c global.c io.c mem.c merge.c poly.c poly2.c qhull.c
qset.c stat.c user.c
- set the library file (use the same for debug and release)
- build the project
- create a "Win32 console application" called "qhull"
- move unix.c from "qhull source"
- Set the library file in Project:Settings..., Link
- Qhull does not use other libraries
- create a "Win32 console application" called "qconvex"
- move qconvex.c from "qhull source"
- Set the library file in Project:Settings..., Link
- do the same for qdelaun.c, qhalf, qvoronoi.c, user_eg.c, user_eg2.c
- delete "qhull sources" since it is no longer needed
- Set the library file in Project:Settings..., Link
- use Project:Settings to make any changes
- use batch build to rebuild everything
Qhull compiles with Borland C++ 5.0 bcc32. A Makefile is included.
Execute 'make -f MBorland'. If you use the Borland IDE, set the ANSI
option in Options:Project:Compiler:Source:Language-compliance.
Qhull compiles with Borland C++ 4.02 for Win32 and DOS Power Pack.
Use 'make -f MBorland -D_DPMI'. Qhull 1.0 compiles with Borland
C++ 4.02. For rbox 1.0, use "bcc32 -WX -w- -O2-e -erbox -lc rbox.c".
Use the same options for Qhull 1.0. [D. Zwick]
Qhull compiles with Metrowerks C++ 1.7 with the ANSI option.
If you turn on full warnings, the compiler will report a number of
unused variables, variables set but not used, and dead code. These are
intentional. For example, variables may be initialized (unnecessarily)
to prevent warnings about possible use of uninitialized variables.
Compiling for the Power Macintosh
Qhull compiles for the Power Macintosh with Metrowerk's C compiler.
It uses the SIOUX interface to read point coordinates and return output.
There is no graphical output. For project files, see 'Compiling for
Windows 95'. Instead of using SIOUX, Qhull may be embedded within an
application.
Version 1 is available for Macintosh computers by download of qhull.sit.hqx
It reads point coordinates from a standard file and returns output
to a standard file. There is no graphical output.
Compiling for other machines
Some users have reported problems with compiling Qhull under Irix 5.1. It
compiles under other versions of Irix.
If you have troubles with the memory manager, you can turn it off by
defining qh_NOmem in mem.h.
You may compile Qhull with a C++ compiler.
Distributed files
README.txt // instructions for installing Qhull
REGISTER.txt // Qhull registration
COPYING.txt // copyright notice
Announce.txt // announcement
Changes.txt // change history for Qhull and rbox
qh-faq.htm // Frequently asked questions
qh-home.htm // Home page
qh-get.htm // Download page
html/index.htm // Manual
Makefile.txt // Makefile for Unix or cygwin 'make'
MBorland // Makefile for Borland C++/Win32
Make-config.sh // Create Debian configure and automake
src/
rbox consists of:
rbox.exe // Win32 executable (.zip only)
rbox.htm // html manual
rbox.man // Unix man page
rbox.txt
rbox.c // source program
qhull consists of:
qhull.exe // Win32 executables (.zip only)
qconvex.exe
qdelaunay.exe
qhalf.exe
qvoronoi.exe
qhull-go.bat // DOS window
qconvex.htm // html manuals
qdelaun.htm
qdelau_f.htm
qhalf.htm
qvoronoi.htm
qvoron_f.htm
qh-eg.htm
qh-impre.htm
qh-in.htm
index.htm
qh-opt*.htm
qh-quick.htm
qh--4d.gif,etc. // images for manual
qhull.man // Unix man page
qhull.txt
q_eg // shell script for Geomview examples
q_egtest // shell script for Geomview test examples
q_test // shell script to test qhull
top-level source files:
src/index.htm // index to source files
qh-...htm // specific files
user.h // header file of user definable constants
qhull.h // header file for qhull
unix.c // Unix front end to qhull
qhull.c // Quickhull algorithm with partitioning
user.c // user re-definable functions
user_eg.c // example of incorporating qhull into a user program
user_eg2.c // more complex example
qhull_interface.cpp // call Qhull from C++
other source files:
qhull_a.h // include file for *.c
geom.c // geometric routines
geom2.c
geom.h
global.c // global variables
io.c // input-output routines
io.h
mem.c // memory routines, this is stand-alone code
mem.h
merge.c // merging of non-convex facets
merge.h
poly.c // polyhedron routines
poly2.c
poly.h
qset.c // set routines, this only depends on mem.c
qset.h
stat.c // statistics
stat.h
Authors:
C. Bradford Barber Hannu Huhdanpaa
bradb@geom.umn.edu hannu@geom.umn.edu
c/o The Geometry Center
University of Minnesota
400 Lind Hall
207 Church Street S.E.
Minneapolis, MN 55455
This software was developed under NSF grants NSF/DMS-8920161 and
NSF-CCR-91-15793 750-7504 at the Geometry Center and Harvard
University. If you find Qhull useful, please let us know.

View File

@ -1,37 +0,0 @@
Dear User of Geometry Center Software:
We would like to find out how you are using our software. Think of
Geometry Center software as a new kind of shareware: you share your
science and successes with us, and we share our software and support
with you.
If you use Geometry Center software, please send us a note telling
us what you are doing with it.
We need to know:
(1) What you are working on - an abstract of your work would be
fine.
(2) What Geometry Center software you use.
(3) How that software has helped you, for example, by increasing
your productivity or allowing you to do things you could not do
before. In particular, if you feel that Geometry Center
software has had a direct bearing on your work, please tell us
about this.
We encourage you to cite the use of any Geometry Center software you
have used in your publications.
To cite Qhull, use
Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., "The Quickhull
algorithm for convex hulls," ACM Trans. on Mathematical Software,
Dec 1996. http://www.geom.umn.edu/software/qhull
Please send e-mail to
qhull@geom.umn.edu
Thank you!

View File

@ -1,35 +0,0 @@
#!/usr/bin/python
import sys
import os
Import('env')
defs = ''
cflags = []
if sys.platform=='linux2' or sys.platform=='linux-i386':
cflags += ['-O2','-ansi']
elif env['OURPLATFORM']=='win32-vc':
cflags += ['/O2']
elif env['OURPLATFORM']=='win32-mingw':
cflags += ['-O2']
elif sys.platform=='sunos5':
cflags += ['-O2', '-ansi']
elif sys.platform=='darwin':
cflags += ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math']
sources = ['src/geom.c',
'src/geom2.c',
'src/global.c',
'src/io.c',
'src/mem.c',
'src/merge.c',
'src/poly.c',
'src/poly2.c',
'src/qhull.c',
'src/qset.c',
'src/stat.c',
'src/user.c']
incs = 'include src'
env.BlenderLib ( 'extern_qhull', sources, Split(incs), Split(defs), libtype=['extern'], priority=[50], compileflags = cflags)

View File

@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "qhull"=".\qhull\qhull.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -1,192 +0,0 @@
# Microsoft Developer Studio Project File - Name="qhull" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=qhull - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "qhull.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "qhull.mak" CFG="qhull - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "qhull - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "qhull - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "qhull - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\lib\windows\qhull\include\qhull\ XCOPY /Y Release\*.lib ..\..\..\..\..\lib\windows\qhull\lib\
# End Special Build Tool
!ELSEIF "$(CFG)" == "qhull - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\lib\windows\qhull\include\qhull\ XCOPY /Y Debug\*.lib ..\..\..\..\..\lib\windows\qhull\lib\Debug\
# End Special Build Tool
!ENDIF
# Begin Target
# Name "qhull - Win32 Release"
# Name "qhull - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\geom.c
# End Source File
# Begin Source File
SOURCE=..\..\src\geom2.c
# End Source File
# Begin Source File
SOURCE=..\..\src\global.c
# End Source File
# Begin Source File
SOURCE=..\..\src\io.c
# End Source File
# Begin Source File
SOURCE=..\..\src\mem.c
# End Source File
# Begin Source File
SOURCE=..\..\src\merge.c
# End Source File
# Begin Source File
SOURCE=..\..\src\poly.c
# End Source File
# Begin Source File
SOURCE=..\..\src\poly2.c
# End Source File
# Begin Source File
SOURCE=..\..\src\qhull.c
# End Source File
# Begin Source File
SOURCE=..\..\src\qset.c
# End Source File
# Begin Source File
SOURCE=..\..\src\stat.c
# End Source File
# Begin Source File
SOURCE=..\..\src\user.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\geom.h
# End Source File
# Begin Source File
SOURCE=..\..\src\io.h
# End Source File
# Begin Source File
SOURCE=..\..\src\mem.h
# End Source File
# Begin Source File
SOURCE=..\..\src\merge.h
# End Source File
# Begin Source File
SOURCE=..\..\src\poly.h
# End Source File
# Begin Source File
SOURCE=..\..\src\qhull.h
# End Source File
# Begin Source File
SOURCE=..\..\src\qhull_a.h
# End Source File
# Begin Source File
SOURCE=..\..\src\qset.h
# End Source File
# Begin Source File
SOURCE=..\..\src\stat.h
# End Source File
# Begin Source File
SOURCE=..\..\src\user.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,177 +0,0 @@
/*<html><pre> -<a href="qh-geom.htm"
>-------------------------------</a><a name="TOP">-</a>
geom.h
header file for geometric routines
see qh-geom.htm and geom.c
copyright (c) 1993-2002 The Geometry Center
*/
#ifndef qhDEFgeom
#define qhDEFgeom 1
/* ============ -macros- ======================== */
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fabs_">-</a>
fabs_(a)
returns the absolute value of a
*/
#define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fmax_">-</a>
fmax_(a,b)
returns the maximum value of a and b
*/
#define fmax_( a,b ) ( ( a ) < ( b ) ? ( b ) : ( a ) )
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fmin_">-</a>
fmin_(a,b)
returns the minimum value of a and b
*/
#define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="maximize_">-</a>
maximize_(maxval, val)
set maxval to val if val is greater than maxval
*/
#define maximize_( maxval, val ) {if (( maxval ) < ( val )) ( maxval )= ( val );}
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="minimize_">-</a>
minimize_(minval, val)
set minval to val if val is less than minval
*/
#define minimize_( minval, val ) {if (( minval ) > ( val )) ( minval )= ( val );}
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="det2_">-</a>
det2_(a1, a2,
b1, b2)
compute a 2-d determinate
*/
#define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="det3_">-</a>
det3_(a1, a2, a3,
b1, b2, b3,
c1, c2, c3)
compute a 3-d determinate
*/
#define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \
- ( b1 )*det2_( a2,a3,c2,c3 ) + ( c1 )*det2_( a2,a3,b2,b3 ) )
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="dX">-</a>
dX( p1, p2 )
dY( p1, p2 )
dZ( p1, p2 )
given two indices into rows[],
compute the difference between X, Y, or Z coordinates
*/
#define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] ))
#define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
#define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
#define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
/*============= prototypes in alphabetical order, infrequent at end ======= */
void qh_backnormal (realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero);
void qh_distplane (pointT *point, facetT *facet, realT *dist);
facetT *qh_findbest (pointT *point, facetT *startfacet,
boolT bestoutside, boolT isnewfacets, boolT noupper,
realT *dist, boolT *isoutside, int *numpart);
facetT *qh_findbesthorizon (boolT ischeckmax, pointT *point,
facetT *startfacet, boolT noupper, realT *bestdist, int *numpart);
facetT *qh_findbestnew (pointT *point, facetT *startfacet, realT *dist,
boolT bestoutside, boolT *isoutside, int *numpart);
void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero);
realT qh_getangle(pointT *vect1, pointT *vect2);
pointT *qh_getcenter(setT *vertices);
pointT *qh_getcentrum(facetT *facet);
realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist);
void qh_normalize (coordT *normal, int dim, boolT toporient);
void qh_normalize2 (coordT *normal, int dim, boolT toporient,
realT *minnorm, boolT *ismin);
pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist);
void qh_setfacetplane(facetT *newfacets);
void qh_sethyperplane_det (int dim, coordT **rows, coordT *point0,
boolT toporient, coordT *normal, realT *offset, boolT *nearzero);
void qh_sethyperplane_gauss (int dim, coordT **rows, pointT *point0,
boolT toporient, coordT *normal, coordT *offset, boolT *nearzero);
boolT qh_sharpnewfacets (void);
/*========= infrequently used code in geom2.c =============*/
coordT *qh_copypoints (coordT *points, int numpoints, int dimension);
void qh_crossproduct (int dim, realT vecA[3], realT vecB[3], realT vecC[3]);
realT qh_determinant (realT **rows, int dim, boolT *nearzero);
realT qh_detjoggle (pointT *points, int numpoints, int dimension);
void qh_detroundoff (void);
realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero);
realT qh_distnorm (int dim, pointT *point, pointT *normal, realT *offsetp);
realT qh_distround (int dimension, realT maxabs, realT maxsumabs);
realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv);
realT qh_facetarea (facetT *facet);
realT qh_facetarea_simplex (int dim, coordT *apex, setT *vertices,
vertexT *notvertex, boolT toporient, coordT *normal, realT *offset);
pointT *qh_facetcenter (setT *vertices);
facetT *qh_findgooddist (pointT *point, facetT *facetA, realT *distp, facetT **facetlist);
void qh_getarea (facetT *facetlist);
boolT qh_gram_schmidt(int dim, realT **rows);
boolT qh_inthresholds (coordT *normal, realT *angle);
void qh_joggleinput (void);
realT *qh_maxabsval (realT *normal, int dim);
setT *qh_maxmin(pointT *points, int numpoints, int dimension);
realT qh_maxouter (void);
void qh_maxsimplex (int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex);
realT qh_minabsval (realT *normal, int dim);
int qh_mindiff (realT *vecA, realT *vecB, int dim);
boolT qh_orientoutside (facetT *facet);
void qh_outerinner (facetT *facet, realT *outerplane, realT *innerplane);
coordT qh_pointdist(pointT *point1, pointT *point2, int dim);
void qh_printmatrix (FILE *fp, char *string, realT **rows, int numrow, int numcol);
void qh_printpoints (FILE *fp, char *string, setT *points);
void qh_projectinput (void);
void qh_projectpoints (signed char *project, int n, realT *points,
int numpoints, int dim, realT *newpoints, int newdim);
int qh_rand( void);
void qh_srand( int seed);
realT qh_randomfactor (void);
void qh_randommatrix (realT *buffer, int dim, realT **row);
void qh_rotateinput (realT **rows);
void qh_rotatepoints (realT *points, int numpoints, int dim, realT **rows);
void qh_scaleinput (void);
void qh_scalelast (coordT *points, int numpoints, int dim, coordT low,
coordT high, coordT newhigh);
void qh_scalepoints (pointT *points, int numpoints, int dim,
realT *newlows, realT *newhighs);
boolT qh_sethalfspace (int dim, coordT *coords, coordT **nextp,
coordT *normal, coordT *offset, coordT *feasible);
coordT *qh_sethalfspace_all (int dim, int count, coordT *halfspaces, pointT *feasible);
pointT *qh_voronoi_center (int dim, setT *points);
#endif /* qhDEFgeom */

View File

@ -1,149 +0,0 @@
/*<html><pre> -<a href="qh-io.htm"
>-------------------------------</a><a name="TOP">-</a>
io.h
declarations of Input/Output functions
see README, qhull.h and io.c
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFio
#define qhDEFio 1
/*============ constants and flags ==================*/
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_MAXfirst">-</a>
qh_MAXfirst
maximum length of first two lines of stdin
*/
#define qh_MAXfirst 200
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_MINradius">-</a>
qh_MINradius
min radius for Gp and Gv, fraction of maxcoord
*/
#define qh_MINradius 0.02
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_GEOMepsilon">-</a>
qh_GEOMepsilon
adjust outer planes for 'lines closer' and geomview roundoff.
This prevents bleed through.
*/
#define qh_GEOMepsilon 2e-3
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_WHITESPACE">-</a>
qh_WHITESPACE
possible values of white space
*/
#define qh_WHITESPACE " \n\t\v\r\f"
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="RIDGE">-</a>
qh_RIDGE
to select which ridges to print in qh_eachvoronoi
*/
typedef enum
{
qh_RIDGEall = 0, qh_RIDGEinner, qh_RIDGEouter
}
qh_RIDGE;
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="printvridgeT">-</a>
printvridgeT
prints results of qh_printvdiagram
see:
<a href="io.c#printvridge">qh_printvridge</a> for an example
*/
typedef void (*printvridgeT)(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
/*============== -prototypes in alphabetical order =========*/
void dfacet( unsigned id);
void dvertex( unsigned id);
void qh_countfacets (facetT *facetlist, setT *facets, boolT printall,
int *numfacetsp, int *numsimplicialp, int *totneighborsp,
int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp);
pointT *qh_detvnorm (vertexT *vertex, vertexT *vertexA, setT *centers, realT *offsetp);
setT *qh_detvridge (vertexT *vertex);
setT *qh_detvridge3 (vertexT *atvertex, vertexT *vertex);
int qh_eachvoronoi (FILE *fp, printvridgeT printvridge, vertexT *atvertex, boolT visitall, qh_RIDGE innerouter, boolT inorder);
int qh_eachvoronoi_all (FILE *fp, printvridgeT printvridge, boolT isupper, qh_RIDGE innerouter, boolT inorder);
void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, realT *mindist);
setT *qh_facetvertices (facetT *facetlist, setT *facets, boolT allfacets);
void qh_geomplanes (facetT *facet, realT *outerplane, realT *innerplane);
void qh_markkeep (facetT *facetlist);
setT *qh_markvoronoi (facetT *facetlist, setT *facets, boolT printall, boolT *islowerp, int *numcentersp);
void qh_order_vertexneighbors(vertexT *vertex);
void qh_printafacet(FILE *fp, int format, facetT *facet, boolT printall);
void qh_printbegin (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printcenter (FILE *fp, int format, char *string, facetT *facet);
void qh_printcentrum (FILE *fp, facetT *facet, realT radius);
void qh_printend (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printend4geom (FILE *fp, facetT *facet, int *num, boolT printall);
void qh_printextremes (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printextremes_2d (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printextremes_d (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printfacet(FILE *fp, facetT *facet);
void qh_printfacet2math(FILE *fp, facetT *facet, int notfirst);
void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2,
facetT *facet, realT offset, realT color[3]);
void qh_printfacet3math (FILE *fp, facetT *facet, int notfirst);
void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]);
void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet3vertex(FILE *fp, facetT *facet, int format);
void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, int format);
void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, int format);
void qh_printfacetheader(FILE *fp, facetT *facet);
void qh_printfacetridges(FILE *fp, facetT *facet);
void qh_printfacets(FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printhelp_degenerate(FILE *fp);
void qh_printhelp_singular(FILE *fp);
void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *facet2,
setT *vertices, realT color[3]);
void qh_printneighborhood (FILE *fp, int format, facetT *facetA, facetT *facetB, boolT printall);
void qh_printline3geom (FILE *fp, pointT *pointA, pointT *pointB, realT color[3]);
void qh_printpoint(FILE *fp, char *string, pointT *point);
void qh_printpointid(FILE *fp, char *string, int dim, pointT *point, int id);
void qh_printpoint3 (FILE *fp, pointT *point);
void qh_printpoints_out (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printpointvect (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius, realT color[3]);
void qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius);
void qh_printridge(FILE *fp, ridgeT *ridge);
void qh_printspheres(FILE *fp, setT *vertices, realT radius);
void qh_printvdiagram (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
int qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertices, qh_RIDGE innerouter, boolT inorder);
void qh_printvertex(FILE *fp, vertexT *vertex);
void qh_printvertexlist (FILE *fp, char* string, facetT *facetlist,
setT *facets, boolT printall);
void qh_printvertices (FILE *fp, char* string, setT *vertices);
void qh_printvneighbors (FILE *fp, facetT* facetlist, setT *facets, boolT printall);
void qh_printvoronoi (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printvnorm (FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
void qh_printvridge (FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
void qh_produce_output(void);
void qh_projectdim3 (pointT *source, pointT *destination);
int qh_readfeasible (int dim, char *remainder);
coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc);
void qh_setfeasible (int dim);
boolT qh_skipfacet(facetT *facet);
#endif /* qhDEFio */

View File

@ -1,174 +0,0 @@
/*<html><pre> -<a href="qh-mem.htm"
>-------------------------------</a><a name="TOP">-</a>
mem.h
prototypes for memory management functions
see qh-mem.htm, mem.c and qset.h
for error handling, writes message and calls
qh_errexit (qhmem_ERRmem, NULL, NULL) if insufficient memory
and
qh_errexit (qhmem_ERRqhull, NULL, NULL) otherwise
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFmem
#define qhDEFmem
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="NOmem">-</a>
qh_NOmem
turn off quick-fit memory allocation
notes:
mem.c implements Quickfit memory allocation for about 20% time
savings. If it fails on your machine, try to locate the
problem, and send the answer to qhull@geom.umn.edu. If this can
not be done, define qh_NOmem to use malloc/free instead.
#define qh_NOmem
*/
/*-------------------------------------------
to avoid bus errors, memory allocation must consider alignment requirements.
malloc() automatically takes care of alignment. Since mem.c manages
its own memory, we need to explicitly specify alignment in
qh_meminitbuffers().
A safe choice is sizeof(double). sizeof(float) may be used if doubles
do not occur in data structures and pointers are the same size. Be careful
of machines (e.g., DEC Alpha) with large pointers. If gcc is available,
use __alignof__(double) or fmax_(__alignof__(float), __alignof__(void *)).
see <a href="user.h#MEMalign">qh_MEMalign</a> in user.h for qhull's alignment
*/
#define qhmem_ERRmem 4 /* matches qh_ERRmem in qhull.h */
#define qhmem_ERRqhull 5 /* matches qh_ERRqhull in qhull.h */
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="ptr_intT">-</a>
ptr_intT
for casting a void* to an integer-type
notes:
On 64-bit machines, a pointer may be larger than an 'int'.
qh_meminit() checks that 'long' holds a 'void*'
*/
typedef unsigned long ptr_intT;
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="qhmemT">-</a>
qhmemT
global memory structure for mem.c
notes:
users should ignore qhmem except for writing extensions
qhmem is allocated in mem.c
qhmem could be swapable like qh and qhstat, but then
multiple qh's and qhmem's would need to keep in synch.
A swapable qhmem would also waste memory buffers. As long
as memory operations are atomic, there is no problem with
multiple qh structures being active at the same time.
If you need separate address spaces, you can swap the
contents of qhmem.
*/
typedef struct qhmemT qhmemT;
extern qhmemT qhmem;
struct qhmemT { /* global memory management variables */
int BUFsize; /* size of memory allocation buffer */
int BUFinit; /* initial size of memory allocation buffer */
int TABLEsize; /* actual number of sizes in free list table */
int NUMsizes; /* maximum number of sizes in free list table */
int LASTsize; /* last size in free list table */
int ALIGNmask; /* worst-case alignment, must be 2^n-1 */
void **freelists; /* free list table, linked by offset 0 */
int *sizetable; /* size of each freelist */
int *indextable; /* size->index table */
void *curbuffer; /* current buffer, linked by offset 0 */
void *freemem; /* free memory in curbuffer */
int freesize; /* size of free memory in bytes */
void *tempstack; /* stack of temporary memory, managed by users */
FILE *ferr; /* file for reporting errors */
int IStracing; /* =5 if tracing memory allocations */
int cntquick; /* count of quick allocations */
/* remove statistics doesn't effect speed */
int cntshort; /* count of short allocations */
int cntlong; /* count of long allocations */
int curlong; /* current count of inuse, long allocations */
int freeshort; /* count of short memfrees */
int freelong; /* count of long memfrees */
int totshort; /* total size of short allocations */
int totlong; /* total size of long allocations */
int maxlong; /* maximum totlong */
int cntlarger; /* count of setlarger's */
int totlarger; /* total copied by setlarger */
};
/*==================== -macros ====================*/
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memalloc_">-</a>
qh_memalloc_(size, object, type)
returns object of size bytes
assumes size<=qhmem.LASTsize and void **freelistp is a temp
*/
#ifdef qh_NOmem
#define qh_memalloc_(size, freelistp, object, type) {\
object= (type*)qh_memalloc (size); }
#else /* !qh_NOmem */
#define qh_memalloc_(size, freelistp, object, type) {\
freelistp= qhmem.freelists + qhmem.indextable[size];\
if ((object= (type*)*freelistp)) {\
qhmem.cntquick++; \
*freelistp= *((void **)*freelistp);\
}else object= (type*)qh_memalloc (size);}
#endif
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memfree_">-</a>
qh_memfree_(object, size)
free up an object
notes:
object may be NULL
assumes size<=qhmem.LASTsize and void **freelistp is a temp
*/
#ifdef qh_NOmem
#define qh_memfree_(object, size, freelistp) {\
qh_memfree (object, size); }
#else /* !qh_NOmem */
#define qh_memfree_(object, size, freelistp) {\
if (object) { \
qhmem .freeshort++;\
freelistp= qhmem.freelists + qhmem.indextable[size];\
*((void **)object)= *freelistp;\
*freelistp= object;}}
#endif
/*=============== prototypes in alphabetical order ============*/
void *qh_memalloc(int insize);
void qh_memfree (void *object, int size);
void qh_memfreeshort (int *curlong, int *totlong);
void qh_meminit (FILE *ferr);
void qh_meminitbuffers (int tracelevel, int alignment, int numsizes,
int bufsize, int bufinit);
void qh_memsetup (void);
void qh_memsize(int size);
void qh_memstatistics (FILE *fp);
#endif /* qhDEFmem */

View File

@ -1,171 +0,0 @@
/*<html><pre> -<a href="qh-merge.htm"
>-------------------------------</a><a name="TOP">-</a>
merge.h
header file for merge.c
see qh-merge.htm and merge.c
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFmerge
#define qhDEFmerge 1
/*============ -constants- ==============*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEredundant">-</a>
qh_ANGLEredundant
indicates redundant merge in mergeT->angle
*/
#define qh_ANGLEredundant 6.0
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEdegen">-</a>
qh_ANGLEdegen
indicates degenerate facet in mergeT->angle
*/
#define qh_ANGLEdegen 5.0
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEconcave">-</a>
qh_ANGLEconcave
offset to indicate concave facets in mergeT->angle
notes:
concave facets are assigned the range of [2,4] in mergeT->angle
roundoff error may make the angle less than 2
*/
#define qh_ANGLEconcave 1.5
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="MRG">-</a>
MRG... (mergeType)
indicates the type of a merge (mergeT->type)
*/
typedef enum { /* in sort order for facet_mergeset */
MRGnone= 0,
MRGcoplanar, /* centrum coplanar */
MRGanglecoplanar, /* angle coplanar */
/* could detect half concave ridges */
MRGconcave, /* concave ridge */
MRGflip, /* flipped facet. facet1 == facet2 */
MRGridge, /* duplicate ridge (qh_MERGEridge) */
/* degen and redundant go onto degen_mergeset */
MRGdegen, /* degenerate facet (not enough neighbors) facet1 == facet2 */
MRGredundant, /* redundant facet (vertex subset) */
/* merge_degenredundant assumes degen < redundant */
MRGmirror, /* mirror facet from qh_triangulate */
ENDmrg
} mergeType;
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_MERGEapex">-</a>
qh_MERGEapex
flag for qh_mergefacet() to indicate an apex merge
*/
#define qh_MERGEapex True
/*============ -structures- ====================*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="mergeT">-</a>
mergeT
structure used to merge facets
*/
typedef struct mergeT mergeT;
struct mergeT { /* initialize in qh_appendmergeset */
realT angle; /* angle between normals of facet1 and facet2 */
facetT *facet1; /* will merge facet1 into facet2 */
facetT *facet2;
mergeType type;
};
/*=========== -macros- =========================*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="FOREACHmerge_">-</a>
FOREACHmerge_( merges ) {...}
assign 'merge' to each merge in merges
notes:
uses 'mergeT *merge, **mergep;'
if qh_mergefacet(),
restart since qh.facet_mergeset may change
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge)
/*============ prototypes in alphabetical order after pre/postmerge =======*/
void qh_premerge (vertexT *apex, realT maxcentrum, realT maxangle);
void qh_postmerge (char *reason, realT maxcentrum, realT maxangle,
boolT vneighbors);
void qh_all_merges (boolT othermerge, boolT vneighbors);
void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle);
setT *qh_basevertices( facetT *samecycle);
void qh_checkconnect (void /* qh new_facets */);
boolT qh_checkzero (boolT testall);
void qh_copynonconvex (ridgeT *atridge);
void qh_degen_redundant_facet (facetT *facet);
void qh_degen_redundant_neighbors (facetT *facet, facetT *delfacet);
vertexT *qh_find_newvertex (vertexT *oldvertex, setT *vertices, setT *ridges);
void qh_findbest_test (boolT testcentrum, facetT *facet, facetT *neighbor,
facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp);
facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp);
void qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
void qh_forcedmerges( boolT *wasmerge);
void qh_getmergeset(facetT *facetlist);
void qh_getmergeset_initial (facetT *facetlist);
void qh_hashridge (setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex);
ridgeT *qh_hashridge_find (setT *hashtable, int hashsize, ridgeT *ridge,
vertexT *vertex, vertexT *oldvertex, int *hashslot);
void qh_makeridges(facetT *facet);
void qh_mark_dupridges(facetT *facetlist);
void qh_maydropneighbor (facetT *facet);
int qh_merge_degenredundant (void);
void qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType mergetype);
void qh_mergecycle (facetT *samecycle, facetT *newfacet);
void qh_mergecycle_all (facetT *facetlist, boolT *wasmerge);
void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex);
void qh_mergefacet2d (facetT *facet1, facetT *facet2);
void qh_mergeneighbors(facetT *facet1, facetT *facet2);
void qh_mergeridges(facetT *facet1, facetT *facet2);
void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
void qh_mergevertex_del (vertexT *vertex, facetT *facet1, facetT *facet2);
void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
void qh_mergevertices(setT *vertices1, setT **vertices);
setT *qh_neighbor_intersections (vertexT *vertex);
void qh_newvertices (setT *vertices);
boolT qh_reducevertices (void);
vertexT *qh_redundant_vertex (vertexT *vertex);
boolT qh_remove_extravertices (facetT *facet);
vertexT *qh_rename_sharedvertex (vertexT *vertex, facetT *facet);
void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex);
void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges,
facetT *oldfacet, facetT *neighborA);
boolT qh_test_appendmerge (facetT *facet, facetT *neighbor);
boolT qh_test_vneighbors (void /* qh newfacet_list */);
void qh_tracemerge (facetT *facet1, facetT *facet2);
void qh_tracemerging (void);
void qh_updatetested( facetT *facet1, facetT *facet2);
setT *qh_vertexridges (vertexT *vertex);
void qh_vertexridges_facet (vertexT *vertex, facetT *facet, setT **ridges);
void qh_willdelete (facetT *facet, facetT *replace);
#endif /* qhDEFmerge */

View File

@ -1,290 +0,0 @@
/*<html><pre> -<a href="qh-poly.htm"
>-------------------------------</a><a name="TOP">-</a>
poly.h
header file for poly.c and poly2.c
see qh-poly.htm, qhull.h and poly.c
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFpoly
#define qhDEFpoly 1
/*=============== constants ========================== */
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="ALGORITHMfault">-</a>
ALGORITHMfault
use as argument to checkconvex() to report errors during buildhull
*/
#define qh_ALGORITHMfault 0
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="DATAfault">-</a>
DATAfault
use as argument to checkconvex() to report errors during initialhull
*/
#define qh_DATAfault 1
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="DUPLICATEridge">-</a>
DUPLICATEridge
special value for facet->neighbor to indicate a duplicate ridge
notes:
set by matchneighbor, used by matchmatch and mark_dupridge
*/
#define qh_DUPLICATEridge ( facetT * ) 1L
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="MERGEridge">-</a>
MERGEridge flag in facet
special value for facet->neighbor to indicate a merged ridge
notes:
set by matchneighbor, used by matchmatch and mark_dupridge
*/
#define qh_MERGEridge ( facetT * ) 2L
/*============ -structures- ====================*/
/*=========== -macros- =========================*/
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLfacet_">-</a>
FORALLfacet_( facetlist ) { ... }
assign 'facet' to each facet in facetlist
notes:
uses 'facetT *facet;'
assumes last facet is a sentinel
see:
FORALLfacets
*/
#define FORALLfacet_( facetlist ) if ( facetlist ) for( facet=( facetlist );facet && facet->next;facet=facet->next )
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLnew_facets">-</a>
FORALLnew_facets { ... }
assign 'newfacet' to each facet in qh.newfacet_list
notes:
uses 'facetT *newfacet;'
at exit, newfacet==NULL
*/
#define FORALLnew_facets for( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLvertex_">-</a>
FORALLvertex_( vertexlist ) { ... }
assign 'vertex' to each vertex in vertexlist
notes:
uses 'vertexT *vertex;'
at exit, vertex==NULL
*/
#define FORALLvertex_( vertexlist ) for ( vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLvisible_facets">-</a>
FORALLvisible_facets { ... }
assign 'visible' to each visible facet in qh.visible_list
notes:
uses 'vacetT *visible;'
at exit, visible==NULL
*/
#define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLsame_">-</a>
FORALLsame_( newfacet ) { ... }
assign 'same' to each facet in newfacet->f.samecycle
notes:
uses 'facetT *same;'
stops when it returns to newfacet
*/
#define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLsame_cycle_">-</a>
FORALLsame_cycle_( newfacet ) { ... }
assign 'same' to each facet in newfacet->f.samecycle
notes:
uses 'facetT *same;'
at exit, same == NULL
*/
#define FORALLsame_cycle_(newfacet) \
for (same= newfacet->f.samecycle; \
same; same= (same == newfacet ? NULL : same->f.samecycle))
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHneighborA_">-</a>
FOREACHneighborA_( facet ) { ... }
assign 'neighborA' to each neighbor in facet->neighbors
FOREACHneighborA_( vertex ) { ... }
assign 'neighborA' to each neighbor in vertex->neighbors
declare:
facetT *neighborA, **neighborAp;
see:
<a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHneighborA_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighborA)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHvisible_">-</a>
FOREACHvisible_( facets ) { ... }
assign 'visible' to each facet in facets
notes:
uses 'facetT *facet, *facetp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHnewfacet_">-</a>
FOREACHnewfacet_( facets ) { ... }
assign 'newfacet' to each facet in facets
notes:
uses 'facetT *newfacet, *newfacetp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHvertexA_">-</a>
FOREACHvertexA_( vertices ) { ... }
assign 'vertexA' to each vertex in vertices
notes:
uses 'vertexT *vertexA, *vertexAp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHvertexreverse12_">-</a>
FOREACHvertexreverse12_( vertices ) { ... }
assign 'vertex' to each vertex in vertices
reverse order of first two vertices
notes:
uses 'vertexT *vertex, *vertexp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
/*=============== prototypes poly.c in alphabetical order ================*/
void qh_appendfacet(facetT *facet);
void qh_appendvertex(vertexT *vertex);
void qh_attachnewfacets (void);
boolT qh_checkflipped (facetT *facet, realT *dist, boolT allerror);
void qh_delfacet(facetT *facet);
void qh_deletevisible(void /*qh visible_list, qh horizon_list*/);
setT *qh_facetintersect (facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *skipelem);
facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
void qh_makenewplanes ( void /* newfacet_list */);
facetT *qh_makenew_nonsimplicial (facetT *visible, vertexT *apex, int *numnew);
facetT *qh_makenew_simplicial (facetT *visible, vertexT *apex, int *numnew);
void qh_matchneighbor (facetT *newfacet, int newskip, int hashsize,
int *hashcount);
void qh_matchnewfacets (void);
boolT qh_matchvertices (int firstindex, setT *verticesA, int skipA,
setT *verticesB, int *skipB, boolT *same);
facetT *qh_newfacet(void);
ridgeT *qh_newridge(void);
int qh_pointid (pointT *point);
void qh_removefacet(facetT *facet);
void qh_removevertex(vertexT *vertex);
void qh_updatevertices (void);
/*========== -prototypes poly2.c in alphabetical order ===========*/
void qh_addhash (void* newelem, setT *hashtable, int hashsize, unsigned hash);
void qh_check_bestdist (void);
void qh_check_maxout (void);
void qh_check_output (void);
void qh_check_point (pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
void qh_check_points(void);
void qh_checkconvex(facetT *facetlist, int fault);
void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
void qh_checkflipped_all (facetT *facetlist);
void qh_checkpolygon(facetT *facetlist);
void qh_checkvertex (vertexT *vertex);
void qh_clearcenters (qh_CENTER type);
void qh_createsimplex(setT *vertices);
void qh_delridge(ridgeT *ridge);
void qh_delvertex (vertexT *vertex);
setT *qh_facet3vertex (facetT *facet);
facetT *qh_findbestfacet (pointT *point, boolT bestoutside,
realT *bestdist, boolT *isoutside);
facetT *qh_findfacet_all (pointT *point, realT *bestdist, boolT *isoutside,
int *numpart);
int qh_findgood (facetT *facetlist, int goodhorizon);
void qh_findgood_all (facetT *facetlist);
void qh_furthestnext (void /* qh facet_list */);
void qh_furthestout (facetT *facet);
void qh_infiniteloop (facetT *facet);
void qh_initbuild(void);
void qh_initialhull(setT *vertices);
setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
vertexT *qh_isvertex (pointT *point, setT *vertices);
vertexT *qh_makenewfacets (pointT *point /*horizon_list, visible_list*/);
void qh_matchduplicates (facetT *atfacet, int atskip, int hashsize, int *hashcount);
void qh_nearcoplanar ( void /* qh.facet_list */);
vertexT *qh_nearvertex (facetT *facet, pointT *point, realT *bestdistp);
int qh_newhashtable(int newsize);
vertexT *qh_newvertex(pointT *point);
ridgeT *qh_nextridge3d (ridgeT *atridge, facetT *facet, vertexT **vertexp);
void qh_outcoplanar (void /* facet_list */);
pointT *qh_point (int id);
void qh_point_add (setT *set, pointT *point, void *elem);
setT *qh_pointfacet (void /*qh facet_list*/);
setT *qh_pointvertex (void /*qh facet_list*/);
void qh_prependfacet(facetT *facet, facetT **facetlist);
void qh_printhashtable(FILE *fp);
void qh_printlists (void);
void qh_resetlists (boolT stats, boolT resetVisible /*qh newvertex_list newfacet_list visible_list*/);
void qh_setvoronoi_all (void);
void qh_triangulate (void /*qh facet_list*/);
void qh_triangulate_facet (facetT *facetA, vertexT **first_vertex);
void qh_triangulate_link (facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
void qh_triangulate_mirror (facetT *facetA, facetT *facetB);
void qh_triangulate_null (facetT *facetA);
void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
void qh_vertexneighbors (void /*qh facet_list*/);
boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
#endif /* qhDEFpoly */

File diff suppressed because it is too large Load Diff

View File

@ -1,127 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
qhull_a.h
all header files for compiling qhull
see qh-qhull.htm
see qhull.h for user-level definitions
see user.h for user-defineable constants
defines internal functions for qhull.c global.c
copyright (c) 1993-2002, The Geometry Center
Notes: grep for ((" and (" to catch fprintf("lkasdjf");
full parens around (x?y:z)
use '#include qhull/qhull_a.h' to avoid name clashes
*/
#ifndef qhDEFqhulla
#define qhDEFqhulla
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
#include <math.h>
#include <float.h> /* some compilers will not need float.h */
#include <limits.h>
#include <time.h>
#include <ctype.h>
/*** uncomment here and qset.c
if string.h does not define memcpy()
#include <memory.h>
*/
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#include "geom.h"
#include "merge.h"
#include "poly.h"
#include "io.h"
#include "stat.h"
#if qh_CLOCKtype == 2 /* defined in user.h from qhull.h */
#include <sys/types.h>
#include <sys/times.h>
#include <unistd.h>
#endif
#ifdef _MSC_VER /* Microsoft Visual C++ */
#pragma warning( disable : 4056) /* float constant expression. Looks like a compiler bug */
#pragma warning( disable : 4146) /* unary minus applied to unsigned type */
#pragma warning( disable : 4244) /* conversion from 'unsigned long' to 'real' */
#pragma warning( disable : 4305) /* conversion from 'const double' to 'float' */
#endif
/* ======= -macros- =========== */
/*-<a href="qh-qhull.htm#TOC"
>--------------------------------</a><a name="traceN">-</a>
traceN((fp.ferr, "format\n", vars));
calls fprintf if qh.IStracing >= N
notes:
removing tracing reduces code size but doesn't change execution speed
*/
#ifndef qh_NOtrace
#define trace0(args) {if (qh IStracing) fprintf args;}
#define trace1(args) {if (qh IStracing >= 1) fprintf args;}
#define trace2(args) {if (qh IStracing >= 2) fprintf args;}
#define trace3(args) {if (qh IStracing >= 3) fprintf args;}
#define trace4(args) {if (qh IStracing >= 4) fprintf args;}
#define trace5(args) {if (qh IStracing >= 5) fprintf args;}
#else /* qh_NOtrace */
#define trace0(args) {}
#define trace1(args) {}
#define trace2(args) {}
#define trace3(args) {}
#define trace4(args) {}
#define trace5(args) {}
#endif /* qh_NOtrace */
/***** -qhull.c prototypes (alphabetical after qhull) ********************/
void qh_qhull (void);
boolT qh_addpoint (pointT *furthest, facetT *facet, boolT checkdist);
void qh_buildhull(void);
void qh_buildtracing (pointT *furthest, facetT *facet);
void qh_build_withrestart (void);
void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet);
void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int *goodhorizon);
pointT *qh_nextfurthest (facetT **visible);
void qh_partitionall(setT *vertices, pointT *points,int npoints);
void qh_partitioncoplanar (pointT *point, facetT *facet, realT *dist);
void qh_partitionpoint (pointT *point, facetT *facet);
void qh_partitionvisible(boolT allpoints, int *numpoints);
void qh_precision (char *reason);
void qh_printsummary(FILE *fp);
/***** -global.c internal prototypes (alphabetical) ***********************/
void qh_appendprint (qh_PRINT format);
void qh_freebuild (boolT allmem);
void qh_freebuffers (void);
void qh_initbuffers (coordT *points, int numpoints, int dim, boolT ismalloc);
int qh_strtol (const char *s, char **endp);
double qh_strtod (const char *s, char **endp);
/***** -stat.c internal prototypes (alphabetical) ***********************/
void qh_allstatA (void);
void qh_allstatB (void);
void qh_allstatC (void);
void qh_allstatD (void);
void qh_allstatE (void);
void qh_allstatE2 (void);
void qh_allstatF (void);
void qh_allstatG (void);
void qh_allstatH (void);
void qh_freebuffers (void);
void qh_initbuffers (coordT *points, int numpoints, int dim, boolT ismalloc);
#endif /* qhDEFqhulla */

View File

@ -1,468 +0,0 @@
/*<html><pre> -<a href="qh-set.htm"
>-------------------------------</a><a name="TOP">-</a>
qset.h
header file for qset.c that implements set
see qh-set.htm and qset.c
only uses mem.c, malloc/free
for error handling, writes message and calls
qh_errexit (qhmem_ERRqhull, NULL, NULL);
set operations satisfy the following properties:
- sets have a max size, the actual size (if different) is stored at the end
- every set is NULL terminated
- sets may be sorted or unsorted, the caller must distinguish this
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFset
#define qhDEFset 1
/*================= -structures- ===============*/
#ifndef DEFsetT
#define DEFsetT 1
typedef struct setT setT; /* a set is a sorted or unsorted array of pointers */
#endif
/*-<a href="qh-set.htm#TOC"
>----------------------------------------</a><a name="setT">-</a>
setT
a set or list of pointers with maximum size and actual size.
variations:
unsorted, unique -- a list of unique pointers with NULL terminator
user guarantees uniqueness
sorted -- a sorted list of unique pointers with NULL terminator
qset.c guarantees uniqueness
unsorted -- a list of pointers terminated with NULL
indexed -- an array of pointers with NULL elements
structure for set of n elements:
--------------
| maxsize
--------------
| e[0] - a pointer, may be NULL for indexed sets
--------------
| e[1]
--------------
| ...
--------------
| e[n-1]
--------------
| e[n] = NULL
--------------
| ...
--------------
| e[maxsize] - n+1 or NULL (determines actual size of set)
--------------
*/
/*-- setelemT -- internal type to allow both pointers and indices
*/
typedef union setelemT setelemT;
union setelemT {
void *p;
int i; /* integer used for e[maxSize] */
};
struct setT {
int maxsize; /* maximum number of elements (except NULL) */
setelemT e[1]; /* array of pointers, tail is NULL */
/* last slot (unless NULL) is actual size+1
e[maxsize]==NULL or e[e[maxsize]-1]==NULL */
/* this may generate a warning since e[] contains
maxsize elements */
};
/*=========== -constants- =========================*/
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="SETelemsize">-</a>
SETelemsize
size of a set element in bytes
*/
#define SETelemsize sizeof(setelemT)
/*=========== -macros- =========================*/
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHsetelement_">-</a>
FOREACHsetelement_(type, set, variable)
define FOREACH iterator
declare:
assumes *variable and **variablep are declared
no space in "variable)" [DEC Alpha cc compiler]
each iteration:
variable is set element
variablep is one beyond variable.
to repeat an element:
variablep--; / *repeat* /
at exit:
variable is NULL at end of loop
example:
#define FOREACHfacet_( facets ) FOREACHsetelement_( facetT, facets, facet )
notes:
use FOREACHsetelement_i_() if need index or include NULLs
WARNING:
nested loops can't use the same variable (define another FOREACH)
needs braces if nested inside another FOREACH
this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
*/
#define FOREACHsetelement_(type, set, variable) \
if (((variable= NULL), set)) for(\
variable##p= (type **)&((set)->e[0].p); \
(variable= *variable##p++);)
/*-<a href="qh-set.htm#TOC"
>----------------------------------------</a><a name="FOREACHsetelement_i_">-</a>
FOREACHsetelement_i_(type, set, variable)
define indexed FOREACH iterator
declare:
type *variable, variable_n, variable_i;
each iteration:
variable is set element, may be NULL
variable_i is index, variable_n is qh_setsize()
to repeat an element:
variable_i--; variable_n-- repeats for deleted element
at exit:
variable==NULL and variable_i==variable_n
example:
#define FOREACHfacet_i_( facets ) FOREACHsetelement_i_( facetT, facets, facet )
WARNING:
nested loops can't use the same variable (define another FOREACH)
needs braces if nested inside another FOREACH
this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
*/
#define FOREACHsetelement_i_(type, set, variable) \
if (((variable= NULL), set)) for (\
variable##_i= 0, variable= (type *)((set)->e[0].p), \
variable##_n= qh_setsize(set);\
variable##_i < variable##_n;\
variable= (type *)((set)->e[++variable##_i].p) )
/*-<a href="qh-set.htm#TOC"
>--------------------------------------</a><a name="FOREACHsetelementreverse_">-</a>
FOREACHsetelementreverse_(type, set, variable)-
define FOREACH iterator in reverse order
declare:
assumes *variable and **variablep are declared
also declare 'int variabletemp'
each iteration:
variable is set element
to repeat an element:
variabletemp++; / *repeat* /
at exit:
variable is NULL
example:
#define FOREACHvertexreverse_( vertices ) FOREACHsetelementreverse_( vertexT, vertices, vertex )
notes:
use FOREACHsetelementreverse12_() to reverse first two elements
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHsetelementreverse_(type, set, variable) \
if (((variable= NULL), set)) for(\
variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\
variable; variable= \
((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type) : NULL))
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHsetelementreverse12_">-</a>
FOREACHsetelementreverse12_(type, set, variable)-
define FOREACH iterator with e[1] and e[0] reversed
declare:
assumes *variable and **variablep are declared
each iteration:
variable is set element
variablep is one after variable.
to repeat an element:
variablep--; / *repeat* /
at exit:
variable is NULL at end of loop
example
#define FOREACHvertexreverse12_( vertices ) FOREACHsetelementreverse12_( vertexT, vertices, vertex )
notes:
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHsetelementreverse12_(type, set, variable) \
if (((variable= NULL), set)) for(\
variable##p= (type **)&((set)->e[1].p); \
(variable= *variable##p); \
variable##p == ((type **)&((set)->e[0].p))?variable##p += 2: \
(variable##p == ((type **)&((set)->e[1].p))?variable##p--:variable##p++))
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHelem_">-</a>
FOREACHelem_( set )-
iterate elements in a set
declare:
void *elem, *elemp;
each iteration:
elem is set element
elemp is one beyond
to repeat an element:
elemp--; / *repeat* /
at exit:
elem == NULL at end of loop
example:
FOREACHelem_(set) {
notes:
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHelem_(set) FOREACHsetelement_(void, set, elem)
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHset_">-</a>
FOREACHset_( set )-
iterate a set of sets
declare:
setT *set, **setp;
each iteration:
set is set element
setp is one beyond
to repeat an element:
setp--; / *repeat* /
at exit:
set == NULL at end of loop
example
FOREACHset_(sets) {
notes:
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHset_(sets) FOREACHsetelement_(setT, sets, set)
/*-<a href="qh-set.htm#TOC"
>-----------------------------------------</a><a name="SETindex_">-</a>
SETindex_( set, elem )
return index of elem in set
notes:
for use with FOREACH iteration
example:
i= SETindex_(ridges, ridge)
*/
#define SETindex_(set, elem) ((void **)elem##p - (void **)&(set)->e[1].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETref_">-</a>
SETref_( elem )
l.h.s. for modifying the current element in a FOREACH iteration
example:
SETref_(ridge)= anotherridge;
*/
#define SETref_(elem) (elem##p[-1])
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETelem_">-</a>
SETelem_(set, n)
return the n'th element of set
notes:
assumes that n is valid [0..size] and that set is defined
use SETelemt_() for type cast
*/
#define SETelem_(set, n) ((set)->e[n].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETelemt_">-</a>
SETelemt_(set, n, type)
return the n'th element of set as a type
notes:
assumes that n is valid [0..size] and that set is defined
*/
#define SETelemt_(set, n, type) ((type*)((set)->e[n].p))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETelemaddr_">-</a>
SETelemaddr_(set, n, type)
return address of the n'th element of a set
notes:
assumes that n is valid [0..size] and set is defined
*/
#define SETelemaddr_(set, n, type) ((type **)(&((set)->e[n].p)))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETfirst_">-</a>
SETfirst_(set)
return first element of set
*/
#define SETfirst_(set) ((set)->e[0].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETfirstt_">-</a>
SETfirstt_(set, type)
return first element of set as a type
*/
#define SETfirstt_(set, type) ((type*)((set)->e[0].p))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETsecond_">-</a>
SETsecond_(set)
return second element of set
*/
#define SETsecond_(set) ((set)->e[1].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETsecondt_">-</a>
SETsecondt_(set, type)
return second element of set as a type
*/
#define SETsecondt_(set, type) ((type*)((set)->e[1].p))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETaddr_">-</a>
SETaddr_(set, type)
return address of set's elements
*/
#define SETaddr_(set,type) ((type **)(&((set)->e[0].p)))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETreturnsize_">-</a>
SETreturnsize_(set, size)
return size of a set
notes:
set must be defined
use qh_setsize(set) unless speed is critical
*/
#define SETreturnsize_(set, size) (((size)= ((set)->e[(set)->maxsize].i))?(--(size)):((size)= (set)->maxsize))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETempty_">-</a>
SETempty_(set)
return true (1) if set is empty
notes:
set may be NULL
*/
#define SETempty_(set) (!set || (SETfirst_(set) ? 0:1))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETtruncate_">-</a>
SETtruncate_(set)
return first element of set
see:
qh_settruncate()
*/
#define SETtruncate_(set, size) {set->e[set->maxsize].i= size+1; /* maybe overwritten */ \
set->e[size].p= NULL;}
/*======= prototypes in alphabetical order ============*/
void qh_setaddsorted(setT **setp, void *elem);
void qh_setaddnth(setT **setp, int nth, void *newelem);
void qh_setappend(setT **setp, void *elem);
void qh_setappend_set(setT **setp, setT *setA);
void qh_setappend2ndlast(setT **setp, void *elem);
void qh_setcheck(setT *set, char *tname, int id);
void qh_setcompact(setT *set);
setT *qh_setcopy(setT *set, int extra);
void *qh_setdel(setT *set, void *elem);
void *qh_setdellast(setT *set);
void *qh_setdelnth(setT *set, int nth);
void *qh_setdelnthsorted(setT *set, int nth);
void *qh_setdelsorted(setT *set, void *newelem);
setT *qh_setduplicate( setT *set, int elemsize);
int qh_setequal(setT *setA, setT *setB);
int qh_setequal_except (setT *setA, void *skipelemA, setT *setB, void *skipelemB);
int qh_setequal_skip (setT *setA, int skipA, setT *setB, int skipB);
void qh_setfree(setT **set);
void qh_setfree2( setT **setp, int elemsize);
void qh_setfreelong(setT **set);
int qh_setin(setT *set, void *setelem);
int qh_setindex(setT *set, void *setelem);
void qh_setlarger(setT **setp);
void *qh_setlast(setT *set);
setT *qh_setnew(int size);
setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend);
void qh_setprint(FILE *fp, char* string, setT *set);
void qh_setreplace(setT *set, void *oldelem, void *newelem);
int qh_setsize(setT *set);
setT *qh_settemp(int setsize);
void qh_settempfree(setT **set);
void qh_settempfree_all(void);
setT *qh_settemppop(void);
void qh_settemppush(setT *set);
void qh_settruncate (setT *set, int size);
int qh_setunique (setT **set, void *elem);
void qh_setzero (setT *set, int index, int size);
#endif /* qhDEFset */

View File

@ -1,520 +0,0 @@
/*<html><pre> -<a href="qh-stat.htm"
>-------------------------------</a><a name="TOP">-</a>
stat.h
contains all statistics that are collected for qhull
see qh-stat.htm and stat.c
copyright (c) 1993-2002, The Geometry Center
recompile qhull if you change this file
Integer statistics are Z* while real statistics are W*.
define maydebugx to call a routine at every statistic event
*/
#ifndef qhDEFstat
#define qhDEFstat 1
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="KEEPstatistics">-</a>
qh_KEEPstatistics
0 turns off statistic gathering (except zzdef/zzinc/zzadd/zzval/wwval)
*/
#ifndef qh_KEEPstatistics
#define qh_KEEPstatistics 1
#endif
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="statistics">-</a>
Zxxx for integers, Wxxx for reals
notes:
be sure that all statistics are defined in stat.c
otherwise initialization may core dump
can pick up all statistics by:
grep '[zw].*_[(][ZW]' *.c >z.x
remove trailers with query">-</a>
remove leaders with query-replace-regexp [ ^I]+ (
*/
#if qh_KEEPstatistics
enum statistics { /* alphabetical after Z/W */
Zacoplanar,
Wacoplanarmax,
Wacoplanartot,
Zangle,
Wangle,
Wanglemax,
Wanglemin,
Zangletests,
Wareatot,
Wareamax,
Wareamin,
Zavoidold,
Wavoidoldmax,
Wavoidoldtot,
Zback0,
Zbestcentrum,
Zbestdist,
Zcentrumtests,
Zcheckpart,
Zcomputefurthest,
Zconcave,
Wconcavemax,
Wconcavetot,
Zconcaveridges,
Zconcaveridge,
Zcoplanar,
Wcoplanarmax,
Wcoplanartot,
Zcoplanarangle,
Zcoplanarcentrum,
Zcoplanarhorizon,
Zcoplanarinside,
Zcoplanarpart,
Zcoplanarridges,
Wcpu,
Zcyclefacetmax,
Zcyclefacettot,
Zcyclehorizon,
Zcyclevertex,
Zdegen,
Wdegenmax,
Wdegentot,
Zdegenvertex,
Zdelfacetdup,
Zdelridge,
Zdelvertextot,
Zdelvertexmax,
Zdetsimplex,
Zdistcheck,
Zdistconvex,
Zdistgood,
Zdistio,
Zdistplane,
Zdiststat,
Zdistvertex,
Zdistzero,
Zdoc1,
Zdoc2,
Zdoc3,
Zdoc4,
Zdoc5,
Zdoc6,
Zdoc7,
Zdoc8,
Zdoc9,
Zdoc10,
Zdoc11,
Zdoc12,
Zdropdegen,
Zdropneighbor,
Zdupflip,
Zduplicate,
Wduplicatemax,
Wduplicatetot,
Zdupridge,
Zdupsame,
Zflipped,
Wflippedmax,
Wflippedtot,
Zflippedfacets,
Zfindbest,
Zfindbestmax,
Zfindbesttot,
Zfindcoplanar,
Zfindfail,
Zfindhorizon,
Zfindhorizonmax,
Zfindhorizontot,
Zfindjump,
Zfindnew,
Zfindnewmax,
Zfindnewtot,
Zfindnewjump,
Zfindnewsharp,
Zgauss0,
Zgoodfacet,
Zhashlookup,
Zhashridge,
Zhashridgetest,
Zhashtests,
Zinsidevisible,
Zintersect,
Zintersectfail,
Zintersectmax,
Zintersectnum,
Zintersecttot,
Zmaxneighbors,
Wmaxout,
Wmaxoutside,
Zmaxridges,
Zmaxvertex,
Zmaxvertices,
Zmaxvneighbors,
Zmemfacets,
Zmempoints,
Zmemridges,
Zmemvertices,
Zmergeflipdup,
Zmergehorizon,
Zmergeinittot,
Zmergeinitmax,
Zmergeinittot2,
Zmergeintohorizon,
Zmergenew,
Zmergesettot,
Zmergesetmax,
Zmergesettot2,
Zmergesimplex,
Zmergevertex,
Wmindenom,
Wminvertex,
Zminnorm,
Zmultiridge,
Znearlysingular,
Zneighbor,
Wnewbalance,
Wnewbalance2,
Znewfacettot,
Znewfacetmax,
Znewvertex,
Wnewvertex,
Wnewvertexmax,
Znoarea,
Znonsimplicial,
Znowsimplicial,
Znotgood,
Znotgoodnew,
Znotmax,
Znumfacets,
Znummergemax,
Znummergetot,
Znumneighbors,
Znumridges,
Znumvertices,
Znumvisibility,
Znumvneighbors,
Zonehorizon,
Zpartangle,
Zpartcoplanar,
Zpartflip,
Zparthorizon,
Zpartinside,
Zpartition,
Zpartitionall,
Zpartnear,
Zpbalance,
Wpbalance,
Wpbalance2,
Zpostfacets,
Zpremergetot,
Zprocessed,
Zremvertex,
Zremvertexdel,
Zrenameall,
Zrenamepinch,
Zrenameshare,
Zretry,
Wretrymax,
Zridge,
Wridge,
Wridgemax,
Zridge0,
Wridge0,
Wridge0max,
Zridgemid,
Wridgemid,
Wridgemidmax,
Zridgeok,
Wridgeok,
Wridgeokmax,
Zsearchpoints,
Zsetplane,
Ztestvneighbor,
Ztotcheck,
Ztothorizon,
Ztotmerge,
Ztotpartcoplanar,
Ztotpartition,
Ztotridges,
Ztotvertices,
Ztotvisible,
Ztricoplanar,
Ztricoplanarmax,
Ztricoplanartot,
Ztridegen,
Ztrimirror,
Ztrinull,
Wvertexmax,
Wvertexmin,
Zvertexridge,
Zvertexridgetot,
Zvertexridgemax,
Zvertices,
Zvisfacettot,
Zvisfacetmax,
Zvisvertextot,
Zvisvertexmax,
Zwidefacet,
Zwidevertices,
ZEND};
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="ZZstat">-</a>
Zxxx/Wxxx statistics that remain defined if qh_KEEPstatistics=0
notes:
be sure to use zzdef, zzinc, etc. with these statistics (no double checking!)
*/
#else
enum statistics { /* for zzdef etc. macros */
Zback0,
Zbestdist,
Zcentrumtests,
Zcheckpart,
Zconcaveridges,
Zcoplanarhorizon,
Zcoplanarpart,
Zcoplanarridges,
Zcyclefacettot,
Zcyclehorizon,
Zdelvertextot,
Zdistcheck,
Zdistconvex,
Zdistzero,
Zdoc1,
Zdoc2,
Zdoc3,
Zdoc11,
Zflippedfacets,
Zgauss0,
Zminnorm,
Zmultiridge,
Znearlysingular,
Wnewvertexmax,
Znumvisibility,
Zpartcoplanar,
Zpartition,
Zpartitionall,
Zprocessed,
Zretry,
Zridge,
Wridge,
Wridgemax,
Zridge0,
Wridge0,
Wridge0max,
Zridgemid,
Wridgemid,
Wridgemidmax,
Zridgeok,
Wridgeok,
Wridgeokmax,
Zsetplane,
Ztotmerge,
ZEND};
#endif
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="ztype">-</a>
ztype
the type of a statistic sets its initial value.
notes:
The type should be the same as the macro for collecting the statistic
*/
enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend};
/*========== macros and constants =============*/
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="MAYdebugx">-</a>
MAYdebugx
define as maydebug() to be called frequently for error trapping
*/
#define MAYdebugx
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zdef_">-</a>
zzdef_, zdef_( type, name, doc, -1)
define a statistic (assumes 'qhstat.next= 0;')
zdef_( type, name, doc, count)
define an averaged statistic
printed as name/count
*/
#define zzdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
#if qh_KEEPstatistics
#define zdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
#else
#define zdef_(type,name,doc,count)
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zinc_">-</a>
zzinc_( name ), zinc_( name)
increment an integer statistic
*/
#define zzinc_(id) {MAYdebugx; qhstat stats[id].i++;}
#if qh_KEEPstatistics
#define zinc_(id) {MAYdebugx; qhstat stats[id].i++;}
#else
#define zinc_(id) {}
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zadd_">-</a>
zzadd_( name, value ), zadd_( name, value ), wadd_( name, value )
add value to an integer or real statistic
*/
#define zzadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
#define wwadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
#if qh_KEEPstatistics
#define zadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
#define wadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
#else
#define zadd_(id, val) {}
#define wadd_(id, val) {}
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zval_">-</a>
zzval_( name ), zval_( name ), wwval_( name )
set or return value of a statistic
*/
#define zzval_(id) ((qhstat stats[id]).i)
#define wwval_(id) ((qhstat stats[id]).r)
#if qh_KEEPstatistics
#define zval_(id) ((qhstat stats[id]).i)
#define wval_(id) ((qhstat stats[id]).r)
#else
#define zval_(id) qhstat tempi
#define wval_(id) qhstat tempr
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zmax_">-</a>
zmax_( id, val ), wmax_( id, value )
maximize id with val
*/
#define wwmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
#if qh_KEEPstatistics
#define zmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].i,(val));}
#define wmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
#else
#define zmax_(id, val) {}
#define wmax_(id, val) {}
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zmin_">-</a>
zmin_( id, val ), wmin_( id, value )
minimize id with val
*/
#if qh_KEEPstatistics
#define zmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].i,(val));}
#define wmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].r,(val));}
#else
#define zmin_(id, val) {}
#define wmin_(id, val) {}
#endif
/*================== stat.h types ==============*/
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="intrealT">-</a>
intrealT
union of integer and real, used for statistics
*/
typedef union intrealT intrealT; /* union of int and realT */
union intrealT {
int i;
realT r;
};
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="qhstat">-</a>
qhstat
global data structure for statistics
notes:
access to qh_qhstat is via the "qhstat" macro. There are two choices
qh_QHpointer = 1 access globals via a pointer
enables qh_saveqhull() and qh_restoreqhull()
= 0 qh_qhstat is a static data structure
only one instance of qhull() can be active at a time
default value
qh_QHpointer is defined in qhull.h
allocated in stat.c
*/
typedef struct qhstatT qhstatT;
#if qh_QHpointer
#define qhstat qh_qhstat->
extern qhstatT *qh_qhstat;
#else
#define qhstat qh_qhstat.
extern qhstatT qh_qhstat;
#endif
struct qhstatT {
intrealT stats[ZEND]; /* integer and real statistics */
unsigned char id[ZEND+10]; /* id's in print order */
char *doc[ZEND]; /* array of documentation strings */
short int count[ZEND]; /* -1 if none, else index of count to use */
char type[ZEND]; /* type, see ztypes above */
char printed[ZEND]; /* true, if statistic has been printed */
intrealT init[ZTYPEend]; /* initial values by types, set initstatistics */
int next; /* next index for zdef_ */
int precision; /* index for precision problems */
int vridges; /* index for Voronoi ridges */
int tempi;
realT tempr;
};
/*========== function prototypes ===========*/
void qh_allstatA(void);
void qh_allstatB(void);
void qh_allstatC(void);
void qh_allstatD(void);
void qh_allstatE(void);
void qh_allstatE2(void);
void qh_allstatF(void);
void qh_allstatG(void);
void qh_allstatH(void);
void qh_allstatI(void);
void qh_allstatistics (void);
void qh_collectstatistics (void);
void qh_freestatistics (void);
void qh_initstatistics (void);
boolT qh_newstats (int index, int *nextindex);
boolT qh_nostatistic (int i);
void qh_printallstatistics (FILE *fp, char *string);
void qh_printstatistics (FILE *fp, char *string);
void qh_printstatlevel (FILE *fp, int id, int start);
void qh_printstats (FILE *fp, int index, int *nextindex);
realT qh_stddev (int num, realT tot, realT tot2, realT *ave);
#endif /* qhDEFstat */

View File

@ -1,762 +0,0 @@
/*<html><pre> -<a href="qh-user.htm"
>-------------------------------</a><a name="TOP">-</a>
user.h
user redefinable constants
see qh-user.htm. see COPYING for copyright information.
before reading any code, review qhull.h for data structure definitions and
the "qh" macro.
*/
#ifndef qhDEFuser
#define qhDEFuser 1
/*============= data types and configuration macros ==========*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="realT">-</a>
realT
set the size of floating point numbers
qh_REALdigits
maximimum number of significant digits
qh_REAL_1, qh_REAL_2n, qh_REAL_3n
format strings for printf
qh_REALmax, qh_REALmin
maximum and minimum (near zero) values
qh_REALepsilon
machine roundoff. Maximum roundoff error for addition and multiplication.
notes:
Select whether to store floating point numbers in single precision (float)
or double precision (double).
Use 'float' to save about 8% in time and 25% in space. This is particularly
help if high-d where convex hulls are space limited. Using 'float' also
reduces the printed size of Qhull's output since numbers have 8 digits of
precision.
Use 'double' when greater arithmetic precision is needed. This is needed
for Delaunay triangulations and Voronoi diagrams when you are not merging
facets.
If 'double' gives insufficient precision, your data probably includes
degeneracies. If so you should use facet merging (done by default)
or exact arithmetic (see imprecision section of manual, qh-impre.htm).
You may also use option 'Po' to force output despite precision errors.
You may use 'long double', but many format statements need to be changed
and you may need a 'long double' square root routine. S. Grundmann
(sg@eeiwzb.et.tu-dresden.de) has done this. He reports that the code runs
much slower with little gain in precision.
WARNING: on some machines, int f(){realT a= REALmax;return (a == REALmax);}
returns False. Use (a > REALmax/2) instead of (a == REALmax).
REALfloat = 1 all numbers are 'float' type
= 0 all numbers are 'double' type
*/
#define REALfloat 0
#if (REALfloat == 1)
#define realT float
#define REALmax FLT_MAX
#define REALmin FLT_MIN
#define REALepsilon FLT_EPSILON
#define qh_REALdigits 8 /* maximum number of significant digits */
#define qh_REAL_1 "%6.8g "
#define qh_REAL_2n "%6.8g %6.8g\n"
#define qh_REAL_3n "%6.8g %6.8g %6.8g\n"
#elif (REALfloat == 0)
#define realT double
#define REALmax DBL_MAX
#define REALmin DBL_MIN
#define REALepsilon DBL_EPSILON
#define qh_REALdigits 16 /* maximum number of significant digits */
#define qh_REAL_1 "%6.16g "
#define qh_REAL_2n "%6.16g %6.16g\n"
#define qh_REAL_3n "%6.16g %6.16g %6.16g\n"
#else
#error unknown float option
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="CPUclock">-</a>
qh_CPUclock
define the clock() function for reporting the total time spent by Qhull
returns CPU ticks as a 'long int'
qh_CPUclock is only used for reporting the total time spent by Qhull
qh_SECticks
the number of clock ticks per second
notes:
looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds
to define a custom clock, set qh_CLOCKtype to 0
if your system does not use clock() to return CPU ticks, replace
qh_CPUclock with the corresponding function. It is converted
to unsigned long to prevent wrap-around during long runs.
Set qh_CLOCKtype to
1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond
Note: may fail if more than 1 hour elapsed time
2 use qh_clock() with POSIX times() (see global.c)
*/
#define qh_CLOCKtype 1 /* change to the desired number */
#if (qh_CLOCKtype == 1)
#if defined (CLOCKS_PER_SECOND)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLOCKS_PER_SECOND
#elif defined (CLOCKS_PER_SEC)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLOCKS_PER_SEC
#elif defined (CLK_TCK)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLK_TCK
#else
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks 1E6
#endif
#elif (qh_CLOCKtype == 2)
#define qh_CPUclock qh_clock() /* return CPU clock */
#define qh_SECticks 100
#else /* qh_CLOCKtype == ? */
#error unknown clock option
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="RANDOM">-</a>
qh_RANDOMtype, qh_RANDOMmax, qh_RANDOMseed
define random number generator
qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax.
qh_RANDOMseed sets the random number seed for qh_RANDOMint
Set qh_RANDOMtype (default 5) to:
1 for random() with 31 bits (UCB)
2 for rand() with RAND_MAX or 15 bits (system 5)
3 for rand() with 31 bits (Sun)
4 for lrand48() with 31 bits (Solaris)
5 for qh_rand() with 31 bits (included with Qhull)
notes:
Random numbers are used by rbox to generate point sets. Random
numbers are used by Qhull to rotate the input ('QRn' option),
simulate a randomized algorithm ('Qr' option), and to simulate
roundoff errors ('Rn' option).
Random number generators differ between systems. Most systems provide
rand() but the period varies. The period of rand() is not critical
since qhull does not normally use random numbers.
The default generator is Park & Miller's minimal standard random
number generator [CACM 31:1195 '88]. It is included with Qhull.
If qh_RANDOMmax is wrong, qhull will report a warning and Geomview
output will likely be invisible.
*/
#define qh_RANDOMtype 5 /* *** change to the desired number *** */
#if (qh_RANDOMtype == 1)
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, random()/MAX */
#define qh_RANDOMint random()
#define qh_RANDOMseed_(seed) srandom(seed);
#elif (qh_RANDOMtype == 2)
#ifdef RAND_MAX
#define qh_RANDOMmax ((realT)RAND_MAX)
#else
#define qh_RANDOMmax ((realT)32767) /* 15 bits (System 5) */
#endif
#define qh_RANDOMint rand()
#define qh_RANDOMseed_(seed) srand((unsigned)seed);
#elif (qh_RANDOMtype == 3)
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, Sun */
#define qh_RANDOMint rand()
#define qh_RANDOMseed_(seed) srand((unsigned)seed);
#elif (qh_RANDOMtype == 4)
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, lrand38()/MAX */
#define qh_RANDOMint lrand48()
#define qh_RANDOMseed_(seed) srand48(seed);
#elif (qh_RANDOMtype == 5)
#define qh_RANDOMmax ((realT)2147483646UL) /* 31 bits, qh_rand/MAX */
#define qh_RANDOMint qh_rand()
#define qh_RANDOMseed_(seed) qh_srand(seed);
/* unlike rand(), never returns 0 */
#else
#error: unknown random option
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="ORIENTclock">-</a>
qh_ORIENTclock
0 for inward pointing normals by Geomview convention
*/
#define qh_ORIENTclock 0
/*========= performance related constants =========*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="HASHfactor">-</a>
qh_HASHfactor
total hash slots / used hash slots. Must be at least 1.1.
notes:
=2 for at worst 50% occupancy for qh hash_table and normally 25% occupancy
*/
#define qh_HASHfactor 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="VERIFYdirect">-</a>
qh_VERIFYdirect
with 'Tv' verify all points against all facets if op count is smaller
notes:
if greater, calls qh_check_bestdist() instead
*/
#define qh_VERIFYdirect 1000000
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INITIALsearch">-</a>
qh_INITIALsearch
if qh_INITIALmax, search points up to this dimension
*/
#define qh_INITIALsearch 6
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INITIALmax">-</a>
qh_INITIALmax
if dim >= qh_INITIALmax, use min/max coordinate points for initial simplex
notes:
from points with non-zero determinants
use option 'Qs' to override (much slower)
*/
#define qh_INITIALmax 8
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEdefault">-</a>
qh_JOGGLEdefault
default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault
notes:
rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-16
rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults
rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults
rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults
rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults
rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults
rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults
rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults
rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults
the later have about 20 points per facet, each of which may interfere
pick a value large enough to avoid retries on most inputs
*/
#define qh_JOGGLEdefault 30000.0
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEincrease">-</a>
qh_JOGGLEincrease
factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain
*/
#define qh_JOGGLEincrease 10.0
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEretry">-</a>
qh_JOGGLEretry
if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax
notes:
try twice at the original value in case of bad luck the first time
*/
#define qh_JOGGLEretry 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEagain">-</a>
qh_JOGGLEagain
every following qh_JOGGLEagain, increase qh.JOGGLEmax
notes:
1 is OK since it's already failed qh_JOGGLEretry times
*/
#define qh_JOGGLEagain 1
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEmaxincrease">-</a>
qh_JOGGLEmaxincrease
maximum qh.JOGGLEmax due to qh_JOGGLEincrease
relative to qh.MAXwidth
notes:
qh.joggleinput will retry at this value until qh_JOGGLEmaxretry
*/
#define qh_JOGGLEmaxincrease 1e-2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEmaxretry">-</a>
qh_JOGGLEmaxretry
stop after qh_JOGGLEmaxretry attempts
*/
#define qh_JOGGLEmaxretry 100
/*========= memory constants =========*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMalign">-</a>
qh_MEMalign
memory alignment for qh_meminitbuffers() in global.c
notes:
to avoid bus errors, memory allocation must consider alignment requirements.
malloc() automatically takes care of alignment. Since mem.c manages
its own memory, we need to explicitly specify alignment in
qh_meminitbuffers().
A safe choice is sizeof(double). sizeof(float) may be used if doubles
do not occur in data structures and pointers are the same size. Be careful
of machines (e.g., DEC Alpha) with large pointers.
If using gcc, best alignment is
#define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *))
*/
#define qh_MEMalign fmax_(sizeof(realT), sizeof(void *))
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMbufsize">-</a>
qh_MEMbufsize
size of additional memory buffers
notes:
used for qh_meminitbuffers() in global.c
*/
#define qh_MEMbufsize 0x10000 /* allocate 64K memory buffers */
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMinitbuf">-</a>
qh_MEMinitbuf
size of initial memory buffer
notes:
use for qh_meminitbuffers() in global.c
*/
#define qh_MEMinitbuf 0x20000 /* initially allocate 128K buffer */
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INFINITE">-</a>
qh_INFINITE
on output, indicates Voronoi center at infinity
*/
#define qh_INFINITE -10.101
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DEFAULTbox">-</a>
qh_DEFAULTbox
default box size (Geomview expects 0.5)
*/
#define qh_DEFAULTbox 0.5
/*======= conditional compilation ============================*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="compiler">-</a>
__cplusplus
defined by C++ compilers
__MSC_VER
defined by Microsoft Visual C++
__MWERKS__ && __POWERPC__
defined by Metrowerks when compiling for the Power Macintosh
__STDC__
defined for strict ANSI C
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="COMPUTEfurthest">-</a>
qh_COMPUTEfurthest
compute furthest distance to an outside point instead of storing it with the facet
=1 to compute furthest
notes:
computing furthest saves memory but costs time
about 40% more distance tests for partitioning
removes facet->furthestdist
*/
#define qh_COMPUTEfurthest 0
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="KEEPstatistics">-</a>
qh_KEEPstatistics
=0 removes most of statistic gathering and reporting
notes:
if 0, code size is reduced by about 4%.
*/
#define qh_KEEPstatistics 1
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXoutside">-</a>
qh_MAXoutside
record outer plane for each facet
=1 to record facet->maxoutside
notes:
this takes a realT per facet and slightly slows down qhull
it produces better outer planes for geomview output
*/
#define qh_MAXoutside 1
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="NOmerge">-</a>
qh_NOmerge
disables facet merging if defined
notes:
This saves about 10% space.
Unless 'Q0'
qh_NOmerge sets 'QJ' to avoid precision errors
#define qh_NOmerge
see:
<a href="mem.h#NOmem">qh_NOmem</a> in mem.c
see user.c/user_eg.c for removing io.o
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="NOtrace">-</a>
qh_NOtrace
no tracing if defined
notes:
This saves about 5% space.
#define qh_NOtrace
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="QHpointer">-</a>
qh_QHpointer
access global data with pointer or static structure
qh_QHpointer = 1 access globals via a pointer to allocated memory
enables qh_saveqhull() and qh_restoreqhull()
costs about 8% in time and 2% in space
= 0 qh_qh and qh_qhstat are static data structures
only one instance of qhull() can be active at a time
default value
notes:
all global variables for qhull are in qh, qhmem, and qhstat
qh is defined in qhull.h
qhmem is defined in mem.h
qhstat is defined in stat.h
see:
user_eg.c for an example
*/
#define qh_QHpointer 0
#if 0 /* sample code */
qhT *oldqhA, *oldqhB;
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
flags, outfile, errfile);
/* use results from first call to qh_new_qhull */
oldqhA= qh_save_qhull();
exitcode= qh_new_qhull (dimB, numpointsB, pointsB, ismalloc,
flags, outfile, errfile);
/* use results from second call to qh_new_qhull */
oldqhB= qh_save_qhull();
qh_restore_qhull (&oldqhA);
/* use results from first call to qh_new_qhull */
qh_freeqhull (qh_ALL); /* frees all memory used by first call */
qh_restore_qhull (&oldqhB);
/* use results from second call to qh_new_qhull */
qh_freeqhull (!qh_ALL); /* frees long memory used by second call */
qh_memfreeshort (&curlong, &totlong); /* frees short memory and memory allocator */
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="QUICKhelp">-</a>
qh_QUICKhelp
=1 to use abbreviated help messages, e.g., for degenerate inputs
*/
#define qh_QUICKhelp 0
/* ============ -merge constants- ====================
These constants effect facet merging. You probably will not need
to modify these. They effect the performance of facet merging.
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DIMmergeVertex">-</a>
qh_DIMmergeVertex
max dimension for vertex merging (it is not effective in high-d)
*/
#define qh_DIMmergeVertex 6
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DIMreduceBuild">-</a>
qh_DIMreduceBuild
max dimension for vertex reduction during build (slow in high-d)
*/
#define qh_DIMreduceBuild 5
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="BESTcentrum">-</a>
qh_BESTcentrum
if > 2*dim+n vertices, qh_findbestneighbor() tests centrums (faster)
else, qh_findbestneighbor() tests all vertices (much better merges)
qh_BESTcentrum2
if qh_BESTcentrum2 * DIM3 + BESTcentrum < #vertices tests centrums
*/
#define qh_BESTcentrum 20
#define qh_BESTcentrum2 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="BESTnonconvex">-</a>
qh_BESTnonconvex
if > dim+n neighbors, qh_findbestneighbor() tests nonconvex ridges.
notes:
It is needed because qh_findbestneighbor is slow for large facets
*/
#define qh_BESTnonconvex 15
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXnewmerges">-</a>
qh_MAXnewmerges
if >n newmerges, qh_merge_nonconvex() calls qh_reducevertices_centrums.
notes:
It is needed because postmerge can merge many facets at once
*/
#define qh_MAXnewmerges 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXnewcentrum">-</a>
qh_MAXnewcentrum
if <= dim+n vertices (n approximates the number of merges),
reset the centrum in qh_updatetested() and qh_mergecycle_facets()
notes:
needed to reduce cost and because centrums may move too much if
many vertices in high-d
*/
#define qh_MAXnewcentrum 5
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="COPLANARratio">-</a>
qh_COPLANARratio
for 3-d+ merging, qh.MINvisible is n*premerge_centrum
notes:
for non-merging, it's DISTround
*/
#define qh_COPLANARratio 3
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DISToutside">-</a>
qh_DISToutside
When is a point clearly outside of a facet?
Stops search in qh_findbestnew or qh_partitionall
qh_findbest uses qh.MINoutside since since it is only called if no merges.
notes:
'Qf' always searches for best facet
if !qh.MERGING, same as qh.MINoutside.
if qh_USEfindbestnew, increase value since neighboring facets may be ill-behaved
[Note: Zdelvertextot occurs normally with interior points]
RBOX 1000 s Z1 G1e-13 t1001188774 | QHULL Tv
When there is a sharp edge, need to move points to a
clearly good facet; otherwise may be lost in another partitioning.
if too big then O(n^2) behavior for partitioning in cone
if very small then important points not processed
Needed in qh_partitionall for
RBOX 1000 s Z1 G1e-13 t1001032651 | QHULL Tv
Needed in qh_findbestnew for many instances of
RBOX 1000 s Z1 G1e-13 t | QHULL Tv
See:
qh_DISToutside -- when is a point clearly outside of a facet
qh_SEARCHdist -- when is facet coplanar with the best facet?
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
*/
#define qh_DISToutside ((qh_USEfindbestnew ? 2 : 1) * \
fmax_((qh MERGING ? 2 : 1)*qh MINoutside, qh max_outside))
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="RATIOnearinside">-</a>
qh_RATIOnearinside
ratio of qh.NEARinside to qh.ONEmerge for retaining inside points for
qh_check_maxout().
notes:
This is overkill since do not know the correct value.
It effects whether 'Qc' reports all coplanar points
Not used for 'd' since non-extreme points are coplanar
*/
#define qh_RATIOnearinside 5
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="SEARCHdist">-</a>
qh_SEARCHdist
When is a facet coplanar with the best facet?
qh_findbesthorizon: all coplanar facets of the best facet need to be searched.
See:
qh_DISToutside -- when is a point clearly outside of a facet
qh_SEARCHdist -- when is facet coplanar with the best facet?
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
*/
#define qh_SEARCHdist ((qh_USEfindbestnew ? 2 : 1) * \
(qh max_outside + 2 * qh DISTround + fmax_( qh MINvisible, qh MAXcoplanar)));
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="USEfindbestnew">-</a>
qh_USEfindbestnew
Always use qh_findbestnew for qh_partitionpoint, otherwise use
qh_findbestnew if merged new facet or sharpnewfacets.
See:
qh_DISToutside -- when is a point clearly outside of a facet
qh_SEARCHdist -- when is facet coplanar with the best facet?
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
*/
#define qh_USEfindbestnew (zzval_(Ztotmerge) > 50)
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="WIDEcoplanar">-</a>
qh_WIDEcoplanar
n*MAXcoplanar or n*MINvisible for a WIDEfacet
if vertex is further than qh.WIDEfacet from the hyperplane
then its ridges are not counted in computing the area, and
the facet's centrum is frozen.
notes:
qh.WIDEfacet= max(qh.MAXoutside,qh_WIDEcoplanar*qh.MAXcoplanar,
qh_WIDEcoplanar * qh.MINvisible);
*/
#define qh_WIDEcoplanar 6
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXnarrow">-</a>
qh_MAXnarrow
max. cosine in initial hull that sets qh.NARROWhull
notes:
If qh.NARROWhull, the initial partition does not make
coplanar points. If narrow, a coplanar point can be
coplanar to two facets of opposite orientations and
distant from the exact convex hull.
Conservative estimate. Don't actually see problems until it is -1.0
*/
#define qh_MAXnarrow -0.99999999
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="WARNnarrow">-</a>
qh_WARNnarrow
max. cosine in initial hull to warn about qh.NARROWhull
notes:
this is a conservative estimate.
Don't actually see problems until it is -1.0. See qh-impre.htm
*/
#define qh_WARNnarrow -0.999999999999999
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="ZEROdelaunay">-</a>
qh_ZEROdelaunay
a zero Delaunay facet occurs for input sites coplanar with their convex hull
the last normal coefficient of a zero Delaunay facet is within
qh_ZEROdelaunay * qh.ANGLEround of 0
notes:
qh_ZEROdelaunay does not allow for joggled input ('QJ').
You can avoid zero Delaunay facets by surrounding the input with a box.
Use option 'PDk:-n' to explicitly define zero Delaunay facets
k= dimension of input sites (e.g., 3 for 3-d Delaunay triangulation)
n= the cutoff for zero Delaunay facets (e.g., 'PD3:-1e-12')
*/
#define qh_ZEROdelaunay 2
#endif /* qh_DEFuser */

View File

@ -1,677 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="qhull"
ProjectGUID="{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\qhull"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\qhull"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\qhull\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\qhull\"
ObjectFile="..\..\..\..\..\build\msvc_7\extern\qhull\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\qhull\"
WarningLevel="2"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\qhull.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_7\extern\qhull\include
XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_7\extern\qhull\include
ECHO Done
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\qhull\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\qhull\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\qhull\debug\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\qhull\debug\"
ObjectFile="..\..\..\..\..\build\msvc_7\extern\qhull\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\qhull\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\debug\qhull.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library (debug target) to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_7\extern\qhull\include
XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_7\extern\qhull\include
ECHO Done
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="3D Plugin Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\"
ObjectFile="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\"
WarningLevel="2"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\mtdll\qhull.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_7\extern\qhull\include
XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_7\extern\qhull\include
ECHO Done
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="3D Plugin Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\debug\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\debug\"
ObjectFile="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\qhull\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_7\libs\extern\mtdll\debug\qhull.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library (debug target) to lib tree."
CommandLine="ECHO Copying header files
IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_7\extern\qhull\include
XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_7\extern\qhull\include
ECHO Done
"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\..\src\geom.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\geom2.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\global.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\io.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\mem.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\merge.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\poly.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\poly2.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\qhull.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\qset.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\stat.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\user.c">
<FileConfiguration
Name="Blender Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\..\src\geom.h">
</File>
<File
RelativePath="..\..\src\io.h">
</File>
<File
RelativePath="..\..\src\mem.h">
</File>
<File
RelativePath="..\..\src\merge.h">
</File>
<File
RelativePath="..\..\src\poly.h">
</File>
<File
RelativePath="..\..\src\qhull.h">
</File>
<File
RelativePath="..\..\src\qhull_a.h">
</File>
<File
RelativePath="..\..\src\qset.h">
</File>
<File
RelativePath="..\..\src\stat.h">
</File>
<File
RelativePath="..\..\src\user.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,877 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="EXT_qhull"
ProjectGUID="{6461F05D-4698-47AB-A8E8-1CA2ACC9948B}"
RootNamespace="qhull"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\qhull"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\qhull"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\qhull\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\qhull\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\qhull\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\qhull\"
WarningLevel="2"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\qhull.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\qhull\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\qhull\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\qhull\debug\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\qhull\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\qhull\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\qhull\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\qhull.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library (debug target) to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="3D Plugin Release|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\"
WarningLevel="2"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\qhull.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="3D Plugin Debug|Win32"
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\debug"
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\debug\qhull.pch"
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\debug\"
ObjectFile="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\debug\"
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\qhull\mtdll\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\qhull.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Copying QHULL files library (debug target) to lib tree."
CommandLine="ECHO Copying header files&#x0D;&#x0A;IF NOT EXIST ..\..\..\..\..\build\msvc_9\extern\qhull\include MKDIR ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;XCOPY /Y ..\..\include\qhull\*.h ..\..\..\..\..\build\msvc_9\extern\qhull\include&#x0D;&#x0A;ECHO Done&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\src\geom.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\geom2.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\global.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\io.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\mem.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\merge.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\poly.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\poly2.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\qhull.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\qset.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\stat.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\user.c"
>
<FileConfiguration
Name="Blender Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Blender Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="3D Plugin Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\src\geom.h"
>
</File>
<File
RelativePath="..\..\src\io.h"
>
</File>
<File
RelativePath="..\..\src\mem.h"
>
</File>
<File
RelativePath="..\..\src\merge.h"
>
</File>
<File
RelativePath="..\..\src\poly.h"
>
</File>
<File
RelativePath="..\..\src\qhull.h"
>
</File>
<File
RelativePath="..\..\src\qhull_a.h"
>
</File>
<File
RelativePath="..\..\src\qset.h"
>
</File>
<File
RelativePath="..\..\src\stat.h"
>
</File>
<File
RelativePath="..\..\src\user.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,285 +0,0 @@
#!/bin/sh -e
#
# Make-config.sh
#
# Setup for Debian build
#
# Writes configure.in and Makefile.am files
# and runs automake and autoconfig
#
# Use 'make dist' to build Unix distribution.
# Use 'configure; make' to build Qhull
#
#note:
# 'configure; make' does not work under cygwin.
# src/unix.c:354: variable 'qh_qh' can't be auto-imported.
# Please read the documentation for ld's --enable-auto-import for details.
###################################################
########### ../configure.in ######################
###################################################
echo Create ../configure.in
cat >../configure.in <<\HERE-CONFIGURE
dnl configure.in for the qhull package
dnl Author: Rafael Laboissiere <rafael@debian.org>
dnl Created: Mon Dec 3 21:36:21 CET 2001
AC_INIT(src/qhull.c)
AM_INIT_AUTOMAKE(qhull, 2002.1)
AC_PROG_CC
AC_PROG_LIBTOOL
AC_OUTPUT([Makefile src/Makefile html/Makefile eg/Makefile])
HERE-CONFIGURE
###################################################
########### ../Makefile.am #######################
###################################################
echo Create ../Makefile.am
cat >../Makefile.am <<\HERE-TOP
### Makefile.am for the qhull package (main)
### Author: Rafael Laboissiere <rafael@debian.org>
### Created: Mon Dec 3 21:36:21 CET 2001
### Documentation files
# to:
docdir = $(prefix)/share/doc/$(PACKAGE)
# which:
doc_DATA = \
Announce.txt \
COPYING.txt \
README.txt \
REGISTER.txt
### Extra files to be included in the tarball
EXTRA_DIST = \
$(doc_DATA) \
File_id.diz \
QHULL-GO.pif
### Subdirectories for Automaking
SUBDIRS = src html eg
HERE-TOP
###################################################
########### ../eg/Makefile.am ####################
###################################################
echo Create ../eg/Makefile.am
cat >../eg/Makefile.am <<\HERE-AM
### Makefile.am for the qhull package (eg)
### Author: Rafael Laboissiere <rafael@debian.org>
### Created: Mon Dec 3 21:36:21 CET 2001
### Documentation files
# to:
docdir = $(prefix)/share/doc/$(PACKAGE)
examplesdir = $(docdir)/examples
# which:
examples_DATA = \
q_eg \
q_egtest \
q_test \
Qhull-go.bat \
q_test.bat
### Extra files to be included in the tarball
EXTRA_DIST = $(examples_DATA)
HERE-AM
###################################################
########### ../html/Makefile.am ##################
###################################################
echo Create ../html/Makefile.am
cat >../html/Makefile.am <<\HERE-HTML
### Makefile.am for the qhull package (html)
### Author: Rafael Laboissiere <rafael@debian.org>
### Created: Mon Dec 3 21:36:21 CET 2001
### Man pages (trick to get around .man extension)
%.1: %.man
cp $< $@
CLEANFILES = *.1
man_MANS = rbox.1 qhull.1
### Documentation files
# to:
docdir = $(prefix)/share/doc/$(PACKAGE)
htmldir = $(docdir)/html
# which:
html_DATA = \
index.htm \
qconvex.htm \
qdelau_f.htm \
qdelaun.htm \
qh--4d.gif \
qh--cone.gif \
qh--dt.gif \
qh--geom.gif \
qh--half.gif \
qh--rand.gif \
qh-eg.htm \
qh-faq.htm \
qh-get.htm \
qh-home.htm \
qh-impre.htm \
qh-in.htm \
qh-optc.htm \
qh-optf.htm \
qh-optg.htm \
qh-opto.htm \
qh-optp.htm \
qh-optq.htm \
qh-optt.htm \
qh-quick.htm \
qhalf.htm \
qhull.htm \
qvoron_f.htm \
qvoronoi.htm \
rbox.htm
### Extra files to be included in the tarball
EXTRA_DIST = \
$(html_DATA) \
qhull.man \
qhull.txt \
rbox.man \
rbox.txt
HERE-HTML
###################################################
########### ../src/Makefile.am ###################
###################################################
echo Create ../src/Makefile.am
cat >../src/Makefile.am <<\HERE-SRC
### Makefile.am for the qhull package (src)
### Author: Rafael Laboissiere <rafael@debian.org>
### Created: Mon Dec 3 21:36:21 CET 2001
### Shared Library
# to:
lib_LTLIBRARIES = libqhull.la
# from:
libqhull_la_SOURCES = \
user.c \
global.c \
stat.c \
io.c \
geom2.c \
poly2.c \
merge.c \
qhull.c \
geom.c \
poly.c \
qset.c \
mem.c
# how:
libqhull_la_LDFLAGS = -version-info 0:0:0 -lm
### Utility programs
# to:
bin_PROGRAMS = qhull rbox qconvex qdelaunay qvoronoi qhalf
# from:
qhull_SOURCES = unix.c
rbox_SOURCES = rbox.c
qconvex_SOURCES = qconvex.c
qdelaunay_SOURCES = qdelaun.c
qvoronoi_SOURCES = qvoronoi.c
qhalf_SOURCES = qhalf.c
# how:
qhull_LDADD = libqhull.la
rbox_LDADD = libqhull.la
qconvex_LDADD = libqhull.la
qdelaunay_LDADD = libqhull.la
qvoronoi_LDADD = libqhull.la
qhalf_LDADD = libqhull.la
### Include files
pkginclude_HEADERS = \
geom.h \
mem.h \
poly.h \
qhull_a.h \
stat.h \
io.h \
merge.h \
qhull.h \
qset.h \
user.h
### Example programs
# to:
docdir = $(prefix)/share/doc/$(PACKAGE)
examplesdir = $(docdir)/examples
# which:
examples_DATA = \
user_eg.c \
user_eg2.c \
qhull_interface.cpp \
Makefile.txt \
Make-config.sh \
MBorland
doc_DATA = Changes.txt \
index.htm \
qh-geom.htm \
qh-globa.htm \
qh-io.htm \
qh-mem.htm \
qh-merge.htm \
qh-poly.htm \
qh-qhull.htm \
qh-set.htm \
qh-stat.htm \
qh-user.htm
### Extra files to be included in the tarball
EXTRA_DIST = \
$(doc_DATA) \
$(examples_DATA)
HERE-SRC
###################################################
########### run automake autoconf ################
###################################################
echo Run automake, libtoolize, and autoconf
cd ..; aclocal &&\
automake --foreign --add-missing --force-missing && \
libtoolize --force && \
autoconf

View File

@ -1,55 +0,0 @@
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
# vim: tabstop=8
#
# $Id$
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): GSR
#
# ***** END GPL LICENSE BLOCK *****
#
#
LIBNAME = qhull
DIR = $(OCGDIR)/extern/$(LIBNAME)
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I../include
CSRCS = user.c global.c stat.c io.c geom2.c poly2.c \
merge.c qhull.c geom.c poly.c qset.c mem.c
CCSRCS =
include nan_compile.mk
install: $(ALL_OR_DEBUG)
@[ -d $(NAN_QHULL) ] || mkdir -p $(NAN_QHULL)
@[ -d $(NAN_QHULL)/include/qhull ] || mkdir -p $(NAN_QHULL)/include/qhull
@[ -d $(NAN_QHULL)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_QHULL)/lib/$(DEBUG_DIR)
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_QHULL)/lib/$(DEBUG_DIR)
ifeq ($(OS),darwin)
ranlib $(NAN_QHULL)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
endif
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh ../include/qhull/*.h $(NAN_QHULL)/include/qhull

View File

@ -1,190 +0,0 @@
# Unix Makefile for qhull and rbox
#
# see README.txt
#
# make to produce qhull qconvex qdelaunay qhalf qvoronoi rbox
# make qvoronoi to produce qvoronoi (etc.)
# make qhullx to produce qhull qconvex etc. w/o using libqhull.a
# make doc to print documentation
# make install to copy qhull, rbox, qhull.1, rbox.1 to BINDIR, MANDIR
# make new to rebuild qhull and rbox from source
#
# make printall to print all files
# make user_eg to produce user_eg
# make user_eg2 to produce user_eg2
# make clean to remove object files and core
# make cleanall to remove all generated files
#
# PRINTMAN -- command for printing manual pages
# PRINTC -- command for printing C files
# BINDIR -- directory where to copy executables
# MANDIR -- directory where to copy manual pages
# CC -- ANSI C or C++ compiler
# CCOPTS1 - options used to compile .c files
# CCOPTS2 -- options used to link .o files
#
# CFILES -- .c files for printing
# HFILES -- .h files for printing
# DFILES -- documentation files
# MFILES -- man pages and html files
# TFILES -- .txt versions of html html files
# FILES -- all other files
# OBJS -- specifies the object files of libqhull.a
#
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1
# if you do not have enscript, try a2ps or just use lpr. The files are text.
PRINTMAN = enscript -2rl
PRINTC = enscript -2r
# PRINTMAN = lpr
# PRINTC = lpr
#for Gnu's gcc compiler -O2 for optimization, -g for debugging, -Wall for check
#
CC = gcc
CCOPTS1 = -O2 -ansi
# for Sun's cc compiler, -fast or O2 for optimization, -g for debugging, -Xc for ANSI
#CC = cc
#CCOPTS1 = -Xc -v -fast
# for Silicon Graphics cc compiler, -O2 for optimization, -g for debugging
#CC = cc
#CCOPTS1 = -ansi -O2
# for Next cc compiler with fat executable
#CC = cc
#CCOPTS1 = -ansi -O2 -arch m68k -arch i386 -arch hppa
# for loader, ld
CCOPTS2 = $(CCOPTS1)
# OBJS in execution frequency order. CFILES after qhull.c are alphabetical
OBJS = user.o global.o stat.o io.o geom2.o poly2.o \
merge.o qhull.o geom.o poly.o qset.o mem.o
CFILES= unix.c qhull.c geom.c geom2.c global.c io.c mem.c merge.c poly.c \
poly2.c qset.c stat.c user.c qconvex.c qdelaun.c qhalf.c qvoronoi.c
HFILES= user.h qhull.h qhull_a.h geom.h io.h mem.h merge.h poly.h qset.h stat.h
TXTFILES= ../Announce.txt ../REGISTER.txt ../COPYING.txt ../README.txt Changes.txt
DOCFILES= ../html/rbox.txt ../html/qhull.txt
FILES= Makefile rbox.c user_eg.c ../eg/q_test ../eg/q_egtest ../eg/q_eg
HTMFILES= qhull.man rbox.man qh-in.htm qh-optg.htm qh-optt.htm qh-optp.htm \
index.htm qh-quick.htm qh-impre.htm qh-eg.htm \
qh-optc.htm qh-opto.htm qh-optf.htm qh-optq.htm \
qh-c.htm qh-faq.htm qhull.htm qconvex.htm qdelaun.htm \
qh-geom.htm qh-globa.htm qh-io.htm qh-mem.htm qh-merge.htm \
qh-poly.htm qh-qhull.htm qh-set.htm qh-stat.htm qh-user.htm \
qdelau_f.htm qhalf.htm qvoronoi.htm qvoron_f.htm rbox.htm
all: rbox qconvex qdelaunay qhalf qvoronoi qhull
unix.o: qhull.h user.h mem.h
qconvex.o: qhull.h user.h mem.h
qdelaun.o: qhull.h user.h mem.h
qhalf.o: qhull.h user.h mem.h
qvoronoi.o: qhull.h user.h mem.h
qhull.o: $(HFILES)
geom.o: $(HFILES)
geom2.o: $(HFILES)
global.o: $(HFILES)
io.o: $(HFILES)
mem.o: mem.h
merge.o: $(HFILES)
poly.o: $(HFILES)
poly2.o: $(HFILES)
qset.o: qset.h mem.h
stat.o: $(HFILES)
user.o: $(HFILES)
.c.o:
$(CC) -c $(CCOPTS1) $<
clean:
rm -f *.o ../core qconvex qdelaunay qhalf qvoronoi qhull libqhull.a \
*.exe
cleanall: clean
rm -f *~ ../rbox ../qhull ../qhalf ../qconvex ../qdelaunay ../qhalf\
../qvoronoi ../user_eg ../user_eg2 ../*.exe >/dev/null
doc:
$(PRINTMAN) $(TXTFILES) $(DOCFILES)
install: all
cp ../qconvex $(BINDIR)/qconvex
cp ../qdelaunay $(BINDIR)/qdelaunay
cp ../qhalf $(BINDIR)/qhalf
cp ../qhull $(BINDIR)/qhull
cp ../qvoronoi $(BINDIR)/qvoronoi
cp ../rbox $(BINDIR)/rbox
cp ../html/qhull.man $(MANDIR)/qhull.1
cp ../html/rbox.man $(MANDIR)/rbox.1
new: cleanall all
printall: doc printh printc printf
printh:
$(PRINTC) $(HFILES)
printc:
$(PRINTC) $(CFILES)
printf:
$(PRINTC) $(FILES)
libqhull.a: $(OBJS)
@echo if 'ar' or 'ranlib' fails, try 'make qhullx'
ar r libqhull.a $(OBJS)
@echo the next line may need to be removed.
-test -x /bin/ranlib -o -x /usr/bin/ranlib && ranlib libqhull.a
# don't use ../qconvex. Does not work on Red Hat Linux
qconvex: qconvex.o libqhull.a
$(CC) -o qconvex $(CCOPTS2) qconvex.o -L. -lqhull -lm
cp qconvex ..
qdelaunay: qdelaun.o libqhull.a
$(CC) -o qdelaunay $(CCOPTS2) qdelaun.o -L. -lqhull -lm
cp qdelaunay ..
qhalf: qhalf.o libqhull.a
$(CC) -o qhalf $(CCOPTS2) qhalf.o -L. -lqhull -lm
cp qhalf ..
qvoronoi: qvoronoi.o libqhull.a
$(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o -L. -lqhull -lm
cp qvoronoi ..
qhull: unix.o libqhull.a
$(CC) -o qhull $(CCOPTS2) unix.o -L. -lqhull -lm
cp qhull ..
-chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest
-cd ..; ./rbox D4 | ./qhull
# compile qhull without using libqhull.a
qhullx: qconvex.o qdelaun.o qhalf.o qvoronoi.o unix.o $(OBJS)
$(CC) -o qconvex $(CCOPTS2) qconvex.o $(OBJS) -lm
$(CC) -o qdelaunay $(CCOPTS2) qdelaun.o $(OBJS) -lm
$(CC) -o qhalf $(CCOPTS2) qhalf.o $(OBJS) -lm
$(CC) -o qvoronoi $(CCOPTS2) qvoronoi.o $(OBJS) -lm
$(CC) -o qhull $(CCOPTS2) unix.o $(OBJS) -lm
cp qconvex qdelaunay qhalf qvoronoi qhull ..
-chmod +x ../eg/q_test ../eg/q_eg ../eg/q_egtest
-cd ..; ./rbox D4 | ./qhull
rbox: rbox.o
$(CC) -o rbox rbox.o $(CCOPTS2) -lm
cp rbox ..
user_eg: user_eg.o libqhull.a
$(CC) -o user_eg $(CCOPTS2) user_eg.o -L. -lqhull -lm
cp user_eg ..
user_eg2: user_eg2.o libqhull.a
$(CC) -o user_eg2 $(CCOPTS2) user_eg2.o -L. -lqhull -lm
cp user_eg2 ..
# end of Makefile

1230
extern/qhull/src/geom.c vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,177 +0,0 @@
/*<html><pre> -<a href="qh-geom.htm"
>-------------------------------</a><a name="TOP">-</a>
geom.h
header file for geometric routines
see qh-geom.htm and geom.c
copyright (c) 1993-2002 The Geometry Center
*/
#ifndef qhDEFgeom
#define qhDEFgeom 1
/* ============ -macros- ======================== */
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fabs_">-</a>
fabs_(a)
returns the absolute value of a
*/
#define fabs_( a ) ((( a ) < 0 ) ? -( a ):( a ))
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fmax_">-</a>
fmax_(a,b)
returns the maximum value of a and b
*/
#define fmax_( a,b ) ( ( a ) < ( b ) ? ( b ) : ( a ) )
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="fmin_">-</a>
fmin_(a,b)
returns the minimum value of a and b
*/
#define fmin_( a,b ) ( ( a ) > ( b ) ? ( b ) : ( a ) )
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="maximize_">-</a>
maximize_(maxval, val)
set maxval to val if val is greater than maxval
*/
#define maximize_( maxval, val ) {if (( maxval ) < ( val )) ( maxval )= ( val );}
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="minimize_">-</a>
minimize_(minval, val)
set minval to val if val is less than minval
*/
#define minimize_( minval, val ) {if (( minval ) > ( val )) ( minval )= ( val );}
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="det2_">-</a>
det2_(a1, a2,
b1, b2)
compute a 2-d determinate
*/
#define det2_( a1,a2,b1,b2 ) (( a1 )*( b2 ) - ( a2 )*( b1 ))
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="det3_">-</a>
det3_(a1, a2, a3,
b1, b2, b3,
c1, c2, c3)
compute a 3-d determinate
*/
#define det3_( a1,a2,a3,b1,b2,b3,c1,c2,c3 ) ( ( a1 )*det2_( b2,b3,c2,c3 ) \
- ( b1 )*det2_( a2,a3,c2,c3 ) + ( c1 )*det2_( a2,a3,b2,b3 ) )
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="dX">-</a>
dX( p1, p2 )
dY( p1, p2 )
dZ( p1, p2 )
given two indices into rows[],
compute the difference between X, Y, or Z coordinates
*/
#define dX( p1,p2 ) ( *( rows[p1] ) - *( rows[p2] ))
#define dY( p1,p2 ) ( *( rows[p1]+1 ) - *( rows[p2]+1 ))
#define dZ( p1,p2 ) ( *( rows[p1]+2 ) - *( rows[p2]+2 ))
#define dW( p1,p2 ) ( *( rows[p1]+3 ) - *( rows[p2]+3 ))
/*============= prototypes in alphabetical order, infrequent at end ======= */
void qh_backnormal (realT **rows, int numrow, int numcol, boolT sign, coordT *normal, boolT *nearzero);
void qh_distplane (pointT *point, facetT *facet, realT *dist);
facetT *qh_findbest (pointT *point, facetT *startfacet,
boolT bestoutside, boolT isnewfacets, boolT noupper,
realT *dist, boolT *isoutside, int *numpart);
facetT *qh_findbesthorizon (boolT ischeckmax, pointT *point,
facetT *startfacet, boolT noupper, realT *bestdist, int *numpart);
facetT *qh_findbestnew (pointT *point, facetT *startfacet, realT *dist,
boolT bestoutside, boolT *isoutside, int *numpart);
void qh_gausselim(realT **rows, int numrow, int numcol, boolT *sign, boolT *nearzero);
realT qh_getangle(pointT *vect1, pointT *vect2);
pointT *qh_getcenter(setT *vertices);
pointT *qh_getcentrum(facetT *facet);
realT qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist);
void qh_normalize (coordT *normal, int dim, boolT toporient);
void qh_normalize2 (coordT *normal, int dim, boolT toporient,
realT *minnorm, boolT *ismin);
pointT *qh_projectpoint(pointT *point, facetT *facet, realT dist);
void qh_setfacetplane(facetT *newfacets);
void qh_sethyperplane_det (int dim, coordT **rows, coordT *point0,
boolT toporient, coordT *normal, realT *offset, boolT *nearzero);
void qh_sethyperplane_gauss (int dim, coordT **rows, pointT *point0,
boolT toporient, coordT *normal, coordT *offset, boolT *nearzero);
boolT qh_sharpnewfacets (void);
/*========= infrequently used code in geom2.c =============*/
coordT *qh_copypoints (coordT *points, int numpoints, int dimension);
void qh_crossproduct (int dim, realT vecA[3], realT vecB[3], realT vecC[3]);
realT qh_determinant (realT **rows, int dim, boolT *nearzero);
realT qh_detjoggle (pointT *points, int numpoints, int dimension);
void qh_detroundoff (void);
realT qh_detsimplex(pointT *apex, setT *points, int dim, boolT *nearzero);
realT qh_distnorm (int dim, pointT *point, pointT *normal, realT *offsetp);
realT qh_distround (int dimension, realT maxabs, realT maxsumabs);
realT qh_divzero(realT numer, realT denom, realT mindenom1, boolT *zerodiv);
realT qh_facetarea (facetT *facet);
realT qh_facetarea_simplex (int dim, coordT *apex, setT *vertices,
vertexT *notvertex, boolT toporient, coordT *normal, realT *offset);
pointT *qh_facetcenter (setT *vertices);
facetT *qh_findgooddist (pointT *point, facetT *facetA, realT *distp, facetT **facetlist);
void qh_getarea (facetT *facetlist);
boolT qh_gram_schmidt(int dim, realT **rows);
boolT qh_inthresholds (coordT *normal, realT *angle);
void qh_joggleinput (void);
realT *qh_maxabsval (realT *normal, int dim);
setT *qh_maxmin(pointT *points, int numpoints, int dimension);
realT qh_maxouter (void);
void qh_maxsimplex (int dim, setT *maxpoints, pointT *points, int numpoints, setT **simplex);
realT qh_minabsval (realT *normal, int dim);
int qh_mindiff (realT *vecA, realT *vecB, int dim);
boolT qh_orientoutside (facetT *facet);
void qh_outerinner (facetT *facet, realT *outerplane, realT *innerplane);
coordT qh_pointdist(pointT *point1, pointT *point2, int dim);
void qh_printmatrix (FILE *fp, char *string, realT **rows, int numrow, int numcol);
void qh_printpoints (FILE *fp, char *string, setT *points);
void qh_projectinput (void);
void qh_projectpoints (signed char *project, int n, realT *points,
int numpoints, int dim, realT *newpoints, int newdim);
int qh_rand( void);
void qh_srand( int seed);
realT qh_randomfactor (void);
void qh_randommatrix (realT *buffer, int dim, realT **row);
void qh_rotateinput (realT **rows);
void qh_rotatepoints (realT *points, int numpoints, int dim, realT **rows);
void qh_scaleinput (void);
void qh_scalelast (coordT *points, int numpoints, int dim, coordT low,
coordT high, coordT newhigh);
void qh_scalepoints (pointT *points, int numpoints, int dim,
realT *newlows, realT *newhighs);
boolT qh_sethalfspace (int dim, coordT *coords, coordT **nextp,
coordT *normal, coordT *offset, coordT *feasible);
coordT *qh_sethalfspace_all (int dim, int count, coordT *halfspaces, pointT *feasible);
pointT *qh_voronoi_center (int dim, setT *points);
#endif /* qhDEFgeom */

2160
extern/qhull/src/geom2.c vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4089
extern/qhull/src/io.c vendored

File diff suppressed because it is too large Load Diff

149
extern/qhull/src/io.h vendored
View File

@ -1,149 +0,0 @@
/*<html><pre> -<a href="qh-io.htm"
>-------------------------------</a><a name="TOP">-</a>
io.h
declarations of Input/Output functions
see README, qhull.h and io.c
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFio
#define qhDEFio 1
/*============ constants and flags ==================*/
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_MAXfirst">-</a>
qh_MAXfirst
maximum length of first two lines of stdin
*/
#define qh_MAXfirst 200
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_MINradius">-</a>
qh_MINradius
min radius for Gp and Gv, fraction of maxcoord
*/
#define qh_MINradius 0.02
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_GEOMepsilon">-</a>
qh_GEOMepsilon
adjust outer planes for 'lines closer' and geomview roundoff.
This prevents bleed through.
*/
#define qh_GEOMepsilon 2e-3
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="qh_WHITESPACE">-</a>
qh_WHITESPACE
possible values of white space
*/
#define qh_WHITESPACE " \n\t\v\r\f"
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="RIDGE">-</a>
qh_RIDGE
to select which ridges to print in qh_eachvoronoi
*/
typedef enum
{
qh_RIDGEall = 0, qh_RIDGEinner, qh_RIDGEouter
}
qh_RIDGE;
/*-<a href="qh-io.htm#TOC"
>--------------------------------</a><a name="printvridgeT">-</a>
printvridgeT
prints results of qh_printvdiagram
see:
<a href="io.c#printvridge">qh_printvridge</a> for an example
*/
typedef void (*printvridgeT)(FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
/*============== -prototypes in alphabetical order =========*/
void dfacet( unsigned id);
void dvertex( unsigned id);
void qh_countfacets (facetT *facetlist, setT *facets, boolT printall,
int *numfacetsp, int *numsimplicialp, int *totneighborsp,
int *numridgesp, int *numcoplanarsp, int *numnumtricoplanarsp);
pointT *qh_detvnorm (vertexT *vertex, vertexT *vertexA, setT *centers, realT *offsetp);
setT *qh_detvridge (vertexT *vertex);
setT *qh_detvridge3 (vertexT *atvertex, vertexT *vertex);
int qh_eachvoronoi (FILE *fp, printvridgeT printvridge, vertexT *atvertex, boolT visitall, qh_RIDGE innerouter, boolT inorder);
int qh_eachvoronoi_all (FILE *fp, printvridgeT printvridge, boolT isupper, qh_RIDGE innerouter, boolT inorder);
void qh_facet2point(facetT *facet, pointT **point0, pointT **point1, realT *mindist);
setT *qh_facetvertices (facetT *facetlist, setT *facets, boolT allfacets);
void qh_geomplanes (facetT *facet, realT *outerplane, realT *innerplane);
void qh_markkeep (facetT *facetlist);
setT *qh_markvoronoi (facetT *facetlist, setT *facets, boolT printall, boolT *islowerp, int *numcentersp);
void qh_order_vertexneighbors(vertexT *vertex);
void qh_printafacet(FILE *fp, int format, facetT *facet, boolT printall);
void qh_printbegin (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printcenter (FILE *fp, int format, char *string, facetT *facet);
void qh_printcentrum (FILE *fp, facetT *facet, realT radius);
void qh_printend (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printend4geom (FILE *fp, facetT *facet, int *num, boolT printall);
void qh_printextremes (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printextremes_2d (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printextremes_d (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printfacet(FILE *fp, facetT *facet);
void qh_printfacet2math(FILE *fp, facetT *facet, int notfirst);
void qh_printfacet2geom(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet2geom_points(FILE *fp, pointT *point1, pointT *point2,
facetT *facet, realT offset, realT color[3]);
void qh_printfacet3math (FILE *fp, facetT *facet, int notfirst);
void qh_printfacet3geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet3geom_points(FILE *fp, setT *points, facetT *facet, realT offset, realT color[3]);
void qh_printfacet3geom_simplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet3vertex(FILE *fp, facetT *facet, int format);
void qh_printfacet4geom_nonsimplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacet4geom_simplicial(FILE *fp, facetT *facet, realT color[3]);
void qh_printfacetNvertex_nonsimplicial(FILE *fp, facetT *facet, int id, int format);
void qh_printfacetNvertex_simplicial(FILE *fp, facetT *facet, int format);
void qh_printfacetheader(FILE *fp, facetT *facet);
void qh_printfacetridges(FILE *fp, facetT *facet);
void qh_printfacets(FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printhelp_degenerate(FILE *fp);
void qh_printhelp_singular(FILE *fp);
void qh_printhyperplaneintersection(FILE *fp, facetT *facet1, facetT *facet2,
setT *vertices, realT color[3]);
void qh_printneighborhood (FILE *fp, int format, facetT *facetA, facetT *facetB, boolT printall);
void qh_printline3geom (FILE *fp, pointT *pointA, pointT *pointB, realT color[3]);
void qh_printpoint(FILE *fp, char *string, pointT *point);
void qh_printpointid(FILE *fp, char *string, int dim, pointT *point, int id);
void qh_printpoint3 (FILE *fp, pointT *point);
void qh_printpoints_out (FILE *fp, facetT *facetlist, setT *facets, int printall);
void qh_printpointvect (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius, realT color[3]);
void qh_printpointvect2 (FILE *fp, pointT *point, coordT *normal, pointT *center, realT radius);
void qh_printridge(FILE *fp, ridgeT *ridge);
void qh_printspheres(FILE *fp, setT *vertices, realT radius);
void qh_printvdiagram (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
int qh_printvdiagram2 (FILE *fp, printvridgeT printvridge, setT *vertices, qh_RIDGE innerouter, boolT inorder);
void qh_printvertex(FILE *fp, vertexT *vertex);
void qh_printvertexlist (FILE *fp, char* string, facetT *facetlist,
setT *facets, boolT printall);
void qh_printvertices (FILE *fp, char* string, setT *vertices);
void qh_printvneighbors (FILE *fp, facetT* facetlist, setT *facets, boolT printall);
void qh_printvoronoi (FILE *fp, int format, facetT *facetlist, setT *facets, boolT printall);
void qh_printvnorm (FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
void qh_printvridge (FILE *fp, vertexT *vertex, vertexT *vertexA, setT *centers, boolT unbounded);
void qh_produce_output(void);
void qh_projectdim3 (pointT *source, pointT *destination);
int qh_readfeasible (int dim, char *remainder);
coordT *qh_readpoints(int *numpoints, int *dimension, boolT *ismalloc);
void qh_setfeasible (int dim);
boolT qh_skipfacet(facetT *facet);
#endif /* qhDEFio */

447
extern/qhull/src/mem.c vendored
View File

@ -1,447 +0,0 @@
/*<html><pre> -<a href="qh-mem.htm"
>-------------------------------</a><a name="TOP">-</a>
mem.c
memory management routines for qhull
This is a standalone program.
To initialize memory:
qh_meminit (stderr);
qh_meminitbuffers (qh IStracing, qh_MEMalign, 7, qh_MEMbufsize,qh_MEMinitbuf);
qh_memsize(sizeof(facetT));
qh_memsize(sizeof(facetT));
...
qh_memsetup();
To free up all memory buffers:
qh_memfreeshort (&curlong, &totlong);
if qh_NOmem,
malloc/free is used instead of mem.c
notes:
uses Quickfit algorithm (freelists for commonly allocated sizes)
assumes small sizes for freelists (it discards the tail of memory buffers)
see:
qh-mem.htm and mem.h
global.c (qh_initbuffers) for an example of using mem.c
copyright (c) 1993-2002 The Geometry Center
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mem.h"
#ifndef qhDEFqhull
typedef struct ridgeT ridgeT;
typedef struct facetT facetT;
void qh_errexit(int exitcode, facetT *, ridgeT *);
#endif
/*============ -global data structure ==============
see mem.h for definition
*/
qhmemT qhmem= {0}; /* remove "= {0}" if this causes a compiler error */
#ifndef qh_NOmem
/*============= internal functions ==============*/
static int qh_intcompare(const void *i, const void *j);
/*========== functions in alphabetical order ======== */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="intcompare">-</a>
qh_intcompare( i, j )
used by qsort and bsearch to compare two integers
*/
static int qh_intcompare(const void *i, const void *j) {
return(*((int *)i) - *((int *)j));
} /* intcompare */
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memalloc">-</a>
qh_memalloc( insize )
returns object of insize bytes
qhmem is the global memory structure
returns:
pointer to allocated memory
errors if insufficient memory
notes:
use explicit type conversion to avoid type warnings on some compilers
actual object may be larger than insize
use qh_memalloc_() for inline code for quick allocations
logs allocations if 'T5'
design:
if size < qhmem.LASTsize
if qhmem.freelists[size] non-empty
return first object on freelist
else
round up request to size of qhmem.freelists[size]
allocate new allocation buffer if necessary
allocate object from allocation buffer
else
allocate object with malloc()
*/
void *qh_memalloc(int insize) {
void **freelistp, *newbuffer;
int index, size;
int outsize, bufsize;
void *object;
if ((unsigned) insize <= (unsigned) qhmem.LASTsize) {
index= qhmem.indextable[insize];
freelistp= qhmem.freelists+index;
if ((object= *freelistp)) {
qhmem.cntquick++;
*freelistp= *((void **)*freelistp); /* replace freelist with next object */
return (object);
}else {
outsize= qhmem.sizetable[index];
qhmem.cntshort++;
if (outsize > qhmem .freesize) {
if (!qhmem.curbuffer)
bufsize= qhmem.BUFinit;
else
bufsize= qhmem.BUFsize;
qhmem.totshort += bufsize;
if (!(newbuffer= malloc(bufsize))) {
fprintf(qhmem.ferr, "qhull error (qh_memalloc): insufficient memory\n");
qh_errexit(qhmem_ERRmem, NULL, NULL);
}
*((void **)newbuffer)= qhmem.curbuffer; /* prepend newbuffer to curbuffer
list */
qhmem.curbuffer= newbuffer;
size= (sizeof(void **) + qhmem.ALIGNmask) & ~qhmem.ALIGNmask;
qhmem.freemem= (void *)((char *)newbuffer+size);
qhmem.freesize= bufsize - size;
}
object= qhmem.freemem;
qhmem.freemem= (void *)((char *)qhmem.freemem + outsize);
qhmem.freesize -= outsize;
return object;
}
}else { /* long allocation */
if (!qhmem.indextable) {
fprintf (qhmem.ferr, "qhull internal error (qh_memalloc): qhmem has not been initialized.\n");
qh_errexit(qhmem_ERRqhull, NULL, NULL);
}
outsize= insize;
qhmem .cntlong++;
qhmem .curlong++;
qhmem .totlong += outsize;
if (qhmem.maxlong < qhmem.totlong)
qhmem.maxlong= qhmem.totlong;
if (!(object= malloc(outsize))) {
fprintf(qhmem.ferr, "qhull error (qh_memalloc): insufficient memory\n");
qh_errexit(qhmem_ERRmem, NULL, NULL);
}
if (qhmem.IStracing >= 5)
fprintf (qhmem.ferr, "qh_memalloc long: %d bytes at %p\n", outsize, object);
}
return (object);
} /* memalloc */
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memfree">-</a>
qh_memfree( object, size )
free up an object of size bytes
size is insize from qh_memalloc
notes:
object may be NULL
type checking warns if using (void **)object
use qh_memfree_() for quick free's of small objects
design:
if size <= qhmem.LASTsize
append object to corresponding freelist
else
call free(object)
*/
void qh_memfree(void *object, int size) {
void **freelistp;
if (!object)
return;
if (size <= qhmem.LASTsize) {
qhmem .freeshort++;
freelistp= qhmem.freelists + qhmem.indextable[size];
*((void **)object)= *freelistp;
*freelistp= object;
}else {
qhmem .freelong++;
qhmem .totlong -= size;
free (object);
if (qhmem.IStracing >= 5)
fprintf (qhmem.ferr, "qh_memfree long: %d bytes at %p\n", size, object);
}
} /* memfree */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="memfreeshort">-</a>
qh_memfreeshort( curlong, totlong )
frees up all short and qhmem memory allocations
returns:
number and size of current long allocations
*/
void qh_memfreeshort (int *curlong, int *totlong) {
void *buffer, *nextbuffer;
*curlong= qhmem .cntlong - qhmem .freelong;
*totlong= qhmem .totlong;
for(buffer= qhmem.curbuffer; buffer; buffer= nextbuffer) {
nextbuffer= *((void **) buffer);
free(buffer);
}
qhmem.curbuffer= NULL;
if (qhmem .LASTsize) {
free (qhmem .indextable);
free (qhmem .freelists);
free (qhmem .sizetable);
}
memset((char *)&qhmem, 0, sizeof qhmem); /* every field is 0, FALSE, NULL */
} /* memfreeshort */
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="meminit">-</a>
qh_meminit( ferr )
initialize qhmem and test sizeof( void*)
*/
void qh_meminit (FILE *ferr) {
memset((char *)&qhmem, 0, sizeof qhmem); /* every field is 0, FALSE, NULL */
qhmem.ferr= ferr;
if (sizeof(void*) < sizeof(int)) {
fprintf (ferr, "qhull internal error (qh_meminit): sizeof(void*) < sizeof(int). qset.c will not work\n");
exit (1); /* can not use qh_errexit() */
}
} /* meminit */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="meminitbuffers">-</a>
qh_meminitbuffers( tracelevel, alignment, numsizes, bufsize, bufinit )
initialize qhmem
if tracelevel >= 5, trace memory allocations
alignment= desired address alignment for memory allocations
numsizes= number of freelists
bufsize= size of additional memory buffers for short allocations
bufinit= size of initial memory buffer for short allocations
*/
void qh_meminitbuffers (int tracelevel, int alignment, int numsizes, int bufsize, int bufinit) {
qhmem.IStracing= tracelevel;
qhmem.NUMsizes= numsizes;
qhmem.BUFsize= bufsize;
qhmem.BUFinit= bufinit;
qhmem.ALIGNmask= alignment-1;
if (qhmem.ALIGNmask & ~qhmem.ALIGNmask) {
fprintf (qhmem.ferr, "qhull internal error (qh_meminit): memory alignment %d is not a power of 2\n", alignment);
qh_errexit (qhmem_ERRqhull, NULL, NULL);
}
qhmem.sizetable= (int *) calloc (numsizes, sizeof(int));
qhmem.freelists= (void **) calloc (numsizes, sizeof(void *));
if (!qhmem.sizetable || !qhmem.freelists) {
fprintf(qhmem.ferr, "qhull error (qh_meminit): insufficient memory\n");
qh_errexit (qhmem_ERRmem, NULL, NULL);
}
if (qhmem.IStracing >= 1)
fprintf (qhmem.ferr, "qh_meminitbuffers: memory initialized with alignment %d\n", alignment);
} /* meminitbuffers */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="memsetup">-</a>
qh_memsetup()
set up memory after running memsize()
*/
void qh_memsetup (void) {
int k,i;
qsort(qhmem.sizetable, qhmem.TABLEsize, sizeof(int), qh_intcompare);
qhmem.LASTsize= qhmem.sizetable[qhmem.TABLEsize-1];
if (qhmem .LASTsize >= qhmem .BUFsize || qhmem.LASTsize >= qhmem .BUFinit) {
fprintf (qhmem.ferr, "qhull error (qh_memsetup): largest mem size %d is >= buffer size %d or initial buffer size %d\n",
qhmem .LASTsize, qhmem .BUFsize, qhmem .BUFinit);
qh_errexit(qhmem_ERRmem, NULL, NULL);
}
if (!(qhmem.indextable= (int *)malloc((qhmem.LASTsize+1) * sizeof(int)))) {
fprintf(qhmem.ferr, "qhull error (qh_memsetup): insufficient memory\n");
qh_errexit(qhmem_ERRmem, NULL, NULL);
}
for(k=qhmem.LASTsize+1; k--; )
qhmem.indextable[k]= k;
i= 0;
for(k= 0; k <= qhmem.LASTsize; k++) {
if (qhmem.indextable[k] <= qhmem.sizetable[i])
qhmem.indextable[k]= i;
else
qhmem.indextable[k]= ++i;
}
} /* memsetup */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="memsize">-</a>
qh_memsize( size )
define a free list for this size
*/
void qh_memsize(int size) {
int k;
if (qhmem .LASTsize) {
fprintf (qhmem .ferr, "qhull error (qh_memsize): called after qhmem_setup\n");
qh_errexit (qhmem_ERRqhull, NULL, NULL);
}
size= (size + qhmem.ALIGNmask) & ~qhmem.ALIGNmask;
for(k= qhmem.TABLEsize; k--; ) {
if (qhmem.sizetable[k] == size)
return;
}
if (qhmem.TABLEsize < qhmem.NUMsizes)
qhmem.sizetable[qhmem.TABLEsize++]= size;
else
fprintf(qhmem.ferr, "qhull warning (memsize): free list table has room for only %d sizes\n", qhmem.NUMsizes);
} /* memsize */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="memstatistics">-</a>
qh_memstatistics( fp )
print out memory statistics
notes:
does not account for wasted memory at the end of each block
*/
void qh_memstatistics (FILE *fp) {
int i, count, totfree= 0;
void *object;
for (i=0; i < qhmem.TABLEsize; i++) {
count=0;
for (object= qhmem .freelists[i]; object; object= *((void **)object))
count++;
totfree += qhmem.sizetable[i] * count;
}
fprintf (fp, "\nmemory statistics:\n\
%7d quick allocations\n\
%7d short allocations\n\
%7d long allocations\n\
%7d short frees\n\
%7d long frees\n\
%7d bytes of short memory in use\n\
%7d bytes of short memory in freelists\n\
%7d bytes of long memory allocated (except for input)\n\
%7d bytes of long memory in use (in %d pieces)\n\
%7d bytes per memory buffer (initially %d bytes)\n",
qhmem .cntquick, qhmem.cntshort, qhmem.cntlong,
qhmem .freeshort, qhmem.freelong,
qhmem .totshort - qhmem .freesize - totfree,
totfree,
qhmem .maxlong, qhmem .totlong, qhmem .cntlong - qhmem .freelong,
qhmem .BUFsize, qhmem .BUFinit);
if (qhmem.cntlarger) {
fprintf (fp, "%7d calls to qh_setlarger\n%7.2g average copy size\n",
qhmem.cntlarger, ((float) qhmem.totlarger)/ qhmem.cntlarger);
fprintf (fp, " freelists (bytes->count):");
}
for (i=0; i < qhmem.TABLEsize; i++) {
count=0;
for (object= qhmem .freelists[i]; object; object= *((void **)object))
count++;
fprintf (fp, " %d->%d", qhmem.sizetable[i], count);
}
fprintf (fp, "\n\n");
} /* memstatistics */
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="NOmem">-</a>
qh_NOmem
turn off quick-fit memory allocation
notes:
uses malloc() and free() instead
*/
#else /* qh_NOmem */
void *qh_memalloc(int insize) {
void *object;
if (!(object= malloc(insize))) {
fprintf(qhmem.ferr, "qhull error (qh_memalloc): insufficient memory\n");
qh_errexit(qhmem_ERRmem, NULL, NULL);
}
if (qhmem.IStracing >= 5)
fprintf (qhmem.ferr, "qh_memalloc long: %d bytes at %p\n", insize, object);
return object;
}
void qh_memfree(void *object, int size) {
if (!object)
return;
free (object);
if (qhmem.IStracing >= 5)
fprintf (qhmem.ferr, "qh_memfree long: %d bytes at %p\n", size, object);
}
void qh_memfreeshort (int *curlong, int *totlong) {
memset((char *)&qhmem, 0, sizeof qhmem); /* every field is 0, FALSE, NULL */
*curlong= 0;
*totlong= 0;
}
void qh_meminit (FILE *ferr) {
memset((char *)&qhmem, 0, sizeof qhmem); /* every field is 0, FALSE, NULL */
qhmem.ferr= ferr;
if (sizeof(void*) < sizeof(int)) {
fprintf (ferr, "qhull internal error (qh_meminit): sizeof(void*) < sizeof(int). qset.c will not work\n");
qh_errexit (qhmem_ERRqhull, NULL, NULL);
}
}
void qh_meminitbuffers (int tracelevel, int alignment, int numsizes, int bufsize, int bufinit) {
qhmem.IStracing= tracelevel;
}
void qh_memsetup (void) {
}
void qh_memsize(int size) {
}
void qh_memstatistics (FILE *fp) {
}
#endif /* qh_NOmem */

174
extern/qhull/src/mem.h vendored
View File

@ -1,174 +0,0 @@
/*<html><pre> -<a href="qh-mem.htm"
>-------------------------------</a><a name="TOP">-</a>
mem.h
prototypes for memory management functions
see qh-mem.htm, mem.c and qset.h
for error handling, writes message and calls
qh_errexit (qhmem_ERRmem, NULL, NULL) if insufficient memory
and
qh_errexit (qhmem_ERRqhull, NULL, NULL) otherwise
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFmem
#define qhDEFmem
/*-<a href="qh-mem.htm#TOC"
>-------------------------------</a><a name="NOmem">-</a>
qh_NOmem
turn off quick-fit memory allocation
notes:
mem.c implements Quickfit memory allocation for about 20% time
savings. If it fails on your machine, try to locate the
problem, and send the answer to qhull@geom.umn.edu. If this can
not be done, define qh_NOmem to use malloc/free instead.
#define qh_NOmem
*/
/*-------------------------------------------
to avoid bus errors, memory allocation must consider alignment requirements.
malloc() automatically takes care of alignment. Since mem.c manages
its own memory, we need to explicitly specify alignment in
qh_meminitbuffers().
A safe choice is sizeof(double). sizeof(float) may be used if doubles
do not occur in data structures and pointers are the same size. Be careful
of machines (e.g., DEC Alpha) with large pointers. If gcc is available,
use __alignof__(double) or fmax_(__alignof__(float), __alignof__(void *)).
see <a href="user.h#MEMalign">qh_MEMalign</a> in user.h for qhull's alignment
*/
#define qhmem_ERRmem 4 /* matches qh_ERRmem in qhull.h */
#define qhmem_ERRqhull 5 /* matches qh_ERRqhull in qhull.h */
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="ptr_intT">-</a>
ptr_intT
for casting a void* to an integer-type
notes:
On 64-bit machines, a pointer may be larger than an 'int'.
qh_meminit() checks that 'long' holds a 'void*'
*/
typedef unsigned long ptr_intT;
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="qhmemT">-</a>
qhmemT
global memory structure for mem.c
notes:
users should ignore qhmem except for writing extensions
qhmem is allocated in mem.c
qhmem could be swapable like qh and qhstat, but then
multiple qh's and qhmem's would need to keep in synch.
A swapable qhmem would also waste memory buffers. As long
as memory operations are atomic, there is no problem with
multiple qh structures being active at the same time.
If you need separate address spaces, you can swap the
contents of qhmem.
*/
typedef struct qhmemT qhmemT;
extern qhmemT qhmem;
struct qhmemT { /* global memory management variables */
int BUFsize; /* size of memory allocation buffer */
int BUFinit; /* initial size of memory allocation buffer */
int TABLEsize; /* actual number of sizes in free list table */
int NUMsizes; /* maximum number of sizes in free list table */
int LASTsize; /* last size in free list table */
int ALIGNmask; /* worst-case alignment, must be 2^n-1 */
void **freelists; /* free list table, linked by offset 0 */
int *sizetable; /* size of each freelist */
int *indextable; /* size->index table */
void *curbuffer; /* current buffer, linked by offset 0 */
void *freemem; /* free memory in curbuffer */
int freesize; /* size of free memory in bytes */
void *tempstack; /* stack of temporary memory, managed by users */
FILE *ferr; /* file for reporting errors */
int IStracing; /* =5 if tracing memory allocations */
int cntquick; /* count of quick allocations */
/* remove statistics doesn't effect speed */
int cntshort; /* count of short allocations */
int cntlong; /* count of long allocations */
int curlong; /* current count of inuse, long allocations */
int freeshort; /* count of short memfrees */
int freelong; /* count of long memfrees */
int totshort; /* total size of short allocations */
int totlong; /* total size of long allocations */
int maxlong; /* maximum totlong */
int cntlarger; /* count of setlarger's */
int totlarger; /* total copied by setlarger */
};
/*==================== -macros ====================*/
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memalloc_">-</a>
qh_memalloc_(size, object, type)
returns object of size bytes
assumes size<=qhmem.LASTsize and void **freelistp is a temp
*/
#ifdef qh_NOmem
#define qh_memalloc_(size, freelistp, object, type) {\
object= (type*)qh_memalloc (size); }
#else /* !qh_NOmem */
#define qh_memalloc_(size, freelistp, object, type) {\
freelistp= qhmem.freelists + qhmem.indextable[size];\
if ((object= (type*)*freelistp)) {\
qhmem.cntquick++; \
*freelistp= *((void **)*freelistp);\
}else object= (type*)qh_memalloc (size);}
#endif
/*-<a href="qh-mem.htm#TOC"
>--------------------------------</a><a name="memfree_">-</a>
qh_memfree_(object, size)
free up an object
notes:
object may be NULL
assumes size<=qhmem.LASTsize and void **freelistp is a temp
*/
#ifdef qh_NOmem
#define qh_memfree_(object, size, freelistp) {\
qh_memfree (object, size); }
#else /* !qh_NOmem */
#define qh_memfree_(object, size, freelistp) {\
if (object) { \
qhmem .freeshort++;\
freelistp= qhmem.freelists + qhmem.indextable[size];\
*((void **)object)= *freelistp;\
*freelistp= object;}}
#endif
/*=============== prototypes in alphabetical order ============*/
void *qh_memalloc(int insize);
void qh_memfree (void *object, int size);
void qh_memfreeshort (int *curlong, int *totlong);
void qh_meminit (FILE *ferr);
void qh_meminitbuffers (int tracelevel, int alignment, int numsizes,
int bufsize, int bufinit);
void qh_memsetup (void);
void qh_memsize(int size);
void qh_memstatistics (FILE *fp);
#endif /* qhDEFmem */

3626
extern/qhull/src/merge.c vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,171 +0,0 @@
/*<html><pre> -<a href="qh-merge.htm"
>-------------------------------</a><a name="TOP">-</a>
merge.h
header file for merge.c
see qh-merge.htm and merge.c
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFmerge
#define qhDEFmerge 1
/*============ -constants- ==============*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEredundant">-</a>
qh_ANGLEredundant
indicates redundant merge in mergeT->angle
*/
#define qh_ANGLEredundant 6.0
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEdegen">-</a>
qh_ANGLEdegen
indicates degenerate facet in mergeT->angle
*/
#define qh_ANGLEdegen 5.0
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_ANGLEconcave">-</a>
qh_ANGLEconcave
offset to indicate concave facets in mergeT->angle
notes:
concave facets are assigned the range of [2,4] in mergeT->angle
roundoff error may make the angle less than 2
*/
#define qh_ANGLEconcave 1.5
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="MRG">-</a>
MRG... (mergeType)
indicates the type of a merge (mergeT->type)
*/
typedef enum { /* in sort order for facet_mergeset */
MRGnone= 0,
MRGcoplanar, /* centrum coplanar */
MRGanglecoplanar, /* angle coplanar */
/* could detect half concave ridges */
MRGconcave, /* concave ridge */
MRGflip, /* flipped facet. facet1 == facet2 */
MRGridge, /* duplicate ridge (qh_MERGEridge) */
/* degen and redundant go onto degen_mergeset */
MRGdegen, /* degenerate facet (not enough neighbors) facet1 == facet2 */
MRGredundant, /* redundant facet (vertex subset) */
/* merge_degenredundant assumes degen < redundant */
MRGmirror, /* mirror facet from qh_triangulate */
ENDmrg
} mergeType;
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="qh_MERGEapex">-</a>
qh_MERGEapex
flag for qh_mergefacet() to indicate an apex merge
*/
#define qh_MERGEapex True
/*============ -structures- ====================*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="mergeT">-</a>
mergeT
structure used to merge facets
*/
typedef struct mergeT mergeT;
struct mergeT { /* initialize in qh_appendmergeset */
realT angle; /* angle between normals of facet1 and facet2 */
facetT *facet1; /* will merge facet1 into facet2 */
facetT *facet2;
mergeType type;
};
/*=========== -macros- =========================*/
/*-<a href="qh-merge.htm#TOC"
>--------------------------------</a><a name="FOREACHmerge_">-</a>
FOREACHmerge_( merges ) {...}
assign 'merge' to each merge in merges
notes:
uses 'mergeT *merge, **mergep;'
if qh_mergefacet(),
restart since qh.facet_mergeset may change
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHmerge_( merges ) FOREACHsetelement_(mergeT, merges, merge)
/*============ prototypes in alphabetical order after pre/postmerge =======*/
void qh_premerge (vertexT *apex, realT maxcentrum, realT maxangle);
void qh_postmerge (char *reason, realT maxcentrum, realT maxangle,
boolT vneighbors);
void qh_all_merges (boolT othermerge, boolT vneighbors);
void qh_appendmergeset(facetT *facet, facetT *neighbor, mergeType mergetype, realT *angle);
setT *qh_basevertices( facetT *samecycle);
void qh_checkconnect (void /* qh new_facets */);
boolT qh_checkzero (boolT testall);
void qh_copynonconvex (ridgeT *atridge);
void qh_degen_redundant_facet (facetT *facet);
void qh_degen_redundant_neighbors (facetT *facet, facetT *delfacet);
vertexT *qh_find_newvertex (vertexT *oldvertex, setT *vertices, setT *ridges);
void qh_findbest_test (boolT testcentrum, facetT *facet, facetT *neighbor,
facetT **bestfacet, realT *distp, realT *mindistp, realT *maxdistp);
facetT *qh_findbestneighbor(facetT *facet, realT *distp, realT *mindistp, realT *maxdistp);
void qh_flippedmerges(facetT *facetlist, boolT *wasmerge);
void qh_forcedmerges( boolT *wasmerge);
void qh_getmergeset(facetT *facetlist);
void qh_getmergeset_initial (facetT *facetlist);
void qh_hashridge (setT *hashtable, int hashsize, ridgeT *ridge, vertexT *oldvertex);
ridgeT *qh_hashridge_find (setT *hashtable, int hashsize, ridgeT *ridge,
vertexT *vertex, vertexT *oldvertex, int *hashslot);
void qh_makeridges(facetT *facet);
void qh_mark_dupridges(facetT *facetlist);
void qh_maydropneighbor (facetT *facet);
int qh_merge_degenredundant (void);
void qh_merge_nonconvex( facetT *facet1, facetT *facet2, mergeType mergetype);
void qh_mergecycle (facetT *samecycle, facetT *newfacet);
void qh_mergecycle_all (facetT *facetlist, boolT *wasmerge);
void qh_mergecycle_facets( facetT *samecycle, facetT *newfacet);
void qh_mergecycle_neighbors(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_ridges(facetT *samecycle, facetT *newfacet);
void qh_mergecycle_vneighbors( facetT *samecycle, facetT *newfacet);
void qh_mergefacet(facetT *facet1, facetT *facet2, realT *mindist, realT *maxdist, boolT mergeapex);
void qh_mergefacet2d (facetT *facet1, facetT *facet2);
void qh_mergeneighbors(facetT *facet1, facetT *facet2);
void qh_mergeridges(facetT *facet1, facetT *facet2);
void qh_mergesimplex(facetT *facet1, facetT *facet2, boolT mergeapex);
void qh_mergevertex_del (vertexT *vertex, facetT *facet1, facetT *facet2);
void qh_mergevertex_neighbors(facetT *facet1, facetT *facet2);
void qh_mergevertices(setT *vertices1, setT **vertices);
setT *qh_neighbor_intersections (vertexT *vertex);
void qh_newvertices (setT *vertices);
boolT qh_reducevertices (void);
vertexT *qh_redundant_vertex (vertexT *vertex);
boolT qh_remove_extravertices (facetT *facet);
vertexT *qh_rename_sharedvertex (vertexT *vertex, facetT *facet);
void qh_renameridgevertex(ridgeT *ridge, vertexT *oldvertex, vertexT *newvertex);
void qh_renamevertex(vertexT *oldvertex, vertexT *newvertex, setT *ridges,
facetT *oldfacet, facetT *neighborA);
boolT qh_test_appendmerge (facetT *facet, facetT *neighbor);
boolT qh_test_vneighbors (void /* qh newfacet_list */);
void qh_tracemerge (facetT *facet1, facetT *facet2);
void qh_tracemerging (void);
void qh_updatetested( facetT *facet1, facetT *facet2);
setT *qh_vertexridges (vertexT *vertex);
void qh_vertexridges_facet (vertexT *vertex, facetT *facet, setT **ridges);
void qh_willdelete (facetT *facet, facetT *replace);
#endif /* qhDEFmerge */

1180
extern/qhull/src/poly.c vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,290 +0,0 @@
/*<html><pre> -<a href="qh-poly.htm"
>-------------------------------</a><a name="TOP">-</a>
poly.h
header file for poly.c and poly2.c
see qh-poly.htm, qhull.h and poly.c
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFpoly
#define qhDEFpoly 1
/*=============== constants ========================== */
/*-<a href="qh-geom.htm#TOC"
>--------------------------------</a><a name="ALGORITHMfault">-</a>
ALGORITHMfault
use as argument to checkconvex() to report errors during buildhull
*/
#define qh_ALGORITHMfault 0
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="DATAfault">-</a>
DATAfault
use as argument to checkconvex() to report errors during initialhull
*/
#define qh_DATAfault 1
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="DUPLICATEridge">-</a>
DUPLICATEridge
special value for facet->neighbor to indicate a duplicate ridge
notes:
set by matchneighbor, used by matchmatch and mark_dupridge
*/
#define qh_DUPLICATEridge ( facetT * ) 1L
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="MERGEridge">-</a>
MERGEridge flag in facet
special value for facet->neighbor to indicate a merged ridge
notes:
set by matchneighbor, used by matchmatch and mark_dupridge
*/
#define qh_MERGEridge ( facetT * ) 2L
/*============ -structures- ====================*/
/*=========== -macros- =========================*/
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLfacet_">-</a>
FORALLfacet_( facetlist ) { ... }
assign 'facet' to each facet in facetlist
notes:
uses 'facetT *facet;'
assumes last facet is a sentinel
see:
FORALLfacets
*/
#define FORALLfacet_( facetlist ) if ( facetlist ) for( facet=( facetlist );facet && facet->next;facet=facet->next )
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLnew_facets">-</a>
FORALLnew_facets { ... }
assign 'newfacet' to each facet in qh.newfacet_list
notes:
uses 'facetT *newfacet;'
at exit, newfacet==NULL
*/
#define FORALLnew_facets for( newfacet=qh newfacet_list;newfacet && newfacet->next;newfacet=newfacet->next )
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLvertex_">-</a>
FORALLvertex_( vertexlist ) { ... }
assign 'vertex' to each vertex in vertexlist
notes:
uses 'vertexT *vertex;'
at exit, vertex==NULL
*/
#define FORALLvertex_( vertexlist ) for ( vertex=( vertexlist );vertex && vertex->next;vertex= vertex->next )
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLvisible_facets">-</a>
FORALLvisible_facets { ... }
assign 'visible' to each visible facet in qh.visible_list
notes:
uses 'vacetT *visible;'
at exit, visible==NULL
*/
#define FORALLvisible_facets for (visible=qh visible_list; visible && visible->visible; visible= visible->next)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLsame_">-</a>
FORALLsame_( newfacet ) { ... }
assign 'same' to each facet in newfacet->f.samecycle
notes:
uses 'facetT *same;'
stops when it returns to newfacet
*/
#define FORALLsame_(newfacet) for (same= newfacet->f.samecycle; same != newfacet; same= same->f.samecycle)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FORALLsame_cycle_">-</a>
FORALLsame_cycle_( newfacet ) { ... }
assign 'same' to each facet in newfacet->f.samecycle
notes:
uses 'facetT *same;'
at exit, same == NULL
*/
#define FORALLsame_cycle_(newfacet) \
for (same= newfacet->f.samecycle; \
same; same= (same == newfacet ? NULL : same->f.samecycle))
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHneighborA_">-</a>
FOREACHneighborA_( facet ) { ... }
assign 'neighborA' to each neighbor in facet->neighbors
FOREACHneighborA_( vertex ) { ... }
assign 'neighborA' to each neighbor in vertex->neighbors
declare:
facetT *neighborA, **neighborAp;
see:
<a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHneighborA_(facet) FOREACHsetelement_(facetT, facet->neighbors, neighborA)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHvisible_">-</a>
FOREACHvisible_( facets ) { ... }
assign 'visible' to each facet in facets
notes:
uses 'facetT *facet, *facetp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHvisible_(facets) FOREACHsetelement_(facetT, facets, visible)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHnewfacet_">-</a>
FOREACHnewfacet_( facets ) { ... }
assign 'newfacet' to each facet in facets
notes:
uses 'facetT *newfacet, *newfacetp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHnewfacet_(facets) FOREACHsetelement_(facetT, facets, newfacet)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHvertexA_">-</a>
FOREACHvertexA_( vertices ) { ... }
assign 'vertexA' to each vertex in vertices
notes:
uses 'vertexT *vertexA, *vertexAp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHvertexA_(vertices) FOREACHsetelement_(vertexT, vertices, vertexA)
/*-<a href="qh-poly.htm#TOC"
>--------------------------------</a><a name="FOREACHvertexreverse12_">-</a>
FOREACHvertexreverse12_( vertices ) { ... }
assign 'vertex' to each vertex in vertices
reverse order of first two vertices
notes:
uses 'vertexT *vertex, *vertexp;'
see <a href="qset.h#FOREACHsetelement_">FOREACHsetelement_</a>
*/
#define FOREACHvertexreverse12_(vertices) FOREACHsetelementreverse12_(vertexT, vertices, vertex)
/*=============== prototypes poly.c in alphabetical order ================*/
void qh_appendfacet(facetT *facet);
void qh_appendvertex(vertexT *vertex);
void qh_attachnewfacets (void);
boolT qh_checkflipped (facetT *facet, realT *dist, boolT allerror);
void qh_delfacet(facetT *facet);
void qh_deletevisible(void /*qh visible_list, qh horizon_list*/);
setT *qh_facetintersect (facetT *facetA, facetT *facetB, int *skipAp,int *skipBp, int extra);
unsigned qh_gethash (int hashsize, setT *set, int size, int firstindex, void *skipelem);
facetT *qh_makenewfacet(setT *vertices, boolT toporient, facetT *facet);
void qh_makenewplanes ( void /* newfacet_list */);
facetT *qh_makenew_nonsimplicial (facetT *visible, vertexT *apex, int *numnew);
facetT *qh_makenew_simplicial (facetT *visible, vertexT *apex, int *numnew);
void qh_matchneighbor (facetT *newfacet, int newskip, int hashsize,
int *hashcount);
void qh_matchnewfacets (void);
boolT qh_matchvertices (int firstindex, setT *verticesA, int skipA,
setT *verticesB, int *skipB, boolT *same);
facetT *qh_newfacet(void);
ridgeT *qh_newridge(void);
int qh_pointid (pointT *point);
void qh_removefacet(facetT *facet);
void qh_removevertex(vertexT *vertex);
void qh_updatevertices (void);
/*========== -prototypes poly2.c in alphabetical order ===========*/
void qh_addhash (void* newelem, setT *hashtable, int hashsize, unsigned hash);
void qh_check_bestdist (void);
void qh_check_maxout (void);
void qh_check_output (void);
void qh_check_point (pointT *point, facetT *facet, realT *maxoutside, realT *maxdist, facetT **errfacet1, facetT **errfacet2);
void qh_check_points(void);
void qh_checkconvex(facetT *facetlist, int fault);
void qh_checkfacet(facetT *facet, boolT newmerge, boolT *waserrorp);
void qh_checkflipped_all (facetT *facetlist);
void qh_checkpolygon(facetT *facetlist);
void qh_checkvertex (vertexT *vertex);
void qh_clearcenters (qh_CENTER type);
void qh_createsimplex(setT *vertices);
void qh_delridge(ridgeT *ridge);
void qh_delvertex (vertexT *vertex);
setT *qh_facet3vertex (facetT *facet);
facetT *qh_findbestfacet (pointT *point, boolT bestoutside,
realT *bestdist, boolT *isoutside);
facetT *qh_findfacet_all (pointT *point, realT *bestdist, boolT *isoutside,
int *numpart);
int qh_findgood (facetT *facetlist, int goodhorizon);
void qh_findgood_all (facetT *facetlist);
void qh_furthestnext (void /* qh facet_list */);
void qh_furthestout (facetT *facet);
void qh_infiniteloop (facetT *facet);
void qh_initbuild(void);
void qh_initialhull(setT *vertices);
setT *qh_initialvertices(int dim, setT *maxpoints, pointT *points, int numpoints);
vertexT *qh_isvertex (pointT *point, setT *vertices);
vertexT *qh_makenewfacets (pointT *point /*horizon_list, visible_list*/);
void qh_matchduplicates (facetT *atfacet, int atskip, int hashsize, int *hashcount);
void qh_nearcoplanar ( void /* qh.facet_list */);
vertexT *qh_nearvertex (facetT *facet, pointT *point, realT *bestdistp);
int qh_newhashtable(int newsize);
vertexT *qh_newvertex(pointT *point);
ridgeT *qh_nextridge3d (ridgeT *atridge, facetT *facet, vertexT **vertexp);
void qh_outcoplanar (void /* facet_list */);
pointT *qh_point (int id);
void qh_point_add (setT *set, pointT *point, void *elem);
setT *qh_pointfacet (void /*qh facet_list*/);
setT *qh_pointvertex (void /*qh facet_list*/);
void qh_prependfacet(facetT *facet, facetT **facetlist);
void qh_printhashtable(FILE *fp);
void qh_printlists (void);
void qh_resetlists (boolT stats, boolT resetVisible /*qh newvertex_list newfacet_list visible_list*/);
void qh_setvoronoi_all (void);
void qh_triangulate (void /*qh facet_list*/);
void qh_triangulate_facet (facetT *facetA, vertexT **first_vertex);
void qh_triangulate_link (facetT *oldfacetA, facetT *facetA, facetT *oldfacetB, facetT *facetB);
void qh_triangulate_mirror (facetT *facetA, facetT *facetB);
void qh_triangulate_null (facetT *facetA);
void qh_vertexintersect(setT **vertexsetA,setT *vertexsetB);
setT *qh_vertexintersect_new(setT *vertexsetA,setT *vertexsetB);
void qh_vertexneighbors (void /*qh facet_list*/);
boolT qh_vertexsubset(setT *vertexsetA, setT *vertexsetB);
#endif /* qhDEFpoly */

3070
extern/qhull/src/poly2.c vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,334 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
qconvex.c
compute convex hulls using qhull
see unix.c for full interface
copyright (c) 1993-2002, The Geometry Center
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#if __MWERKS__ && __POWERPC__
#include <SIOUX.h>
#include <Files.h>
#include <console.h>
#include <Desk.h>
#elif __cplusplus
extern "C" {
int isatty (int);
}
#elif _MSC_VER
#include <io.h>
#define isatty _isatty
#else
int isatty (int); /* returns 1 if stdin is a tty
if "Undefined symbol" this can be deleted along with call in main() */
#endif
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt">-</a>
qh_prompt
long prompt for qconvex
notes:
restricted version of qhull.c
see:
concise prompt below
*/
/* duplicated in qconvex.htm */
char hidden_options[]=" d v H Qbb Qf Qg Qm Qr Qu Qv Qx Qz TR E V Fp Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
char qh_prompta[]= "\n\
qconvex- compute the convex hull\n\
http://www.geom.umn.edu/software/qhull %s\n\
\n\
input (stdin):\n\
first lines: dimension and number of points (or vice-versa).\n\
other lines: point coordinates, best if one point per line\n\
comments: start with a non-numeric character\n\
\n\
options:\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Qc - keep coplanar points with nearest facet\n\
Qi - keep interior points with nearest facet\n\
\n\
Qhull control options:\n\
Qbk:n - scale coord k so that low bound is n\n\
QBk:n - scale coord k so that upper bound is n (QBk is %2.2g)\n\
QbB - scale input to unit cube centered at the origin\n\
Qbk:0Bk:0 - remove k-th coordinate from input\n\
QJn - randomly joggle input in range [-n,n]\n\
QRn - random rotation (n=seed, n=0 time, n=-1 time/no rotate)\n\
%s%s%s%s"; /* split up qh_prompt for Visual C++ */
char qh_promptb[]= "\
Qs - search all points for the initial simplex\n\
QGn - good facet if visible from point n, -n for not visible\n\
QVn - good facet if it includes point n, -n if not\n\
\n\
";
char qh_promptc[]= "\
Trace options:\n\
T4 - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
Tc - check frequently during execution\n\
Ts - print statistics\n\
Tv - verify result: structure, convexity, and point inclusion\n\
Tz - send all output to stdout\n\
TFn - report summary when n or more facets created\n\
TI file - input data from file, no spaces or single quotes\n\
TO file - output results to file, may be enclosed in single quotes\n\
TPn - turn on tracing when point n added to hull\n\
TMn - turn on tracing at merge n\n\
TWn - trace merge facets when width > n\n\
TVn - stop qhull after adding point n, -n for before (see TCn)\n\
TCn - stop qhull after building cone for point n (see TVn)\n\
\n\
Precision options:\n\
Cn - radius of centrum (roundoff added). Merge facets if non-convex\n\
An - cosine of maximum angle. Merge facets if cosine > n or non-convex\n\
C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
Rn - randomly perturb computations by a factor of [1-n,1+n]\n\
Un - max distance below plane for a new, coplanar point\n\
Wn - min facet width for outside point (before roundoff)\n\
\n\
Output formats (may be combined; if none, produces a summary to stdout):\n\
f - facet dump\n\
G - Geomview output (see below)\n\
i - vertices incident to each facet\n\
m - Mathematica output (2-d and 3-d)\n\
n - normals with offsets\n\
o - OFF file format (dim, points and facets; Voronoi regions)\n\
p - point coordinates \n\
s - summary (stderr)\n\
\n\
";
char qh_promptd[]= "\
More formats:\n\
Fa - area for each facet\n\
FA - compute total area and volume for option 's'\n\
Fc - count plus coplanar points for each facet\n\
use 'Qc' (default) for coplanar and 'Qi' for interior\n\
FC - centrum for each facet\n\
Fd - use cdd format for input (homogeneous with offset first)\n\
FD - use cdd format for numeric output (offset first)\n\
FF - facet dump without ridges\n\
Fi - inner plane for each facet\n\
FI - ID for each facet\n\
Fm - merge count for each facet (511 max)\n\
Fn - count plus neighboring facets for each facet\n\
FN - count plus neighboring facets for each point\n\
Fo - outer plane (or max_outside) for each facet\n\
FO - options and precision constants\n\
FP - nearest vertex for each coplanar point\n\
FQ - command used for qconvex\n\
Fs - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
for output: #vertices, #facets,\n\
#coplanar points, #non-simplicial facets\n\
#real (2), max outer plane, min vertex\n\
FS - sizes: #int (0) \n\
#real(2) tot area, tot volume\n\
Ft - triangulation with centrums for non-simplicial facets (OFF format)\n\
Fv - count plus vertices for each facet\n\
FV - average of vertices (a feasible point for 'H')\n\
Fx - extreme points (in order for 2-d)\n\
\n\
";
char qh_prompte[]= "\
Geomview output (2-d, 3-d, and 4-d)\n\
Ga - all points as dots\n\
Gp - coplanar points and vertices as radii\n\
Gv - vertices as spheres\n\
Gi - inner planes only\n\
Gn - no planes\n\
Go - outer planes only\n\
Gc - centrums\n\
Gh - hyperplane intersections\n\
Gr - ridges\n\
GDn - drop dimension n in 3-d and 4-d output\n\
\n\
Print options:\n\
PAn - keep n largest facets by area\n\
Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
PDk:n - drop facet if normal[k] >= n\n\
Pg - print good facets (needs 'QGn' or 'QVn')\n\
PFn - keep facets whose area is at least n\n\
PG - print neighbors of good facets\n\
PMn - keep n facets with most merges\n\
Po - force output. If error, output neighborhood of facet\n\
Pp - do not report precision problems\n\
\n\
. - list of all options\n\
- - one line descriptions of all options\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt2">-</a>
qh_prompt2
synopsis for qhull
*/
char qh_prompt2[]= "\n\
qconvex- compute the convex hull. Qhull %s\n\
input (stdin): dimension, number of points, point coordinates\n\
comments start with a non-numeric character\n\
\n\
options (qconvex.htm):\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Tv - verify result: structure, convexity, and point inclusion\n\
. - concise list of all options\n\
- - one-line description of all options\n\
\n\
output options (subset):\n\
s - summary of results (default)\n\
i - vertices incident to each facet\n\
n - normals with offsets\n\
p - vertex coordinates (includes coplanar points if 'Qc')\n\
Fx - extreme points (convex hull vertices)\n\
FA - compute total area and volume\n\
o - OFF format (dim, n, points, facets)\n\
G - Geomview output (2-d, 3-d, and 4-d)\n\
m - Mathematica output (2-d and 3-d)\n\
QVn - print facets that include point n, -n if not\n\
TO file- output results to file, may be enclosed in single quotes\n\
\n\
examples:\n\
rbox c D2 | qconvex s n rbox c D2 | qconvex i\n\
rbox c D2 | qconvex o rbox 1000 s | qconvex s Tv FA\n\
rbox c d D2 | qconvex s Qc Fx rbox y 1000 W0 | qconvex s n\n\
rbox y 1000 W0 | qconvex s QJ rbox d G1 D12 | qconvex QR0 FA Pp\n\
rbox c D7 | qconvex FA TF1000\n\
\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt3">-</a>
qh_prompt3
concise prompt for qhull
*/
char qh_prompt3[]= "\n\
Qhull %s.\n\
Except for 'F.' and 'PG', upper-case options take an argument.\n\
\n\
incidences mathematica normals OFF_format points\n\
summary facet_dump\n\
\n\
Farea FArea_total Fcoplanars FCentrums Fd_cdd_in\n\
FD_cdd_out FFacet_xridge Finner FIDs Fmerges\n\
Fneighbors FNeigh_vertex Fouter FOptions FPoint_near\n\
FQhull Fsummary FSize Fvertices FVertex_ave\n\
Fxtremes\n\
\n\
Gvertices Gpoints Gall_points Gno_planes Ginner\n\
Gcentrums Ghyperplanes Gridges Gouter GDrop_dim\n\
\n\
PArea_keep Pdrop d0:0D0 PFacet_area_keep Pgood PGood_neighbors\n\
PMerge_keep Poutput_forced Pprecision_not\n\
\n\
QbBound 0:0.5 QbB_scale_box Qcoplanar QGood_point Qinterior\n\
QJoggle Qrandom QRotate Qsearch_1st Qtriangulate\n\
QVertex_good\n\
\n\
T4_trace Tcheck_often Tstatistics Tverify Tz_stdout\n\
TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file\n\
TWide_trace TVertex_stop TCone_stop\n\
\n\
Angle_max Centrum_size Random_dist Ucoplanar_max Wide_outside\n\
";
/*-<a href="qh-qhull.htm"
>-------------------------------</a><a name="main">-</a>
main( argc, argv )
processes the command line, calls qhull() to do the work, and exits
design:
initializes data structures
reads points
finishes initialization
computes convex hull and other structures
checks the result
writes the output
frees memory
*/
int main(int argc, char *argv[]) {
int curlong, totlong; /* used !qh_NOmem */
int exitcode, numpoints, dim;
coordT *points;
boolT ismalloc;
#if __MWERKS__ && __POWERPC__
char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
SIOUXSettings.showstatusline= false;
SIOUXSettings.tabspaces= 1;
SIOUXSettings.rows= 40;
if (setvbuf (stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/
|| setvbuf (stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
|| (stdout != stderr && setvbuf (stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
fprintf (stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
argc= ccommand(&argv);
#endif
if ((argc == 1) && isatty( 0 /*stdin*/)) {
fprintf(stdout, qh_prompt2, qh_VERSION);
exit(qh_ERRnone);
}
if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompta, qh_VERSION, qh_DEFAULTbox,
qh_promptb, qh_promptc, qh_promptd, qh_prompte);
exit(qh_ERRnone);
}
if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompt3, qh_VERSION);
exit(qh_ERRnone);
}
qh_init_A (stdin, stdout, stderr, argc, argv); /* sets qh qhull_command */
exitcode= setjmp (qh errexit); /* simple statement for CRAY J916 */
if (!exitcode) {
qh_checkflags (qh qhull_command, hidden_options);
qh_initflags (qh qhull_command);
points= qh_readpoints (&numpoints, &dim, &ismalloc);
if (dim >= 5) {
qh_option ("Qxact_merge", NULL, NULL);
qh MERGEexact= True; /* 'Qx' always */
}
qh_init_B (points, numpoints, dim, ismalloc);
qh_qhull();
qh_check_output();
qh_produce_output();
if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points();
exitcode= qh_ERRnone;
}
qh NOerrexit= True; /* no more setjmp */
#ifdef qh_NOmem
qh_freeqhull( True);
#else
qh_freeqhull( False);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
#endif
return exitcode;
} /* main */

View File

@ -1,323 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
qdelaun.c
compute Delaunay triangulations and furthest-point Delaunay
triangulations using qhull
see unix.c for full interface
copyright (c) 1993-2002, The Geometry Center
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#if __MWERKS__ && __POWERPC__
#include <SIOUX.h>
#include <Files.h>
#include <console.h>
#include <Desk.h>
#elif __cplusplus
extern "C" {
int isatty (int);
}
#elif _MSC_VER
#include <io.h>
#define isatty _isatty
#else
int isatty (int); /* returns 1 if stdin is a tty
if "Undefined symbol" this can be deleted along with call in main() */
#endif
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt">-</a>
qh_prompt
long prompt for qhull
notes:
restricted version of qhull.c
see:
concise prompt below
*/
/* duplicated in qdelau_f.htm and qdelaun.htm */
char hidden_options[]=" d n v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V FC Fi Fo Ft Fp FV Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
char qh_prompta[]= "\n\
qdelaunay- compute the Delaunay triangulation\n\
http://www.geom.umn.edu/software/qhull %s\n\
\n\
input (stdin):\n\
first lines: dimension and number of points (or vice-versa).\n\
other lines: point coordinates, best if one point per line\n\
comments: start with a non-numeric character\n\
\n\
options:\n\
Qu - compute furthest-site Delaunay triangulation\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
\n\
Qhull control options:\n\
QJn - randomly joggle input in range [-n,n]\n\
%s%s%s%s"; /* split up qh_prompt for Visual C++ */
char qh_promptb[]= "\
Qs - search all points for the initial simplex\n\
Qz - add point-at-infinity to Delaunay triangulation\n\
QGn - print Delaunay region if visible from point n, -n if not\n\
QVn - print Delaunay regions that include point n, -n if not\n\
\n\
";
char qh_promptc[]= "\
Trace options:\n\
T4 - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
Tc - check frequently during execution\n\
Ts - print statistics\n\
Tv - verify result: structure, convexity, and in-circle test\n\
Tz - send all output to stdout\n\
TFn - report summary when n or more facets created\n\
TI file - input data from file, no spaces or single quotes\n\
TO file - output results to file, may be enclosed in single quotes\n\
TPn - turn on tracing when point n added to hull\n\
TMn - turn on tracing at merge n\n\
TWn - trace merge facets when width > n\n\
TVn - stop qhull after adding point n, -n for before (see TCn)\n\
TCn - stop qhull after building cone for point n (see TVn)\n\
\n\
Precision options:\n\
Cn - radius of centrum (roundoff added). Merge facets if non-convex\n\
An - cosine of maximum angle. Merge facets if cosine > n or non-convex\n\
C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
Rn - randomly perturb computations by a factor of [1-n,1+n]\n\
Wn - min facet width for outside point (before roundoff)\n\
\n\
Output formats (may be combined; if none, produces a summary to stdout):\n\
f - facet dump\n\
G - Geomview output (see below)\n\
i - vertices incident to each Delaunay region\n\
m - Mathematica output (2-d only, lifted to a paraboloid)\n\
o - OFF format (dim, points, and facets as a paraboloid)\n\
p - point coordinates (lifted to a paraboloid)\n\
s - summary (stderr)\n\
\n\
";
char qh_promptd[]= "\
More formats:\n\
Fa - area for each Delaunay region\n\
FA - compute total area for option 's'\n\
Fc - count plus coincident points for each Delaunay region\n\
Fd - use cdd format for input (homogeneous with offset first)\n\
FD - use cdd format for numeric output (offset first)\n\
FF - facet dump without ridges\n\
FI - ID of each Delaunay region\n\
Fm - merge count for each Delaunay region (511 max)\n\
Fn - count plus neighboring region for each Delaunay region\n\
FN - count plus neighboring region for each point\n\
FO - options and precision constants\n\
FP - nearest point and distance for each coincident point\n\
FQ - command used for qdelaunay\n\
Fs - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
for output: #vertices, #Delaunay regions,\n\
#coincident points, #non-simplicial regions\n\
#real (2), max outer plane, min vertex\n\
FS - sizes: #int (0)\n\
#real(2) tot area, 0\n\
Fv - count plus vertices for each Delaunay region\n\
Fx - extreme points of Delaunay triangulation (on convex hull)\n\
\n\
";
char qh_prompte[]= "\
Geomview options (2-d and 3-d)\n\
Ga - all points as dots\n\
Gp - coplanar points and vertices as radii\n\
Gv - vertices as spheres\n\
Gi - inner planes only\n\
Gn - no planes\n\
Go - outer planes only\n\
Gc - centrums\n\
Gh - hyperplane intersections\n\
Gr - ridges\n\
GDn - drop dimension n in 3-d and 4-d output\n\
Gt - transparent outer ridges to view 3-d Delaunay\n\
\n\
Print options:\n\
PAn - keep n largest Delaunay regions by area\n\
Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
PDk:n - drop facet if normal[k] >= n\n\
Pg - print good Delaunay regions (needs 'QGn' or 'QVn')\n\
PFn - keep Delaunay regions whose area is at least n\n\
PG - print neighbors of good regions (needs 'QGn' or 'QVn')\n\
PMn - keep n Delaunay regions with most merges\n\
Po - force output. If error, output neighborhood of facet\n\
Pp - do not report precision problems\n\
\n\
. - list of all options\n\
- - one line descriptions of all options\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt2">-</a>
qh_prompt2
synopsis for qhull
*/
char qh_prompt2[]= "\n\
qdelaunay- compute the Delaunay triangulation. Qhull %s\n\
input (stdin): dimension, number of points, point coordinates\n\
comments start with a non-numeric character\n\
\n\
options (qdelaun.htm):\n\
Qu - furthest-site Delaunay triangulation\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Tv - verify result: structure, convexity, and in-circle test\n\
. - concise list of all options\n\
- - one-line description of all options\n\
\n\
output options (subset):\n\
s - summary of results (default)\n\
i - vertices incident to each Delaunay region\n\
Fx - extreme points (vertices of the convex hull)\n\
o - OFF format (shows the points lifted to a paraboloid)\n\
G - Geomview output (2-d and 3-d points lifted to a paraboloid)\n\
m - Mathematica output (2-d inputs lifted to a paraboloid)\n\
QVn - print Delaunay regions that include point n, -n if not\n\
TO file- output results to file, may be enclosed in single quotes\n\
\n\
examples:\n\
rbox c P0 D2 | qdelaunay s o rbox c P0 D2 | qdelaunay i\n\
rbox c P0 D2 | qdelaunay Fv rbox c P0 D2 | qdelaunay s Qu Fv\n\
rbox c G1 d D2 | qdelaunay s i rbox c G1 d D2 | qdelaunay Qt\n\
rbox M3,4 z 100 D2 | qdelaunay s rbox M3,4 z 100 D2 | qdelaunay s Qt\n\
\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt3">-</a>
qh_prompt3
concise prompt for qhull
*/
char qh_prompt3[]= "\n\
Qhull %s.\n\
Except for 'F.' and 'PG', upper-case options take an argument.\n\
\n\
incidences mathematica OFF_format points_lifted summary\n\
facet_dump\n\
\n\
Farea FArea_total Fcoincident Fd_cdd_in FD_cdd_out\n\
FF_dump_xridge FIDs Fmerges Fneighbors FNeigh_vertex\n\
FOptions FPoint_near FQdelaun Fsummary FSize\n\
Fvertices Fxtremes\n\
\n\
Gvertices Gpoints Gall_points Gno_planes Ginner\n\
Gcentrums Ghyperplanes Gridges Gouter GDrop_dim\n\
Gtransparent\n\
\n\
PArea_keep Pdrop d0:0D0 Pgood PFacet_area_keep\n\
PGood_neighbors PMerge_keep Poutput_forced Pprecision_not\n\
\n\
QGood_point QJoggle Qsearch_1st Qtriangulate QupperDelaunay\n\
QVertex_good Qzinfinite\n\
\n\
T4_trace Tcheck_often Tstatistics Tverify Tz_stdout\n\
TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file\n\
TWide_trace TVertex_stop TCone_stop\n\
\n\
Angle_max Centrum_size Random_dist Wide_outside\n\
";
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="main">-</a>
main( argc, argv )
processes the command line, calls qhull() to do the work, and exits
design:
initializes data structures
reads points
finishes initialization
computes convex hull and other structures
checks the result
writes the output
frees memory
*/
int main(int argc, char *argv[]) {
int curlong, totlong; /* used !qh_NOmem */
int exitcode, numpoints, dim;
coordT *points;
boolT ismalloc;
#if __MWERKS__ && __POWERPC__
char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
SIOUXSettings.showstatusline= false;
SIOUXSettings.tabspaces= 1;
SIOUXSettings.rows= 40;
if (setvbuf (stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/
|| setvbuf (stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
|| (stdout != stderr && setvbuf (stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
fprintf (stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
argc= ccommand(&argv);
#endif
if ((argc == 1) && isatty( 0 /*stdin*/)) {
fprintf(stdout, qh_prompt2, qh_VERSION);
exit(qh_ERRnone);
}
if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompta, qh_VERSION,
qh_promptb, qh_promptc, qh_promptd, qh_prompte);
exit(qh_ERRnone);
}
if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompt3, qh_VERSION);
exit(qh_ERRnone);
}
qh_init_A (stdin, stdout, stderr, argc, argv); /* sets qh qhull_command */
exitcode= setjmp (qh errexit); /* simple statement for CRAY J916 */
if (!exitcode) {
qh_option ("delaunay Qbbound-last", NULL, NULL);
qh DELAUNAY= True; /* 'd' */
qh SCALElast= True; /* 'Qbb' */
qh KEEPcoplanar= True; /* 'Qc', to keep coplanars in 'p' */
qh_checkflags (qh qhull_command, hidden_options);
qh_initflags (qh qhull_command);
points= qh_readpoints (&numpoints, &dim, &ismalloc);
if (dim >= 5) {
qh_option ("Qxact_merge", NULL, NULL);
qh MERGEexact= True; /* 'Qx' always */
}
qh_init_B (points, numpoints, dim, ismalloc);
qh_qhull();
qh_check_output();
qh_produce_output();
if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points();
exitcode= qh_ERRnone;
}
qh NOerrexit= True; /* no more setjmp */
#ifdef qh_NOmem
qh_freeqhull( True);
#else
qh_freeqhull( False);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
#endif
return exitcode;
} /* main */

View File

@ -1,324 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
qhalf.c
compute the intersection of halfspaces about a point
see unix.c for full interface
copyright (c) 1993-2002, The Geometry Center
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#if __MWERKS__ && __POWERPC__
#include <SIOUX.h>
#include <Files.h>
#include <console.h>
#include <Desk.h>
#elif __cplusplus
extern "C" {
int isatty (int);
}
#elif _MSC_VER
#include <io.h>
#define isatty _isatty
#else
int isatty (int); /* returns 1 if stdin is a tty
if "Undefined symbol" this can be deleted along with call in main() */
#endif
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt">-</a>
qh_prompt
long prompt for qhull
notes:
restricted version of qhull.c
see:
concise prompt below
*/
/* duplicated in qhalf.htm */
char hidden_options[]=" d n v Qbb QbB Qf Qg Qm Qr QR Qv Qx Qz TR E V Fa FA FC FD FS Ft FV Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
char qh_prompta[]= "\n\
qhalf- compute the intersection of halfspaces about a point\n\
http://www.geom.umn.edu/software/qhull %s\n\
\n\
input (stdin):\n\
optional interior point: dimension, 1, coordinates\n\
first lines: dimension+1 and number of halfspaces\n\
other lines: halfspace coefficients followed by offset\n\
comments: start with a non-numeric character\n\
\n\
options:\n\
Hn,n - specify coordinates of interior point\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Qc - keep coplanar halfspaces\n\
Qi - keep other redundant halfspaces\n\
\n\
Qhull control options:\n\
QJn - randomly joggle input in range [-n,n]\n\
%s%s%s%s"; /* split up qh_prompt for Visual C++ */
char qh_promptb[]= "\
Qbk:0Bk:0 - remove k-th coordinate from input\n\
Qs - search all halfspaces for the initial simplex\n\
QGn - print intersection if visible to halfspace n, -n for not\n\
QVn - print intersections for halfspace n, -n if not\n\
\n\
";
char qh_promptc[]= "\
Trace options:\n\
T4 - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
Tc - check frequently during execution\n\
Ts - print statistics\n\
Tv - verify result: structure, convexity, and redundancy\n\
Tz - send all output to stdout\n\
TFn - report summary when n or more facets created\n\
TI file - input data from file, no spaces or single quotes\n\
TO file - output results to file, may be enclosed in single quotes\n\
TPn - turn on tracing when halfspace n added to intersection\n\
TMn - turn on tracing at merge n\n\
TWn - trace merge facets when width > n\n\
TVn - stop qhull after adding halfspace n, -n for before (see TCn)\n\
TCn - stop qhull after building cone for halfspace n (see TVn)\n\
\n\
Precision options:\n\
Cn - radius of centrum (roundoff added). Merge facets if non-convex\n\
An - cosine of maximum angle. Merge facets if cosine > n or non-convex\n\
C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
Rn - randomly perturb computations by a factor of [1-n,1+n]\n\
Un - max distance below plane for a new, coplanar halfspace\n\
Wn - min facet width for outside halfspace (before roundoff)\n\
\n\
Output formats (may be combined; if none, produces a summary to stdout):\n\
f - facet dump\n\
G - Geomview output (dual convex hull)\n\
i - non-redundant halfspaces incident to each intersection\n\
m - Mathematica output (dual convex hull)\n\
o - OFF format (dual convex hull: dimension, points, and facets)\n\
p - vertex coordinates of dual convex hull (coplanars if 'Qc' or 'Qi')\n\
s - summary (stderr)\n\
\n\
";
char qh_promptd[]= "\
More formats:\n\
Fc - count plus redundant halfspaces for each intersection\n\
- Qc (default) for coplanar and Qi for other redundant\n\
Fd - use cdd format for input (homogeneous with offset first)\n\
FF - facet dump without ridges\n\
FI - ID of each intersection\n\
Fm - merge count for each intersection (511 max)\n\
Fn - count plus neighboring intersections for each intersection\n\
FN - count plus intersections for each non-redundant halfspace\n\
FO - options and precision constants\n\
Fp - dim, count, and intersection coordinates\n\
FP - nearest halfspace and distance for each redundant halfspace\n\
FQ - command used for qhalf\n\
Fs - summary: #int (8), dim, #halfspaces, #non-redundant, #intersections\n\
for output: #non-redundant, #intersections, #coplanar\n\
halfspaces, #non-simplicial intersections\n\
#real (2), max outer plane, min vertex\n\
Fv - count plus non-redundant halfspaces for each intersection\n\
Fx - non-redundant halfspaces\n\
\n\
";
char qh_prompte[]= "\
Geomview output (2-d, 3-d and 4-d; dual convex hull)\n\
Ga - all points (i.e., transformed halfspaces) as dots\n\
Gp - coplanar points and vertices as radii\n\
Gv - vertices (i.e., non-redundant halfspaces) as spheres\n\
Gi - inner planes (i.e., halfspace intersections) only\n\
Gn - no planes\n\
Go - outer planes only\n\
Gc - centrums\n\
Gh - hyperplane intersections\n\
Gr - ridges\n\
GDn - drop dimension n in 3-d and 4-d output\n\
\n\
Print options:\n\
PAn - keep n largest facets (i.e., intersections) by area\n\
Pdk:n- drop facet if normal[k] <= n (default 0.0)\n\
PDk:n- drop facet if normal[k] >= n\n\
Pg - print good facets (needs 'QGn' or 'QVn')\n\
PFn - keep facets whose area is at least n\n\
PG - print neighbors of good facets\n\
PMn - keep n facets with most merges\n\
Po - force output. If error, output neighborhood of facet\n\
Pp - do not report precision problems\n\
\n\
. - list of all options\n\
- - one line descriptions of all options\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt2">-</a>
qh_prompt2
synopsis for qhull
*/
char qh_prompt2[]= "\n\
qhalf- halfspace intersection about a point. Qhull %s\n\
input (stdin): [dim, 1, interior point], dim+1, n, coefficients+offset\n\
comments start with a non-numeric character\n\
\n\
options (qhalf.htm):\n\
Hn,n - specify coordinates of interior point\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Tv - verify result: structure, convexity, and redundancy\n\
. - concise list of all options\n\
- - one-line description of all options\n\
\n\
output options (subset):\n\
s - summary of results (default)\n\
Fp - intersection coordinates\n\
Fv - non-redundant halfspaces incident to each intersection\n\
Fx - non-redundant halfspaces\n\
o - OFF file format (dual convex hull)\n\
G - Geomview output (dual convex hull)\n\
m - Mathematica output (dual convex hull)\n\
QVn - print intersections for halfspace n, -n if not\n\
TO file - output results to file, may be enclosed in single quotes\n\
\n\
examples:\n\
rbox d | qconvex FQ n | qhalf s H0,0,0 Fp\n\
rbox c | qconvex FQ FV n | qhalf s i\n\
rbox c | qconvex FQ FV n | qhalf s o\n\
\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt3">-</a>
qh_prompt3
concise prompt for qhull
*/
char qh_prompt3[]= "\n\
Qhull %s.\n\
Except for 'F.' and 'PG', upper_case options take an argument.\n\
\n\
incidences Geomview mathematica OFF_format point_dual\n\
summary facet_dump\n\
\n\
Fc_redundant Fd_cdd_in FF_dump_xridge FIDs Fmerges\n\
Fneighbors FN_intersect FOptions Fp_coordinates FP_nearest\n\
FQhalf Fsummary Fv_halfspace Fx_non_redundant\n\
\n\
Gvertices Gpoints Gall_points Gno_planes Ginner\n\
Gcentrums Ghyperplanes Gridges Gouter GDrop_dim\n\
\n\
PArea_keep Pdrop d0:0D0 Pgood PFacet_area_keep\n\
PGood_neighbors PMerge_keep Poutput_forced Pprecision_not\n\
\n\
Qbk:0Bk:0_drop Qcoplanar QG_half_good Qi_redundant QJoggle\n\
Qsearch_1st Qtriangulate QVertex_good\n\
\n\
T4_trace Tcheck_often Tstatistics Tverify Tz_stdout\n\
TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file\n\
TWide_trace TVertex_stop TCone_stop\n\
\n\
Angle_max Centrum_size Random_dist Ucoplanar_max Wide_outside\n\
";
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="main">-</a>
main( argc, argv )
processes the command line, calls qhull() to do the work, and exits
design:
initializes data structures
reads points
finishes initialization
computes convex hull and other structures
checks the result
writes the output
frees memory
*/
int main(int argc, char *argv[]) {
int curlong, totlong; /* used !qh_NOmem */
int exitcode, numpoints, dim;
coordT *points;
boolT ismalloc;
#if __MWERKS__ && __POWERPC__
char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
SIOUXSettings.showstatusline= false;
SIOUXSettings.tabspaces= 1;
SIOUXSettings.rows= 40;
if (setvbuf (stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/
|| setvbuf (stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
|| (stdout != stderr && setvbuf (stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
fprintf (stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
argc= ccommand(&argv);
#endif
if ((argc == 1) && isatty( 0 /*stdin*/)) {
fprintf(stdout, qh_prompt2, qh_VERSION);
exit(qh_ERRnone);
}
if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompta, qh_VERSION,
qh_promptb, qh_promptc, qh_promptd, qh_prompte);
exit(qh_ERRnone);
}
if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompt3, qh_VERSION);
exit(qh_ERRnone);
}
qh_init_A (stdin, stdout, stderr, argc, argv); /* sets qh qhull_command */
exitcode= setjmp (qh errexit); /* simple statement for CRAY J916 */
if (!exitcode) {
qh_option ("Halfspace", NULL, NULL);
qh HALFspace= True; /* 'H' */
qh_checkflags (qh qhull_command, hidden_options);
qh_initflags (qh qhull_command);
if (qh SCALEinput) {
fprintf(qh ferr, "\
qhull error: options 'Qbk:n' and 'QBk:n' are not used with qhalf.\n\
Use 'Qbk:0Bk:0 to drop dimension k.\n");
qh_errexit(qh_ERRinput, NULL, NULL);
}
points= qh_readpoints (&numpoints, &dim, &ismalloc);
if (dim >= 5) {
qh_option ("Qxact_merge", NULL, NULL);
qh MERGEexact= True; /* 'Qx' always */
}
qh_init_B (points, numpoints, dim, ismalloc);
qh_qhull();
qh_check_output();
qh_produce_output();
if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points();
exitcode= qh_ERRnone;
}
qh NOerrexit= True; /* no more setjmp */
#ifdef qh_NOmem
qh_freeqhull( True);
#else
qh_freeqhull( False);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
#endif
return exitcode;
} /* main */

1395
extern/qhull/src/qhull.c vendored

File diff suppressed because it is too large Load Diff

1048
extern/qhull/src/qhull.h vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,127 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
qhull_a.h
all header files for compiling qhull
see qh-qhull.htm
see qhull.h for user-level definitions
see user.h for user-defineable constants
defines internal functions for qhull.c global.c
copyright (c) 1993-2002, The Geometry Center
Notes: grep for ((" and (" to catch fprintf("lkasdjf");
full parens around (x?y:z)
use '#include qhull/qhull_a.h' to avoid name clashes
*/
#ifndef qhDEFqhulla
#define qhDEFqhulla
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
#include <math.h>
#include <float.h> /* some compilers will not need float.h */
#include <limits.h>
#include <time.h>
#include <ctype.h>
/*** uncomment here and qset.c
if string.h does not define memcpy()
#include <memory.h>
*/
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#include "geom.h"
#include "merge.h"
#include "poly.h"
#include "io.h"
#include "stat.h"
#if qh_CLOCKtype == 2 /* defined in user.h from qhull.h */
#include <sys/types.h>
#include <sys/times.h>
#include <unistd.h>
#endif
#ifdef _MSC_VER /* Microsoft Visual C++ */
#pragma warning( disable : 4056) /* float constant expression. Looks like a compiler bug */
#pragma warning( disable : 4146) /* unary minus applied to unsigned type */
#pragma warning( disable : 4244) /* conversion from 'unsigned long' to 'real' */
#pragma warning( disable : 4305) /* conversion from 'const double' to 'float' */
#endif
/* ======= -macros- =========== */
/*-<a href="qh-qhull.htm#TOC"
>--------------------------------</a><a name="traceN">-</a>
traceN((fp.ferr, "format\n", vars));
calls fprintf if qh.IStracing >= N
notes:
removing tracing reduces code size but doesn't change execution speed
*/
#ifndef qh_NOtrace
#define trace0(args) {if (qh IStracing) fprintf args;}
#define trace1(args) {if (qh IStracing >= 1) fprintf args;}
#define trace2(args) {if (qh IStracing >= 2) fprintf args;}
#define trace3(args) {if (qh IStracing >= 3) fprintf args;}
#define trace4(args) {if (qh IStracing >= 4) fprintf args;}
#define trace5(args) {if (qh IStracing >= 5) fprintf args;}
#else /* qh_NOtrace */
#define trace0(args) {}
#define trace1(args) {}
#define trace2(args) {}
#define trace3(args) {}
#define trace4(args) {}
#define trace5(args) {}
#endif /* qh_NOtrace */
/***** -qhull.c prototypes (alphabetical after qhull) ********************/
void qh_qhull (void);
boolT qh_addpoint (pointT *furthest, facetT *facet, boolT checkdist);
void qh_buildhull(void);
void qh_buildtracing (pointT *furthest, facetT *facet);
void qh_build_withrestart (void);
void qh_errexit2(int exitcode, facetT *facet, facetT *otherfacet);
void qh_findhorizon(pointT *point, facetT *facet, int *goodvisible,int *goodhorizon);
pointT *qh_nextfurthest (facetT **visible);
void qh_partitionall(setT *vertices, pointT *points,int npoints);
void qh_partitioncoplanar (pointT *point, facetT *facet, realT *dist);
void qh_partitionpoint (pointT *point, facetT *facet);
void qh_partitionvisible(boolT allpoints, int *numpoints);
void qh_precision (char *reason);
void qh_printsummary(FILE *fp);
/***** -global.c internal prototypes (alphabetical) ***********************/
void qh_appendprint (qh_PRINT format);
void qh_freebuild (boolT allmem);
void qh_freebuffers (void);
void qh_initbuffers (coordT *points, int numpoints, int dim, boolT ismalloc);
int qh_strtol (const char *s, char **endp);
double qh_strtod (const char *s, char **endp);
/***** -stat.c internal prototypes (alphabetical) ***********************/
void qh_allstatA (void);
void qh_allstatB (void);
void qh_allstatC (void);
void qh_allstatD (void);
void qh_allstatE (void);
void qh_allstatE2 (void);
void qh_allstatF (void);
void qh_allstatG (void);
void qh_allstatH (void);
void qh_freebuffers (void);
void qh_initbuffers (coordT *points, int numpoints, int dim, boolT ismalloc);
#endif /* qhDEFqhulla */

View File

@ -1,96 +0,0 @@
/*<html><pre> -<a href="qh-user.htm"
>-------------------------------</a><a name="TOP">-</a>
*/
#include <iostream.h>
#include <conio.h>
//--- Include qhull, so it works from with in a C++ source file
//---
//--- In MVC one cannot just do:
//---
//--- extern "C"
//--- {
//--- #include "qhull_a.h"
//--- }
//---
//--- Because qhull_a.h includes math.h, which can not appear
//--- inside a extern "C" declaration.
//---
//--- Maybe that why Numerical recipes in C avoid this problem, by removing
//--- standard include headers from its header files and add them in the
//--- respective source files instead.
//---
//--- [K. Erleben]
#if defined(__cplusplus)
extern "C"
{
#endif
#include <stdio.h>
#include <stdlib.h>
#include <qhull/qhull.h>
#include <qhull/mem.h>
#include <qhull/qset.h>
#include <qhull/geom.h>
#include <qhull/merge.h>
#include <qhull/poly.h>
#include <qhull/io.h>
#include <qhull/stat.h>
#if defined(__cplusplus)
}
#endif
/*********************************************************************/
/* */
/* */
/* */
/* */
/*********************************************************************/
void compute_convex_hull(void)
{
int dim; /* dimension of points */
int numpoints; /* number of points */
coordT *points; /* array of coordinates for each point */
boolT ismalloc; /* True if qhull should free points in qh_freeqhull() or reallocation */
char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */
FILE *outfile= stdout; /* output from qh_produce_output()
use NULL to skip qh_produce_output() */
FILE *errfile= stderr; /* error messages from qhull code */
int exitcode; /* 0 if no error from qhull */
facetT *facet; /* set by FORALLfacets */
int curlong, totlong; /* memory remaining after qh_memfreeshort */
/* initialize dim, numpoints, points[], ismalloc here */
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
flags, outfile, errfile);
if (!exitcode) { /* if no error */
/* 'qh facet_list' contains the convex hull */
FORALLfacets {
/* ... your code ... */
}
}
qh_freeqhull(!qh_ALL);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (errfile, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
};
/*********************************************************************/
/* */
/* */
/* */
/* */
/*********************************************************************/
void main()
{
cout << "Hello world" << endl;
cout << "Press any key..." << endl;
while(!_kbhit());
};

1301
extern/qhull/src/qset.c vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,468 +0,0 @@
/*<html><pre> -<a href="qh-set.htm"
>-------------------------------</a><a name="TOP">-</a>
qset.h
header file for qset.c that implements set
see qh-set.htm and qset.c
only uses mem.c, malloc/free
for error handling, writes message and calls
qh_errexit (qhmem_ERRqhull, NULL, NULL);
set operations satisfy the following properties:
- sets have a max size, the actual size (if different) is stored at the end
- every set is NULL terminated
- sets may be sorted or unsorted, the caller must distinguish this
copyright (c) 1993-2002, The Geometry Center
*/
#ifndef qhDEFset
#define qhDEFset 1
/*================= -structures- ===============*/
#ifndef DEFsetT
#define DEFsetT 1
typedef struct setT setT; /* a set is a sorted or unsorted array of pointers */
#endif
/*-<a href="qh-set.htm#TOC"
>----------------------------------------</a><a name="setT">-</a>
setT
a set or list of pointers with maximum size and actual size.
variations:
unsorted, unique -- a list of unique pointers with NULL terminator
user guarantees uniqueness
sorted -- a sorted list of unique pointers with NULL terminator
qset.c guarantees uniqueness
unsorted -- a list of pointers terminated with NULL
indexed -- an array of pointers with NULL elements
structure for set of n elements:
--------------
| maxsize
--------------
| e[0] - a pointer, may be NULL for indexed sets
--------------
| e[1]
--------------
| ...
--------------
| e[n-1]
--------------
| e[n] = NULL
--------------
| ...
--------------
| e[maxsize] - n+1 or NULL (determines actual size of set)
--------------
*/
/*-- setelemT -- internal type to allow both pointers and indices
*/
typedef union setelemT setelemT;
union setelemT {
void *p;
int i; /* integer used for e[maxSize] */
};
struct setT {
int maxsize; /* maximum number of elements (except NULL) */
setelemT e[1]; /* array of pointers, tail is NULL */
/* last slot (unless NULL) is actual size+1
e[maxsize]==NULL or e[e[maxsize]-1]==NULL */
/* this may generate a warning since e[] contains
maxsize elements */
};
/*=========== -constants- =========================*/
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="SETelemsize">-</a>
SETelemsize
size of a set element in bytes
*/
#define SETelemsize sizeof(setelemT)
/*=========== -macros- =========================*/
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHsetelement_">-</a>
FOREACHsetelement_(type, set, variable)
define FOREACH iterator
declare:
assumes *variable and **variablep are declared
no space in "variable)" [DEC Alpha cc compiler]
each iteration:
variable is set element
variablep is one beyond variable.
to repeat an element:
variablep--; / *repeat* /
at exit:
variable is NULL at end of loop
example:
#define FOREACHfacet_( facets ) FOREACHsetelement_( facetT, facets, facet )
notes:
use FOREACHsetelement_i_() if need index or include NULLs
WARNING:
nested loops can't use the same variable (define another FOREACH)
needs braces if nested inside another FOREACH
this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
*/
#define FOREACHsetelement_(type, set, variable) \
if (((variable= NULL), set)) for(\
variable##p= (type **)&((set)->e[0].p); \
(variable= *variable##p++);)
/*-<a href="qh-set.htm#TOC"
>----------------------------------------</a><a name="FOREACHsetelement_i_">-</a>
FOREACHsetelement_i_(type, set, variable)
define indexed FOREACH iterator
declare:
type *variable, variable_n, variable_i;
each iteration:
variable is set element, may be NULL
variable_i is index, variable_n is qh_setsize()
to repeat an element:
variable_i--; variable_n-- repeats for deleted element
at exit:
variable==NULL and variable_i==variable_n
example:
#define FOREACHfacet_i_( facets ) FOREACHsetelement_i_( facetT, facets, facet )
WARNING:
nested loops can't use the same variable (define another FOREACH)
needs braces if nested inside another FOREACH
this includes intervening blocks, e.g. FOREACH...{ if () FOREACH...} )
*/
#define FOREACHsetelement_i_(type, set, variable) \
if (((variable= NULL), set)) for (\
variable##_i= 0, variable= (type *)((set)->e[0].p), \
variable##_n= qh_setsize(set);\
variable##_i < variable##_n;\
variable= (type *)((set)->e[++variable##_i].p) )
/*-<a href="qh-set.htm#TOC"
>--------------------------------------</a><a name="FOREACHsetelementreverse_">-</a>
FOREACHsetelementreverse_(type, set, variable)-
define FOREACH iterator in reverse order
declare:
assumes *variable and **variablep are declared
also declare 'int variabletemp'
each iteration:
variable is set element
to repeat an element:
variabletemp++; / *repeat* /
at exit:
variable is NULL
example:
#define FOREACHvertexreverse_( vertices ) FOREACHsetelementreverse_( vertexT, vertices, vertex )
notes:
use FOREACHsetelementreverse12_() to reverse first two elements
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHsetelementreverse_(type, set, variable) \
if (((variable= NULL), set)) for(\
variable##temp= qh_setsize(set)-1, variable= qh_setlast(set);\
variable; variable= \
((--variable##temp >= 0) ? SETelemt_(set, variable##temp, type) : NULL))
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHsetelementreverse12_">-</a>
FOREACHsetelementreverse12_(type, set, variable)-
define FOREACH iterator with e[1] and e[0] reversed
declare:
assumes *variable and **variablep are declared
each iteration:
variable is set element
variablep is one after variable.
to repeat an element:
variablep--; / *repeat* /
at exit:
variable is NULL at end of loop
example
#define FOREACHvertexreverse12_( vertices ) FOREACHsetelementreverse12_( vertexT, vertices, vertex )
notes:
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHsetelementreverse12_(type, set, variable) \
if (((variable= NULL), set)) for(\
variable##p= (type **)&((set)->e[1].p); \
(variable= *variable##p); \
variable##p == ((type **)&((set)->e[0].p))?variable##p += 2: \
(variable##p == ((type **)&((set)->e[1].p))?variable##p--:variable##p++))
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHelem_">-</a>
FOREACHelem_( set )-
iterate elements in a set
declare:
void *elem, *elemp;
each iteration:
elem is set element
elemp is one beyond
to repeat an element:
elemp--; / *repeat* /
at exit:
elem == NULL at end of loop
example:
FOREACHelem_(set) {
notes:
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHelem_(set) FOREACHsetelement_(void, set, elem)
/*-<a href="qh-set.htm#TOC"
>-----------------------------------</a><a name="FOREACHset_">-</a>
FOREACHset_( set )-
iterate a set of sets
declare:
setT *set, **setp;
each iteration:
set is set element
setp is one beyond
to repeat an element:
setp--; / *repeat* /
at exit:
set == NULL at end of loop
example
FOREACHset_(sets) {
notes:
WARNING: needs braces if nested inside another FOREACH
*/
#define FOREACHset_(sets) FOREACHsetelement_(setT, sets, set)
/*-<a href="qh-set.htm#TOC"
>-----------------------------------------</a><a name="SETindex_">-</a>
SETindex_( set, elem )
return index of elem in set
notes:
for use with FOREACH iteration
example:
i= SETindex_(ridges, ridge)
*/
#define SETindex_(set, elem) ((void **)elem##p - (void **)&(set)->e[1].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETref_">-</a>
SETref_( elem )
l.h.s. for modifying the current element in a FOREACH iteration
example:
SETref_(ridge)= anotherridge;
*/
#define SETref_(elem) (elem##p[-1])
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETelem_">-</a>
SETelem_(set, n)
return the n'th element of set
notes:
assumes that n is valid [0..size] and that set is defined
use SETelemt_() for type cast
*/
#define SETelem_(set, n) ((set)->e[n].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETelemt_">-</a>
SETelemt_(set, n, type)
return the n'th element of set as a type
notes:
assumes that n is valid [0..size] and that set is defined
*/
#define SETelemt_(set, n, type) ((type*)((set)->e[n].p))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETelemaddr_">-</a>
SETelemaddr_(set, n, type)
return address of the n'th element of a set
notes:
assumes that n is valid [0..size] and set is defined
*/
#define SETelemaddr_(set, n, type) ((type **)(&((set)->e[n].p)))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETfirst_">-</a>
SETfirst_(set)
return first element of set
*/
#define SETfirst_(set) ((set)->e[0].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETfirstt_">-</a>
SETfirstt_(set, type)
return first element of set as a type
*/
#define SETfirstt_(set, type) ((type*)((set)->e[0].p))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETsecond_">-</a>
SETsecond_(set)
return second element of set
*/
#define SETsecond_(set) ((set)->e[1].p)
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETsecondt_">-</a>
SETsecondt_(set, type)
return second element of set as a type
*/
#define SETsecondt_(set, type) ((type*)((set)->e[1].p))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETaddr_">-</a>
SETaddr_(set, type)
return address of set's elements
*/
#define SETaddr_(set,type) ((type **)(&((set)->e[0].p)))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETreturnsize_">-</a>
SETreturnsize_(set, size)
return size of a set
notes:
set must be defined
use qh_setsize(set) unless speed is critical
*/
#define SETreturnsize_(set, size) (((size)= ((set)->e[(set)->maxsize].i))?(--(size)):((size)= (set)->maxsize))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETempty_">-</a>
SETempty_(set)
return true (1) if set is empty
notes:
set may be NULL
*/
#define SETempty_(set) (!set || (SETfirst_(set) ? 0:1))
/*-<a href="qh-set.htm#TOC"
>---------------------------------------</a><a name="SETtruncate_">-</a>
SETtruncate_(set)
return first element of set
see:
qh_settruncate()
*/
#define SETtruncate_(set, size) {set->e[set->maxsize].i= size+1; /* maybe overwritten */ \
set->e[size].p= NULL;}
/*======= prototypes in alphabetical order ============*/
void qh_setaddsorted(setT **setp, void *elem);
void qh_setaddnth(setT **setp, int nth, void *newelem);
void qh_setappend(setT **setp, void *elem);
void qh_setappend_set(setT **setp, setT *setA);
void qh_setappend2ndlast(setT **setp, void *elem);
void qh_setcheck(setT *set, char *tname, int id);
void qh_setcompact(setT *set);
setT *qh_setcopy(setT *set, int extra);
void *qh_setdel(setT *set, void *elem);
void *qh_setdellast(setT *set);
void *qh_setdelnth(setT *set, int nth);
void *qh_setdelnthsorted(setT *set, int nth);
void *qh_setdelsorted(setT *set, void *newelem);
setT *qh_setduplicate( setT *set, int elemsize);
int qh_setequal(setT *setA, setT *setB);
int qh_setequal_except (setT *setA, void *skipelemA, setT *setB, void *skipelemB);
int qh_setequal_skip (setT *setA, int skipA, setT *setB, int skipB);
void qh_setfree(setT **set);
void qh_setfree2( setT **setp, int elemsize);
void qh_setfreelong(setT **set);
int qh_setin(setT *set, void *setelem);
int qh_setindex(setT *set, void *setelem);
void qh_setlarger(setT **setp);
void *qh_setlast(setT *set);
setT *qh_setnew(int size);
setT *qh_setnew_delnthsorted(setT *set, int size, int nth, int prepend);
void qh_setprint(FILE *fp, char* string, setT *set);
void qh_setreplace(setT *set, void *oldelem, void *newelem);
int qh_setsize(setT *set);
setT *qh_settemp(int setsize);
void qh_settempfree(setT **set);
void qh_settempfree_all(void);
setT *qh_settemppop(void);
void qh_settemppush(setT *set);
void qh_settruncate (setT *set, int size);
int qh_setunique (setT **set, void *elem);
void qh_setzero (setT *set, int index, int size);
#endif /* qhDEFset */

View File

@ -1,318 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
qvoronoi.c
compute Voronoi diagrams and furthest-point Voronoi
diagrams using qhull
see unix.c for full interface
copyright (c) 1993-2002, The Geometry Center
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#if __MWERKS__ && __POWERPC__
#include <SIOUX.h>
#include <Files.h>
#include <console.h>
#include <Desk.h>
#elif __cplusplus
extern "C" {
int isatty (int);
}
#elif _MSC_VER
#include <io.h>
#define isatty _isatty
#else
int isatty (int); /* returns 1 if stdin is a tty
if "Undefined symbol" this can be deleted along with call in main() */
#endif
/*-<a href="qh-qhull.c#TOC"
>-------------------------------</a><a name="prompt">-</a>
qh_prompt
long prompt for qhull
notes:
restricted version of qhull.c
see:
concise prompt below
*/
/* duplicated in qvoron_f.htm and qvoronoi.htm */
char hidden_options[]=" d n m v H U Qb QB Qc Qf Qg Qi Qm Qr QR Qv Qx TR E V Fa FA FC Fp FS Ft FV Pv Gt Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 ";
char qh_prompta[]= "\n\
qvoronoi- compute the Voronoi diagram\n\
http://www.geom.umn.edu/software/qhull %s\n\
\n\
input (stdin):\n\
first lines: dimension and number of points (or vice-versa).\n\
other lines: point coordinates, best if one point per line\n\
comments: start with a non-numeric character\n\
\n\
options:\n\
Qu - compute furthest-site Voronoi diagram\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
\n\
Qhull control options:\n\
Qz - add point-at-infinity to Voronoi diagram\n\
QJn - randomly joggle input in range [-n,n]\n\
%s%s%s%s"; /* split up qh_prompt for Visual C++ */
char qh_promptb[]= "\
Qs - search all points for the initial simplex\n\
QGn - Voronoi vertices if visible from point n, -n if not\n\
QVn - Voronoi vertices for input point n, -n if not\n\
\n\
";
char qh_promptc[]= "\
Trace options:\n\
T4 - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
Tc - check frequently during execution\n\
Ts - statistics\n\
Tv - verify result: structure, convexity, and in-circle test\n\
Tz - send all output to stdout\n\
TFn - report summary when n or more facets created\n\
TI file - input data from file, no spaces or single quotes\n\
TO file - output results to file, may be enclosed in single quotes\n\
TPn - turn on tracing when point n added to hull\n\
TMn - turn on tracing at merge n\n\
TWn - trace merge facets when width > n\n\
TVn - stop qhull after adding point n, -n for before (see TCn)\n\
TCn - stop qhull after building cone for point n (see TVn)\n\
\n\
Precision options:\n\
Cn - radius of centrum (roundoff added). Merge facets if non-convex\n\
An - cosine of maximum angle. Merge facets if cosine > n or non-convex\n\
C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
Rn - randomly perturb computations by a factor of [1-n,1+n]\n\
Wn - min facet width for non-coincident point (before roundoff)\n\
\n\
Output formats (may be combined; if none, produces a summary to stdout):\n\
s - summary to stderr\n\
p - Voronoi vertices\n\
o - OFF format (dim, Voronoi vertices, and Voronoi regions)\n\
i - Delaunay regions (use 'Pp' to avoid warning)\n\
f - facet dump\n\
\n\
";
char qh_promptd[]= "\
More formats:\n\
Fc - count plus coincident points (by Voronoi vertex)\n\
Fd - use cdd format for input (homogeneous with offset first)\n\
FD - use cdd format for output (offset first)\n\
FF - facet dump without ridges\n\
Fi - separating hyperplanes for bounded Voronoi regions\n\
FI - ID for each Voronoi vertex\n\
Fm - merge count for each Voronoi vertex (511 max)\n\
Fn - count plus neighboring Voronoi vertices for each Voronoi vertex\n\
FN - count and Voronoi vertices for each Voronoi region\n\
Fo - separating hyperplanes for unbounded Voronoi regions\n\
FO - options and precision constants\n\
FP - nearest point and distance for each coincident point\n\
FQ - command used for qvoronoi\n\
Fs - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
for output: #Voronoi regions, #Voronoi vertices,\n\
#coincident points, #non-simplicial regions\n\
#real (2), max outer plane and min vertex\n\
Fv - Voronoi diagram as Voronoi vertices between adjacent input sites\n\
Fx - extreme points of Delaunay triangulation (on convex hull)\n\
\n\
";
char qh_prompte[]= "\
Geomview options (2-d only)\n\
Ga - all points as dots\n\
Gp - coplanar points and vertices as radii\n\
Gv - vertices as spheres\n\
Gi - inner planes only\n\
Gn - no planes\n\
Go - outer planes only\n\
Gc - centrums\n\
Gh - hyperplane intersections\n\
Gr - ridges\n\
GDn - drop dimension n in 3-d and 4-d output\n\
\n\
Print options:\n\
PAn - keep n largest Voronoi vertices by 'area'\n\
Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
PDk:n - drop facet if normal[k] >= n\n\
Pg - print good Voronoi vertices (needs 'QGn' or 'QVn')\n\
PFn - keep Voronoi vertices whose 'area' is at least n\n\
PG - print neighbors of good Voronoi vertices\n\
PMn - keep n Voronoi vertices with most merges\n\
Po - force output. If error, output neighborhood of facet\n\
Pp - do not report precision problems\n\
\n\
. - list of all options\n\
- - one line descriptions of all options\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt2">-</a>
qh_prompt2
synopsis for qhull
*/
char qh_prompt2[]= "\n\
qvoronoi- compute the Voronoi diagram. Qhull %s\n\
input (stdin): dimension, number of points, point coordinates\n\
comments start with a non-numeric character\n\
\n\
options (qvoronoi.htm):\n\
Qu - compute furthest-site Voronoi diagram\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Tv - verify result: structure, convexity, and in-circle test\n\
. - concise list of all options\n\
- - one-line description of all options\n\
\n\
output options (subset):\n\
s - summary of results (default)\n\
p - Voronoi vertices\n\
o - OFF file format (dim, Voronoi vertices, and Voronoi regions)\n\
FN - count and Voronoi vertices for each Voronoi region\n\
Fv - Voronoi diagram as Voronoi vertices between adjacent input sites\n\
Fi - separating hyperplanes for bounded regions, 'Fo' for unbounded\n\
G - Geomview output (2-d only)\n\
QVn - Voronoi vertices for input point n, -n if not\n\
TO file- output results to file, may be enclosed in single quotes\n\
\n\
examples:\n\
rbox c P0 D2 | qvoronoi s o rbox c P0 D2 | qvoronoi Fi\n\
rbox c P0 D2 | qvoronoi Fo rbox c P0 D2 | qvoronoi Fv\n\
rbox c P0 D2 | qvoronoi s Qu Fv rbox c P0 D2 | qvoronoi Qu Fo\n\
rbox c G1 d D2 | qvoronoi s p rbox c G1 d D2 | qvoronoi QJ s p\n\
rbox c P0 D2 | qvoronoi s Fv QV0\n\
\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt3">-</a>
qh_prompt3
concise prompt for qhull
*/
char qh_prompt3[]= "\n\
Qhull %s.\n\
Except for 'F.' and 'PG', upper-case options take an argument.\n\
\n\
OFF_format p_vertices i_delaunay summary facet_dump\n\
\n\
Fcoincident Fd_cdd_in FD_cdd_out FF-dump-xridge Fi_bounded\n\
Fxtremes Fmerges Fneighbors FNeigh_region FOptions\n\
Fo_unbounded FPoint_near FQvoronoi Fsummary Fvoronoi\n\
FIDs\n\
\n\
Gvertices Gpoints Gall_points Gno_planes Ginner\n\
Gcentrums Ghyperplanes Gridges Gouter GDrop_dim\n\
\n\
PArea_keep Pdrop d0:0D0 Pgood PFacet_area_keep\n\
PGood_neighbors PMerge_keep Poutput_forced Pprecision_not\n\
\n\
QG_vertex_good QJoggle Qsearch_1st Qtriangulate Qupper_voronoi\n\
QV_point_good Qzinfinite\n\
\n\
T4_trace Tcheck_often Tstatistics Tverify Tz_stdout\n\
TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file\n\
TWide_trace TVertex_stop TCone_stop\n\
\n\
Angle_max Centrum_size Random_dist Wide_outside\n\
";
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="main">-</a>
main( argc, argv )
processes the command line, calls qhull() to do the work, and exits
design:
initializes data structures
reads points
finishes initialization
computes convex hull and other structures
checks the result
writes the output
frees memory
*/
int main(int argc, char *argv[]) {
int curlong, totlong; /* used !qh_NOmem */
int exitcode, numpoints, dim;
coordT *points;
boolT ismalloc;
#if __MWERKS__ && __POWERPC__
char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
SIOUXSettings.showstatusline= false;
SIOUXSettings.tabspaces= 1;
SIOUXSettings.rows= 40;
if (setvbuf (stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/
|| setvbuf (stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
|| (stdout != stderr && setvbuf (stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
fprintf (stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
argc= ccommand(&argv);
#endif
if ((argc == 1) && isatty( 0 /*stdin*/)) {
fprintf(stdout, qh_prompt2, qh_VERSION);
exit(qh_ERRnone);
}
if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompta, qh_VERSION,
qh_promptb, qh_promptc, qh_promptd, qh_prompte);
exit(qh_ERRnone);
}
if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompt3, qh_VERSION);
exit(qh_ERRnone);
}
qh_init_A (stdin, stdout, stderr, argc, argv); /* sets qh qhull_command */
exitcode= setjmp (qh errexit); /* simple statement for CRAY J916 */
if (!exitcode) {
qh_option ("voronoi _bbound-last _coplanar-keep", NULL, NULL);
qh DELAUNAY= True; /* 'v' */
qh VORONOI= True;
qh SCALElast= True; /* 'Qbb' */
qh_checkflags (qh qhull_command, hidden_options);
qh_initflags (qh qhull_command);
points= qh_readpoints (&numpoints, &dim, &ismalloc);
if (dim >= 5) {
qh_option ("_merge-exact", NULL, NULL);
qh MERGEexact= True; /* 'Qx' always */
}
qh_init_B (points, numpoints, dim, ismalloc);
qh_qhull();
qh_check_output();
qh_produce_output();
if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points();
exitcode= qh_ERRnone;
}
qh NOerrexit= True; /* no more setjmp */
#ifdef qh_NOmem
qh_freeqhull( True);
#else
qh_freeqhull( False);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
#endif
return exitcode;
} /* main */

View File

@ -1,788 +0,0 @@
/*<html><pre> -<a href="index.htm#TOC"
>-------------------------------</a><a name="TOP">-</a>
rbox.c
Generate input points for qhull.
notes:
50 points generated for 'rbox D4'
This code needs a full rewrite. It needs separate procedures for each
distribution with common, helper procedures.
WARNING:
incorrect range if qh_RANDOMmax is defined wrong (user.h)
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <time.h>
#include "user.h"
#if __MWERKS__ && __POWERPC__
#include <SIOUX.h>
#include <Files.h>
#include <console.h>
#include <Desk.h>
#endif
#ifdef _MSC_VER /* Microsoft Visual C++ */
#pragma warning( disable : 4244) /* conversion from double to int */
#endif
#define MINVALUE 0.8
#define MAXdim 200
#define PI 3.1415926535897932384
#define DEFAULTzbox 1e6
char prompt[]= "\n\
-rbox- generate various point distributions. Default is random in cube.\n\
\n\
args (any order, space separated): Version: 2001/06/24\n\
3000 number of random points in cube, lens, spiral, sphere or grid\n\
D3 dimension 3-d\n\
c add a unit cube to the output ('c G2.0' sets size)\n\
d add a unit diamond to the output ('d G2.0' sets size)\n\
l generate a regular 3-d spiral\n\
r generate a regular polygon, ('r s Z1 G0.1' makes a cone)\n\
s generate cospherical points\n\
x generate random points in simplex, may use 'r' or 'Wn'\n\
y same as 'x', plus simplex\n\
Pn,m,r add point [n,m,r] first, pads with 0\n\
\n\
Ln lens distribution of radius n. Also 's', 'r', 'G', 'W'.\n\
Mn,m,r lattice (Mesh) rotated by [n,-m,0], [m,n,0], [0,0,r], ...\n\
'27 M1,0,1' is {0,1,2} x {0,1,2} x {0,1,2}. Try 'M3,4 z'.\n\
W0.1 random distribution within 0.1 of the cube's or sphere's surface\n\
Z0.5 s random points in a 0.5 disk projected to a sphere\n\
Z0.5 s G0.6 same as Z0.5 within a 0.6 gap\n\
\n\
Bn bounding box coordinates, default %2.2g\n\
h output as homogeneous coordinates for cdd\n\
n remove command line from the first line of output\n\
On offset coordinates by n\n\
t use time as the random number seed (default is command line)\n\
tn use n as the random number seed\n\
z print integer coordinates, default 'Bn' is %2.2g\n\
";
/* ------------------------------ prototypes ----------------*/
int roundi( double a);
void out1( double a);
void out2n( double a, double b);
void out3n( double a, double b, double c);
int qh_rand( void);
void qh_srand( int seed);
/* ------------------------------ globals -------------------*/
FILE *fp;
int isinteger= 0;
double out_offset= 0.0;
/*--------------------------------------------
-rbox- main procedure of rbox application
*/
int main(int argc, char **argv) {
int i,j,k;
int gendim;
int cubesize, diamondsize, seed=0, count, apex;
int dim=3 , numpoints= 0, totpoints, addpoints=0;
int issphere=0, isaxis=0, iscdd= 0, islens= 0, isregular=0, iswidth=0, addcube=0;
int isgap=0, isspiral=0, NOcommand= 0, adddiamond=0, istime=0;
int isbox=0, issimplex=0, issimplex2=0, ismesh=0;
double width=0.0, gap=0.0, radius= 0.0;
double coord[MAXdim], offset, meshm=3.0, meshn=4.0, meshr=5.0;
double *simplex, *simplexp;
int nthroot, mult[MAXdim];
double norm, factor, randr, rangap, lensangle= 0, lensbase= 1;
double anglediff, angle, x, y, cube= 0.0, diamond= 0.0;
double box= qh_DEFAULTbox; /* scale all numbers before output */
double randmax= qh_RANDOMmax;
char command[200], *s, seedbuf[200];
time_t timedata;
#if __MWERKS__ && __POWERPC__
char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
SIOUXSettings.showstatusline= False;
SIOUXSettings.tabspaces= 1;
SIOUXSettings.rows= 40;
if (setvbuf (stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/
|| setvbuf (stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
|| (stdout != stderr && setvbuf (stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
fprintf ( stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
argc= ccommand(&argv);
#endif
if (argc == 1) {
printf (prompt, box, DEFAULTzbox);
exit(1);
}
if ((s = strrchr( argv[0], '\\'))) /* Borland gives full path */
strcpy (command, s+1);
else
strcpy (command, argv[0]);
if ((s= strstr (command, ".EXE"))
|| (s= strstr (command, ".exe")))
*s= '\0';
/* ============= read flags =============== */
for (i=1; i < argc; i++) {
if (strlen (command) + strlen(argv[i]) + 1 < sizeof(command) ) {
strcat (command, " ");
strcat (command, argv[i]);
}
if (isdigit (argv[i][0])) {
numpoints= atoi (argv[i]);
continue;
}
if (argv[i][0] == '-')
(argv[i])++;
switch (argv[i][0]) {
case 'c':
addcube= 1;
if (i+1 < argc && argv[i+1][0] == 'G')
cube= (double) atof (&argv[++i][1]);
break;
case 'd':
adddiamond= 1;
if (i+1 < argc && argv[i+1][0] == 'G')
diamond= (double) atof (&argv[++i][1]);
break;
case 'h':
iscdd= 1;
break;
case 'l':
isspiral= 1;
break;
case 'n':
NOcommand= 1;
break;
case 'r':
isregular= 1;
break;
case 's':
issphere= 1;
break;
case 't':
istime= 1;
if (isdigit (argv[i][1]))
seed= atoi (&argv[i][1]);
else {
seed= time (&timedata);
sprintf (seedbuf, "%d", seed);
strcat (command, seedbuf);
}
break;
case 'x':
issimplex= 1;
break;
case 'y':
issimplex2= 1;
break;
case 'z':
isinteger= 1;
break;
case 'B':
box= (double) atof (&argv[i][1]);
isbox= 1;
break;
case 'D':
dim= atoi (&argv[i][1]);
if (dim < 1
|| dim > MAXdim) {
fprintf (stderr, "rbox error: dim %d too large or too small\n", dim);
exit (1);
}
break;
case 'G':
if (argv[i][1])
gap= (double) atof (&argv[i][1]);
else
gap= 0.5;
isgap= 1;
break;
case 'L':
if (argv[i][1])
radius= (double) atof (&argv[i][1]);
else
radius= 10;
islens= 1;
break;
case 'M':
ismesh= 1;
s= argv[i]+1;
if (*s)
meshn= strtod (s, &s);
if (*s == ',')
meshm= strtod (++s, &s);
else
meshm= 0.0;
if (*s == ',')
meshr= strtod (++s, &s);
else
meshr= sqrt (meshn*meshn + meshm*meshm);
if (*s) {
fprintf (stderr, "rbox warning: assuming 'M3,4,5' since mesh args are not integers or reals\n");
meshn= 3.0, meshm=4.0, meshr=5.0;
}
break;
case 'O':
out_offset= (double) atof (&argv[i][1]);
break;
case 'P':
addpoints++;
break;
case 'W':
width= (double) atof (&argv[i][1]);
iswidth= 1;
break;
case 'Z':
if (argv[i][1])
radius= (double) atof (&argv[i][1]);
else
radius= 1.0;
isaxis= 1;
break;
default:
fprintf (stderr, "rbox warning: unknown flag %s.\nExecute 'rbox' without arguments for documentation.\n", argv[i]);
}
}
/* ============= defaults, constants, and sizes =============== */
if (isinteger && !isbox)
box= DEFAULTzbox;
if (addcube) {
cubesize= floor(ldexp(1.0,dim)+0.5);
if (cube == 0.0)
cube= box;
}else
cubesize= 0;
if (adddiamond) {
diamondsize= 2*dim;
if (diamond == 0.0)
diamond= box;
}else
diamondsize= 0;
if (islens) {
if (isaxis) {
fprintf (stderr, "rbox error: can not combine 'Ln' with 'Zn'\n");
exit(1);
}
if (radius <= 1.0) {
fprintf (stderr, "rbox error: lens radius %.2g should be greater than 1.0\n",
radius);
exit(1);
}
lensangle= asin (1.0/radius);
lensbase= radius * cos (lensangle);
}
if (!numpoints) {
if (issimplex2)
; /* ok */
else if (isregular + issimplex + islens + issphere + isaxis + isspiral + iswidth + ismesh) {
fprintf (stderr, "rbox error: missing count\n");
exit(1);
}else if (adddiamond + addcube + addpoints)
; /* ok */
else {
numpoints= 50; /* ./rbox D4 is the test case */
issphere= 1;
}
}
if ((issimplex + islens + isspiral + ismesh > 1)
|| (issimplex + issphere + isspiral + ismesh > 1)) {
fprintf (stderr, "rbox error: can only specify one of 'l', 's', 'x', 'Ln', or 'Mn,m,r' ('Ln s' is ok).\n");
exit(1);
}
fp= stdout;
/* ============= print header with total points =============== */
if (issimplex || ismesh)
totpoints= numpoints;
else if (issimplex2)
totpoints= numpoints+dim+1;
else if (isregular) {
totpoints= numpoints;
if (dim == 2) {
if (islens)
totpoints += numpoints - 2;
}else if (dim == 3) {
if (islens)
totpoints += 2 * numpoints;
else if (isgap)
totpoints += 1 + numpoints;
else
totpoints += 2;
}
}else
totpoints= numpoints + isaxis;
totpoints += cubesize + diamondsize + addpoints;
if (iscdd)
fprintf(fp, "%s\nbegin\n %d %d %s\n",
NOcommand ? "" : command,
totpoints, dim+1,
isinteger ? "integer" : "real");
else if (NOcommand)
fprintf(fp, "%d\n%d\n", dim, totpoints);
else
fprintf(fp, "%d %s\n%d\n", dim, command, totpoints);
/* ============= seed randoms =============== */
if (istime == 0) {
for (s=command; *s; s++) {
if (issimplex2 && *s == 'y') /* make 'y' same seed as 'x' */
i= 'x';
else
i= *s;
seed= 11*seed + i;
}
} /* else, seed explicitly set to n or to time */
qh_RANDOMseed_(seed);
/* ============= explicit points =============== */
for (i=1; i < argc; i++) {
if (argv[i][0] == 'P') {
s= argv[i]+1;
count= 0;
if (iscdd)
out1( 1.0);
while (*s) {
out1( strtod (s, &s));
count++;
if (*s) {
if (*s++ != ',') {
fprintf (stderr, "rbox error: missing comma after coordinate in %s\n\n", argv[i]);
exit (1);
}
}
}
if (count < dim) {
for (k= dim-count; k--; )
out1( 0.0);
}else if (count > dim) {
fprintf (stderr, "rbox error: %d coordinates instead of %d coordinates in %s\n\n",
count, dim, argv[i]);
exit (1);
}
fprintf (fp, "\n");
}
}
/* ============= simplex distribution =============== */
if (issimplex+issimplex2) {
if (!(simplex= malloc( dim * (dim+1) * sizeof(double)))) {
fprintf (stderr, "insufficient memory for simplex\n");
exit(0);
}
simplexp= simplex;
if (isregular) {
for (i= 0; i<dim; i++) {
for (k= 0; k<dim; k++)
*(simplexp++)= i==k ? 1.0 : 0.0;
}
for (k= 0; k<dim; k++)
*(simplexp++)= -1.0;
}else {
for (i= 0; i<dim+1; i++) {
for (k= 0; k<dim; k++) {
randr= qh_RANDOMint;
*(simplexp++)= 2.0 * randr/randmax - 1.0;
}
}
}
if (issimplex2) {
simplexp= simplex;
for (i= 0; i<dim+1; i++) {
if (iscdd)
out1( 1.0);
for (k= 0; k<dim; k++)
out1( *(simplexp++) * box);
fprintf (fp, "\n");
}
}
for (j= 0; j<numpoints; j++) {
if (iswidth)
apex= qh_RANDOMint % (dim+1);
else
apex= -1;
for (k= 0; k<dim; k++)
coord[k]= 0.0;
norm= 0.0;
for (i= 0; i<dim+1; i++) {
randr= qh_RANDOMint;
factor= randr/randmax;
if (i == apex)
factor *= width;
norm += factor;
for (k= 0; k<dim; k++) {
simplexp= simplex + i*dim + k;
coord[k] += factor * (*simplexp);
}
}
for (k= 0; k<dim; k++)
coord[k] /= norm;
if (iscdd)
out1( 1.0);
for (k=0; k < dim; k++)
out1( coord[k] * box);
fprintf (fp, "\n");
}
isregular= 0; /* continue with isbox */
numpoints= 0;
}
/* ============= mesh distribution =============== */
if (ismesh) {
nthroot= pow (numpoints, 1.0/dim) + 0.99999;
for (k= dim; k--; )
mult[k]= 0;
for (i= 0; i < numpoints; i++) {
for (k= 0; k < dim; k++) {
if (k == 0)
out1( mult[0] * meshn + mult[1] * (-meshm));
else if (k == 1)
out1( mult[0] * meshm + mult[1] * meshn);
else
out1( mult[k] * meshr );
}
fprintf (fp, "\n");
for (k= 0; k < dim; k++) {
if (++mult[k] < nthroot)
break;
mult[k]= 0;
}
}
}
/* ============= regular points for 's' =============== */
else if (isregular && !islens) {
if (dim != 2 && dim != 3) {
fprintf(stderr, "rbox error: regular points can be used only in 2-d and 3-d\n\n");
exit(1);
}
if (!isaxis || radius == 0.0) {
isaxis= 1;
radius= 1.0;
}
if (dim == 3) {
if (iscdd)
out1( 1.0);
out3n( 0.0, 0.0, -box);
if (!isgap) {
if (iscdd)
out1( 1.0);
out3n( 0.0, 0.0, box);
}
}
angle= 0.0;
anglediff= 2.0 * PI/numpoints;
for (i=0; i < numpoints; i++) {
angle += anglediff;
x= radius * cos (angle);
y= radius * sin (angle);
if (dim == 2) {
if (iscdd)
out1( 1.0);
out2n( x*box, y*box);
}else {
norm= sqrt (1.0 + x*x + y*y);
if (iscdd)
out1( 1.0);
out3n( box*x/norm, box*y/norm, box/norm);
if (isgap) {
x *= 1-gap;
y *= 1-gap;
norm= sqrt (1.0 + x*x + y*y);
if (iscdd)
out1( 1.0);
out3n( box*x/norm, box*y/norm, box/norm);
}
}
}
}
/* ============= regular points for 'r Ln D2' =============== */
else if (isregular && islens && dim == 2) {
double cos_0;
angle= lensangle;
anglediff= 2 * lensangle/(numpoints - 1);
cos_0= cos (lensangle);
for (i=0; i < numpoints; i++, angle -= anglediff) {
x= radius * sin (angle);
y= radius * (cos (angle) - cos_0);
if (iscdd)
out1( 1.0);
out2n( x*box, y*box);
if (i != 0 && i != numpoints - 1) {
if (iscdd)
out1( 1.0);
out2n( x*box, -y*box);
}
}
}
/* ============= regular points for 'r Ln D3' =============== */
else if (isregular && islens && dim != 2) {
if (dim != 3) {
fprintf(stderr, "rbox error: regular points can be used only in 2-d and 3-d\n\n");
exit(1);
}
angle= 0.0;
anglediff= 2* PI/numpoints;
if (!isgap) {
isgap= 1;
gap= 0.5;
}
offset= sqrt (radius * radius - (1-gap)*(1-gap)) - lensbase;
for (i=0; i < numpoints; i++, angle += anglediff) {
x= cos (angle);
y= sin (angle);
if (iscdd)
out1( 1.0);
out3n( box*x, box*y, 0);
x *= 1-gap;
y *= 1-gap;
if (iscdd)
out1( 1.0);
out3n( box*x, box*y, box * offset);
if (iscdd)
out1( 1.0);
out3n( box*x, box*y, -box * offset);
}
}
/* ============= apex of 'Zn' distribution + gendim =============== */
else {
if (isaxis) {
gendim= dim-1;
if (iscdd)
out1( 1.0);
for (j=0; j < gendim; j++)
out1( 0.0);
out1( -box);
fprintf (fp, "\n");
}else if (islens)
gendim= dim-1;
else
gendim= dim;
/* ============= generate random point in unit cube =============== */
for (i=0; i < numpoints; i++) {
norm= 0.0;
for (j=0; j < gendim; j++) {
randr= qh_RANDOMint;
coord[j]= 2.0 * randr/randmax - 1.0;
norm += coord[j] * coord[j];
}
norm= sqrt (norm);
/* ============= dim-1 point of 'Zn' distribution ========== */
if (isaxis) {
if (!isgap) {
isgap= 1;
gap= 1.0;
}
randr= qh_RANDOMint;
rangap= 1.0 - gap * randr/randmax;
factor= radius * rangap / norm;
for (j=0; j<gendim; j++)
coord[j]= factor * coord[j];
/* ============= dim-1 point of 'Ln s' distribution =========== */
}else if (islens && issphere) {
if (!isgap) {
isgap= 1;
gap= 1.0;
}
randr= qh_RANDOMint;
rangap= 1.0 - gap * randr/randmax;
factor= rangap / norm;
for (j=0; j<gendim; j++)
coord[j]= factor * coord[j];
/* ============= dim-1 point of 'Ln' distribution ========== */
}else if (islens && !issphere) {
if (!isgap) {
isgap= 1;
gap= 1.0;
}
j= qh_RANDOMint % gendim;
if (coord[j] < 0)
coord[j]= -1.0 - coord[j] * gap;
else
coord[j]= 1.0 - coord[j] * gap;
/* ============= point of 'l' distribution =============== */
}else if (isspiral) {
if (dim != 3) {
fprintf(stderr, "rbox error: spiral distribution is available only in 3d\n\n");
exit(1);
}
coord[0]= cos(2*PI*i/(numpoints - 1));
coord[1]= sin(2*PI*i/(numpoints - 1));
coord[2]= 2.0*(double)i/(double)(numpoints-1) - 1.0;
/* ============= point of 's' distribution =============== */
}else if (issphere) {
factor= 1.0/norm;
if (iswidth) {
randr= qh_RANDOMint;
factor *= 1.0 - width * randr/randmax;
}
for (j=0; j<dim; j++)
coord[j]= factor * coord[j];
}
/* ============= project 'Zn s' point in to sphere =============== */
if (isaxis && issphere) {
coord[dim-1]= 1.0;
norm= 1.0;
for (j=0; j<gendim; j++)
norm += coord[j] * coord[j];
norm= sqrt (norm);
for (j=0; j<dim; j++)
coord[j]= coord[j] / norm;
if (iswidth) {
randr= qh_RANDOMint;
coord[dim-1] *= 1 - width * randr/randmax;
}
/* ============= project 'Zn' point onto cube =============== */
}else if (isaxis && !issphere) { /* not very interesting */
randr= qh_RANDOMint;
coord[dim-1]= 2.0 * randr/randmax - 1.0;
/* ============= project 'Ln' point out to sphere =============== */
}else if (islens) {
coord[dim-1]= lensbase;
for (j=0, norm= 0; j<dim; j++)
norm += coord[j] * coord[j];
norm= sqrt (norm);
for (j=0; j<dim; j++)
coord[j]= coord[j] * radius/ norm;
coord[dim-1] -= lensbase;
if (iswidth) {
randr= qh_RANDOMint;
coord[dim-1] *= 1 - width * randr/randmax;
}
if (qh_RANDOMint > randmax/2)
coord[dim-1]= -coord[dim-1];
/* ============= project 'Wn' point toward boundary =============== */
}else if (iswidth && !issphere) {
j= qh_RANDOMint % gendim;
if (coord[j] < 0)
coord[j]= -1.0 - coord[j] * width;
else
coord[j]= 1.0 - coord[j] * width;
}
/* ============= write point =============== */
if (iscdd)
out1( 1.0);
for (k=0; k < dim; k++)
out1( coord[k] * box);
fprintf (fp, "\n");
}
}
/* ============= write cube vertices =============== */
if (addcube) {
for (j=0; j<cubesize; j++) {
if (iscdd)
out1( 1.0);
for (k=dim-1; k>=0; k--) {
if (j & ( 1 << k))
out1( cube);
else
out1( -cube);
}
fprintf (fp, "\n");
}
}
/* ============= write diamond vertices =============== */
if (adddiamond) {
for (j=0; j<diamondsize; j++) {
if (iscdd)
out1( 1.0);
for (k=dim-1; k>=0; k--) {
if (j/2 != k)
out1( 0.0);
else if (j & 0x1)
out1( diamond);
else
out1( -diamond);
}
fprintf (fp, "\n");
}
}
if (iscdd)
fprintf (fp, "end\nhull\n");
return 0;
} /* rbox */
/*------------------------------------------------
-outxxx - output functions
*/
int roundi( double a) {
if (a < 0.0) {
if (a - 0.5 < INT_MIN) {
fprintf(stderr, "rbox input error: coordinate %2.2g is too large. Reduce 'Bn'\n", a);
exit (1);
}
return a - 0.5;
}else {
if (a + 0.5 > INT_MAX) {
fprintf(stderr, "rbox input error: coordinate %2.2g is too large. Reduce 'Bn'\n", a);
exit (1);
}
return a + 0.5;
}
} /* roundi */
void out1(double a) {
if (isinteger)
fprintf(fp, "%d ", roundi( a+out_offset));
else
fprintf(fp, qh_REAL_1, a+out_offset);
} /* out1 */
void out2n( double a, double b) {
if (isinteger)
fprintf(fp, "%d %d\n", roundi(a+out_offset), roundi(b+out_offset));
else
fprintf(fp, qh_REAL_2n, a+out_offset, b+out_offset);
} /* out2n */
void out3n( double a, double b, double c) {
if (isinteger)
fprintf(fp, "%d %d %d\n", roundi(a+out_offset), roundi(b+out_offset), roundi(c+out_offset));
else
fprintf(fp, qh_REAL_3n, a+out_offset, b+out_offset, c+out_offset);
} /* out3n */
/*-------------------------------------------------
-rand & srand- generate pseudo-random number between 1 and 2^31 -2
from Park & Miller's minimimal standard random number generator
Communications of the ACM, 31:1192-1201, 1988.
notes:
does not use 0 or 2^31 -1
this is silently enforced by qh_srand()
copied from geom2.c
*/
static int seed = 1; /* global static */
int qh_rand( void) {
#define qh_rand_a 16807
#define qh_rand_m 2147483647
#define qh_rand_q 127773 /* m div a */
#define qh_rand_r 2836 /* m mod a */
int lo, hi, test;
hi = seed / qh_rand_q; /* seed div q */
lo = seed % qh_rand_q; /* seed mod q */
test = qh_rand_a * lo - qh_rand_r * hi;
if (test > 0)
seed= test;
else
seed= test + qh_rand_m;
return seed;
} /* rand */
void qh_srand( int newseed) {
if (newseed < 1)
seed= 1;
else if (newseed >= qh_rand_m)
seed= qh_rand_m - 1;
else
seed= newseed;
} /* qh_srand */

View File

@ -1,700 +0,0 @@
/*<html><pre> -<a href="qh-stat.htm"
>-------------------------------</a><a name="TOP">-</a>
stat.c
contains all statistics that are collected for qhull
see qh-stat.htm and stat.h
copyright (c) 1993-2002, The Geometry Center
*/
#include "qhull_a.h"
/*============ global data structure ==========*/
#if qh_QHpointer
qhstatT *qh_qhstat=NULL; /* global data structure */
#else
qhstatT qh_qhstat; /* add "={0}" if this causes a compiler error */
#endif
/*========== functions in alphabetic order ================*/
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="allstatA">-</a>
qh_allstatA()
define statistics in groups of 20
notes:
(otherwise, 'gcc -O2' uses too much memory)
uses qhstat.next
*/
void qh_allstatA (void) {
/* zdef_(type,name,doc,average) */
zzdef_(zdoc, Zdoc2, "precision statistics", -1);
zdef_(zinc, Znewvertex, NULL, -1);
zdef_(wadd, Wnewvertex, "ave. distance of a new vertex to a facet (not 0s)", Znewvertex);
zzdef_(wmax, Wnewvertexmax, "max. distance of a new vertex to a facet", -1);
zdef_(wmax, Wvertexmax, "max. distance of an output vertex to a facet", -1);
zdef_(wmin, Wvertexmin, "min. distance of an output vertex to a facet", -1);
zdef_(wmin, Wmindenom, "min. denominator in hyperplane computation", -1);
qhstat precision= qhstat next; /* call qh_precision for each of these */
zzdef_(zdoc, Zdoc3, "precision problems (corrected unless 'Q0' or an error)", -1);
zzdef_(zinc, Zcoplanarridges, "coplanar half ridges in output", -1);
zzdef_(zinc, Zconcaveridges, "concave half ridges in output", -1);
zzdef_(zinc, Zflippedfacets, "flipped facets", -1);
zzdef_(zinc, Zcoplanarhorizon, "coplanar horizon facets for new vertices", -1);
zzdef_(zinc, Zcoplanarpart, "coplanar points during partitioning", -1);
zzdef_(zinc, Zminnorm, "degenerate hyperplanes recomputed with gaussian elimination", -1);
zzdef_(zinc, Znearlysingular, "nearly singular or axis-parallel hyperplanes", -1);
zzdef_(zinc, Zback0, "zero divisors during back substitute", -1);
zzdef_(zinc, Zgauss0, "zero divisors during gaussian elimination", -1);
zzdef_(zinc, Zmultiridge, "ridges with multiple neighbors", -1);
}
void qh_allstatB (void) {
zzdef_(zdoc, Zdoc1, "summary information", -1);
zdef_(zinc, Zvertices, "number of vertices in output", -1);
zdef_(zinc, Znumfacets, "number of facets in output", -1);
zdef_(zinc, Znonsimplicial, "number of non-simplicial facets in output", -1);
zdef_(zinc, Znowsimplicial, "number of simplicial facets that were merged", -1);
zdef_(zinc, Znumridges, "number of ridges in output", -1);
zdef_(zadd, Znumridges, "average number of ridges per facet", Znumfacets);
zdef_(zmax, Zmaxridges, "maximum number of ridges", -1);
zdef_(zadd, Znumneighbors, "average number of neighbors per facet", Znumfacets);
zdef_(zmax, Zmaxneighbors, "maximum number of neighbors", -1);
zdef_(zadd, Znumvertices, "average number of vertices per facet", Znumfacets);
zdef_(zmax, Zmaxvertices, "maximum number of vertices", -1);
zdef_(zadd, Znumvneighbors, "average number of neighbors per vertex", Zvertices);
zdef_(zmax, Zmaxvneighbors, "maximum number of neighbors", -1);
zdef_(wadd, Wcpu, "cpu seconds for qhull after input", -1);
zdef_(zinc, Ztotvertices, "vertices created altogether", -1);
zzdef_(zinc, Zsetplane, "facets created altogether", -1);
zdef_(zinc, Ztotridges, "ridges created altogether", -1);
zdef_(zinc, Zpostfacets, "facets before post merge", -1);
zdef_(zadd, Znummergetot, "average merges per facet (at most 511)", Znumfacets);
zdef_(zmax, Znummergemax, " maximum merges for a facet (at most 511)", -1);
zdef_(zinc, Zangle, NULL, -1);
zdef_(wadd, Wangle, "average angle (cosine) of facet normals for all ridges", Zangle);
zdef_(wmax, Wanglemax, " maximum angle (cosine) of facet normals across a ridge", -1);
zdef_(wmin, Wanglemin, " minimum angle (cosine) of facet normals across a ridge", -1);
zdef_(wadd, Wareatot, "total area of facets", -1);
zdef_(wmax, Wareamax, " maximum facet area", -1);
zdef_(wmin, Wareamin, " minimum facet area", -1);
}
void qh_allstatC (void) {
zdef_(zdoc, Zdoc9, "build hull statistics", -1);
zzdef_(zinc, Zprocessed, "points processed", -1);
zzdef_(zinc, Zretry, "retries due to precision problems", -1);
zdef_(wmax, Wretrymax, " max. random joggle", -1);
zdef_(zmax, Zmaxvertex, "max. vertices at any one time", -1);
zdef_(zinc, Ztotvisible, "ave. visible facets per iteration", Zprocessed);
zdef_(zinc, Zinsidevisible, " ave. visible facets without an horizon neighbor", Zprocessed);
zdef_(zadd, Zvisfacettot, " ave. facets deleted per iteration", Zprocessed);
zdef_(zmax, Zvisfacetmax, " maximum", -1);
zdef_(zadd, Zvisvertextot, "ave. visible vertices per iteration", Zprocessed);
zdef_(zmax, Zvisvertexmax, " maximum", -1);
zdef_(zinc, Ztothorizon, "ave. horizon facets per iteration", Zprocessed);
zdef_(zadd, Znewfacettot, "ave. new or merged facets per iteration", Zprocessed);
zdef_(zmax, Znewfacetmax, " maximum (includes initial simplex)", -1);
zdef_(wadd, Wnewbalance, "average new facet balance", Zprocessed);
zdef_(wadd, Wnewbalance2, " standard deviation", -1);
zdef_(wadd, Wpbalance, "average partition balance", Zpbalance);
zdef_(wadd, Wpbalance2, " standard deviation", -1);
zdef_(zinc, Zpbalance, " number of trials", -1);
zdef_(zinc, Zsearchpoints, "searches of all points for initial simplex", -1);
zdef_(zinc, Zdetsimplex, "determinants computed (area & initial hull)", -1);
zdef_(zinc, Znoarea, "determinants not computed because vertex too low", -1);
zdef_(zinc, Znotmax, "points ignored (not above max_outside)", -1);
zdef_(zinc, Znotgood, "points ignored (not above a good facet)", -1);
zdef_(zinc, Znotgoodnew, "points ignored (didn't create a good new facet)", -1);
zdef_(zinc, Zgoodfacet, "good facets found", -1);
zzdef_(zinc, Znumvisibility, "distance tests for facet visibility", -1);
zdef_(zinc, Zdistvertex, "distance tests to report minimum vertex", -1);
zdef_(zinc, Ztotcheck, "points checked for facets' outer planes", -1);
zzdef_(zinc, Zcheckpart, " ave. distance tests per check", Ztotcheck);
}
void qh_allstatD(void) {
zdef_(zdoc, Zdoc4, "partitioning statistics (see previous for outer planes)", -1);
zzdef_(zadd, Zdelvertextot, "total vertices deleted", -1);
zdef_(zmax, Zdelvertexmax, " maximum vertices deleted per iteration", -1);
zdef_(zinc, Zfindbest, "calls to findbest", -1);
zdef_(zadd, Zfindbesttot, " ave. facets tested", Zfindbest);
zdef_(zmax, Zfindbestmax, " max. facets tested", -1);
zdef_(zadd, Zfindcoplanar, " ave. coplanar search", Zfindbest);
zdef_(zinc, Zfindnew, "calls to findbestnew", -1);
zdef_(zadd, Zfindnewtot, " ave. facets tested", Zfindnew);
zdef_(zmax, Zfindnewmax, " max. facets tested", -1);
zdef_(zinc, Zfindnewjump, " ave. clearly better", Zfindnew);
zdef_(zinc, Zfindnewsharp, " calls due to qh_sharpnewfacets", -1);
zdef_(zinc, Zfindhorizon, "calls to findhorizon", -1);
zdef_(zadd, Zfindhorizontot, " ave. facets tested", Zfindhorizon);
zdef_(zmax, Zfindhorizonmax, " max. facets tested", -1);
zdef_(zinc, Zfindjump, " ave. clearly better", Zfindhorizon);
zdef_(zinc, Zparthorizon, " horizon facets better than bestfacet", -1);
zdef_(zinc, Zpartangle, "angle tests for repartitioned coplanar points", -1);
zdef_(zinc, Zpartflip, " repartitioned coplanar points for flipped orientation", -1);
zdef_(zinc, Zpartinside, "inside points", -1);
zdef_(zinc, Zpartnear, " inside points kept with a facet", -1);
zdef_(zinc, Zcoplanarinside, " inside points that were coplanar with a facet", -1);
zdef_(wadd, Wmaxout, "difference in max_outside at final check", -1);
}
void qh_allstatE(void) {
zzdef_(zinc, Zpartitionall, "distance tests for initial partition", -1);
zdef_(zinc, Ztotpartition, "partitions of a point", -1);
zzdef_(zinc, Zpartition, "distance tests for partitioning", -1);
zzdef_(zinc, Zdistcheck, "distance tests for checking flipped facets", -1);
zzdef_(zinc, Zdistconvex, "distance tests for checking convexity", -1);
zdef_(zinc, Zdistgood, "distance tests for checking good point", -1);
zdef_(zinc, Zdistio, "distance tests for output", -1);
zdef_(zinc, Zdiststat, "distance tests for statistics", -1);
zdef_(zinc, Zdistplane, "total number of distance tests", -1);
zdef_(zinc, Ztotpartcoplanar, "partitions of coplanar points or deleted vertices", -1);
zzdef_(zinc, Zpartcoplanar, " distance tests for these partitions", -1);
zdef_(zinc, Zcomputefurthest, "distance tests for computing furthest", -1);
}
void qh_allstatE2(void) {
zdef_(zdoc, Zdoc5, "statistics for matching ridges", -1);
zdef_(zinc, Zhashlookup, "total lookups for matching ridges of new facets", -1);
zdef_(zinc, Zhashtests, "average number of tests to match a ridge", Zhashlookup);
zdef_(zinc, Zhashridge, "total lookups of subridges (duplicates and boundary)", -1);
zdef_(zinc, Zhashridgetest, "average number of tests per subridge", Zhashridge);
zdef_(zinc, Zdupsame, "duplicated ridges in same merge cycle", -1);
zdef_(zinc, Zdupflip, "duplicated ridges with flipped facets", -1);
zdef_(zdoc, Zdoc6, "statistics for determining merges", -1);
zdef_(zinc, Zangletests, "angles computed for ridge convexity", -1);
zdef_(zinc, Zbestcentrum, "best merges used centrum instead of vertices",-1);
zzdef_(zinc, Zbestdist, "distance tests for best merge", -1);
zzdef_(zinc, Zcentrumtests, "distance tests for centrum convexity", -1);
zzdef_(zinc, Zdistzero, "distance tests for checking simplicial convexity", -1);
zdef_(zinc, Zcoplanarangle, "coplanar angles in getmergeset", -1);
zdef_(zinc, Zcoplanarcentrum, "coplanar centrums in getmergeset", -1);
zdef_(zinc, Zconcaveridge, "concave ridges in getmergeset", -1);
}
void qh_allstatF(void) {
zdef_(zdoc, Zdoc7, "statistics for merging", -1);
zdef_(zinc, Zpremergetot, "merge iterations", -1);
zdef_(zadd, Zmergeinittot, "ave. initial non-convex ridges per iteration", Zpremergetot);
zdef_(zadd, Zmergeinitmax, " maximum", -1);
zdef_(zadd, Zmergesettot, " ave. additional non-convex ridges per iteration", Zpremergetot);
zdef_(zadd, Zmergesetmax, " maximum additional in one pass", -1);
zdef_(zadd, Zmergeinittot2, "initial non-convex ridges for post merging", -1);
zdef_(zadd, Zmergesettot2, " additional non-convex ridges", -1);
zdef_(wmax, Wmaxoutside, "max distance of vertex or coplanar point above facet (w/roundoff)", -1);
zdef_(wmin, Wminvertex, "max distance of merged vertex below facet (or roundoff)", -1);
zdef_(zinc, Zwidefacet, "centrums frozen due to a wide merge", -1);
zdef_(zinc, Zwidevertices, "centrums frozen due to extra vertices", -1);
zzdef_(zinc, Ztotmerge, "total number of facets or cycles of facets merged", -1);
zdef_(zinc, Zmergesimplex, "merged a simplex", -1);
zdef_(zinc, Zonehorizon, "simplices merged into coplanar horizon", -1);
zzdef_(zinc, Zcyclehorizon, "cycles of facets merged into coplanar horizon", -1);
zzdef_(zadd, Zcyclefacettot, " ave. facets per cycle", Zcyclehorizon);
zdef_(zmax, Zcyclefacetmax, " max. facets", -1);
zdef_(zinc, Zmergeintohorizon, "new facets merged into horizon", -1);
zdef_(zinc, Zmergenew, "new facets merged", -1);
zdef_(zinc, Zmergehorizon, "horizon facets merged into new facets", -1);
zdef_(zinc, Zmergevertex, "vertices deleted by merging", -1);
zdef_(zinc, Zcyclevertex, "vertices deleted by merging into coplanar horizon", -1);
zdef_(zinc, Zdegenvertex, "vertices deleted by degenerate facet", -1);
zdef_(zinc, Zmergeflipdup, "merges due to flipped facets in duplicated ridge", -1);
zdef_(zinc, Zneighbor, "merges due to redundant neighbors", -1);
zdef_(zadd, Ztestvneighbor, "non-convex vertex neighbors", -1);
}
void qh_allstatG(void) {
zdef_(zinc, Zacoplanar, "merges due to angle coplanar facets", -1);
zdef_(wadd, Wacoplanartot, " average merge distance", Zacoplanar);
zdef_(wmax, Wacoplanarmax, " maximum merge distance", -1);
zdef_(zinc, Zcoplanar, "merges due to coplanar facets", -1);
zdef_(wadd, Wcoplanartot, " average merge distance", Zcoplanar);
zdef_(wmax, Wcoplanarmax, " maximum merge distance", -1);
zdef_(zinc, Zconcave, "merges due to concave facets", -1);
zdef_(wadd, Wconcavetot, " average merge distance", Zconcave);
zdef_(wmax, Wconcavemax, " maximum merge distance", -1);
zdef_(zinc, Zavoidold, "coplanar/concave merges due to avoiding old merge", -1);
zdef_(wadd, Wavoidoldtot, " average merge distance", Zavoidold);
zdef_(wmax, Wavoidoldmax, " maximum merge distance", -1);
zdef_(zinc, Zdegen, "merges due to degenerate facets", -1);
zdef_(wadd, Wdegentot, " average merge distance", Zdegen);
zdef_(wmax, Wdegenmax, " maximum merge distance", -1);
zdef_(zinc, Zflipped, "merges due to removing flipped facets", -1);
zdef_(wadd, Wflippedtot, " average merge distance", Zflipped);
zdef_(wmax, Wflippedmax, " maximum merge distance", -1);
zdef_(zinc, Zduplicate, "merges due to duplicated ridges", -1);
zdef_(wadd, Wduplicatetot, " average merge distance", Zduplicate);
zdef_(wmax, Wduplicatemax, " maximum merge distance", -1);
}
void qh_allstatH(void) {
zdef_(zdoc, Zdoc8, "renamed vertex statistics", -1);
zdef_(zinc, Zrenameshare, "renamed vertices shared by two facets", -1);
zdef_(zinc, Zrenamepinch, "renamed vertices in a pinched facet", -1);
zdef_(zinc, Zrenameall, "renamed vertices shared by multiple facets", -1);
zdef_(zinc, Zfindfail, "rename failures due to duplicated ridges", -1);
zdef_(zinc, Zdupridge, " duplicate ridges detected", -1);
zdef_(zinc, Zdelridge, "deleted ridges due to renamed vertices", -1);
zdef_(zinc, Zdropneighbor, "dropped neighbors due to renamed vertices", -1);
zdef_(zinc, Zdropdegen, "degenerate facets due to dropped neighbors", -1);
zdef_(zinc, Zdelfacetdup, " facets deleted because of no neighbors", -1);
zdef_(zinc, Zremvertex, "vertices removed from facets due to no ridges", -1);
zdef_(zinc, Zremvertexdel, " deleted", -1);
zdef_(zinc, Zintersectnum, "vertex intersections for locating redundant vertices", -1);
zdef_(zinc, Zintersectfail, "intersections failed to find a redundant vertex", -1);
zdef_(zinc, Zintersect, "intersections found redundant vertices", -1);
zdef_(zadd, Zintersecttot, " ave. number found per vertex", Zintersect);
zdef_(zmax, Zintersectmax, " max. found for a vertex", -1);
zdef_(zinc, Zvertexridge, NULL, -1);
zdef_(zadd, Zvertexridgetot, " ave. number of ridges per tested vertex", Zvertexridge);
zdef_(zmax, Zvertexridgemax, " max. number of ridges per tested vertex", -1);
zdef_(zdoc, Zdoc10, "memory usage statistics (in bytes)", -1);
zdef_(zadd, Zmemfacets, "for facets and their normals, neighbor and vertex sets", -1);
zdef_(zadd, Zmemvertices, "for vertices and their neighbor sets", -1);
zdef_(zadd, Zmempoints, "for input points and outside and coplanar sets",-1);
zdef_(zadd, Zmemridges, "for ridges and their vertex sets", -1);
} /* allstat */
void qh_allstatI(void) {
qhstat vridges= qhstat next;
zzdef_(zdoc, Zdoc11, "Voronoi ridge statistics", -1);
zzdef_(zinc, Zridge, "non-simplicial Voronoi vertices for all ridges", -1);
zzdef_(wadd, Wridge, " ave. distance to ridge", Zridge);
zzdef_(wmax, Wridgemax, " max. distance to ridge", -1);
zzdef_(zinc, Zridgemid, "bounded ridges", -1);
zzdef_(wadd, Wridgemid, " ave. distance of midpoint to ridge", Zridgemid);
zzdef_(wmax, Wridgemidmax, " max. distance of midpoint to ridge", -1);
zzdef_(zinc, Zridgeok, "bounded ridges with ok normal", -1);
zzdef_(wadd, Wridgeok, " ave. angle to ridge", Zridgeok);
zzdef_(wmax, Wridgeokmax, " max. angle to ridge", -1);
zzdef_(zinc, Zridge0, "bounded ridges with near-zero normal", -1);
zzdef_(wadd, Wridge0, " ave. angle to ridge", Zridge0);
zzdef_(wmax, Wridge0max, " max. angle to ridge", -1);
zdef_(zdoc, Zdoc12, "Triangulation statistics (Qt)", -1);
zdef_(zinc, Ztricoplanar, "non-simplicial facets triangulated", -1);
zdef_(zadd, Ztricoplanartot, " ave. new facets created (may be deleted)", Ztricoplanar);
zdef_(zmax, Ztricoplanarmax, " max. new facets created", -1);
zdef_(zinc, Ztrinull, "null new facets deleted (duplicated vertex)", -1);
zdef_(zinc, Ztrimirror, "mirrored pairs of new facets deleted (same vertices)", -1);
zdef_(zinc, Ztridegen, "degenerate new facets in output (same ridge)", -1);
} /* allstat */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="allstatistics">-</a>
qh_allstatistics()
reset printed flag for all statistics
*/
void qh_allstatistics (void) {
int i;
for (i=ZEND; i--; )
qhstat printed[i]= False;
} /* allstatistics */
#if qh_KEEPstatistics
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="collectstatistics">-</a>
qh_collectstatistics()
collect statistics for qh.facet_list
*/
void qh_collectstatistics (void) {
facetT *facet, *neighbor, **neighborp;
vertexT *vertex, **vertexp;
realT dotproduct, dist;
int sizneighbors, sizridges, sizvertices, i;
qh old_randomdist= qh RANDOMdist;
qh RANDOMdist= False;
zval_(Zmempoints)= qh num_points * qh normal_size +
sizeof (qhT) + sizeof (qhstatT);
zval_(Zmemfacets)= 0;
zval_(Zmemridges)= 0;
zval_(Zmemvertices)= 0;
zval_(Zangle)= 0;
wval_(Wangle)= 0.0;
zval_(Znumridges)= 0;
zval_(Znumfacets)= 0;
zval_(Znumneighbors)= 0;
zval_(Znumvertices)= 0;
zval_(Znumvneighbors)= 0;
zval_(Znummergetot)= 0;
zval_(Znummergemax)= 0;
zval_(Zvertices)= qh num_vertices - qh_setsize (qh del_vertices);
if (qh MERGING || qh APPROXhull || qh JOGGLEmax < REALmax/2)
wmax_(Wmaxoutside, qh max_outside);
if (qh MERGING)
wmin_(Wminvertex, qh min_vertex);
FORALLfacets
facet->seen= False;
if (qh DELAUNAY) {
FORALLfacets {
if (facet->upperdelaunay != qh UPPERdelaunay)
facet->seen= True; /* remove from angle statistics */
}
}
FORALLfacets {
if (facet->visible && qh NEWfacets)
continue;
sizvertices= qh_setsize (facet->vertices);
sizneighbors= qh_setsize (facet->neighbors);
sizridges= qh_setsize (facet->ridges);
zinc_(Znumfacets);
zadd_(Znumvertices, sizvertices);
zmax_(Zmaxvertices, sizvertices);
zadd_(Znumneighbors, sizneighbors);
zmax_(Zmaxneighbors, sizneighbors);
zadd_(Znummergetot, facet->nummerge);
i= facet->nummerge; /* avoid warnings */
zmax_(Znummergemax, i);
if (!facet->simplicial) {
if (sizvertices == qh hull_dim) {
zinc_(Znowsimplicial);
}else {
zinc_(Znonsimplicial);
}
}
if (sizridges) {
zadd_(Znumridges, sizridges);
zmax_(Zmaxridges, sizridges);
}
zadd_(Zmemfacets, sizeof (facetT) + qh normal_size + 2*sizeof (setT)
+ SETelemsize * (sizneighbors + sizvertices));
if (facet->ridges) {
zadd_(Zmemridges,
sizeof (setT) + SETelemsize * sizridges + sizridges *
(sizeof (ridgeT) + sizeof (setT) + SETelemsize * (qh hull_dim-1))/2);
}
if (facet->outsideset)
zadd_(Zmempoints, sizeof (setT) + SETelemsize * qh_setsize (facet->outsideset));
if (facet->coplanarset)
zadd_(Zmempoints, sizeof (setT) + SETelemsize * qh_setsize (facet->coplanarset));
if (facet->seen) /* Delaunay upper envelope */
continue;
facet->seen= True;
FOREACHneighbor_(facet) {
if (neighbor == qh_DUPLICATEridge || neighbor == qh_MERGEridge
|| neighbor->seen || !facet->normal || !neighbor->normal)
continue;
dotproduct= qh_getangle(facet->normal, neighbor->normal);
zinc_(Zangle);
wadd_(Wangle, dotproduct);
wmax_(Wanglemax, dotproduct)
wmin_(Wanglemin, dotproduct)
}
if (facet->normal) {
FOREACHvertex_(facet->vertices) {
zinc_(Zdiststat);
qh_distplane(vertex->point, facet, &dist);
wmax_(Wvertexmax, dist);
wmin_(Wvertexmin, dist);
}
}
}
FORALLvertices {
if (vertex->deleted)
continue;
zadd_(Zmemvertices, sizeof (vertexT));
if (vertex->neighbors) {
sizneighbors= qh_setsize (vertex->neighbors);
zadd_(Znumvneighbors, sizneighbors);
zmax_(Zmaxvneighbors, sizneighbors);
zadd_(Zmemvertices, sizeof (vertexT) + SETelemsize * sizneighbors);
}
}
qh RANDOMdist= qh old_randomdist;
} /* collectstatistics */
#endif /* qh_KEEPstatistics */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="freestatistics">-</a>
qh_freestatistics( )
free memory used for statistics
*/
void qh_freestatistics (void) {
#if qh_QHpointer
free (qh_qhstat);
qh_qhstat= NULL;
#endif
} /* freestatistics */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="initstatistics">-</a>
qh_initstatistics( )
allocate and initialize statistics
notes:
uses malloc() instead of qh_memalloc() since mem.c not set up yet
*/
void qh_initstatistics (void) {
int i;
realT realx;
int intx;
#if qh_QHpointer
if (!(qh_qhstat= (qhstatT *)malloc (sizeof(qhstatT)))) {
fprintf (qhmem.ferr, "qhull error (qh_initstatistics): insufficient memory\n");
exit (1); /* can not use qh_errexit() */
}
#endif
qhstat next= 0;
qh_allstatA();
qh_allstatB();
qh_allstatC();
qh_allstatD();
qh_allstatE();
qh_allstatE2();
qh_allstatF();
qh_allstatG();
qh_allstatH();
qh_allstatI();
if (qhstat next > sizeof(qhstat id)) {
fprintf (qhmem.ferr, "qhull error (qh_initstatistics): increase size of qhstat.id[].\n\
qhstat.next %d should be <= sizeof(qhstat id) %ld\n", qhstat next, sizeof(qhstat id));
#if 0 /* for locating error, Znumridges should be duplicated */
for (i=0; i < ZEND; i++) {
int j;
for (j=i+1; j < ZEND; j++) {
if (qhstat id[i] == qhstat id[j]) {
fprintf (qhmem.ferr, "qhull error (qh_initstatistics): duplicated statistic %d at indices %d and %d\n",
qhstat id[i], i, j);
}
}
}
#endif
exit (1); /* can not use qh_errexit() */
}
qhstat init[zinc].i= 0;
qhstat init[zadd].i= 0;
qhstat init[zmin].i= INT_MAX;
qhstat init[zmax].i= INT_MIN;
qhstat init[wadd].r= 0;
qhstat init[wmin].r= REALmax;
qhstat init[wmax].r= -REALmax;
for (i=0; i < ZEND; i++) {
if (qhstat type[i] > ZTYPEreal) {
realx= qhstat init[(unsigned char)(qhstat type[i])].r;
qhstat stats[i].r= realx;
}else if (qhstat type[i] != zdoc) {
intx= qhstat init[(unsigned char)(qhstat type[i])].i;
qhstat stats[i].i= intx;
}
}
} /* initstatistics */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="newstats">-</a>
qh_newstats( )
returns True if statistics for zdoc
returns:
next zdoc
*/
boolT qh_newstats (int index, int *nextindex) {
boolT isnew= False;
int start, i;
if (qhstat type[qhstat id[index]] == zdoc)
start= index+1;
else
start= index;
for (i= start; i < qhstat next && qhstat type[qhstat id[i]] != zdoc; i++) {
if (!qh_nostatistic(qhstat id[i]) && !qhstat printed[qhstat id[i]])
isnew= True;
}
*nextindex= i;
return isnew;
} /* newstats */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="nostatistic">-</a>
qh_nostatistic( index )
true if no statistic to print
*/
boolT qh_nostatistic (int i) {
if ((qhstat type[i] > ZTYPEreal
&&qhstat stats[i].r == qhstat init[(unsigned char)(qhstat type[i])].r)
|| (qhstat type[i] < ZTYPEreal
&&qhstat stats[i].i == qhstat init[(unsigned char)(qhstat type[i])].i))
return True;
return False;
} /* nostatistic */
#if qh_KEEPstatistics
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="printallstatistics">-</a>
qh_printallstatistics( fp, string )
print all statistics with header 'string'
*/
void qh_printallstatistics (FILE *fp, char *string) {
qh_allstatistics();
qh_collectstatistics();
qh_printstatistics (fp, string);
qh_memstatistics (fp);
}
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="printstatistics">-</a>
qh_printstatistics( fp, string )
print statistics to a file with header 'string'
skips statistics with qhstat.printed[] (reset with qh_allstatistics)
see:
qh_printallstatistics()
*/
void qh_printstatistics (FILE *fp, char *string) {
int i, k;
realT ave;
if (qh num_points != qh num_vertices) {
wval_(Wpbalance)= 0;
wval_(Wpbalance2)= 0;
}else
wval_(Wpbalance2)= qh_stddev (zval_(Zpbalance), wval_(Wpbalance),
wval_(Wpbalance2), &ave);
wval_(Wnewbalance2)= qh_stddev (zval_(Zprocessed), wval_(Wnewbalance),
wval_(Wnewbalance2), &ave);
fprintf (fp, "\n\
%s\n\
qhull invoked by: %s | %s\n%s with options:\n%s\n", string, qh rbox_command,
qh qhull_command, qh_VERSION, qh qhull_options);
fprintf (fp, "\nprecision constants:\n\
%6.2g max. abs. coordinate in the (transformed) input ('Qbd:n')\n\
%6.2g max. roundoff error for distance computation ('En')\n\
%6.2g max. roundoff error for angle computations\n\
%6.2g min. distance for outside points ('Wn')\n\
%6.2g min. distance for visible facets ('Vn')\n\
%6.2g max. distance for coplanar facets ('Un')\n\
%6.2g max. facet width for recomputing centrum and area\n\
",
qh MAXabs_coord, qh DISTround, qh ANGLEround, qh MINoutside,
qh MINvisible, qh MAXcoplanar, qh WIDEfacet);
if (qh KEEPnearinside)
fprintf(fp, "\
%6.2g max. distance for near-inside points\n", qh NEARinside);
if (qh premerge_cos < REALmax/2) fprintf (fp, "\
%6.2g max. cosine for pre-merge angle\n", qh premerge_cos);
if (qh PREmerge) fprintf (fp, "\
%6.2g radius of pre-merge centrum\n", qh premerge_centrum);
if (qh postmerge_cos < REALmax/2) fprintf (fp, "\
%6.2g max. cosine for post-merge angle\n", qh postmerge_cos);
if (qh POSTmerge) fprintf (fp, "\
%6.2g radius of post-merge centrum\n", qh postmerge_centrum);
fprintf (fp, "\
%6.2g max. distance for merging two simplicial facets\n\
%6.2g max. roundoff error for arithmetic operations\n\
%6.2g min. denominator for divisions\n\
zero diagonal for Gauss: ", qh ONEmerge, REALepsilon, qh MINdenom);
for (k=0; k < qh hull_dim; k++)
fprintf (fp, "%6.2e ", qh NEARzero[k]);
fprintf (fp, "\n\n");
for (i=0 ; i < qhstat next; )
qh_printstats (fp, i, &i);
} /* printstatistics */
#endif /* qh_KEEPstatistics */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="printstatlevel">-</a>
qh_printstatlevel( fp, id )
print level information for a statistic
notes:
nop if id >= ZEND, printed, or same as initial value
*/
void qh_printstatlevel (FILE *fp, int id, int start) {
#define NULLfield " "
if (id >= ZEND || qhstat printed[id])
return;
if (qhstat type[id] == zdoc) {
fprintf (fp, "%s\n", qhstat doc[id]);
return;
}
start= 0; /* not used */
if (qh_nostatistic(id) || !qhstat doc[id])
return;
qhstat printed[id]= True;
if (qhstat count[id] != -1
&& qhstat stats[(unsigned char)(qhstat count[id])].i == 0)
fprintf (fp, " *0 cnt*");
else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] == -1)
fprintf (fp, "%7.2g", qhstat stats[id].r);
else if (qhstat type[id] >= ZTYPEreal && qhstat count[id] != -1)
fprintf (fp, "%7.2g", qhstat stats[id].r/ qhstat stats[(unsigned char)(qhstat count[id])].i);
else if (qhstat type[id] < ZTYPEreal && qhstat count[id] == -1)
fprintf (fp, "%7d", qhstat stats[id].i);
else if (qhstat type[id] < ZTYPEreal && qhstat count[id] != -1)
fprintf (fp, "%7.3g", (realT) qhstat stats[id].i / qhstat stats[(unsigned char)(qhstat count[id])].i);
fprintf (fp, " %s\n", qhstat doc[id]);
} /* printstatlevel */
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="printstats">-</a>
qh_printstats( fp, index, nextindex )
print statistics for a zdoc group
returns:
next zdoc if non-null
*/
void qh_printstats (FILE *fp, int index, int *nextindex) {
int j, nexti;
if (qh_newstats (index, &nexti)) {
fprintf (fp, "\n");
for (j=index; j<nexti; j++)
qh_printstatlevel (fp, qhstat id[j], 0);
}
if (nextindex)
*nextindex= nexti;
} /* printstats */
#if qh_KEEPstatistics
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="stddev">-</a>
qh_stddev( num, tot, tot2, ave )
compute the standard deviation and average from statistics
tot2 is the sum of the squares
notes:
computes r.m.s.:
(x-ave)^2
== x^2 - 2x tot/num + (tot/num)^2
== tot2 - 2 tot tot/num + tot tot/num
== tot2 - tot ave
*/
realT qh_stddev (int num, realT tot, realT tot2, realT *ave) {
realT stddev;
*ave= tot/num;
stddev= sqrt (tot2/num - *ave * *ave);
return stddev;
} /* stddev */
#endif /* qh_KEEPstatistics */
#if !qh_KEEPstatistics
void qh_collectstatistics (void) {}
void qh_printallstatistics (FILE *fp, char *string) {};
void qh_printstatistics (FILE *fp, char *string) {}
#endif

View File

@ -1,520 +0,0 @@
/*<html><pre> -<a href="qh-stat.htm"
>-------------------------------</a><a name="TOP">-</a>
stat.h
contains all statistics that are collected for qhull
see qh-stat.htm and stat.c
copyright (c) 1993-2002, The Geometry Center
recompile qhull if you change this file
Integer statistics are Z* while real statistics are W*.
define maydebugx to call a routine at every statistic event
*/
#ifndef qhDEFstat
#define qhDEFstat 1
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="KEEPstatistics">-</a>
qh_KEEPstatistics
0 turns off statistic gathering (except zzdef/zzinc/zzadd/zzval/wwval)
*/
#ifndef qh_KEEPstatistics
#define qh_KEEPstatistics 1
#endif
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="statistics">-</a>
Zxxx for integers, Wxxx for reals
notes:
be sure that all statistics are defined in stat.c
otherwise initialization may core dump
can pick up all statistics by:
grep '[zw].*_[(][ZW]' *.c >z.x
remove trailers with query">-</a>
remove leaders with query-replace-regexp [ ^I]+ (
*/
#if qh_KEEPstatistics
enum statistics { /* alphabetical after Z/W */
Zacoplanar,
Wacoplanarmax,
Wacoplanartot,
Zangle,
Wangle,
Wanglemax,
Wanglemin,
Zangletests,
Wareatot,
Wareamax,
Wareamin,
Zavoidold,
Wavoidoldmax,
Wavoidoldtot,
Zback0,
Zbestcentrum,
Zbestdist,
Zcentrumtests,
Zcheckpart,
Zcomputefurthest,
Zconcave,
Wconcavemax,
Wconcavetot,
Zconcaveridges,
Zconcaveridge,
Zcoplanar,
Wcoplanarmax,
Wcoplanartot,
Zcoplanarangle,
Zcoplanarcentrum,
Zcoplanarhorizon,
Zcoplanarinside,
Zcoplanarpart,
Zcoplanarridges,
Wcpu,
Zcyclefacetmax,
Zcyclefacettot,
Zcyclehorizon,
Zcyclevertex,
Zdegen,
Wdegenmax,
Wdegentot,
Zdegenvertex,
Zdelfacetdup,
Zdelridge,
Zdelvertextot,
Zdelvertexmax,
Zdetsimplex,
Zdistcheck,
Zdistconvex,
Zdistgood,
Zdistio,
Zdistplane,
Zdiststat,
Zdistvertex,
Zdistzero,
Zdoc1,
Zdoc2,
Zdoc3,
Zdoc4,
Zdoc5,
Zdoc6,
Zdoc7,
Zdoc8,
Zdoc9,
Zdoc10,
Zdoc11,
Zdoc12,
Zdropdegen,
Zdropneighbor,
Zdupflip,
Zduplicate,
Wduplicatemax,
Wduplicatetot,
Zdupridge,
Zdupsame,
Zflipped,
Wflippedmax,
Wflippedtot,
Zflippedfacets,
Zfindbest,
Zfindbestmax,
Zfindbesttot,
Zfindcoplanar,
Zfindfail,
Zfindhorizon,
Zfindhorizonmax,
Zfindhorizontot,
Zfindjump,
Zfindnew,
Zfindnewmax,
Zfindnewtot,
Zfindnewjump,
Zfindnewsharp,
Zgauss0,
Zgoodfacet,
Zhashlookup,
Zhashridge,
Zhashridgetest,
Zhashtests,
Zinsidevisible,
Zintersect,
Zintersectfail,
Zintersectmax,
Zintersectnum,
Zintersecttot,
Zmaxneighbors,
Wmaxout,
Wmaxoutside,
Zmaxridges,
Zmaxvertex,
Zmaxvertices,
Zmaxvneighbors,
Zmemfacets,
Zmempoints,
Zmemridges,
Zmemvertices,
Zmergeflipdup,
Zmergehorizon,
Zmergeinittot,
Zmergeinitmax,
Zmergeinittot2,
Zmergeintohorizon,
Zmergenew,
Zmergesettot,
Zmergesetmax,
Zmergesettot2,
Zmergesimplex,
Zmergevertex,
Wmindenom,
Wminvertex,
Zminnorm,
Zmultiridge,
Znearlysingular,
Zneighbor,
Wnewbalance,
Wnewbalance2,
Znewfacettot,
Znewfacetmax,
Znewvertex,
Wnewvertex,
Wnewvertexmax,
Znoarea,
Znonsimplicial,
Znowsimplicial,
Znotgood,
Znotgoodnew,
Znotmax,
Znumfacets,
Znummergemax,
Znummergetot,
Znumneighbors,
Znumridges,
Znumvertices,
Znumvisibility,
Znumvneighbors,
Zonehorizon,
Zpartangle,
Zpartcoplanar,
Zpartflip,
Zparthorizon,
Zpartinside,
Zpartition,
Zpartitionall,
Zpartnear,
Zpbalance,
Wpbalance,
Wpbalance2,
Zpostfacets,
Zpremergetot,
Zprocessed,
Zremvertex,
Zremvertexdel,
Zrenameall,
Zrenamepinch,
Zrenameshare,
Zretry,
Wretrymax,
Zridge,
Wridge,
Wridgemax,
Zridge0,
Wridge0,
Wridge0max,
Zridgemid,
Wridgemid,
Wridgemidmax,
Zridgeok,
Wridgeok,
Wridgeokmax,
Zsearchpoints,
Zsetplane,
Ztestvneighbor,
Ztotcheck,
Ztothorizon,
Ztotmerge,
Ztotpartcoplanar,
Ztotpartition,
Ztotridges,
Ztotvertices,
Ztotvisible,
Ztricoplanar,
Ztricoplanarmax,
Ztricoplanartot,
Ztridegen,
Ztrimirror,
Ztrinull,
Wvertexmax,
Wvertexmin,
Zvertexridge,
Zvertexridgetot,
Zvertexridgemax,
Zvertices,
Zvisfacettot,
Zvisfacetmax,
Zvisvertextot,
Zvisvertexmax,
Zwidefacet,
Zwidevertices,
ZEND};
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="ZZstat">-</a>
Zxxx/Wxxx statistics that remain defined if qh_KEEPstatistics=0
notes:
be sure to use zzdef, zzinc, etc. with these statistics (no double checking!)
*/
#else
enum statistics { /* for zzdef etc. macros */
Zback0,
Zbestdist,
Zcentrumtests,
Zcheckpart,
Zconcaveridges,
Zcoplanarhorizon,
Zcoplanarpart,
Zcoplanarridges,
Zcyclefacettot,
Zcyclehorizon,
Zdelvertextot,
Zdistcheck,
Zdistconvex,
Zdistzero,
Zdoc1,
Zdoc2,
Zdoc3,
Zdoc11,
Zflippedfacets,
Zgauss0,
Zminnorm,
Zmultiridge,
Znearlysingular,
Wnewvertexmax,
Znumvisibility,
Zpartcoplanar,
Zpartition,
Zpartitionall,
Zprocessed,
Zretry,
Zridge,
Wridge,
Wridgemax,
Zridge0,
Wridge0,
Wridge0max,
Zridgemid,
Wridgemid,
Wridgemidmax,
Zridgeok,
Wridgeok,
Wridgeokmax,
Zsetplane,
Ztotmerge,
ZEND};
#endif
/*-<a href="qh-stat.htm#TOC"
>-------------------------------</a><a name="ztype">-</a>
ztype
the type of a statistic sets its initial value.
notes:
The type should be the same as the macro for collecting the statistic
*/
enum ztypes {zdoc,zinc,zadd,zmax,zmin,ZTYPEreal,wadd,wmax,wmin,ZTYPEend};
/*========== macros and constants =============*/
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="MAYdebugx">-</a>
MAYdebugx
define as maydebug() to be called frequently for error trapping
*/
#define MAYdebugx
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zdef_">-</a>
zzdef_, zdef_( type, name, doc, -1)
define a statistic (assumes 'qhstat.next= 0;')
zdef_( type, name, doc, count)
define an averaged statistic
printed as name/count
*/
#define zzdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
#if qh_KEEPstatistics
#define zdef_(stype,name,string,cnt) qhstat id[qhstat next++]=name; \
qhstat doc[name]= string; qhstat count[name]= cnt; qhstat type[name]= stype
#else
#define zdef_(type,name,doc,count)
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zinc_">-</a>
zzinc_( name ), zinc_( name)
increment an integer statistic
*/
#define zzinc_(id) {MAYdebugx; qhstat stats[id].i++;}
#if qh_KEEPstatistics
#define zinc_(id) {MAYdebugx; qhstat stats[id].i++;}
#else
#define zinc_(id) {}
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zadd_">-</a>
zzadd_( name, value ), zadd_( name, value ), wadd_( name, value )
add value to an integer or real statistic
*/
#define zzadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
#define wwadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
#if qh_KEEPstatistics
#define zadd_(id, val) {MAYdebugx; qhstat stats[id].i += (val);}
#define wadd_(id, val) {MAYdebugx; qhstat stats[id].r += (val);}
#else
#define zadd_(id, val) {}
#define wadd_(id, val) {}
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zval_">-</a>
zzval_( name ), zval_( name ), wwval_( name )
set or return value of a statistic
*/
#define zzval_(id) ((qhstat stats[id]).i)
#define wwval_(id) ((qhstat stats[id]).r)
#if qh_KEEPstatistics
#define zval_(id) ((qhstat stats[id]).i)
#define wval_(id) ((qhstat stats[id]).r)
#else
#define zval_(id) qhstat tempi
#define wval_(id) qhstat tempr
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zmax_">-</a>
zmax_( id, val ), wmax_( id, value )
maximize id with val
*/
#define wwmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
#if qh_KEEPstatistics
#define zmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].i,(val));}
#define wmax_(id, val) {MAYdebugx; maximize_(qhstat stats[id].r,(val));}
#else
#define zmax_(id, val) {}
#define wmax_(id, val) {}
#endif
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="zmin_">-</a>
zmin_( id, val ), wmin_( id, value )
minimize id with val
*/
#if qh_KEEPstatistics
#define zmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].i,(val));}
#define wmin_(id, val) {MAYdebugx; minimize_(qhstat stats[id].r,(val));}
#else
#define zmin_(id, val) {}
#define wmin_(id, val) {}
#endif
/*================== stat.h types ==============*/
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="intrealT">-</a>
intrealT
union of integer and real, used for statistics
*/
typedef union intrealT intrealT; /* union of int and realT */
union intrealT {
int i;
realT r;
};
/*-<a href="qh-stat.htm#TOC"
>--------------------------------</a><a name="qhstat">-</a>
qhstat
global data structure for statistics
notes:
access to qh_qhstat is via the "qhstat" macro. There are two choices
qh_QHpointer = 1 access globals via a pointer
enables qh_saveqhull() and qh_restoreqhull()
= 0 qh_qhstat is a static data structure
only one instance of qhull() can be active at a time
default value
qh_QHpointer is defined in qhull.h
allocated in stat.c
*/
typedef struct qhstatT qhstatT;
#if qh_QHpointer
#define qhstat qh_qhstat->
extern qhstatT *qh_qhstat;
#else
#define qhstat qh_qhstat.
extern qhstatT qh_qhstat;
#endif
struct qhstatT {
intrealT stats[ZEND]; /* integer and real statistics */
unsigned char id[ZEND+10]; /* id's in print order */
char *doc[ZEND]; /* array of documentation strings */
short int count[ZEND]; /* -1 if none, else index of count to use */
char type[ZEND]; /* type, see ztypes above */
char printed[ZEND]; /* true, if statistic has been printed */
intrealT init[ZTYPEend]; /* initial values by types, set initstatistics */
int next; /* next index for zdef_ */
int precision; /* index for precision problems */
int vridges; /* index for Voronoi ridges */
int tempi;
realT tempr;
};
/*========== function prototypes ===========*/
void qh_allstatA(void);
void qh_allstatB(void);
void qh_allstatC(void);
void qh_allstatD(void);
void qh_allstatE(void);
void qh_allstatE2(void);
void qh_allstatF(void);
void qh_allstatG(void);
void qh_allstatH(void);
void qh_allstatI(void);
void qh_allstatistics (void);
void qh_collectstatistics (void);
void qh_freestatistics (void);
void qh_initstatistics (void);
boolT qh_newstats (int index, int *nextindex);
boolT qh_nostatistic (int i);
void qh_printallstatistics (FILE *fp, char *string);
void qh_printstatistics (FILE *fp, char *string);
void qh_printstatlevel (FILE *fp, int id, int start);
void qh_printstats (FILE *fp, int index, int *nextindex);
realT qh_stddev (int num, realT tot, realT tot2, realT *ave);
#endif /* qhDEFstat */

View File

@ -1,376 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
unix.c
command line interface to qhull
includes SIOUX interface for Macintoshes
see qh-qhull.htm
copyright (c) 1993-2002, The Geometry Center
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "qhull.h"
#include "mem.h"
#include "qset.h"
#if __MWERKS__ && __POWERPC__
#include <SIOUX.h>
#include <Files.h>
#include <console.h>
#include <Desk.h>
#elif __cplusplus
extern "C" {
int isatty (int);
}
#elif _MSC_VER
#include <io.h>
#define isatty _isatty
#else
int isatty (int); /* returns 1 if stdin is a tty
if "Undefined symbol" this can be deleted along with call in main() */
#endif
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt">-</a>
qh_prompt
long prompt for qhull
see:
concise prompt below
*/
char qh_prompta[]= "\n\
qhull- compute convex hulls and related structures.\n\
http://www.geom.umn.edu/software/qhull %s\n\
\n\
input (stdin):\n\
first lines: dimension and number of points (or vice-versa).\n\
other lines: point coordinates, best if one point per line\n\
comments: start with a non-numeric character\n\
halfspaces: use dim plus one and put offset after coefficients.\n\
May be preceeded by a single interior point ('H').\n\
\n\
options:\n\
d - Delaunay triangulation by lifting points to a paraboloid\n\
d Qu - furthest-site Delaunay triangulation (upper convex hull)\n\
v - Voronoi diagram (dual of the Delaunay triangulation)\n\
v Qu - furthest-site Voronoi diagram\n\
Hn,n,... - halfspace intersection about point [n,n,0,...]\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Qc - keep coplanar points with nearest facet\n\
Qi - keep interior points with nearest facet\n\
\n\
Qhull control options:\n\
Qbk:n - scale coord k so that low bound is n\n\
QBk:n - scale coord k so that upper bound is n (QBk is %2.2g)\n\
QbB - scale input to unit cube centered at the origin\n\
Qbb - scale last coordinate to [0,m] for Delaunay triangulations\n\
Qbk:0Bk:0 - remove k-th coordinate from input\n\
QJn - randomly joggle input in range [-n,n]\n\
QRn - random rotation (n=seed, n=0 time, n=-1 time/no rotate)\n\
%s%s%s%s"; /* split up qh_prompt for Visual C++ */
char qh_promptb[]= "\
Qf - partition point to furthest outside facet\n\
Qg - only build good facets (needs 'QGn', 'QVn', or 'PdD')\n\
Qm - only process points that would increase max_outside\n\
Qr - process random outside points instead of furthest ones\n\
Qs - search all points for the initial simplex\n\
Qu - for 'd' or 'v', compute upper hull without point at-infinity\n\
returns furthest-site Delaunay triangulation\n\
Qv - test vertex neighbors for convexity\n\
Qx - exact pre-merges (skips coplanar and angle-coplanar facets)\n\
Qz - add point-at-infinity to Delaunay triangulation\n\
QGn - good facet if visible from point n, -n for not visible\n\
QVn - good facet if it includes point n, -n if not\n\
Q0 - turn off default premerge with 'C-0'/'Qx'\n\
Q1 - sort merges by type instead of angle\n\
Q2 - merge all non-convex at once instead of independent sets\n\
Q3 - do not merge redundant vertices\n\
Q4 - avoid old->new merges\n\
Q5 - do not correct outer planes at end of qhull\n\
Q6 - do not pre-merge concave or coplanar facets\n\
Q7 - depth-first processing instead of breadth-first\n\
Q8 - do not process near-inside points\n\
Q9 - process furthest of furthest points\n\
Q10 - no special processing for narrow distributions\n\
Q11 - copy normals and recompute centrums for tricoplanar facets\n\
\n\
";
char qh_promptc[]= "\
Topts- Trace options:\n\
T4 - trace at level n, 4=all, 5=mem/gauss, -1= events\n\
Tc - check frequently during execution\n\
Ts - print statistics\n\
Tv - verify result: structure, convexity, and point inclusion\n\
Tz - send all output to stdout\n\
TFn - report summary when n or more facets created\n\
TI file - input data from file, no spaces or single quotes\n\
TO file - output results to file, may be enclosed in single quotes\n\
TPn - turn on tracing when point n added to hull\n\
TMn - turn on tracing at merge n\n\
TWn - trace merge facets when width > n\n\
TRn - rerun qhull n times. Use with 'QJn'\n\
TVn - stop qhull after adding point n, -n for before (see TCn)\n\
TCn - stop qhull after building cone for point n (see TVn)\n\
\n\
Precision options:\n\
Cn - radius of centrum (roundoff added). Merge facets if non-convex\n\
An - cosine of maximum angle. Merge facets if cosine > n or non-convex\n\
C-0 roundoff, A-0.99/C-0.01 pre-merge, A0.99/C0.01 post-merge\n\
En - max roundoff error for distance computation\n\
Rn - randomly perturb computations by a factor of [1-n,1+n]\n\
Vn - min distance above plane for a visible facet (default 3C-n or En)\n\
Un - max distance below plane for a new, coplanar point (default Vn)\n\
Wn - min facet width for outside point (before roundoff, default 2Vn)\n\
\n\
Output formats (may be combined; if none, produces a summary to stdout):\n\
f - facet dump\n\
G - Geomview output (see below)\n\
i - vertices incident to each facet\n\
m - Mathematica output (2-d and 3-d)\n\
o - OFF format (dim, points and facets; Voronoi regions)\n\
n - normals with offsets\n\
p - vertex coordinates or Voronoi vertices (coplanar points if 'Qc')\n\
s - summary (stderr)\n\
\n\
";
char qh_promptd[]= "\
More formats:\n\
Fa - area for each facet\n\
FA - compute total area and volume for option 's'\n\
Fc - count plus coplanar points for each facet\n\
use 'Qc' (default) for coplanar and 'Qi' for interior\n\
FC - centrum or Voronoi center for each facet\n\
Fd - use cdd format for input (homogeneous with offset first)\n\
FD - use cdd format for numeric output (offset first)\n\
FF - facet dump without ridges\n\
Fi - inner plane for each facet\n\
for 'v', separating hyperplanes for bounded Voronoi regions\n\
FI - ID of each facet\n\
Fm - merge count for each facet (511 max)\n\
Fn - count plus neighboring facets for each facet\n\
FN - count plus neighboring facets for each point\n\
Fo - outer plane (or max_outside) for each facet\n\
for 'v', separating hyperplanes for unbounded Voronoi regions\n\
FO - options and precision constants\n\
Fp - dim, count, and intersection coordinates (halfspace only)\n\
FP - nearest vertex and distance for each coplanar point\n\
FQ - command used for qhull\n\
Fs - summary: #int (8), dimension, #points, tot vertices, tot facets,\n\
output: #vertices, #facets, #coplanars, #nonsimplicial\n\
#real (2), max outer plane, min vertex\n\
FS - sizes: #int (0)\n\
#real(2) tot area, tot volume\n\
Ft - triangulation with centrums for non-simplicial facets (OFF format)\n\
Fv - count plus vertices for each facet\n\
for 'v', Voronoi diagram as Voronoi vertices for pairs of sites\n\
FV - average of vertices (a feasible point for 'H')\n\
Fx - extreme points (in order for 2-d)\n\
\n\
";
char qh_prompte[]= "\
Geomview options (2-d, 3-d, and 4-d; 2-d Voronoi)\n\
Ga - all points as dots\n\
Gp - coplanar points and vertices as radii\n\
Gv - vertices as spheres\n\
Gi - inner planes only\n\
Gn - no planes\n\
Go - outer planes only\n\
Gc - centrums\n\
Gh - hyperplane intersections\n\
Gr - ridges\n\
GDn - drop dimension n in 3-d and 4-d output\n\
Gt - for 3-d 'd', transparent outer ridges\n\
\n\
Print options:\n\
PAn - keep n largest facets by area\n\
Pdk:n - drop facet if normal[k] <= n (default 0.0)\n\
PDk:n - drop facet if normal[k] >= n\n\
Pg - print good facets (needs 'QGn' or 'QVn')\n\
PFn - keep facets whose area is at least n\n\
PG - print neighbors of good facets\n\
PMn - keep n facets with most merges\n\
Po - force output. If error, output neighborhood of facet\n\
Pp - do not report precision problems\n\
\n\
. - list of all options\n\
- - one line descriptions of all options\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt2">-</a>
qh_prompt2
synopsis for qhull
*/
char qh_prompt2[]= "\n\
qhull- compute convex hulls and related structures. %s\n\
input (stdin): dimension, n, point coordinates\n\
comments start with a non-numeric character\n\
halfspace: use dim+1 and put offsets after coefficients\n\
\n\
options (qh-quick.htm):\n\
d - Delaunay triangulation by lifting points to a paraboloid\n\
d Qu - furthest-site Delaunay triangulation (upper convex hull)\n\
v - Voronoi diagram as the dual of the Delaunay triangulation\n\
v Qu - furthest-site Voronoi diagram\n\
H1,1 - Halfspace intersection about [1,1,0,...] via polar duality\n\
Qt - triangulated output\n\
QJ - joggled input instead of merged facets\n\
Tv - verify result: structure, convexity, and point inclusion\n\
. - concise list of all options\n\
- - one-line description of all options\n\
\n\
Output options (subset):\n\
s - summary of results (default)\n\
i - vertices incident to each facet\n\
n - normals with offsets\n\
p - vertex coordinates (if 'Qc', includes coplanar points)\n\
if 'v', Voronoi vertices\n\
Fp - halfspace intersections\n\
Fx - extreme points (convex hull vertices)\n\
FA - compute total area and volume\n\
o - OFF format (if 'v', outputs Voronoi regions)\n\
G - Geomview output (2-d, 3-d and 4-d)\n\
m - Mathematica output (2-d and 3-d)\n\
QVn - print facets that include point n, -n if not\n\
TO file- output results to file, may be enclosed in single quotes\n\
\n\
examples:\n\
rbox c d D2 | qhull Qc s f Fx | more rbox 1000 s | qhull Tv s FA\n\
rbox 10 D2 | qhull d QJ s i TO result rbox 10 D2 | qhull v QJ p\n\
rbox 10 D2 | qhull d Qu QJ m rbox 10 D2 | qhull v Qu QJ o\n\
rbox c | qhull n rbox c | qhull FV n | qhull H Fp\n\
rbox d D12 | qhull QR0 FA rbox c D7 | qhull FA TF1000\n\
rbox y 1000 W0 | qhull rbox 10 | qhull v QJ o Fv\n\
\n\
";
/* for opts, don't assign 'e' or 'E' to a flag (already used for exponent) */
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="prompt3">-</a>
qh_prompt3
concise prompt for qhull
*/
char qh_prompt3[]= "\n\
Qhull %s.\n\
Except for 'F.' and 'PG', upper-case options take an argument.\n\
\n\
delaunay voronoi Geomview Halfspace facet_dump\n\
incidences mathematica normals OFF_format points\n\
summary\n\
\n\
Farea FArea-total Fcoplanars FCentrums Fd-cdd-in\n\
FD-cdd-out FF-dump-xridge Finner FIDs Fmerges\n\
Fneighbors FNeigh-vertex Fouter FOptions Fpoint-intersect\n\
FPoint_near FQhull Fsummary FSize Ftriangles\n\
Fvertices Fvoronoi FVertex-ave Fxtremes\n\
\n\
Gvertices Gpoints Gall_points Gno_planes Ginner\n\
Gcentrums Ghyperplanes Gridges Gouter GDrop_dim\n\
Gtransparent\n\
\n\
PArea-keep Pdrop d0:0D0 Pgood PFacet_area_keep\n\
PGood_neighbors PMerge-keep Poutput_forced Pprecision_not\n\
\n\
QbBound 0:0.5 Qbk:0Bk:0_drop QbB-scale-box Qbb-scale-last Qcoplanar\n\
Qfurthest Qgood_only QGood_point Qinterior Qmax_out\n\
QJoggle Qrandom QRotate Qsearch_1st Qtriangulate\n\
QupperDelaunay QVertex_good Qvneighbors Qxact_merge Qzinfinite\n\
\n\
Q0_no_premerge Q1_no_angle Q2_no_independ Q3_no_redundant Q4_no_old\n\
Q5_no_check_out Q6_no_concave Q7_depth_first Q8_no_near_in Q9_pick_furthest\n\
Q10_no_narrow Q11_trinormals\n\
\n\
T4_trace Tcheck_often Tstatistics Tverify Tz_stdout\n\
TFacet_log TInput_file TPoint_trace TMerge_trace TOutput_file\n\
TRerun TWide_trace TVertex_stop TCone_stop\n\
\n\
Angle_max Centrum_size Error_round Random_dist Visible_min\n\
Ucoplanar_max Wide_outside\n\
";
/*-<a href="qh-qhull.htm#TOC"
>-------------------------------</a><a name="main">-</a>
main( argc, argv )
processes the command line, calls qhull() to do the work, and exits
design:
initializes data structures
reads points
finishes initialization
computes convex hull and other structures
checks the result
writes the output
frees memory
*/
int main(int argc, char *argv[]) {
int curlong, totlong; /* used !qh_NOmem */
int exitcode, numpoints, dim;
coordT *points;
boolT ismalloc;
#if __MWERKS__ && __POWERPC__
char inBuf[BUFSIZ], outBuf[BUFSIZ], errBuf[BUFSIZ];
SIOUXSettings.showstatusline= false;
SIOUXSettings.tabspaces= 1;
SIOUXSettings.rows= 40;
if (setvbuf (stdin, inBuf, _IOFBF, sizeof(inBuf)) < 0 /* w/o, SIOUX I/O is slow*/
|| setvbuf (stdout, outBuf, _IOFBF, sizeof(outBuf)) < 0
|| (stdout != stderr && setvbuf (stderr, errBuf, _IOFBF, sizeof(errBuf)) < 0))
fprintf (stderr, "qhull internal warning (main): could not change stdio to fully buffered.\n");
argc= ccommand(&argv);
#endif
if ((argc == 1) && isatty( 0 /*stdin*/)) {
fprintf(stdout, qh_prompt2, qh_VERSION);
exit(qh_ERRnone);
}
if (argc > 1 && *argv[1] == '-' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompta, qh_VERSION, qh_DEFAULTbox,
qh_promptb, qh_promptc, qh_promptd, qh_prompte);
exit(qh_ERRnone);
}
if (argc >1 && *argv[1] == '.' && !*(argv[1]+1)) {
fprintf(stdout, qh_prompt3, qh_VERSION);
exit(qh_ERRnone);
}
qh_init_A (stdin, stdout, stderr, argc, argv); /* sets qh qhull_command */
exitcode= setjmp (qh errexit); /* simple statement for CRAY J916 */
if (!exitcode) {
qh_initflags (qh qhull_command);
points= qh_readpoints (&numpoints, &dim, &ismalloc);
qh_init_B (points, numpoints, dim, ismalloc);
qh_qhull();
qh_check_output();
qh_produce_output();
if (qh VERIFYoutput && !qh FORCEoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points();
exitcode= qh_ERRnone;
}
qh NOerrexit= True; /* no more setjmp */
#ifdef qh_NOmem
qh_freeqhull( True);
#else
qh_freeqhull( False);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
#endif
return exitcode;
} /* main */

View File

@ -1,324 +0,0 @@
/*<html><pre> -<a href="qh-user.htm"
>-------------------------------</a><a name="TOP">-</a>
user.c
user redefinable functions
see README.txt see COPYING.txt for copyright information.
see qhull.h for data structures, macros, and user-callable functions.
see user_eg.c, unix.c, and qhull_interface.cpp for examples.
see user.h for user-definable constants
use qh_NOmem in mem.h to turn off memory management
use qh_NOmerge in user.h to turn off facet merging
set qh_KEEPstatistics in user.h to 0 to turn off statistics
This is unsupported software. You're welcome to make changes,
but you're on your own if something goes wrong. Use 'Tc' to
check frequently. Usually qhull will report an error if
a data structure becomes inconsistent. If so, it also reports
the last point added to the hull, e.g., 102. You can then trace
the execution of qhull with "T4P102".
Please report any errors that you fix to qhull@geom.umn.edu
call_qhull is a template for calling qhull from within your application
if you recompile and load this module, then user.o will not be loaded
from qhull.a
you can add additional quick allocation sizes in qh_user_memsizes
if the other functions here are redefined to not use qh_print...,
then io.o will not be loaded from qhull.a. See user_eg.c for an
example. We recommend keeping io.o for the extra debugging
information it supplies.
*/
#include "qhull_a.h"
/*-<a href="qh-user.htm#TOC"
>-------------------------------</a><a name="call_qhull">-</a>
qh_call_qhull( void )
template for calling qhull from inside your program
remove #if 0, #endif to compile
returns:
exit code (see qh_ERR... in qhull.h)
all memory freed
notes:
This can be called any number of times.
see:
qh_call_qhull_once()
*/
#if 0
{
int dim; /* dimension of points */
int numpoints; /* number of points */
coordT *points; /* array of coordinates for each point */
boolT ismalloc; /* True if qhull should free points in qh_freeqhull() or reallocation */
char flags[]= "qhull Tv"; /* option flags for qhull, see qh_opt.htm */
FILE *outfile= stdout; /* output from qh_produce_output()
use NULL to skip qh_produce_output() */
FILE *errfile= stderr; /* error messages from qhull code */
int exitcode; /* 0 if no error from qhull */
facetT *facet; /* set by FORALLfacets */
int curlong, totlong; /* memory remaining after qh_memfreeshort */
/* initialize dim, numpoints, points[], ismalloc here */
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
flags, outfile, errfile);
if (!exitcode) { /* if no error */
/* 'qh facet_list' contains the convex hull */
FORALLfacets {
/* ... your code ... */
}
}
qh_freeqhull(!qh_ALL);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong)
fprintf (errfile, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
}
#endif
/*-<a href="qh-user.htm#TOC"
>-------------------------------</a><a name="new_qhull">-</a>
qh_new_qhull( dim, numpoints, points, ismalloc, qhull_cmd, outfile, errfile )
build new qhull data structure and return exitcode (0 if no errors)
notes:
do not modify points until finished with results.
The qhull data structure contains pointers into the points array.
do not call qhull functions before qh_new_qhull().
The qhull data structure is not initialized until qh_new_qhull().
outfile may be null
qhull_cmd must start with "qhull "
projects points to a new point array for Delaunay triangulations ('d' and 'v')
transforms points into a new point array for halfspace intersection ('H')
To allow multiple, concurrent calls to qhull()
- set qh_QHpointer in user.h
- use qh_save_qhull and qh_restore_qhull to swap the global data structure between calls.
- use qh_freeqhull(qh_ALL) to free intermediate convex hulls
see:
user_eg.c for an example
*/
int qh_new_qhull (int dim, int numpoints, coordT *points, boolT ismalloc,
char *qhull_cmd, FILE *outfile, FILE *errfile) {
int exitcode, hulldim;
boolT new_ismalloc;
static boolT firstcall = True;
coordT *new_points;
if (firstcall) {
qh_meminit (errfile);
firstcall= False;
}
if (strncmp (qhull_cmd,"qhull ", 6)) {
fprintf (errfile, "qh_new_qhull: start qhull_cmd argument with \"qhull \"\n");
exit(1);
}
qh_initqhull_start (NULL, outfile, errfile);
trace1(( qh ferr, "qh_new_qhull: build new Qhull for %d %d-d points with %s\n", numpoints, dim, qhull_cmd));
exitcode = setjmp (qh errexit);
if (!exitcode)
{
qh NOerrexit = False;
qh_initflags (qhull_cmd);
if (qh DELAUNAY)
qh PROJECTdelaunay= True;
if (qh HALFspace) {
/* points is an array of halfspaces,
the last coordinate of each halfspace is its offset */
hulldim= dim-1;
qh_setfeasible (hulldim);
new_points= qh_sethalfspace_all (dim, numpoints, points, qh feasible_point);
new_ismalloc= True;
if (ismalloc)
free (points);
}else {
hulldim= dim;
new_points= points;
new_ismalloc= ismalloc;
}
qh_init_B (new_points, numpoints, hulldim, new_ismalloc);
qh_qhull();
qh_check_output();
if (outfile)
qh_produce_output();
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points();
}
qh NOerrexit = True;
return exitcode;
} /* new_qhull */
/*-<a href="qh-user.htm#TOC"
>-------------------------------</a><a name="errexit">-</a>
qh_errexit( exitcode, facet, ridge )
report and exit from an error
report facet and ridge if non-NULL
reports useful information such as last point processed
set qh.FORCEoutput to print neighborhood of facet
see:
qh_errexit2() in qhull.c for printing 2 facets
design:
check for error within error processing
compute qh.hulltime
print facet and ridge (if any)
report commandString, options, qh.furthest_id
print summary and statistics (including precision statistics)
if qh_ERRsingular
print help text for singular data set
exit program via long jump (if defined) or exit()
*/
void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) {
if (qh ERREXITcalled) {
fprintf (qh ferr, "\nqhull error while processing previous error. Exit program\n");
exit(1);
}
qh ERREXITcalled= True;
if (!qh QHULLfinished)
qh hulltime= qh_CPUclock - qh hulltime;
qh_errprint("ERRONEOUS", facet, NULL, ridge, NULL);
fprintf (qh ferr, "\nWhile executing: %s | %s\n", qh rbox_command, qh qhull_command);
fprintf(qh ferr, "Options selected for Qhull %s:\n%s\n", qh_VERSION, qh qhull_options);
if (qh furthest_id >= 0) {
fprintf(qh ferr, "Last point added to hull was p%d.", qh furthest_id);
if (zzval_(Ztotmerge))
fprintf(qh ferr, " Last merge was #%d.", zzval_(Ztotmerge));
if (qh QHULLfinished)
fprintf(qh ferr, "\nQhull has finished constructing the hull.");
else if (qh POSTmerging)
fprintf(qh ferr, "\nQhull has started post-merging.");
fprintf (qh ferr, "\n");
}
if (qh FORCEoutput && (qh QHULLfinished || (!facet && !ridge)))
qh_produce_output();
else {
if (exitcode != qh_ERRsingular && zzval_(Zsetplane) > qh hull_dim+1) {
fprintf (qh ferr, "\nAt error exit:\n");
qh_printsummary (qh ferr);
if (qh PRINTstatistics) {
qh_collectstatistics();
qh_printstatistics(qh ferr, "at error exit");
qh_memstatistics (qh ferr);
}
}
if (qh PRINTprecision)
qh_printstats (qh ferr, qhstat precision, NULL);
}
if (!exitcode)
exitcode= qh_ERRqhull;
else if (exitcode == qh_ERRsingular)
qh_printhelp_singular(qh ferr);
else if (exitcode == qh_ERRprec && !qh PREmerge)
qh_printhelp_degenerate (qh ferr);
if (qh NOerrexit) {
fprintf (qh ferr, "qhull error while ending program. Exit program\n");
exit(1);
}
qh NOerrexit= True;
longjmp(qh errexit, exitcode);
} /* errexit */
/*-<a href="qh-user.htm#TOC"
>-------------------------------</a><a name="errprint">-</a>
qh_errprint( fp, string, atfacet, otherfacet, atridge, atvertex )
prints out the information of facets and ridges to fp
also prints neighbors and geomview output
notes:
except for string, any parameter may be NULL
*/
void qh_errprint(char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex) {
int i;
if (atfacet) {
fprintf(qh ferr, "%s FACET:\n", string);
qh_printfacet(qh ferr, atfacet);
}
if (otherfacet) {
fprintf(qh ferr, "%s OTHER FACET:\n", string);
qh_printfacet(qh ferr, otherfacet);
}
if (atridge) {
fprintf(qh ferr, "%s RIDGE:\n", string);
qh_printridge(qh ferr, atridge);
if (atridge->top && atridge->top != atfacet && atridge->top != otherfacet)
qh_printfacet(qh ferr, atridge->top);
if (atridge->bottom
&& atridge->bottom != atfacet && atridge->bottom != otherfacet)
qh_printfacet(qh ferr, atridge->bottom);
if (!atfacet)
atfacet= atridge->top;
if (!otherfacet)
otherfacet= otherfacet_(atridge, atfacet);
}
if (atvertex) {
fprintf(qh ferr, "%s VERTEX:\n", string);
qh_printvertex (qh ferr, atvertex);
}
if (qh fout && qh FORCEoutput && atfacet && !qh QHULLfinished && !qh IStracing) {
fprintf(qh ferr, "ERRONEOUS and NEIGHBORING FACETS to output\n");
for (i= 0; i < qh_PRINTEND; i++) /* use fout for geomview output */
qh_printneighborhood (qh fout, qh PRINTout[i], atfacet, otherfacet,
!qh_ALL);
}
} /* errprint */
/*-<a href="qh-user.htm#TOC"
>-------------------------------</a><a name="printfacetlist">-</a>
qh_printfacetlist( fp, facetlist, facets, printall )
print all fields for a facet list and/or set of facets to fp
if !printall,
only prints good facets
notes:
also prints all vertices
*/
void qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall) {
facetT *facet, **facetp;
qh_printbegin (qh ferr, qh_PRINTfacets, facetlist, facets, printall);
FORALLfacet_(facetlist)
qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);
FOREACHfacet_(facets)
qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall);
qh_printend (qh ferr, qh_PRINTfacets, facetlist, facets, printall);
} /* printfacetlist */
/*-<a href="qh-globa.htm#TOC"
>-------------------------------</a><a name="user_memsizes">-</a>
qh_user_memsizes()
allocate up to 10 additional, quick allocation sizes
notes:
increase maximum number of allocations in qh_initqhull_mem()
*/
void qh_user_memsizes (void) {
/* qh_memsize (size); */
} /* user_memsizes */

View File

@ -1,762 +0,0 @@
/*<html><pre> -<a href="qh-user.htm"
>-------------------------------</a><a name="TOP">-</a>
user.h
user redefinable constants
see qh-user.htm. see COPYING for copyright information.
before reading any code, review qhull.h for data structure definitions and
the "qh" macro.
*/
#ifndef qhDEFuser
#define qhDEFuser 1
/*============= data types and configuration macros ==========*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="realT">-</a>
realT
set the size of floating point numbers
qh_REALdigits
maximimum number of significant digits
qh_REAL_1, qh_REAL_2n, qh_REAL_3n
format strings for printf
qh_REALmax, qh_REALmin
maximum and minimum (near zero) values
qh_REALepsilon
machine roundoff. Maximum roundoff error for addition and multiplication.
notes:
Select whether to store floating point numbers in single precision (float)
or double precision (double).
Use 'float' to save about 8% in time and 25% in space. This is particularly
help if high-d where convex hulls are space limited. Using 'float' also
reduces the printed size of Qhull's output since numbers have 8 digits of
precision.
Use 'double' when greater arithmetic precision is needed. This is needed
for Delaunay triangulations and Voronoi diagrams when you are not merging
facets.
If 'double' gives insufficient precision, your data probably includes
degeneracies. If so you should use facet merging (done by default)
or exact arithmetic (see imprecision section of manual, qh-impre.htm).
You may also use option 'Po' to force output despite precision errors.
You may use 'long double', but many format statements need to be changed
and you may need a 'long double' square root routine. S. Grundmann
(sg@eeiwzb.et.tu-dresden.de) has done this. He reports that the code runs
much slower with little gain in precision.
WARNING: on some machines, int f(){realT a= REALmax;return (a == REALmax);}
returns False. Use (a > REALmax/2) instead of (a == REALmax).
REALfloat = 1 all numbers are 'float' type
= 0 all numbers are 'double' type
*/
#define REALfloat 0
#if (REALfloat == 1)
#define realT float
#define REALmax FLT_MAX
#define REALmin FLT_MIN
#define REALepsilon FLT_EPSILON
#define qh_REALdigits 8 /* maximum number of significant digits */
#define qh_REAL_1 "%6.8g "
#define qh_REAL_2n "%6.8g %6.8g\n"
#define qh_REAL_3n "%6.8g %6.8g %6.8g\n"
#elif (REALfloat == 0)
#define realT double
#define REALmax DBL_MAX
#define REALmin DBL_MIN
#define REALepsilon DBL_EPSILON
#define qh_REALdigits 16 /* maximum number of significant digits */
#define qh_REAL_1 "%6.16g "
#define qh_REAL_2n "%6.16g %6.16g\n"
#define qh_REAL_3n "%6.16g %6.16g %6.16g\n"
#else
#error unknown float option
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="CPUclock">-</a>
qh_CPUclock
define the clock() function for reporting the total time spent by Qhull
returns CPU ticks as a 'long int'
qh_CPUclock is only used for reporting the total time spent by Qhull
qh_SECticks
the number of clock ticks per second
notes:
looks for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or assumes microseconds
to define a custom clock, set qh_CLOCKtype to 0
if your system does not use clock() to return CPU ticks, replace
qh_CPUclock with the corresponding function. It is converted
to unsigned long to prevent wrap-around during long runs.
Set qh_CLOCKtype to
1 for CLOCKS_PER_SEC, CLOCKS_PER_SECOND, or microsecond
Note: may fail if more than 1 hour elapsed time
2 use qh_clock() with POSIX times() (see global.c)
*/
#define qh_CLOCKtype 1 /* change to the desired number */
#if (qh_CLOCKtype == 1)
#if defined (CLOCKS_PER_SECOND)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLOCKS_PER_SECOND
#elif defined (CLOCKS_PER_SEC)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLOCKS_PER_SEC
#elif defined (CLK_TCK)
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks CLK_TCK
#else
#define qh_CPUclock ((unsigned long)clock()) /* return CPU clock */
#define qh_SECticks 1E6
#endif
#elif (qh_CLOCKtype == 2)
#define qh_CPUclock qh_clock() /* return CPU clock */
#define qh_SECticks 100
#else /* qh_CLOCKtype == ? */
#error unknown clock option
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="RANDOM">-</a>
qh_RANDOMtype, qh_RANDOMmax, qh_RANDOMseed
define random number generator
qh_RANDOMint generates a random integer between 0 and qh_RANDOMmax.
qh_RANDOMseed sets the random number seed for qh_RANDOMint
Set qh_RANDOMtype (default 5) to:
1 for random() with 31 bits (UCB)
2 for rand() with RAND_MAX or 15 bits (system 5)
3 for rand() with 31 bits (Sun)
4 for lrand48() with 31 bits (Solaris)
5 for qh_rand() with 31 bits (included with Qhull)
notes:
Random numbers are used by rbox to generate point sets. Random
numbers are used by Qhull to rotate the input ('QRn' option),
simulate a randomized algorithm ('Qr' option), and to simulate
roundoff errors ('Rn' option).
Random number generators differ between systems. Most systems provide
rand() but the period varies. The period of rand() is not critical
since qhull does not normally use random numbers.
The default generator is Park & Miller's minimal standard random
number generator [CACM 31:1195 '88]. It is included with Qhull.
If qh_RANDOMmax is wrong, qhull will report a warning and Geomview
output will likely be invisible.
*/
#define qh_RANDOMtype 5 /* *** change to the desired number *** */
#if (qh_RANDOMtype == 1)
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, random()/MAX */
#define qh_RANDOMint random()
#define qh_RANDOMseed_(seed) srandom(seed);
#elif (qh_RANDOMtype == 2)
#ifdef RAND_MAX
#define qh_RANDOMmax ((realT)RAND_MAX)
#else
#define qh_RANDOMmax ((realT)32767) /* 15 bits (System 5) */
#endif
#define qh_RANDOMint rand()
#define qh_RANDOMseed_(seed) srand((unsigned)seed);
#elif (qh_RANDOMtype == 3)
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, Sun */
#define qh_RANDOMint rand()
#define qh_RANDOMseed_(seed) srand((unsigned)seed);
#elif (qh_RANDOMtype == 4)
#define qh_RANDOMmax ((realT)0x7fffffffUL) /* 31 bits, lrand38()/MAX */
#define qh_RANDOMint lrand48()
#define qh_RANDOMseed_(seed) srand48(seed);
#elif (qh_RANDOMtype == 5)
#define qh_RANDOMmax ((realT)2147483646UL) /* 31 bits, qh_rand/MAX */
#define qh_RANDOMint qh_rand()
#define qh_RANDOMseed_(seed) qh_srand(seed);
/* unlike rand(), never returns 0 */
#else
#error: unknown random option
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="ORIENTclock">-</a>
qh_ORIENTclock
0 for inward pointing normals by Geomview convention
*/
#define qh_ORIENTclock 0
/*========= performance related constants =========*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="HASHfactor">-</a>
qh_HASHfactor
total hash slots / used hash slots. Must be at least 1.1.
notes:
=2 for at worst 50% occupancy for qh hash_table and normally 25% occupancy
*/
#define qh_HASHfactor 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="VERIFYdirect">-</a>
qh_VERIFYdirect
with 'Tv' verify all points against all facets if op count is smaller
notes:
if greater, calls qh_check_bestdist() instead
*/
#define qh_VERIFYdirect 1000000
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INITIALsearch">-</a>
qh_INITIALsearch
if qh_INITIALmax, search points up to this dimension
*/
#define qh_INITIALsearch 6
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INITIALmax">-</a>
qh_INITIALmax
if dim >= qh_INITIALmax, use min/max coordinate points for initial simplex
notes:
from points with non-zero determinants
use option 'Qs' to override (much slower)
*/
#define qh_INITIALmax 8
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEdefault">-</a>
qh_JOGGLEdefault
default qh.JOGGLEmax is qh.DISTround * qh_JOGGLEdefault
notes:
rbox s r 100 | qhull QJ1e-15 QR0 generates 90% faults at distround 7e-16
rbox s r 100 | qhull QJ1e-14 QR0 generates 70% faults
rbox s r 100 | qhull QJ1e-13 QR0 generates 35% faults
rbox s r 100 | qhull QJ1e-12 QR0 generates 8% faults
rbox s r 100 | qhull QJ1e-11 QR0 generates 1% faults
rbox s r 100 | qhull QJ1e-10 QR0 generates 0% faults
rbox 1000 W0 | qhull QJ1e-12 QR0 generates 86% faults
rbox 1000 W0 | qhull QJ1e-11 QR0 generates 20% faults
rbox 1000 W0 | qhull QJ1e-10 QR0 generates 2% faults
the later have about 20 points per facet, each of which may interfere
pick a value large enough to avoid retries on most inputs
*/
#define qh_JOGGLEdefault 30000.0
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEincrease">-</a>
qh_JOGGLEincrease
factor to increase qh.JOGGLEmax on qh_JOGGLEretry or qh_JOGGLEagain
*/
#define qh_JOGGLEincrease 10.0
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEretry">-</a>
qh_JOGGLEretry
if ZZretry = qh_JOGGLEretry, increase qh.JOGGLEmax
notes:
try twice at the original value in case of bad luck the first time
*/
#define qh_JOGGLEretry 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEagain">-</a>
qh_JOGGLEagain
every following qh_JOGGLEagain, increase qh.JOGGLEmax
notes:
1 is OK since it's already failed qh_JOGGLEretry times
*/
#define qh_JOGGLEagain 1
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEmaxincrease">-</a>
qh_JOGGLEmaxincrease
maximum qh.JOGGLEmax due to qh_JOGGLEincrease
relative to qh.MAXwidth
notes:
qh.joggleinput will retry at this value until qh_JOGGLEmaxretry
*/
#define qh_JOGGLEmaxincrease 1e-2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="JOGGLEmaxretry">-</a>
qh_JOGGLEmaxretry
stop after qh_JOGGLEmaxretry attempts
*/
#define qh_JOGGLEmaxretry 100
/*========= memory constants =========*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMalign">-</a>
qh_MEMalign
memory alignment for qh_meminitbuffers() in global.c
notes:
to avoid bus errors, memory allocation must consider alignment requirements.
malloc() automatically takes care of alignment. Since mem.c manages
its own memory, we need to explicitly specify alignment in
qh_meminitbuffers().
A safe choice is sizeof(double). sizeof(float) may be used if doubles
do not occur in data structures and pointers are the same size. Be careful
of machines (e.g., DEC Alpha) with large pointers.
If using gcc, best alignment is
#define qh_MEMalign fmax_(__alignof__(realT),__alignof__(void *))
*/
#define qh_MEMalign fmax_(sizeof(realT), sizeof(void *))
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMbufsize">-</a>
qh_MEMbufsize
size of additional memory buffers
notes:
used for qh_meminitbuffers() in global.c
*/
#define qh_MEMbufsize 0x10000 /* allocate 64K memory buffers */
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MEMinitbuf">-</a>
qh_MEMinitbuf
size of initial memory buffer
notes:
use for qh_meminitbuffers() in global.c
*/
#define qh_MEMinitbuf 0x20000 /* initially allocate 128K buffer */
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="INFINITE">-</a>
qh_INFINITE
on output, indicates Voronoi center at infinity
*/
#define qh_INFINITE -10.101
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DEFAULTbox">-</a>
qh_DEFAULTbox
default box size (Geomview expects 0.5)
*/
#define qh_DEFAULTbox 0.5
/*======= conditional compilation ============================*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="compiler">-</a>
__cplusplus
defined by C++ compilers
__MSC_VER
defined by Microsoft Visual C++
__MWERKS__ && __POWERPC__
defined by Metrowerks when compiling for the Power Macintosh
__STDC__
defined for strict ANSI C
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="COMPUTEfurthest">-</a>
qh_COMPUTEfurthest
compute furthest distance to an outside point instead of storing it with the facet
=1 to compute furthest
notes:
computing furthest saves memory but costs time
about 40% more distance tests for partitioning
removes facet->furthestdist
*/
#define qh_COMPUTEfurthest 0
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="KEEPstatistics">-</a>
qh_KEEPstatistics
=0 removes most of statistic gathering and reporting
notes:
if 0, code size is reduced by about 4%.
*/
#define qh_KEEPstatistics 1
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXoutside">-</a>
qh_MAXoutside
record outer plane for each facet
=1 to record facet->maxoutside
notes:
this takes a realT per facet and slightly slows down qhull
it produces better outer planes for geomview output
*/
#define qh_MAXoutside 1
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="NOmerge">-</a>
qh_NOmerge
disables facet merging if defined
notes:
This saves about 10% space.
Unless 'Q0'
qh_NOmerge sets 'QJ' to avoid precision errors
#define qh_NOmerge
see:
<a href="mem.h#NOmem">qh_NOmem</a> in mem.c
see user.c/user_eg.c for removing io.o
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="NOtrace">-</a>
qh_NOtrace
no tracing if defined
notes:
This saves about 5% space.
#define qh_NOtrace
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="QHpointer">-</a>
qh_QHpointer
access global data with pointer or static structure
qh_QHpointer = 1 access globals via a pointer to allocated memory
enables qh_saveqhull() and qh_restoreqhull()
costs about 8% in time and 2% in space
= 0 qh_qh and qh_qhstat are static data structures
only one instance of qhull() can be active at a time
default value
notes:
all global variables for qhull are in qh, qhmem, and qhstat
qh is defined in qhull.h
qhmem is defined in mem.h
qhstat is defined in stat.h
see:
user_eg.c for an example
*/
#define qh_QHpointer 0
#if 0 /* sample code */
qhT *oldqhA, *oldqhB;
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
flags, outfile, errfile);
/* use results from first call to qh_new_qhull */
oldqhA= qh_save_qhull();
exitcode= qh_new_qhull (dimB, numpointsB, pointsB, ismalloc,
flags, outfile, errfile);
/* use results from second call to qh_new_qhull */
oldqhB= qh_save_qhull();
qh_restore_qhull (&oldqhA);
/* use results from first call to qh_new_qhull */
qh_freeqhull (qh_ALL); /* frees all memory used by first call */
qh_restore_qhull (&oldqhB);
/* use results from second call to qh_new_qhull */
qh_freeqhull (!qh_ALL); /* frees long memory used by second call */
qh_memfreeshort (&curlong, &totlong); /* frees short memory and memory allocator */
#endif
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="QUICKhelp">-</a>
qh_QUICKhelp
=1 to use abbreviated help messages, e.g., for degenerate inputs
*/
#define qh_QUICKhelp 0
/* ============ -merge constants- ====================
These constants effect facet merging. You probably will not need
to modify these. They effect the performance of facet merging.
*/
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DIMmergeVertex">-</a>
qh_DIMmergeVertex
max dimension for vertex merging (it is not effective in high-d)
*/
#define qh_DIMmergeVertex 6
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DIMreduceBuild">-</a>
qh_DIMreduceBuild
max dimension for vertex reduction during build (slow in high-d)
*/
#define qh_DIMreduceBuild 5
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="BESTcentrum">-</a>
qh_BESTcentrum
if > 2*dim+n vertices, qh_findbestneighbor() tests centrums (faster)
else, qh_findbestneighbor() tests all vertices (much better merges)
qh_BESTcentrum2
if qh_BESTcentrum2 * DIM3 + BESTcentrum < #vertices tests centrums
*/
#define qh_BESTcentrum 20
#define qh_BESTcentrum2 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="BESTnonconvex">-</a>
qh_BESTnonconvex
if > dim+n neighbors, qh_findbestneighbor() tests nonconvex ridges.
notes:
It is needed because qh_findbestneighbor is slow for large facets
*/
#define qh_BESTnonconvex 15
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXnewmerges">-</a>
qh_MAXnewmerges
if >n newmerges, qh_merge_nonconvex() calls qh_reducevertices_centrums.
notes:
It is needed because postmerge can merge many facets at once
*/
#define qh_MAXnewmerges 2
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXnewcentrum">-</a>
qh_MAXnewcentrum
if <= dim+n vertices (n approximates the number of merges),
reset the centrum in qh_updatetested() and qh_mergecycle_facets()
notes:
needed to reduce cost and because centrums may move too much if
many vertices in high-d
*/
#define qh_MAXnewcentrum 5
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="COPLANARratio">-</a>
qh_COPLANARratio
for 3-d+ merging, qh.MINvisible is n*premerge_centrum
notes:
for non-merging, it's DISTround
*/
#define qh_COPLANARratio 3
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="DISToutside">-</a>
qh_DISToutside
When is a point clearly outside of a facet?
Stops search in qh_findbestnew or qh_partitionall
qh_findbest uses qh.MINoutside since since it is only called if no merges.
notes:
'Qf' always searches for best facet
if !qh.MERGING, same as qh.MINoutside.
if qh_USEfindbestnew, increase value since neighboring facets may be ill-behaved
[Note: Zdelvertextot occurs normally with interior points]
RBOX 1000 s Z1 G1e-13 t1001188774 | QHULL Tv
When there is a sharp edge, need to move points to a
clearly good facet; otherwise may be lost in another partitioning.
if too big then O(n^2) behavior for partitioning in cone
if very small then important points not processed
Needed in qh_partitionall for
RBOX 1000 s Z1 G1e-13 t1001032651 | QHULL Tv
Needed in qh_findbestnew for many instances of
RBOX 1000 s Z1 G1e-13 t | QHULL Tv
See:
qh_DISToutside -- when is a point clearly outside of a facet
qh_SEARCHdist -- when is facet coplanar with the best facet?
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
*/
#define qh_DISToutside ((qh_USEfindbestnew ? 2 : 1) * \
fmax_((qh MERGING ? 2 : 1)*qh MINoutside, qh max_outside))
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="RATIOnearinside">-</a>
qh_RATIOnearinside
ratio of qh.NEARinside to qh.ONEmerge for retaining inside points for
qh_check_maxout().
notes:
This is overkill since do not know the correct value.
It effects whether 'Qc' reports all coplanar points
Not used for 'd' since non-extreme points are coplanar
*/
#define qh_RATIOnearinside 5
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="SEARCHdist">-</a>
qh_SEARCHdist
When is a facet coplanar with the best facet?
qh_findbesthorizon: all coplanar facets of the best facet need to be searched.
See:
qh_DISToutside -- when is a point clearly outside of a facet
qh_SEARCHdist -- when is facet coplanar with the best facet?
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
*/
#define qh_SEARCHdist ((qh_USEfindbestnew ? 2 : 1) * \
(qh max_outside + 2 * qh DISTround + fmax_( qh MINvisible, qh MAXcoplanar)));
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="USEfindbestnew">-</a>
qh_USEfindbestnew
Always use qh_findbestnew for qh_partitionpoint, otherwise use
qh_findbestnew if merged new facet or sharpnewfacets.
See:
qh_DISToutside -- when is a point clearly outside of a facet
qh_SEARCHdist -- when is facet coplanar with the best facet?
qh_USEfindbestnew -- when to use qh_findbestnew for qh_partitionpoint()
*/
#define qh_USEfindbestnew (zzval_(Ztotmerge) > 50)
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="WIDEcoplanar">-</a>
qh_WIDEcoplanar
n*MAXcoplanar or n*MINvisible for a WIDEfacet
if vertex is further than qh.WIDEfacet from the hyperplane
then its ridges are not counted in computing the area, and
the facet's centrum is frozen.
notes:
qh.WIDEfacet= max(qh.MAXoutside,qh_WIDEcoplanar*qh.MAXcoplanar,
qh_WIDEcoplanar * qh.MINvisible);
*/
#define qh_WIDEcoplanar 6
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="MAXnarrow">-</a>
qh_MAXnarrow
max. cosine in initial hull that sets qh.NARROWhull
notes:
If qh.NARROWhull, the initial partition does not make
coplanar points. If narrow, a coplanar point can be
coplanar to two facets of opposite orientations and
distant from the exact convex hull.
Conservative estimate. Don't actually see problems until it is -1.0
*/
#define qh_MAXnarrow -0.99999999
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="WARNnarrow">-</a>
qh_WARNnarrow
max. cosine in initial hull to warn about qh.NARROWhull
notes:
this is a conservative estimate.
Don't actually see problems until it is -1.0. See qh-impre.htm
*/
#define qh_WARNnarrow -0.999999999999999
/*-<a href="qh-user.htm#TOC"
>--------------------------------</a><a name="ZEROdelaunay">-</a>
qh_ZEROdelaunay
a zero Delaunay facet occurs for input sites coplanar with their convex hull
the last normal coefficient of a zero Delaunay facet is within
qh_ZEROdelaunay * qh.ANGLEround of 0
notes:
qh_ZEROdelaunay does not allow for joggled input ('QJ').
You can avoid zero Delaunay facets by surrounding the input with a box.
Use option 'PDk:-n' to explicitly define zero Delaunay facets
k= dimension of input sites (e.g., 3 for 3-d Delaunay triangulation)
n= the cutoff for zero Delaunay facets (e.g., 'PD3:-1e-12')
*/
#define qh_ZEROdelaunay 2
#endif /* qh_DEFuser */

View File

@ -1,310 +0,0 @@
/*<html><pre> -<a href="qh-user.htm"
>-------------------------------</a><a name="TOP">-</a>
user_eg.c
sample code for calling qhull() from an application
call with:
user_eg "cube/diamond options" "delaunay options" "halfspace options"
for example:
user_eg # return summaries
user_eg "n" "o" "Fp" # return normals, OFF, points
user_eg "n Qt" "o" "Fp" # triangulated cube
user_eg "QR0 p" "QR0 v p" "QR0 Fp" # rotate input and return points
# 'v' returns Voronoi
# transform is rotated for halfspaces
main() makes three runs of qhull.
1) compute the convex hull of a cube
2a) compute the Delaunay triangulation of random points
2b) find the Delaunay triangle closest to a point.
3) compute the halfspace intersection of a diamond
notes:
For another example, see main() in unix.c and user_eg2.c.
These examples, call qh_qhull() directly. They allow
tighter control on the code loaded with Qhull.
For a simple C++ example, see qhull_interface.cpp
Summaries are sent to stderr if other output formats are used
compiled by 'make user_eg'
see qhull.h for data structures, macros, and user-callable functions.
*/
#include "qhull_a.h"
/*-------------------------------------------------
-internal function prototypes
*/
void print_summary (void);
void makecube (coordT *points, int numpoints, int dim);
void makeDelaunay (coordT *points, int numpoints, int dim, int seed);
void findDelaunay (int dim);
void makehalf (coordT *points, int numpoints, int dim);
/*-------------------------------------------------
-print_summary()
*/
void print_summary (void) {
facetT *facet;
int k;
printf ("\n%d vertices and %d facets with normals:\n",
qh num_vertices, qh num_facets);
FORALLfacets {
for (k=0; k < qh hull_dim; k++)
printf ("%6.2g ", facet->normal[k]);
printf ("\n");
}
}
/*--------------------------------------------------
-makecube- set points to vertices of cube
points is numpoints X dim
*/
void makecube (coordT *points, int numpoints, int dim) {
int j,k;
coordT *point;
for (j=0; j<numpoints; j++) {
point= points + j*dim;
for (k=dim; k--; ) {
if (j & ( 1 << k))
point[k]= 1.0;
else
point[k]= -1.0;
}
}
} /*.makecube.*/
/*--------------------------------------------------
-makeDelaunay- set points for dim Delaunay triangulation of random points
points is numpoints X dim.
notes:
makeDelaunay() in user_eg2.c uses qh_setdelaunay() to project points in place.
*/
void makeDelaunay (coordT *points, int numpoints, int dim, int seed) {
int j,k;
coordT *point, realr;
printf ("seed: %d\n", seed);
qh_RANDOMseed_( seed);
for (j=0; j<numpoints; j++) {
point= points + j*dim;
for (k= 0; k < dim; k++) {
realr= qh_RANDOMint;
point[k]= 2.0 * realr/(qh_RANDOMmax+1) - 1.0;
}
}
} /*.makeDelaunay.*/
/*--------------------------------------------------
-findDelaunay- find Delaunay triangle for [0.5,0.5,...]
assumes dim < 100
notes:
calls qh_setdelaunay() to project the point to a parabaloid
*/
void findDelaunay (int dim) {
int k;
coordT point[ 100];
boolT isoutside;
realT bestdist;
facetT *facet;
vertexT *vertex, **vertexp;
for (k= 0; k < dim; k++)
point[k]= 0.5;
qh_setdelaunay (dim+1, 1, point);
facet= qh_findbestfacet (point, qh_ALL, &bestdist, &isoutside);
FOREACHvertex_(facet->vertices) {
for (k=0; k < dim; k++)
printf ("%5.2f ", vertex->point[k]);
printf ("\n");
}
} /*.findDelaunay.*/
/*--------------------------------------------------
-makehalf- set points to halfspaces for a (dim)-dimensional diamond
points is numpoints X dim+1
each halfspace consists of dim coefficients followed by an offset
*/
void makehalf (coordT *points, int numpoints, int dim) {
int j,k;
coordT *point;
for (j=0; j<numpoints; j++) {
point= points + j*(dim+1);
point[dim]= -1.0; /* offset */
for (k=dim; k--; ) {
if (j & ( 1 << k))
point[k]= 1.0;
else
point[k]= -1.0;
}
}
} /*.makehalf.*/
#define DIM 3 /* dimension of points, must be < 31 for SIZEcube */
#define SIZEcube (1<<DIM)
#define SIZEdiamond (2*DIM)
#define TOTpoints (SIZEcube + SIZEdiamond)
/*--------------------------------------------------
-main- derived from call_qhull in user.c
see program header
this contains three runs of Qhull for convex hull, Delaunay
triangulation or Voronoi vertices, and halfspace intersection
*/
int main (int argc, char *argv[]) {
int dim= DIM; /* dimension of points */
int numpoints; /* number of points */
coordT points[(DIM+1)*TOTpoints]; /* array of coordinates for each point */
coordT *rows[TOTpoints];
boolT ismalloc= False; /* True if qhull should free points in qh_freeqhull() or reallocation */
char flags[250]; /* option flags for qhull, see qh_opt.htm */
FILE *outfile= stdout; /* output from qh_produce_output()
use NULL to skip qh_produce_output() */
FILE *errfile= stderr; /* error messages from qhull code */
int exitcode; /* 0 if no error from qhull */
facetT *facet; /* set by FORALLfacets */
int curlong, totlong; /* memory remaining after qh_memfreeshort */
int i;
printf ("This is the output from user_eg.c\n\n\
It shows how qhull() may be called from an application. It is not part\n\
of qhull itself. If it appears accidently, please remove user_eg.c from\n\
your project.\n\n");
/*
Run 1: convex hull
*/
printf( "\ncompute convex hull of cube after rotating input\n");
sprintf (flags, "qhull s Tcv %s", argc >= 2 ? argv[1] : "");
numpoints= SIZEcube;
makecube (points, numpoints, DIM);
for (i=numpoints; i--; )
rows[i]= points+dim*i;
qh_printmatrix (outfile, "input", rows, numpoints, dim);
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
flags, outfile, errfile);
if (!exitcode) { /* if no error */
/* 'qh facet_list' contains the convex hull */
print_summary();
FORALLfacets {
/* ... your code ... */
}
}
qh_freeqhull(!qh_ALL); /* free long memory */
qh_memfreeshort (&curlong, &totlong); /* free short memory and memory allocator */
if (curlong || totlong)
fprintf (errfile, "qhull internal warning (user_eg, #1): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
/*
Run 2: Delaunay triangulation
*/
printf( "\ncompute 3-d Delaunay triangulation\n");
sprintf (flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
numpoints= SIZEcube;
makeDelaunay (points, numpoints, dim, time(NULL));
for (i=numpoints; i--; )
rows[i]= points+dim*i;
qh_printmatrix (outfile, "input", rows, numpoints, dim);
exitcode= qh_new_qhull (dim, numpoints, points, ismalloc,
flags, outfile, errfile);
if (!exitcode) { /* if no error */
/* 'qh facet_list' contains the convex hull */
/* If you want a Voronoi diagram ('v') and do not request output (i.e., outfile=NULL),
call qh_setvoronoi_all() after qh_new_qhull(). */
print_summary();
FORALLfacets {
/* ... your code ... */
}
printf( "\nfind 3-d Delaunay triangle closest to [0.5, 0.5, ...]\n");
exitcode= setjmp (qh errexit);
if (!exitcode) {
/* Trap Qhull errors in findDelaunay(). Without the setjmp(), Qhull
will exit() after reporting an error */
qh NOerrexit= False;
findDelaunay (DIM);
}
qh NOerrexit= True;
}
#if qh_QHpointer /* see user.h */
{
qhT *oldqhA, *oldqhB;
coordT pointsB[DIM*TOTpoints]; /* array of coordinates for each point */
printf( "\nsave first triangulation and compute a new triangulation\n");
oldqhA= qh_save_qhull();
sprintf (flags, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
numpoints= SIZEcube;
makeDelaunay (pointsB, numpoints, dim, time(NULL)+1);
for (i=numpoints; i--; )
rows[i]= pointsB+dim*i;
qh_printmatrix (outfile, "input", rows, numpoints, dim);
exitcode= qh_new_qhull (dim, numpoints, pointsB, ismalloc,
flags, outfile, errfile);
if (!exitcode)
print_summary();
printf( "\nsave second triangulation and restore first one\n");
oldqhB= qh_save_qhull();
qh_restore_qhull (&oldqhA);
print_summary();
printf( "\nfree first triangulation and restore second one.\n");
qh_freeqhull (qh_ALL); /* free short and long memory used by first call */
/* do not use qh_memfreeshort */
qh_restore_qhull (&oldqhB);
print_summary();
}
#endif
qh_freeqhull(!qh_ALL); /* free long memory */
qh_memfreeshort (&curlong, &totlong); /* free short memory and memory allocator */
if (curlong || totlong)
fprintf (errfile, "qhull internal warning (user_eg, #2): did not free %d bytes of long memory (%d pieces)\n", totlong, curlong);
/*
Run 3: halfspace intersection about the origin
*/
printf( "\ncompute halfspace intersection about the origin for a diamond\n");
sprintf (flags, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "Fp");
numpoints= SIZEcube;
makehalf (points, numpoints, dim);
for (i=numpoints; i--; )
rows[i]= points+(dim+1)*i;
qh_printmatrix (outfile, "input as halfspace coefficients + offsets", rows, numpoints, dim+1);
/* use qh_sethalfspace_all to transform the halfspaces yourself.
If so, set 'qh feasible_point and do not use option 'Hn,...' [it would retransform the halfspaces]
*/
exitcode= qh_new_qhull (dim+1, numpoints, points, ismalloc,
flags, outfile, errfile);
if (!exitcode)
print_summary();
qh_freeqhull (!qh_ALL);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong) /* could also check previous runs */
fprintf (stderr, "qhull internal warning (user_eg, #3): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
return exitcode;
} /* main */

View File

@ -1,532 +0,0 @@
/*<html><pre> -<a href="qh-qhull.htm"
>-------------------------------</a><a name="TOP">-</a>
user_eg2.c
sample code for calling qhull() from an application.
See user_eg.c for a simpler method using qh_new_qhull().
The method used here and in unix.c gives you additional
control over Qhull.
call with:
user_eg2 "triangulated cube/diamond options" "delaunay options" "halfspace options"
for example:
user_eg2 # return summaries
user_eg2 "n" "o" "Fp" # return normals, OFF, points
user_eg2 "QR0 p" "QR0 v p" "QR0 Fp" # rotate input and return points
# 'v' returns Voronoi
# transform is rotated for halfspaces
main() makes three runs of qhull.
1) compute the convex hull of a cube, and incrementally add a diamond
2a) compute the Delaunay triangulation of random points, and add points.
2b) find the Delaunay triangle closest to a point.
3) compute the halfspace intersection of a diamond, and add a cube
notes:
summaries are sent to stderr if other output formats are used
derived from unix.c and compiled by 'make user_eg2'
see qhull.h for data structures, macros, and user-callable functions.
If you want to control all output to stdio and input to stdin,
set the #if below to "1" and delete all lines that contain "io.c".
This prevents the loading of io.o. Qhull will
still write to 'qh ferr' (stderr) for error reporting and tracing.
Defining #if 1, also prevents user.o from being loaded.
*/
#include "qhull_a.h"
/*-------------------------------------------------
-internal function prototypes
*/
void print_summary (void);
void makecube (coordT *points, int numpoints, int dim);
void adddiamond (coordT *points, int numpoints, int numnew, int dim);
void makeDelaunay (coordT *points, int numpoints, int dim);
void addDelaunay (coordT *points, int numpoints, int numnew, int dim);
void findDelaunay (int dim);
void makehalf (coordT *points, int numpoints, int dim);
void addhalf (coordT *points, int numpoints, int numnew, int dim, coordT *feasible);
/*-------------------------------------------------
-print_summary()
*/
void print_summary (void) {
facetT *facet;
int k;
printf ("\n%d vertices and %d facets with normals:\n",
qh num_vertices, qh num_facets);
FORALLfacets {
for (k=0; k < qh hull_dim; k++)
printf ("%6.2g ", facet->normal[k]);
printf ("\n");
}
}
/*--------------------------------------------------
-makecube- set points to vertices of cube
points is numpoints X dim
*/
void makecube (coordT *points, int numpoints, int dim) {
int j,k;
coordT *point;
for (j=0; j<numpoints; j++) {
point= points + j*dim;
for (k=dim; k--; ) {
if (j & ( 1 << k))
point[k]= 1.0;
else
point[k]= -1.0;
}
}
} /*.makecube.*/
/*--------------------------------------------------
-adddiamond- add diamond to convex hull
points is numpoints+numnew X dim.
notes:
qh_addpoint() does not make a copy of the point coordinates.
For inside points and some outside points, qh_findbestfacet performs
an exhaustive search for a visible facet. Algorithms that retain
previously constructed hulls should be faster for on-line construction
of the convex hull.
*/
void adddiamond (coordT *points, int numpoints, int numnew, int dim) {
int j,k;
coordT *point;
facetT *facet;
boolT isoutside;
realT bestdist;
for (j= 0; j < numnew ; j++) {
point= points + (numpoints+j)*dim;
if (points == qh first_point) /* in case of 'QRn' */
qh num_points= numpoints+j+1;
/* qh num_points sets the size of the points array. You may
allocate the points elsewhere. If so, qh_addpoint records
the point's address in qh other_points
*/
for (k=dim; k--; ) {
if (j/2 == k)
point[k]= (j & 1) ? 2.0 : -2.0;
else
point[k]= 0.0;
}
facet= qh_findbestfacet (point, !qh_ALL, &bestdist, &isoutside);
if (isoutside) {
if (!qh_addpoint (point, facet, False))
break; /* user requested an early exit with 'TVn' or 'TCn' */
}
printf ("%d vertices and %d facets\n",
qh num_vertices, qh num_facets);
/* qh_produce_output(); */
}
if (qh DOcheckmax)
qh_check_maxout();
else if (qh KEEPnearinside)
qh_nearcoplanar();
} /*.adddiamond.*/
/*--------------------------------------------------
-makeDelaunay- set points for dim-1 Delaunay triangulation of random points
points is numpoints X dim. Each point is projected to a paraboloid.
*/
void makeDelaunay (coordT *points, int numpoints, int dim) {
int j,k, seed;
coordT *point, realr;
seed= time(NULL);
printf ("seed: %d\n", seed);
qh_RANDOMseed_( seed);
for (j=0; j<numpoints; j++) {
point= points + j*dim;
for (k= 0; k < dim-1; k++) {
realr= qh_RANDOMint;
point[k]= 2.0 * realr/(qh_RANDOMmax+1) - 1.0;
}
}
qh_setdelaunay (dim, numpoints, points);
} /*.makeDelaunay.*/
/*--------------------------------------------------
-addDelaunay- add points to dim-1 Delaunay triangulation
points is numpoints+numnew X dim. Each point is projected to a paraboloid.
notes:
qh_addpoint() does not make a copy of the point coordinates.
Since qh_addpoint() is not given a visible facet, it performs a directed
search of all facets. Algorithms that retain previously
constructed hulls may be faster.
*/
void addDelaunay (coordT *points, int numpoints, int numnew, int dim) {
int j,k;
coordT *point, realr;
facetT *facet;
realT bestdist;
boolT isoutside;
for (j= 0; j < numnew ; j++) {
point= points + (numpoints+j)*dim;
if (points == qh first_point) /* in case of 'QRn' */
qh num_points= numpoints+j+1;
/* qh num_points sets the size of the points array. You may
allocate the point elsewhere. If so, qh_addpoint records
the point's address in qh other_points
*/
for (k= 0; k < dim-1; k++) {
realr= qh_RANDOMint;
point[k]= 2.0 * realr/(qh_RANDOMmax+1) - 1.0;
}
qh_setdelaunay (dim, 1, point);
facet= qh_findbestfacet (point, !qh_ALL, &bestdist, &isoutside);
if (isoutside) {
if (!qh_addpoint (point, facet, False))
break; /* user requested an early exit with 'TVn' or 'TCn' */
}
qh_printpoint (stdout, "added point", point);
printf ("%d points, %d extra points, %d vertices, and %d facets in total\n",
qh num_points, qh_setsize (qh other_points),
qh num_vertices, qh num_facets);
/* qh_produce_output(); */
}
if (qh DOcheckmax)
qh_check_maxout();
else if (qh KEEPnearinside)
qh_nearcoplanar();
} /*.addDelaunay.*/
/*--------------------------------------------------
-findDelaunay- find Delaunay triangle for [0.5,0.5,...]
assumes dim < 100
*/
void findDelaunay (int dim) {
int k;
coordT point[ 100];
boolT isoutside;
realT bestdist;
facetT *facet;
vertexT *vertex, **vertexp;
for (k= 0; k < dim-1; k++)
point[k]= 0.5;
qh_setdelaunay (dim, 1, point);
facet= qh_findbestfacet (point, qh_ALL, &bestdist, &isoutside);
FOREACHvertex_(facet->vertices) {
for (k=0; k < dim-1; k++)
printf ("%5.2f ", vertex->point[k]);
printf ("\n");
}
} /*.findDelaunay.*/
/*--------------------------------------------------
-makehalf- set points to halfspaces for a (dim)-d diamond
points is numpoints X dim+1
each halfspace consists of dim coefficients followed by an offset
*/
void makehalf (coordT *points, int numpoints, int dim) {
int j,k;
coordT *point;
for (j=0; j<numpoints; j++) {
point= points + j*(dim+1);
point[dim]= -1.0; /* offset */
for (k=dim; k--; ) {
if (j & ( 1 << k))
point[k]= 1.0;
else
point[k]= -1.0;
}
}
} /*.makehalf.*/
/*--------------------------------------------------
-addhalf- add halfspaces for a (dim)-d cube to the intersection
points is numpoints+numnew X dim+1
notes:
assumes dim < 100.
For makehalf(), points is the initial set of halfspaces with offsets.
It is transformed by qh_sethalfspace_all into a
(dim)-d set of newpoints. Qhull computed the convex hull of newpoints -
this is equivalent to the halfspace intersection of the
orginal halfspaces.
For addhalf(), the remainder of points stores the transforms of
the added halfspaces. Qhull computes the convex hull of newpoints
and the added points. qh_addpoint() does not make a copy of these points.
Since halfspace intersection is equivalent to a convex hull,
qh_findbestfacet may perform an exhaustive search
for a visible facet. Algorithms that retain previously constructed
intersections should be faster for on-line construction.
*/
void addhalf (coordT *points, int numpoints, int numnew, int dim, coordT *feasible) {
int j,k;
coordT *point, normal[100], offset, *next;
facetT *facet;
boolT isoutside;
realT bestdist;
for (j= 0; j < numnew ; j++) {
offset= -1.0;
for (k=dim; k--; ) {
if (j/2 == k) {
normal[k]= sqrt (dim); /* to normalize as in makehalf */
if (j & 1)
normal[k]= -normal[k];
}else
normal[k]= 0.0;
}
point= points + (numpoints+j)* (dim+1); /* does not use point[dim] */
qh_sethalfspace (dim, point, &next, normal, &offset, feasible);
facet= qh_findbestfacet (point, !qh_ALL, &bestdist, &isoutside);
if (isoutside) {
if (!qh_addpoint (point, facet, False))
break; /* user requested an early exit with 'TVn' or 'TCn' */
}
qh_printpoint (stdout, "added offset -1 and normal", normal);
printf ("%d points, %d extra points, %d vertices, and %d facets in total\n",
qh num_points, qh_setsize (qh other_points),
qh num_vertices, qh num_facets);
/* qh_produce_output(); */
}
if (qh DOcheckmax)
qh_check_maxout();
else if (qh KEEPnearinside)
qh_nearcoplanar();
} /*.addhalf.*/
#define DIM 3 /* dimension of points, must be < 31 for SIZEcube */
#define SIZEcube (1<<DIM)
#define SIZEdiamond (2*DIM)
#define TOTpoints (SIZEcube + SIZEdiamond)
/*--------------------------------------------------
-main- derived from call_qhull in user.c
see program header
this contains three runs of Qhull for convex hull, Delaunay
triangulation or Voronoi vertices, and halfspace intersection
*/
int main (int argc, char *argv[]) {
boolT ismalloc;
int curlong, totlong, exitcode;
char options [2000];
printf ("This is the output from user_eg2.c\n\n\
It shows how qhull() may be called from an application. It is not part\n\
of qhull itself. If it appears accidently, please remove user_eg2.c from\n\
your project.\n\n");
ismalloc= False; /* True if qh_freeqhull should 'free(array)' */
/*
Run 1: convex hull
*/
qh_init_A (stdin, stdout, stderr, 0, NULL);
exitcode= setjmp (qh errexit);
if (!exitcode) {
coordT array[TOTpoints][DIM];
strcat (qh rbox_command, "user_eg cube");
sprintf (options, "qhull s Tcv Q11 %s ", argc >= 2 ? argv[1] : "");
qh_initflags (options);
printf( "\ncompute triangulated convex hull of cube after rotating input\n");
makecube (array[0], SIZEcube, DIM);
qh_init_B (array[0], SIZEcube, DIM, ismalloc);
qh_qhull();
qh_check_output();
qh_triangulate(); /* requires option 'Q11' if want to add points */
print_summary ();
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points ();
printf( "\nadd points in a diamond\n");
adddiamond (array[0], SIZEcube, SIZEdiamond, DIM);
qh_check_output();
print_summary ();
qh_produce_output(); /* delete this line to help avoid io.c */
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points ();
}
qh NOerrexit= True;
qh_freeqhull (!qh_ALL);
qh_memfreeshort (&curlong, &totlong);
/*
Run 2: Delaunay triangulation
*/
qh_init_A (stdin, stdout, stderr, 0, NULL);
exitcode= setjmp (qh errexit);
if (!exitcode) {
coordT array[TOTpoints][DIM];
strcat (qh rbox_command, "user_eg Delaunay");
sprintf (options, "qhull s d Tcv %s", argc >= 3 ? argv[2] : "");
qh_initflags (options);
printf( "\ncompute 2-d Delaunay triangulation\n");
makeDelaunay (array[0], SIZEcube, DIM);
/* Instead of makeDelaunay with qh_setdelaunay, you may
produce a 2-d array of points, set DIM to 2, and set
qh PROJECTdelaunay to True. qh_init_B will call
qh_projectinput to project the points to the paraboloid
and add a point "at-infinity".
*/
qh_init_B (array[0], SIZEcube, DIM, ismalloc);
qh_qhull();
/* If you want Voronoi ('v') without qh_produce_output(), call
qh_setvoronoi_all() after qh_qhull() */
qh_check_output();
print_summary ();
qh_produce_output(); /* delete this line to help avoid io.c */
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points ();
printf( "\nadd points to triangulation\n");
addDelaunay (array[0], SIZEcube, SIZEdiamond, DIM);
qh_check_output();
qh_produce_output(); /* delete this line to help avoid io.c */
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points ();
printf( "\nfind Delaunay triangle closest to [0.5, 0.5, ...]\n");
findDelaunay (DIM);
}
qh NOerrexit= True;
qh_freeqhull (!qh_ALL);
qh_memfreeshort (&curlong, &totlong);
/*
Run 3: halfspace intersection
*/
qh_init_A (stdin, stdout, stderr, 0, NULL);
exitcode= setjmp (qh errexit);
if (!exitcode) {
coordT array[TOTpoints][DIM+1]; /* +1 for halfspace offset */
pointT *points;
strcat (qh rbox_command, "user_eg halfspaces");
sprintf (options, "qhull H0 s Tcv %s", argc >= 4 ? argv[3] : "");
qh_initflags (options);
printf( "\ncompute halfspace intersection about the origin for a diamond\n");
makehalf (array[0], SIZEcube, DIM);
qh_setfeasible (DIM); /* from io.c, sets qh feasible_point from 'Hn,n' */
/* you may malloc and set qh feasible_point directly. It is only used for
option 'Fp' */
points= qh_sethalfspace_all ( DIM+1, SIZEcube, array[0], qh feasible_point);
qh_init_B (points, SIZEcube, DIM, True); /* qh_freeqhull frees points */
qh_qhull();
qh_check_output();
qh_produce_output(); /* delete this line to help avoid io.c */
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points ();
printf( "\nadd halfspaces for cube to intersection\n");
addhalf (array[0], SIZEcube, SIZEdiamond, DIM, qh feasible_point);
qh_check_output();
qh_produce_output(); /* delete this line to help avoid io.c */
if (qh VERIFYoutput && !qh STOPpoint && !qh STOPcone)
qh_check_points ();
}
qh NOerrexit= True;
qh NOerrexit= True;
qh_freeqhull (!qh_ALL);
qh_memfreeshort (&curlong, &totlong);
if (curlong || totlong) /* could also check previous runs */
fprintf (stderr, "qhull internal warning (main): did not free %d bytes of long memory (%d pieces)\n",
totlong, curlong);
return exitcode;
} /* main */
#if 1 /* use 1 to prevent loading of io.o and user.o */
/*-------------------------------------------
-errexit- return exitcode to system after an error
assumes exitcode non-zero
prints useful information
see qh_errexit2() in qhull.c for 2 facets
*/
void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge) {
if (qh ERREXITcalled) {
fprintf (qh ferr, "qhull error while processing previous error. Exit program\n");
exit(1);
}
qh ERREXITcalled= True;
if (!qh QHULLfinished)
qh hulltime= (unsigned)clock() - qh hulltime;
fprintf (qh ferr, "\nWhile executing: %s | %s\n", qh rbox_command, qh qhull_command);
fprintf(qh ferr, "Options selected:\n%s\n", qh qhull_options);
if (qh furthest_id >= 0) {
fprintf(qh ferr, "\nLast point added to hull was p%d", qh furthest_id);
if (zzval_(Ztotmerge))
fprintf(qh ferr, " Last merge was #%d.", zzval_(Ztotmerge));
if (qh QHULLfinished)
fprintf(qh ferr, "\nQhull has finished constructing the hull.");
else if (qh POSTmerging)
fprintf(qh ferr, "\nQhull has started post-merging");
fprintf(qh ferr, "\n\n");
}
if (qh NOerrexit) {
fprintf (qh ferr, "qhull error while ending program. Exit program\n");
exit(1);
}
if (!exitcode)
exitcode= qh_ERRqhull;
qh NOerrexit= True;
longjmp(qh errexit, exitcode);
} /* errexit */
/*-------------------------------------------
-errprint- prints out the information of the erroneous object
any parameter may be NULL, also prints neighbors and geomview output
*/
void qh_errprint(char *string, facetT *atfacet, facetT *otherfacet, ridgeT *atridge, vertexT *atvertex) {
fprintf (qh ferr, "%s facets f%d f%d ridge r%d vertex v%d\n",
string, getid_(atfacet), getid_(otherfacet), getid_(atridge),
getid_(atvertex));
} /* errprint */
void qh_printfacetlist(facetT *facetlist, setT *facets, boolT printall) {
facetT *facet, **facetp;
/* remove these calls to help avoid io.c */
qh_printbegin (qh ferr, qh_PRINTfacets, facetlist, facets, printall);/*io.c*/
FORALLfacet_(facetlist) /*io.c*/
qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall); /*io.c*/
FOREACHfacet_(facets) /*io.c*/
qh_printafacet(qh ferr, qh_PRINTfacets, facet, printall); /*io.c*/
qh_printend (qh ferr, qh_PRINTfacets, facetlist, facets, printall); /*io.c*/
FORALLfacet_(facetlist)
fprintf( qh ferr, "facet f%d\n", facet->id);
} /* printfacetlist */
/*-----------------------------------------
-user_memsizes- allocate up to 10 additional, quick allocation sizes
*/
void qh_user_memsizes (void) {
/* qh_memsize (size); */
} /* user_memsizes */
#endif

View File

@ -1,34 +0,0 @@
# $Id$
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
SET(INC include src src/broad src/complex src/convex ../qhull/include)
FILE(GLOB SRC src/*.cpp src/convex/*.cpp src/complex/*.cpp src/broad/*.cpp)
ADD_DEFINITIONS(-DUSE_DOUBLES -DQHULL -D_LIB)
BLENDERLIB(extern_solid "${SRC}" "${INC}")
#, libtype=['game2','player'], priority=[45, 75]

View File

@ -1,349 +0,0 @@
The SOLID library is Copyright (C) 2001-2003 Dtecta.
You may use, distribute and copy the SOLID library under the terms of
GNU General Public License version 2, which is displayed below.
-------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
-------------------------------------------------------------------------

View File

@ -1,110 +0,0 @@
The SOLID library is Copyright (C) 2001-2003 Dtecta.
You may use, distribute and copy the SOLID library under the terms of
the Q Public License, which is displayed below.
-------------------------------------------------------------------------
THE Q PUBLIC LICENSE
version 1.0
Copyright (C) 1999-2000 Trolltech AS, Norway.
Everyone is permitted to copy and
distribute this license document.
The intent of this license is to establish freedom to share and change the
software regulated by this license under the open source model.
This license applies to any software containing a notice placed by the
copyright holder saying that it may be distributed under the terms of
the Q Public License version 1.0. Such software is herein referred to as
the Software. This license covers modification and distribution of the
Software, use of third-party application programs based on the Software,
and development of free software which uses the Software.
Granted Rights
1. You are granted the non-exclusive rights set forth in this license
provided you agree to and comply with any and all conditions in this
license. Whole or partial distribution of the Software, or software
items that link with the Software, in any form signifies acceptance of
this license.
2. You may copy and distribute the Software in unmodified form provided
that the entire package, including - but not restricted to - copyright,
trademark notices and disclaimers, as released by the initial developer
of the Software, is distributed.
3. You may make modifications to the Software and distribute your
modifications, in a form that is separate from the Software, such as
patches. The following restrictions apply to modifications:
a. Modifications must not alter or remove any copyright notices in
the Software.
b. When modifications to the Software are released under this
license, a non-exclusive royalty-free right is granted to the
initial developer of the Software to distribute your modification
in future versions of the Software provided such versions remain
available under these terms in addition to any other license(s) of
the initial developer.
4. You may distribute machine-executable forms of the Software or
machine-executable forms of modified versions of the Software, provided
that you meet these restrictions:
a. You must include this license document in the distribution.
b. You must ensure that all recipients of the machine-executable forms
are also able to receive the complete machine-readable source code
to the distributed Software, including all modifications, without
any charge beyond the costs of data transfer, and place prominent
notices in the distribution explaining this.
c. You must ensure that all modifications included in the
machine-executable forms are available under the terms of this
license.
5. You may use the original or modified versions of the Software to
compile, link and run application programs legally developed by you
or by others.
6. You may develop application programs, reusable components and other
software items that link with the original or modified versions of the
Software. These items, when distributed, are subject to the following
requirements:
a. You must ensure that all recipients of machine-executable forms of
these items are also able to receive and use the complete
machine-readable source code to the items without any charge
beyond the costs of data transfer.
b. You must explicitly license all recipients of your items to use
and re-distribute original and modified versions of the items in
both machine-executable and source code forms. The recipients must
be able to do so without any charges whatsoever, and they must be
able to re-distribute to anyone they choose.
c. If the items are not available to the general public, and the
initial developer of the Software requests a copy of the items,
then you must supply one.
Limitations of Liability
In no event shall the initial developers or copyright holders be liable
for any damages whatsoever, including - but not restricted to - lost
revenue or profits or other direct, indirect, special, incidental or
consequential damages, even if they have been advised of the possibility
of such damages, except to the extent invariable law, if any, provides
otherwise.
No Warranty
The Software and this license document are provided AS IS with NO WARRANTY
OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE.
Choice of Law
This license is governed by the Laws of Norway. Disputes shall be settled
by Oslo City Court.

56
extern/solid/Makefile vendored
View File

@ -1,56 +0,0 @@
# -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
# vim: tabstop=8
#
# $Id$
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): GSR
#
# ***** END GPL LICENSE BLOCK *****
#
#
include nan_definitions.mk
SOURCEDIR = extern/solid
LIBNAMES = solid solid_broad solid_convex solid_complex
DIR = $(OCGDIR)/extern/
DIRS = src
include nan_subdirs.mk
install: $(ALL_OR_DEBUG)
@[ -d $(NAN_SOLID) ] || mkdir -p $(NAN_SOLID)
@[ -d $(NAN_SOLID)/include/SOLID ] || mkdir -p $(NAN_SOLID)/include/SOLID
@[ -d $(NAN_SOLID)/include/SOLID/MT ] || mkdir -p $(NAN_SOLID)/include/SOLID/MT
@[ -d $(NAN_SOLID)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_SOLID)/lib/$(DEBUG_DIR)
@for i in $(LIBNAMES); do \
$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$$i/$(DEBUG_DIR)lib$$i.a $(NAN_SOLID)/lib/$(DEBUG_DIR) ; \
if [ $(OS) = darwin ] ; then \
ranlib $(NAN_SOLID)/lib/$(DEBUG_DIR)lib$$i.a ; \
fi ; \
done
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh include/*.h $(NAN_SOLID)/include/SOLID
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh include/MT/*.h $(NAN_SOLID)/include/SOLID/MT

View File

@ -1,55 +0,0 @@
SOLID - Software Library for Interference Detection
SOLID is a software library containing functions for performing
intersection tests and proximity queries that are useful in the context
of collision detection. Collision detection is the process of detecting
pairs of geometric objects that are intersecting or are within a given
proximity of each other. In particular, SOLID is useful for detecting
collisions between objects that are moving relatively of each other over
time. The motions of objects are controlled by the client application,
and are not determined or affected by SOLID.
This open-source edition of SOLID version 3 is released under the terms of
either the GNU Public License (GPL) or the Q Public License (QPL). This means
that for software created with SOLID version 3 you must comply with the terms
of one of these licenses. You may choose wich of these licenses best suits
your purpose. See the following files contained in this distribution for a
complete list of terms and conditions of these licenses:
LICENSE_QPL.txt The Q Public License
LICENSE_GPL.txt The GNU General Public License
These licenses do not permit the use of SOLID 3 in closed-source software
products. For enquiries about commercial use of SOLID, please contact
info@dtecta.com.
SOLID 3 uses Qhull from The Geometry Center of the University of Minnesota.
Qhull is copyrighted as noted below. Qhull is free software and may be
obtained via anonymous ftp from geom.umn.edu.
Qhull, Copyright (c) 1993-2002
The National Science and Technology Research Center for
Computation and Visualization of Geometric Structures
(The Geometry Center)
University of Minnesota
400 Lind Hall
207 Church Street S.E.
Minneapolis, MN 55455 USA
email: qhull@geom.umn.edu
Installation
For details on how to install SOLID see the documention in the 'doc' directory.
Platforms
SOLID 3 has been tested on the following platforms:
Linux IA32 gcc 2.95.3, gcc 3.3
Win32 MSVC++ 6.0 SP4, MSVC++ 7.1

View File

@ -1,34 +0,0 @@
#!/usr/bin/python
import sys
Import('env')
defs = 'USE_DOUBLES QHULL _LIB'
cflags = []
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
defs += ' WIN32 NDEBUG _WINDOWS _LIB'
cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
elif env['OURPLATFORM']=='win32-mingw':
defs += ' NDEBUG'
cflags += ['-O2']
elif sys.platform=='linux2' or sys.platform=='linux-i386' or sys.platform=='freebsd4' or sys.platform=='freebsd5' or sys.platform=='openbsd3' or sys.platform=='sunos5':
defs += ' NDEBUG'
cflags += ['-O2']
elif sys.platform=='darwin' :
defs += ' NDEBUG'
cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math']
else:
print "################################################"
print
print "Check if solid builds on your platform correctly"
print "Add your platform specific defines"
print "and cflags / cxxflags to the"
print "extern/solid/SConscript file"
sources = env.Glob('src/*.cpp') + env.Glob('src/convex/*.cpp') + env.Glob('src/complex/*.cpp') + env.Glob('src/broad/*.cpp')
incs = 'include src src/broad src/complex src/convex ../qhull/include'
env.BlenderLib ( libname='extern_solid', sources=sources, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[10] , compileflags = cflags)

View File

@ -1,279 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef SOLID_H
#define SOLID_H
#include "SOLID_types.h"
#ifdef __cplusplus
extern "C" {
#endif
DT_DECLARE_HANDLE(DT_ObjectHandle);
DT_DECLARE_HANDLE(DT_SceneHandle);
DT_DECLARE_HANDLE(DT_ShapeHandle);
DT_DECLARE_HANDLE(DT_VertexBaseHandle);
DT_DECLARE_HANDLE(DT_RespTableHandle);
DT_DECLARE_HANDLE(DT_ArchiveHandle);
typedef unsigned int DT_ResponseClass;
typedef enum DT_ResponseType {
DT_NO_RESPONSE, /* No response (obsolete) */
DT_BROAD_RESPONSE,
DT_SIMPLE_RESPONSE, /* No collision data */
DT_WITNESSED_RESPONSE, /* A point common to both objects
is returned as collision data
*/
DT_DEPTH_RESPONSE /* The penetration depth is returned
as collision data. The penetration depth
is the shortest vector over which one
object needs to be translated in order
to bring the objects in touching contact.
*/
} DT_ResponseType;
/* For witnessed response, the following structure represents a common point. The world
coordinates of 'point1' and 'point2' coincide. 'normal' is the zero vector.
For depth response, the following structure represents the penetration depth.
'point1' en 'point2' are the witness points of the penetration depth in world coordinates.
The penetration depth vector in world coordinates is represented by 'normal'.
*/
typedef struct DT_CollData {
DT_Vector3 point1; /* Point in object1 in world coordinates */
DT_Vector3 point2; /* Point in object2 in world coordinates */
DT_Vector3 normal; /* point2 - point1 */
} DT_CollData;
/* A response callback is called by SOLID for each pair of collding objects. 'client-data'
is a pointer to an arbitrary structure in the client application. The client objects are
pointers to structures in the client application associated with the coliding objects.
'coll_data' is the collision data computed by SOLID.
*/
typedef DT_Bool (*DT_ResponseCallback)(void *client_data,
void *client_object1,
void *client_object2,
const DT_CollData *coll_data);
/* Shape definition */
extern DECLSPEC DT_ShapeHandle DT_NewBox(DT_Scalar x, DT_Scalar y, DT_Scalar z);
extern DECLSPEC DT_ShapeHandle DT_NewCone(DT_Scalar radius, DT_Scalar height);
extern DECLSPEC DT_ShapeHandle DT_NewCylinder(DT_Scalar radius, DT_Scalar height);
extern DECLSPEC DT_ShapeHandle DT_NewSphere(DT_Scalar radius);
extern DECLSPEC DT_ShapeHandle DT_NewPoint(const DT_Vector3 point);
extern DECLSPEC DT_ShapeHandle DT_NewLineSegment(const DT_Vector3 source, const DT_Vector3 target);
extern DECLSPEC DT_ShapeHandle DT_NewMinkowski(DT_ShapeHandle shape1, DT_ShapeHandle shape2);
extern DECLSPEC DT_ShapeHandle DT_NewHull(DT_ShapeHandle shape1, DT_ShapeHandle shape2);
extern DECLSPEC DT_VertexBaseHandle DT_NewVertexBase(const void *pointer, DT_Size stride);
extern DECLSPEC void DT_DeleteVertexBase(DT_VertexBaseHandle vertexBase);
extern DECLSPEC void DT_ChangeVertexBase(DT_VertexBaseHandle vertexBase, const void *pointer);
extern DECLSPEC DT_ShapeHandle DT_NewComplexShape(DT_VertexBaseHandle vertexBase);
extern DECLSPEC void DT_EndComplexShape();
extern DECLSPEC DT_ShapeHandle DT_NewPolytope(DT_VertexBaseHandle vertexBase);
extern DECLSPEC void DT_EndPolytope();
extern DECLSPEC void DT_Begin();
extern DECLSPEC void DT_End();
extern DECLSPEC void DT_Vertex(const DT_Vector3 vertex);
extern DECLSPEC void DT_VertexIndex(DT_Index index);
extern DECLSPEC void DT_VertexIndices(DT_Count count, const DT_Index *indices);
extern DECLSPEC void DT_VertexRange(DT_Index first, DT_Count count);
extern DECLSPEC void DT_DeleteShape(DT_ShapeHandle shape);
/* Object */
extern DECLSPEC DT_ObjectHandle DT_CreateObject(
void *client_object, /* pointer to object in client memory */
DT_ShapeHandle shape /* the shape or geometry of the object */
);
extern DECLSPEC void DT_DestroyObject(DT_ObjectHandle object);
extern DECLSPEC void DT_SetPosition(DT_ObjectHandle object, const DT_Vector3 position);
extern DECLSPEC void DT_SetOrientation(DT_ObjectHandle object, const DT_Quaternion orientation);
extern DECLSPEC void DT_SetScaling(DT_ObjectHandle object, const DT_Vector3 scaling);
/* The margin is an offset from the actual shape. The actual geometry of an
object is the set of points whose distance to the transformed shape is at
most the margin. During the lifetime of an object the margin can be
modified.
*/
extern DECLSPEC void DT_SetMargin(DT_ObjectHandle object, DT_Scalar margin);
/* These commands assume a column-major 4x4 OpenGL matrix representation */
extern DECLSPEC void DT_SetMatrixf(DT_ObjectHandle object, const float *m);
extern DECLSPEC void DT_GetMatrixf(DT_ObjectHandle object, float *m);
extern DECLSPEC void DT_SetMatrixd(DT_ObjectHandle object, const double *m);
extern DECLSPEC void DT_GetMatrixd(DT_ObjectHandle object, double *m);
extern DECLSPEC void DT_GetBBox(DT_ObjectHandle object, DT_Vector3 min, DT_Vector3 max);
extern DECLSPEC DT_Bool DT_GetIntersect(DT_ObjectHandle object1, DT_ObjectHandle object2,
DT_Vector3 v);
/* This next command returns the distance between the objects. De returned
closest points are given in world coordinates.
*/
extern DECLSPEC DT_Scalar DT_GetClosestPair(DT_ObjectHandle object1, DT_ObjectHandle object2,
DT_Vector3 point1, DT_Vector3 point2);
extern DECLSPEC DT_Bool DT_GetCommonPoint(DT_ObjectHandle object1, DT_ObjectHandle object2,
DT_Vector3 point);
extern DECLSPEC DT_Bool DT_GetPenDepth(DT_ObjectHandle object1, DT_ObjectHandle object2,
DT_Vector3 point1, DT_Vector3 point2);
/* Scene */
extern DECLSPEC DT_SceneHandle DT_CreateScene();
extern DECLSPEC void DT_DestroyScene(DT_SceneHandle scene);
extern DECLSPEC void DT_AddObject(DT_SceneHandle scene, DT_ObjectHandle object);
extern DECLSPEC void DT_RemoveObject(DT_SceneHandle scene, DT_ObjectHandle object);
/* Note that objects can be assigned to multiple scenes! */
/* Response */
/* Response tables are defined independent of the scenes in which they are used.
Multiple response tables can be used in one scene, and a response table
can be shared among scenes.
*/
extern DECLSPEC DT_RespTableHandle DT_CreateRespTable();
extern DECLSPEC void DT_DestroyRespTable(DT_RespTableHandle respTable);
/* Responses are defined on (pairs of) response classes. Each response table
maintains its set of response classes.
*/
extern DECLSPEC DT_ResponseClass DT_GenResponseClass(DT_RespTableHandle respTable);
/* To each object for which a response is defined in the response table a
response class needs to be assigned.
*/
extern DECLSPEC void DT_SetResponseClass(DT_RespTableHandle respTable,
DT_ObjectHandle object,
DT_ResponseClass responseClass);
extern DECLSPEC void DT_ClearResponseClass(DT_RespTableHandle respTable,
DT_ObjectHandle object);
extern DECLSPEC void DT_CallResponse(DT_RespTableHandle respTable,
DT_ObjectHandle object1,
DT_ObjectHandle object2,
const DT_CollData *coll_data);
/* For each pair of objects multiple responses can be defined. A response is a callback
together with its response type and client data. */
/* Responses can be defined for all pairs of response classes... */
extern DECLSPEC void DT_AddDefaultResponse(DT_RespTableHandle respTable,
DT_ResponseCallback response,
DT_ResponseType type, void *client_data);
extern DECLSPEC void DT_RemoveDefaultResponse(DT_RespTableHandle respTable,
DT_ResponseCallback response);
/* ...per response class... */
extern DECLSPEC void DT_AddClassResponse(DT_RespTableHandle respTable,
DT_ResponseClass responseClass,
DT_ResponseCallback response,
DT_ResponseType type, void *client_data);
extern DECLSPEC void DT_RemoveClassResponse(DT_RespTableHandle respTable,
DT_ResponseClass responseClass,
DT_ResponseCallback response);
/* ... and per pair of response classes...*/
extern DECLSPEC void DT_AddPairResponse(DT_RespTableHandle respTable,
DT_ResponseClass responseClass1,
DT_ResponseClass responseClass2,
DT_ResponseCallback response,
DT_ResponseType type, void *client_data);
extern DECLSPEC void DT_RemovePairResponse(DT_RespTableHandle respTable,
DT_ResponseClass responseClass1,
DT_ResponseClass responseClass2,
DT_ResponseCallback response);
/* The next command calls the response callbacks for all intersecting pairs of objects in a scene.
'DT_Test' returns the number of pairs of objects for which callbacks have been called.
*/
extern DECLSPEC DT_Count DT_Test(DT_SceneHandle scene, DT_RespTableHandle respTable);
/* Set the maximum relative error in the closest points and penetration depth
computation. The default for `max_error' is 1.0e-3. Larger errors result
in better performance. Non-positive error tolerances are ignored.
*/
extern DECLSPEC void DT_SetAccuracy(DT_Scalar max_error);
/* Set the maximum tolerance on relative errors due to rounding. The default for `tol_error'
is the machine epsilon. Very large tolerances result in false collisions. Setting tol_error too small
results in missed collisions. Non-positive error tolerances are ignored.
*/
extern DECLSPEC void DT_SetTolerance(DT_Scalar tol_error);
/* This function returns the client pointer to the first object in a scene hit by the ray
(actually a line segment) defined by the points 'from' en 'to'. The spot is the hit point
on the object in local coordinates. 'normal' is the normal to the surface of the object in
world coordinates. The ignore_client pointer is used to make one of the objects transparent.
NB: Currently ray tests are implemented for spheres, boxes, and meshes only!!
*/
extern DECLSPEC void *DT_RayCast(DT_SceneHandle scene, void *ignore_client,
const DT_Vector3 source, const DT_Vector3 target,
DT_Scalar max_param, DT_Scalar *param, DT_Vector3 normal);
/* Similar, only here a single object is tested and a boolean is returned */
extern DECLSPEC DT_Bool DT_ObjectRayCast(DT_ObjectHandle object,
const DT_Vector3 source, const DT_Vector3 target,
DT_Scalar max_param, DT_Scalar *param, DT_Vector3 normal);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,75 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef SOLID_BROAD_H
#define SOLID_BROAD_H
#include "SOLID_types.h"
#ifdef __cplusplus
extern "C" {
#endif
DT_DECLARE_HANDLE(BP_SceneHandle);
DT_DECLARE_HANDLE(BP_ProxyHandle);
typedef void (*BP_Callback)(void *client_data,
void *object1,
void *object2);
typedef bool (*BP_RayCastCallback)(void *client_data,
void *object,
const DT_Vector3 source,
const DT_Vector3 target,
DT_Scalar *lambda);
extern DECLSPEC BP_SceneHandle BP_CreateScene(void *client_data,
BP_Callback beginOverlap,
BP_Callback endOverlap);
extern DECLSPEC void BP_DestroyScene(BP_SceneHandle scene);
extern DECLSPEC BP_ProxyHandle BP_CreateProxy(BP_SceneHandle scene,
void *object,
const DT_Vector3 min,
const DT_Vector3 max);
extern DECLSPEC void BP_DestroyProxy(BP_SceneHandle scene,
BP_ProxyHandle proxy);
extern DECLSPEC void BP_SetBBox(BP_ProxyHandle proxy,
const DT_Vector3 min,
const DT_Vector3 max);
extern DECLSPEC void *BP_RayCast(BP_SceneHandle scene,
BP_RayCastCallback objectRayCast,
void *client_data,
const DT_Vector3 source,
const DT_Vector3 target,
DT_Scalar *lambda);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,53 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef SOLID_TYPES_H
#define SOLID_TYPES_H
#ifndef DECLSPEC
# ifdef WIN32
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC
# endif
#endif
#define DT_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
typedef unsigned short DT_Index;
typedef unsigned short DT_Count;
typedef unsigned int DT_Size;
typedef float DT_Scalar;
typedef int DT_Bool;
#define DT_FALSE 0
#define DT_TRUE 1
#define DT_CONTINUE 0
#define DT_DONE 1
typedef DT_Scalar DT_Vector3[3];
typedef DT_Scalar DT_Quaternion[4];
#endif

View File

@ -1,132 +0,0 @@
# Microsoft Developer Studio Project File - Name="broad" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=broad - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "broad.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "broad.mak" CFG="broad - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "broad - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "broad - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "broad - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "broad - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /GX /Zd /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "broad - Win32 Release"
# Name "broad - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE="..\..\src\broad\BP_C-api.cpp"
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_EndpointList.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_Proxy.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_Scene.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\broad\BP_Endpoint.h
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_EndpointList.h
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_Proxy.h
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_ProxyList.h
# End Source File
# Begin Source File
SOURCE=..\..\src\broad\BP_Scene.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,116 +0,0 @@
# Microsoft Developer Studio Project File - Name="complex" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=complex - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "complex.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "complex.mak" CFG="complex - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "complex - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "complex - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "complex - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/convex" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "complex - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /GX /Zd /Od /I "../../include" /I "../../src/convex" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "complex - Win32 Release"
# Name "complex - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\complex\DT_BBoxTree.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\complex\DT_Complex.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\complex\DT_BBoxTree.h
# End Source File
# Begin Source File
SOURCE=..\..\src\complex\DT_CBox.h
# End Source File
# Begin Source File
SOURCE=..\..\src\complex\DT_Complex.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,232 +0,0 @@
# Microsoft Developer Studio Project File - Name="convex" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=convex - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "convex.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "convex.mak" CFG="convex - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "convex - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "convex - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "convex - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../../qhull/include" /D "NDEBUG" /D "QHULL" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "convex - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /GX /Zd /Od /I "../../include" /I "../../../qhull/include" /D "_DEBUG" /D "QHULL" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "convex - Win32 Release"
# Name "convex - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\convex\DT_Accuracy.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Box.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Cone.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Convex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Cylinder.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Facet.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_LineSegment.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_PenDepth.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Point.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Polyhedron.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Polytope.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Sphere.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Triangle.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\convex\DT_Accuracy.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Array.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Box.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Cone.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Convex.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Cylinder.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Facet.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_GJK.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Hull.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_IndexArray.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_LineSegment.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Minkowski.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_PenDepth.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Point.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Polyhedron.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Polytope.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Shape.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Sphere.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Transform.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_Triangle.h
# End Source File
# Begin Source File
SOURCE=..\..\src\convex\DT_VertexBase.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,120 +0,0 @@
# Microsoft Developer Studio Project File - Name="dynamics" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=dynamics - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "dynamics.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "dynamics.mak" CFG="dynamics - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "dynamics - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "dynamics - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "dynamics - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "dynamics - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /GX /Zd /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "dynamics - Win32 Release"
# Name "dynamics - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\examples\dynamics\Dynamic.cpp
# End Source File
# Begin Source File
SOURCE=..\..\examples\dynamics\Kinetic.cpp
# End Source File
# Begin Source File
SOURCE=..\..\examples\dynamics\RigidBody.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\examples\dynamics\Dynamic.h
# End Source File
# Begin Source File
SOURCE=..\..\examples\dynamics\Kinetic.h
# End Source File
# Begin Source File
SOURCE=..\..\examples\dynamics\RigidBody.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,102 +0,0 @@
# Microsoft Developer Studio Project File - Name="gldemo" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=gldemo - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "gldemo.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "gldemo.mak" CFG="gldemo - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "gldemo - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "gldemo - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "gldemo - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "gldemo - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /GX /Zd /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "gldemo - Win32 Release"
# Name "gldemo - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\examples\gldemo.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="mnm" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=mnm - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mnm.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mnm.mak" CFG="mnm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mnm - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mnm - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mnm - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../examples/dynamics" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "mnm - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /GX /Zd /Od /I "../../include" /I "../../examples/dynamics" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "mnm - Win32 Release"
# Name "mnm - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\examples\mnm.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="physics" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=physics - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "physics.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "physics.mak" CFG="physics - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "physics - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "physics - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "physics - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../examples/dynamics" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "physics - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /GX /Zd /Od /I "../../include" /I "../../examples/dynamics" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "physics - Win32 Release"
# Name "physics - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\examples\physics.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -1,102 +0,0 @@
# Microsoft Developer Studio Project File - Name="sample" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sample - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "sample.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "sample.mak" CFG="sample - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sample - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sample - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "sample - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "sample - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /GX /Zd /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "sample - Win32 Release"
# Name "sample - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\examples\sample.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -1,89 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "broad"=".\broad\broad.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "complex"=".\complex\complex.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "convex"=".\convex\convex.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name qhull
End Project Dependency
}}}
###############################################################################
Project: "qhull"="..\..\qhull\VisualC6\qhull\qhull.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "solid"=".\solid\solid.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name broad
End Project Dependency
Begin Project Dependency
Project_Dep_Name complex
End Project Dependency
Begin Project Dependency
Project_Dep_Name convex
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -1,148 +0,0 @@
# Microsoft Developer Studio Project File - Name="solid" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=solid - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "solid.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "solid.mak" CFG="solid - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "solid - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "solid - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "solid - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/convex" /I "../../src/complex" /D "NDEBUG" /D "QHULL" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=XCOPY /Y ..\..\include\SOLID*.h ..\..\..\..\..\lib\windows\solid\include\solid\ XCOPY /Y Release\*.lib ..\..\..\..\..\lib\windows\solid\lib\
# End Special Build Tool
!ELSEIF "$(CFG)" == "solid - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
LINK32=cwlink.exe
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /GX /Zd /Od /I "../../include" /I "../../src/convex" /I "../../src/complex" /D "_DEBUG" /D "QHULL" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=XCOPY /Y ..\..\include\SOLID*.h ..\..\..\..\..\lib\windows\solid\include\solid\ XCOPY /Y Debug\*.lib ..\..\..\..\..\lib\windows\solid\lib\Debug\
# End Special Build Tool
!ENDIF
# Begin Target
# Name "solid - Win32 Release"
# Name "solid - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE="..\..\src\DT_C-api.cpp"
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Encounter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_RespTable.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Scene.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\DT_AlgoTable.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Encounter.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Object.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Response.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_RespTable.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Scene.h
# End Source File
# End Group
# End Target
# End Project

View File

@ -1,147 +0,0 @@
# Microsoft Developer Studio Project File - Name="solid_dll" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=solid_dll - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "solid_dll.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "solid_dll.mak" CFG="solid_dll - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "solid_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "solid_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "solid_dll - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../lib/win32/vc6"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOLID_DLL_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../src/convex" /I "../../src/complex" /D "NDEBUG" /D "USE_DOUBLES" /D "QHULL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOLID_DLL_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../lib/win32/vc6/solid.dll"
!ELSEIF "$(CFG)" == "solid_dll - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../lib/win32/vc6"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOLID_DLL_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MD /W3 /GX /Zd /Od /I "../../include" /I "../../src/convex" /I "../../src/complex" /D "_DEBUG" /D "QHULL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOLID_DLL_EXPORTS" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../lib/win32/vc6/solidd.dll" /pdbtype:sept
!ENDIF
# Begin Target
# Name "solid_dll - Win32 Release"
# Name "solid_dll - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE="..\..\src\DT_C-api.cpp"
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Encounter.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_RespTable.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Scene.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\src\DT_AlgoTable.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Encounter.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Object.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Response.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_RespTable.h
# End Source File
# Begin Source File
SOURCE=..\..\src\DT_Scene.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -1,76 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef GEN_MINMAX_H
#define GEN_MINMAX_H
template <class T>
inline const T& GEN_min(const T& a, const T& b)
{
return b < a ? b : a;
}
template <class T>
inline const T& GEN_max(const T& a, const T& b)
{
return a < b ? b : a;
}
template <class T>
inline const T& GEN_clamped(const T& a, const T& lb, const T& ub)
{
return a < lb ? lb : (ub < a ? ub : a);
}
template <class T>
inline void GEN_set_min(T& a, const T& b)
{
if (b < a)
{
a = b;
}
}
template <class T>
inline void GEN_set_max(T& a, const T& b)
{
if (a < b)
{
a = b;
}
}
template <class T>
inline void GEN_clamp(T& a, const T& lb, const T& ub)
{
if (a < lb)
{
a = lb;
}
else if (ub < a)
{
a = ub;
}
}
#endif

View File

@ -1,49 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef GEN_RANDOM_H
#define GEN_RANDOM_H
#ifdef MT19937
#include <limits.h>
#include <mt19937.h>
#define GEN_RAND_MAX UINT_MAX
inline void GEN_srand(unsigned int seed) { init_genrand(seed); }
inline unsigned int GEN_rand() { return genrand_int32(); }
#else
#include <stdlib.h>
#define GEN_RAND_MAX RAND_MAX
inline void GEN_srand(unsigned int seed) { srand(seed); }
inline unsigned int GEN_rand() { return rand(); }
#endif
#endif

View File

@ -1,180 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef INTERVAL_H
#define INTERVAL_H
#if defined (__sgi)
#include <assert.h>
#else
#include <cassert>
#endif
#include <iostream>
#include <algorithm>
namespace MT {
template <typename Scalar>
class Interval {
public:
Interval() {}
#if _MSC_VER <= 1200
explicit Interval(const Scalar& x)
: m_lb(x), m_ub(x)
{}
Interval(const Scalar& lb, const Scalar& ub)
: m_lb(lb), m_ub(ub)
{
assert(lb <= ub);
}
#else
template <typename Scalar2>
explicit Interval(const Scalar2& x)
: m_lb(x), m_ub(x)
{}
template <typename Scalar2>
Interval(const Scalar2& lb, const Scalar2& ub)
: m_lb(lb), m_ub(ub)
{
assert(lb <= ub);
}
template <typename Scalar2>
Interval(const Interval<Scalar2>& z)
{
*this = z;
}
template <typename Scalar2>
Interval<Scalar>& operator=(const Interval<Scalar2>& z)
{
m_lb = Scalar(z.lower());
m_ub = Scalar(z.upper());
return *this;
}
#endif
Scalar& lower() { return m_lb; }
const Scalar& lower() const { return m_lb; }
Scalar& upper() { return m_ub; }
const Scalar& upper() const { return m_ub; }
Scalar center() const { return (m_lb + m_ub) * Scalar(0.5); }
Scalar extent() const { return (m_ub - m_lb) * Scalar(0.5); }
protected:
Scalar m_lb, m_ub;
};
template <typename Scalar>
inline Interval<Scalar>
operator+(const Interval<Scalar>& z1, const Interval<Scalar>& z2)
{
return Interval<Scalar>(z1.lower() + z2.lower(),
z1.upper() + z2.upper());
}
template <typename Scalar>
inline Interval<Scalar>
operator-(const Interval<Scalar>& z1, const Interval<Scalar>& z2)
{
return Interval<Scalar>(z1.lower() - z2.upper(),
z1.upper() - z2.lower());
}
template <typename Scalar>
inline std::ostream&
operator<<(std::ostream& os, const Interval<Scalar>& z)
{
return os << '[' << z.lower() << ", " << z.upper() << ']';
}
template <typename Scalar>
inline Scalar
median(const Interval<Scalar>& z)
{
return (z.lower() + z.upper()) * Scalar(0.5);
}
template <typename Scalar>
inline Scalar
width(const Interval<Scalar>& z)
{
return z.upper() - z.lower();
}
template <typename Scalar>
inline bool
overlap(const Interval<Scalar>& z1, const Interval<Scalar>& z2)
{
return z1.lower() <= z2.upper() && z2.lower() <= z1.upper();
}
template <typename Scalar>
inline bool
in(const Interval<Scalar>& z1, const Interval<Scalar>& z2)
{
return z2.lower() <= z1.lower() && z1.upper() <= z2.upper();
}
template <typename Scalar>
inline bool
in(Scalar x, const Interval<Scalar>& z)
{
return z.lower() <= x && x <= z.upper();
}
template <typename Scalar>
inline Interval<Scalar>
widen(const Interval<Scalar>& z, const Scalar& x)
{
return Interval<Scalar>(z.lower() - x, z.upper() + x);
}
template<typename Scalar>
inline Interval<Scalar>
hull(const Interval<Scalar>& z1, const Interval<Scalar>& z2)
{
return Interval<Scalar>(GEN_min(z1.lower(), z2.lower()),
GEN_max(z1.upper(), z2.upper()));
}
template<typename Scalar>
inline Interval<Scalar>
operator+(Scalar x, const Interval<Scalar>& z)
{
return Interval<Scalar>(x + z.lower(), x + z.upper());
}
}
#endif

View File

@ -1,380 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef MATRIX3X3_H
#define MATRIX3X3_H
#if defined (__sgi)
#include <assert.h>
#else
#include <cassert>
#endif
#include "Vector3.h"
#include "Quaternion.h"
namespace MT {
// Row-major 3x3 matrix
template <typename Scalar>
class Matrix3x3 {
public:
Matrix3x3() {}
template <typename Scalar2>
explicit Matrix3x3(const Scalar2 *m) { setValue(m); }
explicit Matrix3x3(const Quaternion<Scalar>& q) { setRotation(q); }
template <typename Scalar2>
Matrix3x3(const Scalar2& yaw, const Scalar2& pitch, const Scalar2& roll)
{
setEuler(yaw, pitch, roll);
}
template <typename Scalar2>
Matrix3x3(const Scalar2& xx, const Scalar2& xy, const Scalar2& xz,
const Scalar2& yx, const Scalar2& yy, const Scalar2& yz,
const Scalar2& zx, const Scalar2& zy, const Scalar2& zz)
{
setValue(xx, xy, xz,
yx, yy, yz,
zx, zy, zz);
}
Vector3<Scalar>& operator[](int i)
{
assert(0 <= i && i < 3);
return m_el[i];
}
const Vector3<Scalar>& operator[](int i) const
{
assert(0 <= i && i < 3);
return m_el[i];
}
Matrix3x3<Scalar>& operator*=(const Matrix3x3<Scalar>& m);
template <typename Scalar2>
void setValue(const Scalar2 *m)
{
m_el[0][0] = Scalar(m[0]);
m_el[1][0] = Scalar(m[1]);
m_el[2][0] = Scalar(m[2]);
m_el[0][1] = Scalar(m[4]);
m_el[1][1] = Scalar(m[5]);
m_el[2][1] = Scalar(m[6]);
m_el[0][2] = Scalar(m[8]);
m_el[1][2] = Scalar(m[9]);
m_el[2][2] = Scalar(m[10]);
}
template <typename Scalar2>
void setValue(const Scalar2& xx, const Scalar2& xy, const Scalar2& xz,
const Scalar2& yx, const Scalar2& yy, const Scalar2& yz,
const Scalar2& zx, const Scalar2& zy, const Scalar2& zz)
{
m_el[0][0] = Scalar(xx);
m_el[0][1] = Scalar(xy);
m_el[0][2] = Scalar(xz);
m_el[1][0] = Scalar(yx);
m_el[1][1] = Scalar(yy);
m_el[1][2] = Scalar(yz);
m_el[2][0] = Scalar(zx);
m_el[2][1] = Scalar(zy);
m_el[2][2] = Scalar(zz);
}
void setRotation(const Quaternion<Scalar>& q)
{
Scalar d = q.length2();
assert(d != Scalar(0.0));
Scalar s = Scalar(2.0) / d;
Scalar xs = q[0] * s, ys = q[1] * s, zs = q[2] * s;
Scalar wx = q[3] * xs, wy = q[3] * ys, wz = q[3] * zs;
Scalar xx = q[0] * xs, xy = q[0] * ys, xz = q[0] * zs;
Scalar yy = q[1] * ys, yz = q[1] * zs, zz = q[2] * zs;
setValue(Scalar(1.0) - (yy + zz), xy - wz, xz + wy,
xy + wz, Scalar(1.0) - (xx + zz), yz - wx,
xz - wy, yz + wx, Scalar(1.0) - (xx + yy));
}
template <typename Scalar2>
void setEuler(const Scalar2& yaw, const Scalar2& pitch, const Scalar2& roll)
{
Scalar cy(Scalar_traits<Scalar>::cos(yaw));
Scalar sy(Scalar_traits<Scalar>::sin(yaw));
Scalar cp(Scalar_traits<Scalar>::cos(pitch));
Scalar sp(Scalar_traits<Scalar>::sin(pitch));
Scalar cr(Scalar_traits<Scalar>::cos(roll));
Scalar sr(Scalar_traits<Scalar>::sin(roll));
Scalar cc = cy * cr;
Scalar cs = cy * sr;
Scalar sc = sy * cr;
Scalar ss = sy * sr;
setValue(cy * cp, -sc + sp * cs, ss - sp * cc,
sy * cp, cc + sp * ss, -cs + sp * sc,
-sp, cp * sr, cp * cr);
}
void setIdentity()
{
setValue(Scalar(1.0), Scalar(0.0), Scalar(0.0),
Scalar(0.0), Scalar(1.0), Scalar(0.0),
Scalar(0.0), Scalar(0.0), Scalar(1.0));
}
template <typename Scalar2>
void getValue(Scalar2 *m) const
{
m[0] = Scalar2(m_el[0][0]);
m[1] = Scalar2(m_el[1][0]);
m[2] = Scalar2(m_el[2][0]);
m[3] = Scalar2(0.0);
m[4] = Scalar2(m_el[0][1]);
m[5] = Scalar2(m_el[1][1]);
m[6] = Scalar2(m_el[2][1]);
m[7] = Scalar2(0.0);
m[8] = Scalar2(m_el[0][2]);
m[9] = Scalar2(m_el[1][2]);
m[10] = Scalar2(m_el[2][2]);
m[11] = Scalar2(0.0);
}
void getRotation(Quaternion<Scalar>& q) const
{
Scalar trace = m_el[0][0] + m_el[1][1] + m_el[2][2];
if (trace > Scalar(0.0))
{
Scalar s = Scalar_traits<Scalar>::sqrt(trace + Scalar(1.0));
q[3] = s * Scalar(0.5);
s = Scalar(0.5) / s;
q[0] = (m_el[2][1] - m_el[1][2]) * s;
q[1] = (m_el[0][2] - m_el[2][0]) * s;
q[2] = (m_el[1][0] - m_el[0][1]) * s;
}
else
{
int i = m_el[0][0] < m_el[1][1] ?
(m_el[1][1] < m_el[2][2] ? 2 : 1) :
(m_el[0][0] < m_el[2][2] ? 2 : 0);
int j = (i + 1) % 3;
int k = (i + 2) % 3;
Scalar s = Scalar_traits<Scalar>::sqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + Scalar(1.0));
q[i] = s * Scalar(0.5);
s = Scalar(0.5) / s;
q[3] = (m_el[k][j] - m_el[j][k]) * s;
q[j] = (m_el[j][i] + m_el[i][j]) * s;
q[k] = (m_el[k][i] + m_el[i][k]) * s;
}
}
template <typename Scalar2>
void getEuler(Scalar2& yaw, Scalar2& pitch, Scalar2& roll) const
{
pitch = Scalar2(Scalar_traits<Scalar>::asin(-m_el[2][0]));
if (pitch < Scalar_traits<Scalar2>::TwoTimesPi())
{
if (pitch > Scalar_traits<Scalar2>::TwoTimesPi())
{
yaw = Scalar2(Scalar_traits<Scalar>::atan2(m_el[1][0], m_el[0][0]));
roll = Scalar2(Scalar_traits<Scalar>::atan2(m_el[2][1], m_el[2][2]));
}
else
{
yaw = Scalar2(-Scalar_traits<Scalar>::atan2(-m_el[0][1], m_el[0][2]));
roll = Scalar2(0.0);
}
}
else
{
yaw = Scalar2(Scalar_traits<Scalar>::atan2(-m_el[0][1], m_el[0][2]));
roll = Scalar2(0.0);
}
}
Vector3<Scalar> getScaling() const
{
return Vector3<Scalar>(m_el[0][0] * m_el[0][0] + m_el[1][0] * m_el[1][0] + m_el[2][0] * m_el[2][0],
m_el[0][1] * m_el[0][1] + m_el[1][1] * m_el[1][1] + m_el[2][1] * m_el[2][1],
m_el[0][2] * m_el[0][2] + m_el[1][2] * m_el[1][2] + m_el[2][2] * m_el[2][2]);
}
Matrix3x3<Scalar> scaled(const Vector3<Scalar>& s) const
{
return Matrix3x3<Scalar>(m_el[0][0] * s[0], m_el[0][1] * s[1], m_el[0][2] * s[2],
m_el[1][0] * s[0], m_el[1][1] * s[1], m_el[1][2] * s[2],
m_el[2][0] * s[0], m_el[2][1] * s[1], m_el[2][2] * s[2]);
}
Scalar determinant() const;
Matrix3x3<Scalar> adjoint() const;
Matrix3x3<Scalar> absolute() const;
Matrix3x3<Scalar> transpose() const;
Matrix3x3<Scalar> inverse() const;
Matrix3x3<Scalar> transposeTimes(const Matrix3x3<Scalar>& m) const;
Matrix3x3<Scalar> timesTranspose(const Matrix3x3<Scalar>& m) const;
Scalar tdot(int c, const Vector3<Scalar>& v) const
{
return m_el[0][c] * v[0] + m_el[1][c] * v[1] + m_el[2][c] * v[2];
}
protected:
Scalar cofac(int r1, int c1, int r2, int c2) const
{
return m_el[r1][c1] * m_el[r2][c2] - m_el[r1][c2] * m_el[r2][c1];
}
Vector3<Scalar> m_el[3];
};
template <typename Scalar>
inline std::ostream&
operator<<(std::ostream& os, const Matrix3x3<Scalar>& m)
{
return os << m[0] << std::endl << m[1] << std::endl << m[2] << std::endl;
}
template <typename Scalar>
inline Matrix3x3<Scalar>&
Matrix3x3<Scalar>::operator*=(const Matrix3x3<Scalar>& m)
{
setValue(m.tdot(0, m_el[0]), m.tdot(1, m_el[0]), m.tdot(2, m_el[0]),
m.tdot(0, m_el[1]), m.tdot(1, m_el[1]), m.tdot(2, m_el[1]),
m.tdot(0, m_el[2]), m.tdot(1, m_el[2]), m.tdot(2, m_el[2]));
return *this;
}
template <typename Scalar>
inline Scalar
Matrix3x3<Scalar>::determinant() const
{
return triple((*this)[0], (*this)[1], (*this)[2]);
}
template <typename Scalar>
inline Matrix3x3<Scalar>
Matrix3x3<Scalar>::absolute() const
{
return Matrix3x3<Scalar>(
Scalar_traits<Scalar>::abs(m_el[0][0]), Scalar_traits<Scalar>::abs(m_el[0][1]), Scalar_traits<Scalar>::abs(m_el[0][2]),
Scalar_traits<Scalar>::abs(m_el[1][0]), Scalar_traits<Scalar>::abs(m_el[1][1]), Scalar_traits<Scalar>::abs(m_el[1][2]),
Scalar_traits<Scalar>::abs(m_el[2][0]), Scalar_traits<Scalar>::abs(m_el[2][1]), Scalar_traits<Scalar>::abs(m_el[2][2]));
}
template <typename Scalar>
inline Matrix3x3<Scalar>
Matrix3x3<Scalar>::transpose() const
{
return Matrix3x3<Scalar>(m_el[0][0], m_el[1][0], m_el[2][0],
m_el[0][1], m_el[1][1], m_el[2][1],
m_el[0][2], m_el[1][2], m_el[2][2]);
}
template <typename Scalar>
inline Matrix3x3<Scalar>
Matrix3x3<Scalar>::adjoint() const
{
return Matrix3x3<Scalar>(cofac(1, 1, 2, 2), cofac(0, 2, 2, 1), cofac(0, 1, 1, 2),
cofac(1, 2, 2, 0), cofac(0, 0, 2, 2), cofac(0, 2, 1, 0),
cofac(1, 0, 2, 1), cofac(0, 1, 2, 0), cofac(0, 0, 1, 1));
}
template <typename Scalar>
inline Matrix3x3<Scalar>
Matrix3x3<Scalar>::inverse() const
{
Vector3<Scalar> co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1));
Scalar det = (*this)[0].dot(co);
assert(det != Scalar(0.0));
Scalar s = Scalar(1.0) / det;
return Matrix3x3<Scalar>(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
co[1] * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,
co[2] * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s);
}
template <typename Scalar>
inline Matrix3x3<Scalar>
Matrix3x3<Scalar>::transposeTimes(const Matrix3x3<Scalar>& m) const
{
return Matrix3x3<Scalar>(
m_el[0][0] * m[0][0] + m_el[1][0] * m[1][0] + m_el[2][0] * m[2][0],
m_el[0][0] * m[0][1] + m_el[1][0] * m[1][1] + m_el[2][0] * m[2][1],
m_el[0][0] * m[0][2] + m_el[1][0] * m[1][2] + m_el[2][0] * m[2][2],
m_el[0][1] * m[0][0] + m_el[1][1] * m[1][0] + m_el[2][1] * m[2][0],
m_el[0][1] * m[0][1] + m_el[1][1] * m[1][1] + m_el[2][1] * m[2][1],
m_el[0][1] * m[0][2] + m_el[1][1] * m[1][2] + m_el[2][1] * m[2][2],
m_el[0][2] * m[0][0] + m_el[1][2] * m[1][0] + m_el[2][2] * m[2][0],
m_el[0][2] * m[0][1] + m_el[1][2] * m[1][1] + m_el[2][2] * m[2][1],
m_el[0][2] * m[0][2] + m_el[1][2] * m[1][2] + m_el[2][2] * m[2][2]);
}
template <typename Scalar>
inline Matrix3x3<Scalar>
Matrix3x3<Scalar>::timesTranspose(const Matrix3x3<Scalar>& m) const
{
return Matrix3x3<Scalar>(
m_el[0].dot(m[0]), m_el[0].dot(m[1]), m_el[0].dot(m[2]),
m_el[1].dot(m[0]), m_el[1].dot(m[1]), m_el[1].dot(m[2]),
m_el[2].dot(m[0]), m_el[2].dot(m[1]), m_el[2].dot(m[2]));
}
template <typename Scalar>
inline Vector3<Scalar>
operator*(const Matrix3x3<Scalar>& m, const Vector3<Scalar>& v)
{
return Vector3<Scalar>(m[0].dot(v), m[1].dot(v), m[2].dot(v));
}
template <typename Scalar>
inline Vector3<Scalar>
operator*(const Vector3<Scalar>& v, const Matrix3x3<Scalar>& m)
{
return Vector3<Scalar>(m.tdot(0, v), m.tdot(1, v), m.tdot(2, v));
}
template <typename Scalar>
inline Matrix3x3<Scalar>
operator*(const Matrix3x3<Scalar>& m1, const Matrix3x3<Scalar>& m2)
{
return Matrix3x3<Scalar>(
m2.tdot(0, m1[0]), m2.tdot(1, m1[0]), m2.tdot(2, m1[0]),
m2.tdot(0, m1[1]), m2.tdot(1, m1[1]), m2.tdot(2, m1[1]),
m2.tdot(0, m1[2]), m2.tdot(1, m1[2]), m2.tdot(2, m1[2]));
}
}
#endif

View File

@ -1,316 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef QUATERNION_H
#define QUATERNION_H
#if defined (__sgi)
#include <assert.h>
#else
#include <cassert>
#endif
#include "Tuple4.h"
#include "Vector3.h"
namespace MT {
template <typename Scalar>
class Quaternion : public Tuple4<Scalar> {
public:
Quaternion() {}
template <typename Scalar2>
explicit Quaternion(const Scalar2 *v) : Tuple4<Scalar>(v) {}
template <typename Scalar2>
Quaternion(const Scalar2& x, const Scalar2& y, const Scalar2& z, const Scalar2& w)
: Tuple4<Scalar>(x, y, z, w)
{}
Quaternion(const Vector3<Scalar>& axis, const Scalar& angle)
{
setRotation(axis, angle);
}
template <typename Scalar2>
Quaternion(const Scalar2& yaw, const Scalar2& pitch, const Scalar2& roll)
{
setEuler(yaw, pitch, roll);
}
void setRotation(const Vector3<Scalar>& axis, const Scalar& angle)
{
Scalar d = axis.length();
assert(d != Scalar(0.0));
Scalar s = Scalar_traits<Scalar>::sin(angle * Scalar(0.5)) / d;
setValue(axis[0] * s, axis[1] * s, axis[2] * s,
Scalar_traits<Scalar>::cos(angle * Scalar(0.5)));
}
template <typename Scalar2>
void setEuler(const Scalar2& yaw, const Scalar2& pitch, const Scalar2& roll)
{
Scalar halfYaw = Scalar(yaw) * Scalar(0.5);
Scalar halfPitch = Scalar(pitch) * Scalar(0.5);
Scalar halfRoll = Scalar(roll) * Scalar(0.5);
Scalar cosYaw = Scalar_traits<Scalar>::cos(halfYaw);
Scalar sinYaw = Scalar_traits<Scalar>::sin(halfYaw);
Scalar cosPitch = Scalar_traits<Scalar>::cos(halfPitch);
Scalar sinPitch = Scalar_traits<Scalar>::sin(halfPitch);
Scalar cosRoll = Scalar_traits<Scalar>::cos(halfRoll);
Scalar sinRoll = Scalar_traits<Scalar>::sin(halfRoll);
setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,
cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,
sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,
cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
}
Quaternion<Scalar>& operator+=(const Quaternion<Scalar>& q)
{
this->m_co[0] += q[0]; this->m_co[1] += q[1]; this->m_co[2] += q[2]; this->m_co[3] += q[3];
return *this;
}
Quaternion<Scalar>& operator-=(const Quaternion<Scalar>& q)
{
this->m_co[0] -= q[0]; this->m_co[1] -= q[1]; this->m_co[2] -= q[2]; this->m_co[3] -= q[3];
return *this;
}
Quaternion<Scalar>& operator*=(const Scalar& s)
{
this->m_co[0] *= s; this->m_co[1] *= s; this->m_co[2] *= s; this->m_co[3] *= s;
return *this;
}
Quaternion<Scalar>& operator/=(const Scalar& s)
{
assert(s != Scalar(0.0));
return *this *= Scalar(1.0) / s;
}
Quaternion<Scalar>& operator*=(const Quaternion<Scalar>& q)
{
setValue(this->m_co[3] * q[0] + this->m_co[0] * q[3] + this->m_co[1] * q[2] - this->m_co[2] * q[1],
this->m_co[3] * q[1] + this->m_co[1] * q[3] + this->m_co[2] * q[0] - this->m_co[0] * q[2],
this->m_co[3] * q[2] + this->m_co[2] * q[3] + this->m_co[0] * q[1] - this->m_co[1] * q[0],
this->m_co[3] * q[3] - this->m_co[0] * q[0] - this->m_co[1] * q[1] - this->m_co[2] * q[2]);
return *this;
}
Scalar dot(const Quaternion<Scalar>& q) const
{
return this->m_co[0] * q[0] + this->m_co[1] * q[1] + this->m_co[2] * q[2] + this->m_co[3] * q[3];
}
Scalar length2() const
{
return dot(*this);
}
Scalar length() const
{
return Scalar_traits<Scalar>::sqrt(length2());
}
Quaternion<Scalar>& normalize()
{
return *this /= length();
}
Quaternion<Scalar> normalized() const
{
return *this / length();
}
Scalar angle(const Quaternion<Scalar>& q) const
{
Scalar s = Scalar_traits<Scalar>::sqrt(length2() * q.length2());
assert(s != Scalar(0.0));
return Scalar_traits<Scalar>::acos(dot(q) / s);
}
Quaternion<Scalar> conjugate() const
{
return Quaternion<Scalar>(-this->m_co[0], -this->m_co[1], -this->m_co[2], this->m_co[3]);
}
Quaternion<Scalar> inverse() const
{
return conjugate / length2();
}
Quaternion<Scalar> slerp(const Quaternion<Scalar>& q, const Scalar& t) const
{
Scalar theta = angle(q);
if (theta != Scalar(0.0))
{
Scalar d = Scalar(1.0) / Scalar_traits<Scalar>::sin(theta);
Scalar s0 = Scalar_traits<Scalar>::sin((Scalar(1.0) - t) * theta);
Scalar s1 = Scalar_traits<Scalar>::sin(t * theta);
return Quaternion<Scalar>((this->m_co[0] * s0 + q[0] * s1) * d,
(this->m_co[1] * s0 + q[1] * s1) * d,
(this->m_co[2] * s0 + q[2] * s1) * d,
(this->m_co[3] * s0 + q[3] * s1) * d);
}
else
{
return *this;
}
}
static Quaternion<Scalar> random()
{
// From: "Uniform Random Rotations", Ken Shoemake, Graphics Gems III,
// pg. 124-132
Scalar x0 = Scalar_traits<Scalar>::random();
Scalar r1 = Scalar_traits<Scalar>::sqrt(Scalar(1.0) - x0);
Scalar r2 = Scalar_traits<Scalar>::sqrt(x0);
Scalar t1 = Scalar_traits<Scalar>::TwoTimesPi() * Scalar_traits<Scalar>::random();
Scalar t2 = Scalar_traits<Scalar>::TwoTimesPi() * Scalar_traits<Scalar>::random();
Scalar c1 = Scalar_traits<Scalar>::cos(t1);
Scalar s1 = Scalar_traits<Scalar>::sin(t1);
Scalar c2 = Scalar_traits<Scalar>::cos(t2);
Scalar s2 = Scalar_traits<Scalar>::sin(t2);
return Quaternion<Scalar>(s1 * r1, c1 * r1, s2 * r2, c2 * r2);
}
};
template <typename Scalar>
inline Quaternion<Scalar>
operator+(const Quaternion<Scalar>& q1, const Quaternion<Scalar>& q2)
{
return Quaternion<Scalar>(q1[0] + q2[0], q1[1] + q2[1], q1[2] + q2[2], q1[3] + q2[3]);
}
template <typename Scalar>
inline Quaternion<Scalar>
operator-(const Quaternion<Scalar>& q1, const Quaternion<Scalar>& q2)
{
return Quaternion<Scalar>(q1[0] - q2[0], q1[1] - q2[1], q1[2] - q2[2], q1[3] - q2[3]);
}
template <typename Scalar>
inline Quaternion<Scalar>
operator-(const Quaternion<Scalar>& q)
{
return Quaternion<Scalar>(-q[0], -q[1], -q[2], -q[3]);
}
template <typename Scalar>
inline Quaternion<Scalar>
operator*(const Quaternion<Scalar>& q, const Scalar& s)
{
return Quaternion<Scalar>(q[0] * s, q[1] * s, q[2] * s, q[3] * s);
}
template <typename Scalar>
inline Quaternion<Scalar>
operator*(const Scalar& s, const Quaternion<Scalar>& q)
{
return q * s;
}
template <typename Scalar>
inline Quaternion<Scalar>
operator*(const Quaternion<Scalar>& q1, const Quaternion<Scalar>& q2) {
return Quaternion<Scalar>(q1[3] * q2[0] + q1[0] * q2[3] + q1[1] * q2[2] - q1[2] * q2[1],
q1[3] * q2[1] + q1[1] * q2[3] + q1[2] * q2[0] - q1[0] * q2[2],
q1[3] * q2[2] + q1[2] * q2[3] + q1[0] * q2[1] - q1[1] * q2[0],
q1[3] * q2[3] - q1[0] * q2[0] - q1[1] * q2[1] - q1[2] * q2[2]);
}
template <typename Scalar>
inline Quaternion<Scalar>
operator*(const Quaternion<Scalar>& q, const Vector3<Scalar>& w)
{
return Quaternion<Scalar>( q[3] * w[0] + q[1] * w[2] - q[2] * w[1],
q[3] * w[1] + q[2] * w[0] - q[0] * w[2],
q[3] * w[2] + q[0] * w[1] - q[1] * w[0],
-q[0] * w[0] - q[1] * w[1] - q[2] * w[2]);
}
template <typename Scalar>
inline Quaternion<Scalar>
operator*(const Vector3<Scalar>& w, const Quaternion<Scalar>& q)
{
return Quaternion<Scalar>( w[0] * q[3] + w[1] * q[2] - w[2] * q[1],
w[1] * q[3] + w[2] * q[0] - w[0] * q[2],
w[2] * q[3] + w[0] * q[1] - w[1] * q[0],
-w[0] * q[0] - w[1] * q[1] - w[2] * q[2]);
}
template <typename Scalar>
inline Scalar
dot(const Quaternion<Scalar>& q1, const Quaternion<Scalar>& q2)
{
return q1.dot(q2);
}
template <typename Scalar>
inline Scalar
length2(const Quaternion<Scalar>& q)
{
return q.length2();
}
template <typename Scalar>
inline Scalar
length(const Quaternion<Scalar>& q)
{
return q.length();
}
template <typename Scalar>
inline Scalar
angle(const Quaternion<Scalar>& q1, const Quaternion<Scalar>& q2)
{
return q1.angle(q2);
}
template <typename Scalar>
inline Quaternion<Scalar>
conjugate(const Quaternion<Scalar>& q)
{
return q.conjugate();
}
template <typename Scalar>
inline Quaternion<Scalar>
inverse(const Quaternion<Scalar>& q)
{
return q.inverse();
}
template <typename Scalar>
inline Quaternion<Scalar>
slerp(const Quaternion<Scalar>& q1, const Quaternion<Scalar>& q2, const Scalar& t)
{
return q1.slerp(q2, t);
}
}
#endif

View File

@ -1,189 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef TRANSFORM_H
#define TRANSFORM_H
#include "Vector3.h"
#include "Matrix3x3.h"
namespace MT {
template <typename Scalar>
class Transform {
enum {
TRANSLATION = 0x01,
ROTATION = 0x02,
RIGID = TRANSLATION | ROTATION,
SCALING = 0x04,
LINEAR = ROTATION | SCALING,
AFFINE = TRANSLATION | LINEAR
};
public:
Transform() {}
template <typename Scalar2>
explicit Transform(const Scalar2 *m) { setValue(m); }
explicit Transform(const Quaternion<Scalar>& q,
const Vector3<Scalar>& c = Vector3<Scalar>(Scalar(0), Scalar(0), Scalar(0)))
: m_basis(q),
m_origin(c),
m_type(RIGID)
{}
explicit Transform(const Matrix3x3<Scalar>& b,
const Vector3<Scalar>& c = Vector3<Scalar>(Scalar(0), Scalar(0), Scalar(0)),
unsigned int type = AFFINE)
: m_basis(b),
m_origin(c),
m_type(type)
{}
Vector3<Scalar> operator()(const Vector3<Scalar>& x) const
{
return Vector3<Scalar>(m_basis[0].dot(x) + m_origin[0],
m_basis[1].dot(x) + m_origin[1],
m_basis[2].dot(x) + m_origin[2]);
}
Vector3<Scalar> operator*(const Vector3<Scalar>& x) const
{
return (*this)(x);
}
Matrix3x3<Scalar>& getBasis() { return m_basis; }
const Matrix3x3<Scalar>& getBasis() const { return m_basis; }
Vector3<Scalar>& getOrigin() { return m_origin; }
const Vector3<Scalar>& getOrigin() const { return m_origin; }
Quaternion<Scalar> getRotation() const { return m_basis.getRotation(); }
template <typename Scalar2>
void setValue(const Scalar2 *m)
{
m_basis.setValue(m);
m_origin.setValue(&m[12]);
m_type = AFFINE;
}
template <typename Scalar2>
void getValue(Scalar2 *m) const
{
m_basis.getValue(m);
m_origin.getValue(&m[12]);
m[15] = Scalar2(1.0);
}
void setOrigin(const Vector3<Scalar>& origin)
{
m_origin = origin;
m_type |= TRANSLATION;
}
void setBasis(const Matrix3x3<Scalar>& basis)
{
m_basis = basis;
m_type |= LINEAR;
}
void setRotation(const Quaternion<Scalar>& q)
{
m_basis.setRotation(q);
m_type = (m_type & ~LINEAR) | ROTATION;
}
void scale(const Vector3<Scalar>& scaling)
{
m_basis = m_basis.scaled(scaling);
m_type |= SCALING;
}
void setIdentity()
{
m_basis.setIdentity();
m_origin.setValue(Scalar(0.0), Scalar(0.0), Scalar(0.0));
m_type = 0x0;
}
bool isIdentity() const { return m_type == 0x0; }
Transform<Scalar>& operator*=(const Transform<Scalar>& t)
{
m_origin += m_basis * t.m_origin;
m_basis *= t.m_basis;
m_type |= t.m_type;
return *this;
}
Transform<Scalar> inverse() const
{
Matrix3x3<Scalar> inv = (m_type & SCALING) ?
m_basis.inverse() :
m_basis.transpose();
return Transform<Scalar>(inv, inv * -m_origin, m_type);
}
Transform<Scalar> inverseTimes(const Transform<Scalar>& t) const;
Transform<Scalar> operator*(const Transform<Scalar>& t) const;
private:
Matrix3x3<Scalar> m_basis;
Vector3<Scalar> m_origin;
unsigned int m_type;
};
template <typename Scalar>
inline Transform<Scalar>
Transform<Scalar>::inverseTimes(const Transform<Scalar>& t) const
{
Vector3<Scalar> v = t.getOrigin() - m_origin;
if (m_type & SCALING)
{
Matrix3x3<Scalar> inv = m_basis.inverse();
return Transform<Scalar>(inv * t.getBasis(), inv * v,
m_type | t.m_type);
}
else
{
return Transform<Scalar>(m_basis.transposeTimes(t.m_basis),
v * m_basis, m_type | t.m_type);
}
}
template <typename Scalar>
inline Transform<Scalar>
Transform<Scalar>::operator*(const Transform<Scalar>& t) const
{
return Transform<Scalar>(m_basis * t.m_basis,
(*this)(t.m_origin),
m_type | t.m_type);
}
}
#endif

View File

@ -1,120 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef TUPLE3_H
#define TUPLE3_H
#if defined (__sgi)
#include <assert.h>
#else
#include <cassert>
#endif
#include <iostream>
namespace MT {
template <typename Scalar>
class Tuple3 {
public:
Tuple3() {}
template <typename Scalar2>
explicit Tuple3(const Scalar2 *v)
{
setValue(v);
}
template <typename Scalar2>
Tuple3(const Scalar2& x, const Scalar2& y, const Scalar2& z)
{
setValue(x, y, z);
}
template <typename Scalar2>
Tuple3(const Tuple3<Scalar2>& t)
{
*this = t;
}
template <typename Scalar2>
Tuple3<Scalar>& operator=(const Tuple3<Scalar2>& t)
{
m_co[0] = Scalar(t[0]);
m_co[1] = Scalar(t[1]);
m_co[2] = Scalar(t[2]);
return *this;
}
operator Scalar *() { return m_co; }
operator const Scalar *() const { return m_co; }
Scalar& operator[](int i) { return m_co[i]; }
const Scalar& operator[](int i) const { return m_co[i]; }
Scalar& x() { return m_co[0]; }
const Scalar& x() const { return m_co[0]; }
Scalar& y() { return m_co[1]; }
const Scalar& y() const { return m_co[1]; }
Scalar& z() { return m_co[2]; }
const Scalar& z() const { return m_co[2]; }
template <typename Scalar2>
void setValue(const Scalar2 *v)
{
m_co[0] = Scalar(v[0]);
m_co[1] = Scalar(v[1]);
m_co[2] = Scalar(v[2]);
}
template <typename Scalar2>
void setValue(const Scalar2& x, const Scalar2& y, const Scalar2& z)
{
m_co[0] = Scalar(x);
m_co[1] = Scalar(y);
m_co[2] = Scalar(z);
}
template <typename Scalar2>
void getValue(Scalar2 *v) const
{
v[0] = Scalar2(m_co[0]);
v[1] = Scalar2(m_co[1]);
v[2] = Scalar2(m_co[2]);
}
protected:
Scalar m_co[3];
};
template <typename Scalar>
inline std::ostream&
operator<<(std::ostream& os, const Tuple3<Scalar>& t)
{
return os << t[0] << ' ' << t[1] << ' ' << t[2];
}
}
#endif

View File

@ -1,112 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef TUPLE4_H
#define TUPLE4_H
#if defined (__sgi)
#include <assert.h>
#else
#include <cassert>
#endif
#include <iostream>
namespace MT {
template <typename Scalar>
class Tuple4 {
public:
Tuple4() {}
template <typename Scalar2>
explicit Tuple4(const Scalar2 *v)
{
setValue(v);
}
template <typename Scalar2>
Tuple4(const Scalar2& x, const Scalar2& y, const Scalar2& z, const Scalar2& w)
{
setValue(x, y, z, w);
}
operator Scalar *() { return m_co; }
operator const Scalar *() const { return m_co; }
Scalar& operator[](int i) { return m_co[i]; }
const Scalar& operator[](int i) const { return m_co[i]; }
Scalar& x() { return m_co[0]; }
const Scalar& x() const { return m_co[0]; }
Scalar& y() { return m_co[1]; }
const Scalar& y() const { return m_co[1]; }
Scalar& z() { return m_co[2]; }
const Scalar& z() const { return m_co[2]; }
Scalar& w() { return m_co[3]; }
const Scalar& w() const { return m_co[3]; }
template <typename Scalar2>
void setValue(const Scalar2 *v)
{
m_co[0] = Scalar(v[0]);
m_co[1] = Scalar(v[1]);
m_co[2] = Scalar(v[2]);
m_co[3] = Scalar(v[3]);
}
template <typename Scalar2>
void setValue(const Scalar2& x, const Scalar2& y, const Scalar2& z, const Scalar2& w)
{
m_co[0] = Scalar(x);
m_co[1] = Scalar(y);
m_co[2] = Scalar(z);
m_co[3] = Scalar(w);
}
template <typename Scalar2>
void getValue(Scalar2 *v) const
{
v[0] = Scalar2(m_co[0]);
v[1] = Scalar2(m_co[1]);
v[2] = Scalar2(m_co[2]);
v[3] = Scalar2(m_co[3]);
}
protected:
Scalar m_co[4];
};
template <typename Scalar>
inline std::ostream&
operator<<(std::ostream& os, const Tuple4<Scalar>& t)
{
return os << t[0] << ' ' << t[1] << ' ' << t[2] << ' ' << t[3];
}
}
#endif

View File

@ -1,283 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef VECTOR3_H
#define VECTOR3_H
#if defined (__sgi)
#include <assert.h>
#else
#include <cassert>
#endif
#include "Tuple3.h"
namespace MT {
template <typename Scalar>
class Vector3 : public Tuple3<Scalar> {
public:
Vector3() {}
template <typename Scalar2>
explicit Vector3(const Scalar2 *v) : Tuple3<Scalar>(v) {}
template <typename Scalar2>
Vector3(const Scalar2& x, const Scalar2& y, const Scalar2& z)
: Tuple3<Scalar>(x, y, z)
{}
Vector3<Scalar>& operator+=(const Vector3<Scalar>& v)
{
this->m_co[0] += v[0]; this->m_co[1] += v[1]; this->m_co[2] += v[2];
return *this;
}
Vector3<Scalar>& operator-=(const Vector3<Scalar>& v)
{
this->m_co[0] -= v[0]; this->m_co[1] -= v[1]; this->m_co[2] -= v[2];
return *this;
}
Vector3<Scalar>& operator*=(const Scalar& s)
{
this->m_co[0] *= s; this->m_co[1] *= s; this->m_co[2] *= s;
return *this;
}
Vector3<Scalar>& operator/=(const Scalar& s)
{
assert(s != Scalar(0.0));
return *this *= Scalar(1.0) / s;
}
Scalar dot(const Vector3<Scalar>& v) const
{
return this->m_co[0] * v[0] + this->m_co[1] * v[1] + this->m_co[2] * v[2];
}
Scalar length2() const
{
return dot(*this);
}
Scalar length() const
{
return Scalar_traits<Scalar>::sqrt(length2());
}
Scalar distance2(const Vector3<Scalar>& v) const
{
return (v - *this).length2();
}
Scalar distance(const Vector3<Scalar>& v) const
{
return (v - *this).length();
}
Vector3<Scalar>& normalize()
{
return *this /= length();
}
Vector3<Scalar> normalized() const
{
return *this / length();
}
Scalar angle(const Vector3<Scalar>& v) const
{
Scalar s = Scalar_traits<Scalar>::sqrt(length2() * v.length2());
assert(s != Scalar(0.0));
return Scalar_traits<Scalar>::acos(dot(v) / s);
}
Vector3<Scalar> absolute() const
{
return Vector3<Scalar>(Scalar_traits<Scalar>::abs(this->m_co[0]),
Scalar_traits<Scalar>::abs(this->m_co[1]),
Scalar_traits<Scalar>::abs(this->m_co[2]));
}
Vector3<Scalar> cross(const Vector3<Scalar>& v) const
{
return Vector3<Scalar>(this->m_co[1] * v[2] - this->m_co[2] * v[1],
this->m_co[2] * v[0] - this->m_co[0] * v[2],
this->m_co[0] * v[1] - this->m_co[1] * v[0]);
}
Scalar triple(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2) const
{
return this->m_co[0] * (v1[1] * v2[2] - v1[2] * v2[1]) +
this->m_co[1] * (v1[2] * v2[0] - v1[0] * v2[2]) +
this->m_co[2] * (v1[0] * v2[1] - v1[1] * v2[0]);
}
int minAxis() const
{
return this->m_co[0] < this->m_co[1] ? (this->m_co[0] < this->m_co[2] ? 0 : 2) : (this->m_co[1] < this->m_co[2] ? 1 : 2);
}
int maxAxis() const
{
return this->m_co[0] < this->m_co[1] ? (this->m_co[1] < this->m_co[2] ? 2 : 1) : (this->m_co[0] < this->m_co[2] ? 2 : 0);
}
int furthestAxis() const
{
return absolute().minAxis();
}
int closestAxis() const
{
return absolute().maxAxis();
}
Vector3<Scalar> lerp(const Vector3<Scalar>& v, const Scalar& t) const
{
return Vector3<Scalar>(this->m_co[0] + (v[0] - this->m_co[0]) * t,
this->m_co[1] + (v[1] - this->m_co[1]) * t,
this->m_co[2] + (v[2] - this->m_co[2]) * t);
}
static Vector3<Scalar> random()
{
Scalar z = Scalar(2.0) * Scalar_traits<Scalar>::random() - Scalar(1.0);
Scalar r = Scalar_traits<Scalar>::sqrt(Scalar(1.0) - z * z);
Scalar t = Scalar_traits<Scalar>::TwoTimesPi() * Scalar_traits<Scalar>::random();
return Vector3<Scalar>(r * Scalar_traits<Scalar>::cos(t),
r * Scalar_traits<Scalar>::sin(t),
z);
}
};
template <typename Scalar>
inline Vector3<Scalar>
operator+(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return Vector3<Scalar>(v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2]);
}
template <typename Scalar>
inline Vector3<Scalar>
operator-(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return Vector3<Scalar>(v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2]);
}
template <typename Scalar>
inline Vector3<Scalar>
operator-(const Vector3<Scalar>& v)
{
return Vector3<Scalar>(-v[0], -v[1], -v[2]);
}
template <typename Scalar>
inline Vector3<Scalar>
operator*(const Vector3<Scalar>& v, const Scalar& s)
{
return Vector3<Scalar>(v[0] * s, v[1] * s, v[2] * s);
}
template <typename Scalar>
inline Vector3<Scalar>
operator*(const Scalar& s, const Vector3<Scalar>& v)
{
return v * s;
}
template <typename Scalar>
inline Vector3<Scalar>
operator/(const Vector3<Scalar>& v, const Scalar& s)
{
assert(s != Scalar(0.0));
return v * (Scalar(1.0) / s);
}
template <typename Scalar>
inline Scalar
dot(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return v1.dot(v2);
}
template <typename Scalar>
inline Scalar
length2(const Vector3<Scalar>& v)
{
return v.length2();
}
template <typename Scalar>
inline Scalar
length(const Vector3<Scalar>& v)
{
return v.length();
}
template <typename Scalar>
inline Scalar
distance2(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return v1.distance2(v2);
}
template <typename Scalar>
inline Scalar
distance(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return v1.distance(v2);
}
template <typename Scalar>
inline Scalar
angle(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return v1.angle(v2);
}
template <typename Scalar>
inline Vector3<Scalar>
cross(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2)
{
return v1.cross(v2);
}
template <typename Scalar>
inline Scalar
triple(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2, const Vector3<Scalar>& v3)
{
return v1.triple(v2, v3);
}
template <typename Scalar>
inline Vector3<Scalar>
lerp(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2, const Scalar& t)
{
return v1.lerp(v2, t);
}
}
#endif

View File

@ -1,119 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef MT_BBOX_H
#define MT_BBOX_H
#include "MT_Scalar.h"
#include "MT_Point3.h"
#include "MT_Vector3.h"
#include <MT/Tuple3.h>
#include "MT_Interval.h"
class MT_BBox : public MT::Tuple3<MT_Interval> {
public:
MT_BBox() {}
MT_BBox(const MT_Point3& p)
: MT::Tuple3<MT_Interval>(MT_Interval(p[0]),
MT_Interval(p[1]),
MT_Interval(p[2]))
{}
MT_BBox(const MT_Point3& lb, const MT_Point3& ub)
: MT::Tuple3<MT_Interval>(MT_Interval(lb[0], ub[0]),
MT_Interval(lb[1], ub[1]),
MT_Interval(lb[2], ub[2]))
{}
MT_BBox(const MT_Interval& x, const MT_Interval& y, const MT_Interval& z)
: MT::Tuple3<MT_Interval>(x, y, z)
{}
MT_Point3 getMin() const
{
return MT_Point3(m_co[0].lower(), m_co[1].lower(), m_co[2].lower());
}
MT_Point3 getMax() const
{
return MT_Point3(m_co[0].upper(), m_co[1].upper(), m_co[2].upper());
}
MT_Point3 getCenter() const
{
return MT_Point3(MT::median(m_co[0]), MT::median(m_co[1]), MT::median(m_co[2]));
}
MT_Vector3 getExtent() const
{
return MT_Vector3(MT::width(m_co[0]) * MT_Scalar(0.5), MT::width(m_co[1]) * MT_Scalar(0.5), MT::width(m_co[2]) * MT_Scalar(0.5));
}
void extend(const MT_Vector3& v)
{
m_co[0] = MT::widen(m_co[0], v[0]);
m_co[1] = MT::widen(m_co[1], v[1]);
m_co[2] = MT::widen(m_co[2], v[2]);
}
bool overlaps(const MT_BBox& b) const
{
return MT::overlap(m_co[0], b[0]) &&
MT::overlap(m_co[1], b[1]) &&
MT::overlap(m_co[2], b[2]);
}
bool inside(const MT_BBox& b) const
{
return MT::in(m_co[0], b[0]) &&
MT::in(m_co[1], b[1]) &&
MT::in(m_co[2], b[2]);
}
MT_BBox hull(const MT_BBox& b) const
{
return MT_BBox(MT::hull(m_co[0], b[0]),
MT::hull(m_co[1], b[1]),
MT::hull(m_co[2], b[2]));
}
bool contains(const MT_Point3& p) const
{
return MT::in(p[0], m_co[0]) && MT::in(p[1], m_co[1]) && MT::in(p[2], m_co[2]);
}
};
inline MT_BBox operator+(const MT_BBox& b1, const MT_BBox& b2)
{
return MT_BBox(b1[0] + b2[0], b1[1] + b2[1], b1[2] + b2[2]);
}
inline MT_BBox operator-(const MT_BBox& b1, const MT_BBox& b2)
{
return MT_BBox(b1[0] - b2[0], b1[1] - b2[1], b1[2] - b2[2]);
}
#endif

View File

@ -1,33 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef MT_INTERVAL_H
#define MT_INTERVAL_H
#include <MT/Interval.h>
#include "MT_Scalar.h"
typedef MT::Interval<MT_Scalar> MT_Interval;
#endif

View File

@ -1,34 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef MT_MATRIX3X3_H
#define MT_MATRIX3X3_H
#include "MT_Scalar.h"
#include <MT/Matrix3x3.h>
typedef MT::Matrix3x3<MT_Scalar> MT_Matrix3x3;
#endif

View File

@ -1,31 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef MT_POINT3_H
#define MT_POINT3_H
#include "MT_Vector3.h"
typedef MT_Vector3 MT_Point3;
#endif

View File

@ -1,35 +0,0 @@
/*
* SOLID - Software Library for Interference Detection
*
* Copyright (C) 2001-2003 Dtecta. All rights reserved.
*
* This library may be distributed under the terms of the Q Public License
* (QPL) as defined by Trolltech AS of Norway and appearing in the file
* LICENSE.QPL included in the packaging of this file.
*
* This library may be distributed and/or modified under the terms of the
* GNU General Public License (GPL) version 2 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Commercial use or any other use of this library not covered by either
* the QPL or the GPL requires an additional license from Dtecta.
* Please contact info@dtecta.com for enquiries about the terms of commercial
* use of this library.
*/
#ifndef MT_QUATERNION_H
#define MT_QUATERNION_H
#include "MT_Scalar.h"
#include <MT/Quaternion.h>
typedef MT::Quaternion<MT_Scalar> MT_Quaternion;
#endif

Some files were not shown because too many files have changed in this diff Show More