diff --git a/cpp/Qhull.cpp b/cpp/Qhull.cpp index 04797d494d5e9786f370d7cdb95b8d3bacd0993f..f7077e3c62892262b58e8c8823997b07202b8f1c 100644 --- a/cpp/Qhull.cpp +++ b/cpp/Qhull.cpp @@ -1,13 +1,13 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/Qhull.cpp#35 $$Change: 1096 $ -** $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/Qhull.cpp#37 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ #//! Qhull -- invoke qhull from C++ -#//! Compile qhulllib and Qhull together due to use of setjmp/longjmp() +#//! Compile libqhull and Qhull together due to use of setjmp/longjmp() #include <iostream> @@ -17,7 +17,7 @@ #include "QhullFacetList.h" #include "QhullQh.h" #include "RboxPoints.h" -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" extern "C" { #include "../src/qhull_a.h" @@ -44,7 +44,7 @@ char s_not_output_options[]= " Fd TI A C d E H P Qb QbB Qbb Qc Qf Qg Qi Qm QJ Qr Qhull:: Qhull() : qhull_qh(0) -, qhull_run_id(UsingQhullLib::NOqhRunId) +, qhull_run_id(UsingLibQhull::NOqhRunId) , origin_point() , qhull_status(qh_ERRnone) , qhull_dimension(0) @@ -62,7 +62,7 @@ Qhull() Qhull:: Qhull(const RboxPoints &points, const char *qhullCommand) : qhull_qh(0) -, qhull_run_id(UsingQhullLib::NOqhRunId) +, qhull_run_id(UsingLibQhull::NOqhRunId) , origin_point() , qhull_status(qh_ERRnone) , qhull_dimension(0) @@ -81,7 +81,7 @@ Qhull(const RboxPoints &points, const char *qhullCommand) Qhull:: Qhull(const char *rboxCommand, int pointDimension, int pointCount, const realT *points, const char *qhullCommand) : qhull_qh(0) -, qhull_run_id(UsingQhullLib::NOqhRunId) +, qhull_run_id(UsingLibQhull::NOqhRunId) , origin_point() , qhull_status(qh_ERRnone) , qhull_dimension(0) @@ -119,8 +119,8 @@ initializeQhull() Qhull:: ~Qhull() throw() { - //! UsingQhullLib is required by ~QhullQh - UsingQhullLib q(this, QhullError::NOthrow); + //! UsingLibQhull is required by ~QhullQh + UsingLibQhull q(this, QhullError::NOthrow); if(q.defined()){ int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() @@ -132,16 +132,17 @@ Qhull:: qhull_qh->~QhullQh(); qhull_qh= 0; #endif - qhull_run_id= UsingQhullLib::NOqhRunId; + qhull_run_id= UsingLibQhull::NOqhRunId; // Except for cerr, does not throw errors if(hasQhullMessage()){ + cerr<< "\nQhull output at end\n"; cerr<<qhullMessage(); //FIXUP: where should error and log messages go on ~Qhull? clearQhullMessage(); } } maybeThrowQhullMessage(exitCode, QhullError::NOthrow); } - s_qhull_output= 0; // Set by UsingQhullLib + s_qhull_output= 0; // Set by UsingLibQhull }//~Qhull #//Messaging @@ -212,7 +213,7 @@ setOutputStream(ostream *os) int Qhull:: runId() { - UsingQhullLib u(this); + UsingLibQhull u(this); QHULL_UNUSED(u); return qhull_run_id; @@ -223,7 +224,7 @@ runId() double Qhull:: area(){ - UsingQhullLib q(this); + UsingLibQhull q(this); qhull_qh->checkIfQhullRan(); if(!qh hasAreaVolume){ int exitCode = setjmp(qh errexit); @@ -237,7 +238,7 @@ area(){ double Qhull:: volume(){ - UsingQhullLib q(this); + UsingLibQhull q(this); qhull_qh->checkIfQhullRan(); if(!qh hasAreaVolume){ int exitCode = setjmp(qh errexit); @@ -271,7 +272,7 @@ vertexList() const{ void Qhull:: outputQhull() { - UsingQhullLib q(this); + UsingLibQhull q(this); qhull_qh->checkIfQhullRan(); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() @@ -283,7 +284,7 @@ outputQhull() void Qhull:: outputQhull(const char *outputflags) { - UsingQhullLib q(this); + UsingLibQhull q(this); qhull_qh->checkIfQhullRan(); string cmd(" "); // qh_checkflags skips first word cmd += outputflags; @@ -332,7 +333,7 @@ runQhull(const char *rboxCommand, int pointDimension, int pointCount, const real string s("qhull "); s += qhullCommand; char *command= const_cast<char*>(s.c_str()); - UsingQhullLib q(this); + UsingLibQhull q(this); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() qh_checkflags(command, s_unsupported_options); @@ -430,7 +431,7 @@ maybeThrowQhullMessage(int exitCode, int noThrow) throw() s_qhull_output == Qhull notes: - only called from qhulllib + only called from libqhull same as fprintf() and RboxPoints::qh_fprintf_rbox() fgets() is not trapped like fprintf() Do not throw errors from here. Use qh_errexit; @@ -442,7 +443,7 @@ void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) { using namespace orgQhull; if(!s_qhull_output){ - fprintf(stderr, "QH10025 Qhull error: UsingQhullLib not declared prior to calling qh_...(). s_qhull_output==NULL.\n"); + fprintf(stderr, "QH10025 Qhull error: UsingLibQhull not declared prior to calling qh_...(). s_qhull_output==NULL.\n"); qh_exit(10025); } Qhull *out= s_qhull_output; diff --git a/cpp/Qhull.h b/cpp/Qhull.h index 9646c9fc89b6430c3548c8d04e05b1f618beced9..a1cd4d7a91fabbaec93f6942907b481197a23a58 100644 --- a/cpp/Qhull.h +++ b/cpp/Qhull.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/Qhull.h#31 $$Change: 1096 $ -** $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/Qhull.h#32 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -26,7 +26,7 @@ namespace orgQhull { /*** - Compile qhullcpp and qhulllib with the same compiler. setjmp() and longjmp() must be the same. + Compile qhullcpp and libqhull with the same compiler. setjmp() and longjmp() must be the same. */ #//Types @@ -53,7 +53,7 @@ private: std::ostream *output_stream; //! send output to stream friend void ::qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ); - friend class UsingQhullLib; + friend class UsingLibQhull; #//Attribute public: diff --git a/cpp/QhullError.h b/cpp/QhullError.h index a57ef39f6eb19722607aedcbf9ae829cc0036680..6fa4e632e8726f0c67a22778f6c71a22a40ca32a 100644 --- a/cpp/QhullError.h +++ b/cpp/QhullError.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullError.h#29 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullError.h#30 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -28,7 +28,7 @@ public: enum { QHULLfirstError= 10000, //Larger than msgcode in Qhull's user.h QHULLlastError= 10067, - NOthrow= 1 //! For flag to UsingQhullLIb() + NOthrow= 1 //! For flag to UsingLibQhull() }; #//Constructors diff --git a/cpp/QhullFacet.cpp b/cpp/QhullFacet.cpp index 95694548dfa5faa698baadde3654d56c7f7a6912..6606f414a59abb502722af23615f8d6a1eca5d89 100644 --- a/cpp/QhullFacet.cpp +++ b/cpp/QhullFacet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacet.cpp#28 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacet.cpp#29 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -57,7 +57,7 @@ dimension() const QhullPoint QhullFacet:: getCenter(int qhRunId, qh_PRINT printFormat) { - UsingQhullLib q(qhRunId); + UsingLibQhull q(qhRunId); if(qh CENTERtype==qh_ASvoronoi){ if(!qh_facet->normal || !qh_facet->upperdelaunay || !qh ATinfinity){ @@ -91,7 +91,7 @@ getCenter(int qhRunId, qh_PRINT printFormat) //! from io.c[qh_PRINTinner] QhullHyperplane QhullFacet:: innerplane(int qhRunId) const{ - UsingQhullLib q(qhRunId); + UsingLibQhull q(qhRunId); realT inner; // Does not error qh_outerinner(const_cast<facetT *>(getFacetT()), NULL, &inner); @@ -104,7 +104,7 @@ innerplane(int qhRunId) const{ //! from io.c[qh_PRINTouter] QhullHyperplane QhullFacet:: outerplane(int qhRunId) const{ - UsingQhullLib q(qhRunId); + UsingLibQhull q(qhRunId); realT outer; // Does not error qh_outerinner(const_cast<facetT *>(getFacetT()), &outer, NULL); @@ -147,7 +147,7 @@ double QhullFacet:: facetArea(int qhRunId) { if(!qh_facet->isarea){ - UsingQhullLib q(qhRunId); + UsingLibQhull q(qhRunId); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() qh_facet->f.area= qh_facetarea(qh_facet); @@ -205,7 +205,7 @@ using orgQhull::QhullRidge; using orgQhull::QhullRidgeSet; using orgQhull::QhullSetBase; using orgQhull::QhullVertexSet; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; ostream & operator<<(ostream &os, const QhullFacet::PrintFacet &pr) // FIXUP make const (center) @@ -435,16 +435,16 @@ operator<<(ostream &os, const QhullFacet::PrintHeader &pr) //! Print ridges of facet to stream. Same as qh_printfacetridges [io.c] -//! If qhRunId==UsingQhullLib::NOqhRunId, does not use qh +//! If qhRunId==UsingLibQhull::NOqhRunId, does not use qh ostream & operator<<(ostream &os, const QhullFacet::PrintRidges &pr) { const QhullFacet facet= *pr.facet; facetT *f= facet.getFacetT(); QhullRidgeSet rs= facet.ridges(); - if(pr.run_id!=UsingQhullLib::NOqhRunId){ - UsingQhullLib q(pr.run_id); - // No calls to qhulllib + if(pr.run_id!=UsingLibQhull::NOqhRunId){ + UsingLibQhull q(pr.run_id); + // No calls to libqhull if(f->visible && qh NEWfacets){ os<< " - ridges(ids may be garbage):"; for(QhullRidgeSet::iterator i=rs.begin(); i!=rs.end(); ++i){ @@ -507,6 +507,6 @@ operator<<(ostream &os, const QhullFacet::PrintRidges &pr) ostream & operator<<(ostream &os, QhullFacet &f) { - os<< f.print(UsingQhullLib::NOqhRunId); + os<< f.print(UsingLibQhull::NOqhRunId); return os; }//<< QhullFacet diff --git a/cpp/QhullFacet.h b/cpp/QhullFacet.h index b85f695f501b01a37f4f910a49671823265b53b1..130f9194b819285ea71f13ae2878b5fdde222882 100644 --- a/cpp/QhullFacet.h +++ b/cpp/QhullFacet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacet.h#30 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacet.h#31 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -33,7 +33,7 @@ namespace orgQhull { class QhullVertexSet; #//Types - //! QhullFacet -- Qhull's facet structure, facetT [qhulllib.h], as a C++ class + //! QhullFacet -- Qhull's facet structure, facetT [libqhull.h], as a C++ class class QhullFacet; //! A QhullFacet is the C++ equivalent to Qhull's facetT* @@ -146,6 +146,6 @@ std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintFlag std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintHeader &pr); std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintRidges &pr); std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacet::PrintFacet &pr); -std::ostream &operator<<(std::ostream &os, orgQhull::QhullFacet &f); //FIXUP. No conversion! { os<< f.print(orgQhull::UsingQhullLib::NOqhRunId); return os; } // FIXUP non-const due to center. Make it mutable? +std::ostream &operator<<(std::ostream &os, orgQhull::QhullFacet &f); //FIXUP. No conversion! { os<< f.print(orgQhull::UsingLibQhull::NOqhRunId); return os; } // FIXUP non-const due to center. Make it mutable? #endif // QHULLFACET_H diff --git a/cpp/QhullFacetList.cpp b/cpp/QhullFacetList.cpp index f2811eea3f670eacbaa56fa0b37bbebb2a8af06c..12f23d0eeb10b73560ff1248823a308a3b5b2e96 100644 --- a/cpp/QhullFacetList.cpp +++ b/cpp/QhullFacetList.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacetList.cpp#18 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacetList.cpp#19 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -82,7 +82,7 @@ using orgQhull::QhullFacet; using orgQhull::QhullFacetList; using orgQhull::QhullVertex; using orgQhull::QhullVertexSet; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; ostream & operator<<(ostream &os, const QhullFacetList::PrintFacetList &pr) diff --git a/cpp/QhullFacetList.h b/cpp/QhullFacetList.h index dbd253ecbf6318d8f747de1c8d132a52ff9054b0..2678927abed06a61b33af4703206f1ddb0eb7b06 100644 --- a/cpp/QhullFacetList.h +++ b/cpp/QhullFacetList.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacetList.h#16 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacetList.h#17 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -100,6 +100,6 @@ std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::Print // FIXUP -- why did <<facetList work and the others did not? // print() not available since printVertices() requires qhRunId. // [9/09] added const -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs) { os<< fs.printFacets(orgQhull::UsingQhullLib::NOqhRunId); return os; } +inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs) { os<< fs.printFacets(orgQhull::UsingLibQhull::NOqhRunId); return os; } #endif // QHULLFACETLIST_H diff --git a/cpp/QhullFacetSet.cpp b/cpp/QhullFacetSet.cpp index a229f638b521ae9056d8a6d1c028ca0b59452e4e..9db1bbb692c18f885a48ace06c1bf0e2322be3e4 100644 --- a/cpp/QhullFacetSet.cpp +++ b/cpp/QhullFacetSet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacetSet.cpp#15 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacetSet.cpp#16 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -81,12 +81,12 @@ using std::endl; using std::ostream; using orgQhull::QhullFacet; using orgQhull::QhullFacetSet; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; ostream & operator<<(ostream &os, const QhullFacetSet &fs) { - os<< fs.print(UsingQhullLib::NOqhRunId, ""); + os<< fs.print(UsingLibQhull::NOqhRunId, ""); return os; }//<<QhullFacetSet diff --git a/cpp/QhullFacetSet.h b/cpp/QhullFacetSet.h index 7a0db93a568a10ed47c807737a13e7249d0753e1..de9f2840ed1d4f620642fbbacf220528819b0c25 100644 --- a/cpp/QhullFacetSet.h +++ b/cpp/QhullFacetSet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullFacetSet.h#14 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullFacetSet.h#15 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -87,7 +87,7 @@ public: #//== Global namespace ========================================= -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs); // FIXUP no 'const ...PrintFacetSet as below! { os<< fs.print(orgQhull::UsingQhullLib::NOqhRunId, ""); } +std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs); // FIXUP no 'const ...PrintFacetSet as below! { os<< fs.print(orgQhull::UsingLibQhull::NOqhRunId, ""); } std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintFacetSet &pr); std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintIdentifiers &p); diff --git a/cpp/QhullHyperplane.cpp b/cpp/QhullHyperplane.cpp index b2166c17307e64a3a94e7a72d77263c327873433..32024db59e7e511725b88b4aa66522176b1e219c 100644 --- a/cpp/QhullHyperplane.cpp +++ b/cpp/QhullHyperplane.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullHyperplane.cpp#4 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullHyperplane.cpp#5 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -82,7 +82,7 @@ operator==(const QhullHyperplane &other) const return false; } double d= abs(hyperplane_offset-other.hyperplane_offset); - if(d>UsingQhullLib::globalDistanceEpsilon()){ + if(d>UsingLibQhull::globalDistanceEpsilon()){ return false; } const coordT *c= hyperplane_coordinates; @@ -95,7 +95,7 @@ operator==(const QhullHyperplane &other) const double diff= *c++ - *c2++; dist2 += diff*diff; } - if(dist2 > UsingQhullLib::globalAngleEpsilon()){ + if(dist2 > UsingLibQhull::globalAngleEpsilon()){ return false; } return true; @@ -109,7 +109,7 @@ operator==(const QhullHyperplane &other) const using std::ostream; using orgQhull::QhullHyperplane; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; #//operator<< diff --git a/cpp/QhullHyperplane.h b/cpp/QhullHyperplane.h index c1764a320b8600be359eac219d29326e7f5e2a92..32e4f94ad69e38dfd10ddf6298b092ab122f7945 100644 --- a/cpp/QhullHyperplane.h +++ b/cpp/QhullHyperplane.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullHyperplane.h#4 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullHyperplane.h#5 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -11,7 +11,7 @@ #include "QhullError.h" #include "QhullIterator.h" -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" #include <ostream> diff --git a/cpp/QhullLinkedList.h b/cpp/QhullLinkedList.h index 7bba491a0bebe4ec2bf372153b2b0d7007b830c1..d8ccd26d6d1f985ac04ba43c694a9e0a633895ee 100644 --- a/cpp/QhullLinkedList.h +++ b/cpp/QhullLinkedList.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullLinkedList.h#24 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullLinkedList.h#25 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -26,9 +26,9 @@ namespace orgQhull { #//Type //! QhullLinkedList<T> -- A linked list modeled on QLinkedList. //! T is an opaque type with T(B *b), b=t.getBaseT(), t=t.next(), and t=t.prev(). The end node is a sentinel. - //! qhulllib owns the contents. + //! libqhull owns the contents. //! QhullLinkedList does not define erase(), clear(), removeFirst(), removeLast(), pop_back(), pop_front(), fromStdList() - //! Derived from Qt/core/tools/qlinkedlist.h and qhulllib.h/FORALLfacets_() + //! Derived from Qt/core/tools/qlinkedlist.h and libqhull.h/FORALLfacets_() //! QhullLinkedList<T>::const_iterator -- STL-style iterator //! QhullLinkedList<T>::iterator -- STL-style iterator //! QhullLinkedListIterator<T> -- Java-style iterator diff --git a/cpp/QhullPoint.cpp b/cpp/QhullPoint.cpp index 1073f122f4890f06a5ae3c0552f8765f47589c23..0b767008ea5757b4a99f58cbc168595a3f528bf8 100644 --- a/cpp/QhullPoint.cpp +++ b/cpp/QhullPoint.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoint.cpp#21 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoint.cpp#22 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -10,7 +10,7 @@ #include <iostream> #include "QhullPoint.h" -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" #ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4 #endif @@ -23,17 +23,17 @@ namespace orgQhull { int QhullPoint:: id(int qhRunId, int dimension, const coordT *c) { - if(UsingQhullLib::hasPoints()){ - if(qhRunId==UsingQhullLib::NOqhRunId){ + if(UsingLibQhull::hasPoints()){ + if(qhRunId==UsingLibQhull::NOqhRunId){ const coordT *pointsEnd; int dimension; - const coordT *points= UsingQhullLib::globalPoints(&dimension, &pointsEnd); + const coordT *points= UsingLibQhull::globalPoints(&dimension, &pointsEnd); if(c>=points && c<pointsEnd){ int offset= (int)(c-points); // WARN64 return offset/dimension; } }else{ - UsingQhullLib q(qhRunId); + UsingLibQhull q(qhRunId); // NOerrors from qh_pointid or qh_setindex return qh_pointid(const_cast<coordT *>(c)); } @@ -60,7 +60,7 @@ operator==(const QhullPoint &other) const double diff= *c++ - *c2++; dist2 += diff*diff; } - double epsilon= UsingQhullLib::globalDistanceEpsilon(); + double epsilon= UsingLibQhull::globalDistanceEpsilon(); // std::cout<< "FIXUP dist2 " << dist2 << " epsilon^2 " << epsilon*epsilon << std::endl; return (dist2<=(epsilon*epsilon)); }//operator== @@ -118,14 +118,14 @@ distance(const QhullPoint &p) const using std::ostream; using orgQhull::QhullPoint; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; #//operator<< ostream & operator<<(ostream &os, const QhullPoint &p) { - os<< p.printWithIdentifier(UsingQhullLib::NOqhRunId, ""); + os<< p.printWithIdentifier(UsingLibQhull::NOqhRunId, ""); return os; } diff --git a/cpp/QhullPoint.h b/cpp/QhullPoint.h index 514df4e2349c8e3ac460b195ca0e0d80406cedb4..bbf5f28af487bcba6fbd98dd91301d1c69dbd809 100644 --- a/cpp/QhullPoint.h +++ b/cpp/QhullPoint.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoint.h#24 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoint.h#25 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -11,7 +11,7 @@ #include "QhullError.h" #include "QhullIterator.h" -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" #include "Coordinates.h" #include <ostream> @@ -31,11 +31,11 @@ namespace orgQhull { class QhullPoint { #//Class objects - //! QhullPoint and UsingQhullLib store QhullQh fields + //! QhullPoint and UsingLibQhull store QhullQh fields #//Class methods -- Convert point to id w/o QhullQh data structure public: - static int id(const coordT *c) { return QhullPoint::id(UsingQhullLib::NOqhRunId, 0, c); } + static int id(const coordT *c) { return QhullPoint::id(UsingLibQhull::NOqhRunId, 0, c); } static int id(int qhRunId, const coordT *c) { return QhullPoint::id(qhRunId, 0, c); } static int id(int qhRunId, int dimension, const coordT *c); @@ -81,7 +81,7 @@ public: coordT *coordinates() { return point_coordinates; } int dimension() const { return point_dimension; } int id(int qhRunId) const { return id(qhRunId, dimension(), coordinates()); } - int id() const { return id(UsingQhullLib::NOqhRunId, dimension(), coordinates()); } + int id() const { return id(UsingLibQhull::NOqhRunId, dimension(), coordinates()); } bool isDefined() const { return point_coordinates!=0 && point_dimension>0; } #//Define @@ -118,7 +118,7 @@ public: bool with_identifier; PrintPoint(int qhRunId, const char *message, bool withIdentifier, const QhullPoint &p) : point(&p), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {} };//PrintPoint - PrintPoint print() const { return PrintPoint(UsingQhullLib::NOqhRunId, "", false, *this); } + PrintPoint print() const { return PrintPoint(UsingLibQhull::NOqhRunId, "", false, *this); } PrintPoint print(int qhRunId) const { return PrintPoint(qhRunId, "", true, *this); } PrintPoint print(int qhRunId, const char *message) const { return PrintPoint(qhRunId, message, false, *this); } PrintPoint printWithIdentifier(int qhRunId, const char *message) const { return PrintPoint(qhRunId, message, true, *this); } @@ -132,7 +132,7 @@ QHULL_DECLARE_SEQUENTIAL_ITERATOR(QhullPoint, coordT) #//Global functions std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPoint::PrintPoint &pr); -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPoint &p); // FIXUP OK in c program but not inline { os<< p.print(orgQhull::UsingQhullLib::NOqhRunId, ""); return os; } +std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPoint &p); // FIXUP OK in c program but not inline { os<< p.print(orgQhull::UsingLibQhull::NOqhRunId, ""); return os; } #endif // QHPOINT_H diff --git a/cpp/QhullPointSet.cpp b/cpp/QhullPointSet.cpp index 614751f731f4d40f8f75e030c0f4fc160f0331f8..11c8e7d84ddb81267df08765d802353bd1163f07 100644 --- a/cpp/QhullPointSet.cpp +++ b/cpp/QhullPointSet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 c-> Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPointSet.cpp#3 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPointSet.cpp#4 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -153,14 +153,14 @@ using std::endl; using std::ostream; using orgQhull::QhullPoint; using orgQhull::QhullPointSet; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; #//operator<< ostream & operator<<(ostream &os, const QhullPointSet &ps) { - os<< ps.print(UsingQhullLib::NOqhRunId); + os<< ps.print(UsingLibQhull::NOqhRunId); return os; }//<<QhullPointSet diff --git a/cpp/QhullPoints.cpp b/cpp/QhullPoints.cpp index bc34c6704485ab1059fa36b68666287c7320c869..e5d59d341f305c2b03d66fa637e54b90ef45c3bc 100644 --- a/cpp/QhullPoints.cpp +++ b/cpp/QhullPoints.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoints.cpp#13 $$Change: 1094 $ -** $DateTime: 2009/11/24 20:04:16 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoints.cpp#14 $$Change: 1107 $ +** $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ ** ****************************************************************************/ @@ -134,7 +134,7 @@ indexOf(const QhullPoint &t) const { int j=0; const_iterator i= begin(); - while(i != end()){ + while(i!=end()){ if(*i==t){ return j; } diff --git a/cpp/QhullPoints.h b/cpp/QhullPoints.h index 1d758f931a41899631c5389dc5b59aac2c626181..7b54d77d877625d7c1075de333793d81b246305f 100644 --- a/cpp/QhullPoints.h +++ b/cpp/QhullPoints.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullPoints.h#19 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullPoints.h#20 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -201,7 +201,7 @@ public: bool with_identifier; PrintPoints(int qhRunId, const char *message, bool withIdentifier, const QhullPoints &ps) : points(&ps), point_message(message), run_id(qhRunId), with_identifier(withIdentifier) {} };//PrintPoints - PrintPoints print() const { return PrintPoints(UsingQhullLib::NOqhRunId, "", false, *this); } + PrintPoints print() const { return PrintPoints(UsingLibQhull::NOqhRunId, "", false, *this); } PrintPoints print(int qhRunId) const { return PrintPoints(qhRunId, "", true, *this); } PrintPoints print(int qhRunId, const char *message) const { return PrintPoints(qhRunId, message, false, *this); } PrintPoints printWithIdentifier(int qhRunId, const char *message) const { return PrintPoints(qhRunId, message, true, *this); } diff --git a/cpp/QhullQh.cpp b/cpp/QhullQh.cpp index a990d35c53955397ce89269146cf8337fb829312..aee151a9654f3e7d53958d8200cf38444248d4d2 100644 --- a/cpp/QhullQh.cpp +++ b/cpp/QhullQh.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullQh.cpp#19 $$Change: 1053 $ -** $DateTime: 2009/10/02 22:00:28 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullQh.cpp#21 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -33,7 +33,7 @@ namespace orgQhull { #//Constructor, destructor, etc. //! If qh_QHpointer==0, invoke with placement new on qh_qh; -//! Sets qh_qh and qh_qhstat. Need to reset before UsingQhullLib. +//! Sets qh_qh and qh_qhstat. Need to reset before UsingLibQhull. //! Derived from qh_new_qhull[user.c] QhullQh:: QhullQh() @@ -47,7 +47,7 @@ QhullQh() qh_meminit(NULL); firstcall= False; } - // QhullQh() and UsingQhullLib() are the same + // QhullQh() and UsingLibQhull() are the same #if qh_QHpointer if(qh_qh){ if(qh old_qhstat){ @@ -70,26 +70,26 @@ QhullQh() qh_initqhull_start2(NULL, NULL, qh_FILEstderr); }//QhullQh -//! UsingQhullLib must be declared along with QhullQh +//! UsingLibQhull must be declared along with QhullQh QhullQh:: ~QhullQh() { #if qh_QHpointer if(!qh_qh){ - QhullError e(10042, "Qhull internal error: qh_qh undefined. Was ~QhullQh() invoked independent of UsingQhullLib?", qh run_id, 0, 0, qh_qh); + QhullError e(10042, "Qhull internal error: qh_qh undefined. Was ~QhullQh() invoked independent of UsingLibQhull?", qh run_id, 0, 0, qh_qh); e.logError(); }else if(!qh_qhstat){ QhullError e(10043, "Qhull internal error: qh_qhstat null. Is another thread running?"); e.logError(); }else if(qh_qh!=this){ - QhullError e(10044, "Qhull error: ~QhullQh() invoked independent of UsingQhullLib. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); + QhullError e(10044, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); e.logError(); }else{ qh_freeqhull2(qh_ALL); // sets qh.NOerrexit. Clears struct *qh_qh including run_id, but not qh_qh itself } #else if(&qh_qh!=this){ - QhullError e(10045, "Qhull error: ~QhullQh() invoked independent of UsingQhullLib. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); + QhullError e(10045, "Qhull error: ~QhullQh() invoked independent of UsingLibQhull. qh_qh %x (runId %d) vs. QhullQh.runId %d.", qh run_id, run_id, 0.0, qh_qh); e.logError(); }else{ qh_freeqhull2(qh_ALL); // sets qh.NOerrexit. Clears struct *qh_qh including run_id, but not qh_qh itself diff --git a/cpp/QhullQh.h b/cpp/QhullQh.h index fcd1a0c349c96ee87927b9db2f106d1be0702330..16b1f8ee345e10a3be0f40843f644b2d61d4fa79 100644 --- a/cpp/QhullQh.h +++ b/cpp/QhullQh.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullQh.h#14 $$Change: 1053 $ -** $DateTime: 2009/10/02 22:00:28 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullQh.h#15 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -20,7 +20,7 @@ namespace orgQhull { #//defined here //! QhullQh -- Qhull's global data structure, qhT, as a C++ class - //! See UsingQhullLib.h for C++/C interface to qhT + //! See UsingLibQhull.h for C++/C interface to qhT class QhullQh; class QhullQh : public qhT { diff --git a/cpp/QhullRidge.cpp b/cpp/QhullRidge.cpp index 68788ff46c0e0beedc61f55e5fd7c0c2258c5aae..b25ebfc7be5a9455f0281afc76ae21a024fdd9f8 100644 --- a/cpp/QhullRidge.cpp +++ b/cpp/QhullRidge.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullRidge.cpp#11 $$Change: 1052 $ -** $DateTime: 2009/09/27 23:20:48 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullRidge.cpp#12 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -52,17 +52,17 @@ using std::endl; using std::ostream; using orgQhull::QhullRidge; using orgQhull::QhullVertex; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; ostream & operator<<(ostream &os, const QhullRidge &r) { - os<< r.print(UsingQhullLib::NOqhRunId); + os<< r.print(UsingLibQhull::NOqhRunId); return os; }//<< QhullRidge //! Duplicate of qh_printridge [io.c] -//! if pr.run_id==UsingQhullLib::NOqhRunId, no access to qh [needed for QhullVertex/QhullPoint] +//! if pr.run_id==UsingLibQhull::NOqhRunId, no access to qh [needed for QhullVertex/QhullPoint] ostream & operator<<(ostream &os, const QhullRidge::PrintRidge &pr) { diff --git a/cpp/QhullRidge.h b/cpp/QhullRidge.h index e76a3e55b82dc693da775413adc8063ea695e59b..d30aa9b0485c717839fbf30324f4a0b88d332dd8 100644 --- a/cpp/QhullRidge.h +++ b/cpp/QhullRidge.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullRidge.h#17 $$Change: 1098 $ -** $DateTime: 2009/12/04 22:47:59 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullRidge.h#18 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -27,7 +27,7 @@ namespace orgQhull { class QhullFacet; #//Types - //! QhullRidge -- Qhull's ridge structure, ridgeT [qhulllib.h], as a C++ class + //! QhullRidge -- Qhull's ridge structure, ridgeT [libqhull.h], as a C++ class class QhullRidge; typedef QhullSet<QhullRidge> QhullRidgeSet; typedef QhullSetIterator<QhullRidge> QhullRidgeSetIterator; @@ -102,7 +102,7 @@ public: }//namespace orgQhull -std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge &r); //FIXUP no conversion. OK in .cpp { os<< r.print(orgQhull::UsingQhullLib::NOqhRunId); return os; } +std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge &r); //FIXUP no conversion. OK in .cpp { os<< r.print(orgQhull::UsingLibQhull::NOqhRunId); return os; } std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge::PrintRidge &pr); #endif // QHULLRIDGE_H diff --git a/cpp/QhullVertex.cpp b/cpp/QhullVertex.cpp index f30552ff1e82c8cdf5a8a0349fe0b5f4db03ea7a..8329f6d1177e41208e7f9390dd43a60e5a3b6fca 100644 --- a/cpp/QhullVertex.cpp +++ b/cpp/QhullVertex.cpp @@ -1,14 +1,14 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertex.cpp#18 $$Change: 1049 $ -** $DateTime: 2009/09/27 09:56:18 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertex.cpp#19 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ #//! QhullVertex -- Qhull's vertex structure, vertexT, as a C++ class -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" #include "QhullPoint.h" #include "QhullFacetSet.h" #include "QhullVertex.h" @@ -49,7 +49,7 @@ using orgQhull::QhullFacet; using orgQhull::QhullFacetSet; using orgQhull::QhullFacetSetIterator; using orgQhull::QhullVertex; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; //! Duplicate of qh_printvertex [io.c] ostream & diff --git a/cpp/QhullVertex.h b/cpp/QhullVertex.h index d5f1fbc7f444687bcedd3c2384e404629d752a3f..e31219915635449821f69df437b74eb1ed9a3540 100644 --- a/cpp/QhullVertex.h +++ b/cpp/QhullVertex.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertex.h#20 $$Change: 1057 $ -** $DateTime: 2009/10/22 20:38:42 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertex.h#21 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -11,7 +11,7 @@ #include <ostream> -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" #include "QhullPoint.h" #include "QhullLinkedList.h" #include "QhullSet.h" @@ -26,7 +26,7 @@ namespace orgQhull { class QhullFacetSet; #//Types - //! QhullVertex -- Qhull's vertex structure, vertexT [qhulllib.h], as a C++ class + //! QhullVertex -- Qhull's vertex structure, vertexT [libqhull.h], as a C++ class class QhullVertex; typedef QhullLinkedList<QhullVertex> QhullVertexList; typedef QhullLinkedListIterator<QhullVertex> QhullVertexListIterator; @@ -68,7 +68,7 @@ public: vertexT *getBaseT() const { return getVertexT(); } #//getSet - int dimension() const { return (qh_vertex->dim || !isDefined()) ? qh_vertex->dim : UsingQhullLib::globalVertexDimension(); } + int dimension() const { return (qh_vertex->dim || !isDefined()) ? qh_vertex->dim : UsingLibQhull::globalVertexDimension(); } int id() const { return qh_vertex->id; } bool isDefined() const { return qh_vertex != &s_empty_vertex; } QhullVertex next() const { return qh_vertex->next; } @@ -95,6 +95,6 @@ public: #//GLobal std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex::PrintVertex &pr); -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex &v) { os<< v.print(orgQhull::UsingQhullLib::NOqhRunId); return os; } +inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertex &v) { os<< v.print(orgQhull::UsingLibQhull::NOqhRunId); return os; } #endif // QHULLVERTEX_H diff --git a/cpp/QhullVertexSet.cpp b/cpp/QhullVertexSet.cpp index b9e8ed8c409a0ed6f663c6af92b33fc178659837..b079bdbfbec37457bf06191709f635b4e8034d8a 100644 --- a/cpp/QhullVertexSet.cpp +++ b/cpp/QhullVertexSet.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertexSet.cpp#4 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertexSet.cpp#5 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -30,7 +30,7 @@ QhullVertexSet(int qhRunId, facetT *facetlist, setT *facetset, bool allfacets) , qhsettemp_qhull(0) , qhsettemp_defined(false) { - UsingQhullLib q(qhRunId); + UsingLibQhull q(qhRunId); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() setT *vertices= qh_facetvertices(facetlist, facetset, allfacets); @@ -45,7 +45,7 @@ void QhullVertexSet:: freeQhSetTemp() { if(qhsettemp_defined){ - UsingQhullLib q(qhsettemp_qhull, QhullError::NOthrow); + UsingLibQhull q(qhsettemp_qhull, QhullError::NOthrow); if(q.defined()){ int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() @@ -72,7 +72,7 @@ using orgQhull::QhullPoint; using orgQhull::QhullVertex; using orgQhull::QhullVertexSet; using orgQhull::QhullVertexSetIterator; -using orgQhull::UsingQhullLib; +using orgQhull::UsingLibQhull; //! Print Vertex identifiers to stream. Space prefix. From qh_printVertexheader [io.c] ostream & @@ -90,7 +90,7 @@ operator<<(ostream &os, const QhullVertexSet::PrintIdentifiers &pr) }//<<QhullVertexSet::PrintIdentifiers //! Duplicate of printvertices [io.c] -//! If pr.run_id==UsingQhullLib::NOqhRunId, no access to qh [needed for QhullPoint] +//! If pr.run_id==UsingLibQhull::NOqhRunId, no access to qh [needed for QhullPoint] ostream & operator<<(ostream &os, const QhullVertexSet::PrintVertexSet &pr){ diff --git a/cpp/QhullVertexSet.h b/cpp/QhullVertexSet.h index 0d7f0c05dad098e79778ee842fb577297bbe1bc2..865142c05dab514b1c96aba210ade77e5ea054b6 100644 --- a/cpp/QhullVertexSet.h +++ b/cpp/QhullVertexSet.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/QhullVertexSet.h#3 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/QhullVertexSet.h#4 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -74,6 +74,6 @@ public: std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet::PrintVertexSet &pr); std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet::PrintIdentifiers &p); -inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet &vs) { os<< vs.print(orgQhull::UsingQhullLib::NOqhRunId, ""); return os; } +inline std::ostream &operator<<(std::ostream &os, const orgQhull::QhullVertexSet &vs) { os<< vs.print(orgQhull::UsingLibQhull::NOqhRunId, ""); return os; } #endif // QHULLVERTEXSET_H diff --git a/cpp/RboxPoints.cpp b/cpp/RboxPoints.cpp index dae858cbe1f43151ce6017e50e1b92ac66cce8a0..2c18d6be5209d4396667436cc00e0a9fa6865def 100644 --- a/cpp/RboxPoints.cpp +++ b/cpp/RboxPoints.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/RboxPoints.cpp#27 $$Change: 1096 $ -** $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/RboxPoints.cpp#28 $$Change: 1100 $ +** $DateTime: 2009/12/06 22:53:01 $$Author: bbarber $ ** ****************************************************************************/ diff --git a/cpp/RboxPoints.h b/cpp/RboxPoints.h index b8aabb797f9797edbcc2db75e924b74098ba954a..c379194e277879f38788bd7553233f990cbac904 100644 --- a/cpp/RboxPoints.h +++ b/cpp/RboxPoints.h @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/RboxPoints.h#23 $$Change: 1095 $ -** $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/RboxPoints.h#24 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -20,7 +20,7 @@ #include "QhullPoint.h" extern "C" { -#include "../src/qhulllib.h" +#include "../src/libqhull.h" }; namespace orgQhull { diff --git a/cpp/UsingQhullLib.cpp b/cpp/UsingLibQhull.cpp similarity index 79% rename from cpp/UsingQhullLib.cpp rename to cpp/UsingLibQhull.cpp index 5d3dd971ce24ba801e5ab170a5b38f758c222493..b318207ebf7922fc468b96ee5a941c1d2fb7f3af 100644 --- a/cpp/UsingQhullLib.cpp +++ b/cpp/UsingLibQhull.cpp @@ -1,15 +1,15 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/UsingQhullLib.cpp#16 $$Change: 1087 $ -** $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/UsingLibQhull.cpp#1 $$Change: 1107 $ +** $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ ** ****************************************************************************/ -#//! UsingQhullLib -- Set up qhull C code from C++ +#//! UsingLibQhull -- Set up qhull C code from C++ #include "Qhull.h" -#include "UsingQhullLib.h" +#include "UsingLibQhull.h" #include "QhullError.h" #include "QhullQh.h" @@ -20,59 +20,59 @@ namespace orgQhull { #//Class objects -const double UsingQhullLib:: +const double UsingLibQhull:: DEFAULTdistanceEpsilon= 1e-15*FACTORepsilon; //! ~DISTround*FACTORepsilon for unit cube -const double UsingQhullLib:: +const double UsingLibQhull:: DEFAULTangleEpsilon= 1e-15*FACTORepsilon; //! ~ANGLEround*FACTORepsilon for unit cube //! Global pointer to Qhull for qh_fprintf callback and QhullError Qhull * s_qhull_output= 0; -double UsingQhullLib:: +double UsingLibQhull:: s_angle_epsilon= 0; -double UsingQhullLib:: +double UsingLibQhull:: s_distance_epsilon= 0; //! For QhullPoint.id() w/o qhRunId. Initialized by Qhull -const coordT *UsingQhullLib:: +const coordT *UsingLibQhull:: s_points_begin= 0; -const coordT *UsingQhullLib:: +const coordT *UsingLibQhull:: s_points_end= 0; -int UsingQhullLib:: +int UsingLibQhull:: s_points_dimension= 0; -int UsingQhullLib:: +int UsingLibQhull:: s_vertex_dimension= 0; // FIXUP: required if dimension>15 -bool UsingQhullLib:: +bool UsingLibQhull:: s_has_points= false; -bool UsingQhullLib:: +bool UsingLibQhull:: s_has_angle_epsilon= false; -bool UsingQhullLib:: +bool UsingLibQhull:: s_has_vertex_dimension= false; -bool UsingQhullLib:: +bool UsingLibQhull:: s_has_distance_epsilon= false; -bool UsingQhullLib:: -s_using_qhulllib= false; +bool UsingLibQhull:: +s_using_libqhull= false; #//Constructors //! Grabs global state (qh_qh, qh_qhstat, qhmem.tempstack) -//! Follow immediately with setjmp(qh errexit), otherwise errors in qhulllib are not caught properly +//! Follow immediately with setjmp(qh errexit), otherwise errors in libqhull are not caught properly //! See qh_restore_qhull [global.c] -UsingQhullLib:: -UsingQhullLib(Qhull *q) +UsingLibQhull:: +UsingLibQhull(Qhull *q) : my_qhull(q) , qh_exitcode(0) { - checkUsingQhullLib(); + checkUsingLibQhull(); QhullQh *qhullqh= q->qhullQh(); if(!qhullqh){ throw QhullError(10014, "Qhull internal error: Qhull.qhullQh() not defined. initializeQhull() not called."); @@ -82,7 +82,7 @@ UsingQhullLib(Qhull *q) } // qh.old_qhstat is zero at initialization // qh.old_tempstack is zero when empty - // QhullQh() and UsingQhullLib() are the same + // QhullQh() and UsingLibQhull() are the same #if qh_QHpointer if(qh_qh){ qh old_qhstat= qh_qhstat; @@ -101,18 +101,18 @@ UsingQhullLib(Qhull *q) #endif s_qhull_output= q; // set s_qhull_output for qh_fprintf() qh NOerrexit= False; // assumes setjmp called next -}//UsingQhullLib qhull +}//UsingLibQhull qhull -//! Same as UsingQhullLib but does not throw exceptions +//! Same as UsingLibQhull but does not throw exceptions //! !defined() on failure. For use in destructors -UsingQhullLib:: -UsingQhullLib(Qhull *q, int noThrow) +UsingLibQhull:: +UsingLibQhull(Qhull *q, int noThrow) : my_qhull(0) // Fail by default , qh_exitcode(0) { QhullQh *qhullqh= q->qhullQh(); - if(s_using_qhulllib){ - QhullError e(10050, "Qhull error: UsingQhullLib already in use"); + if(s_using_libqhull){ + QhullError e(10050, "Qhull error: UsingLibQhull already in use"); e.logError(); }else if(!qhullqh || qhullqh->run_id != q->qhull_run_id){ QhullError e(10051, "Qhull error: Qhull.qhullQh (%x) undefined or QhullQh.runId %d != Qhull.runId %d. Overwritten?", (qhullqh ? qhullqh->run_id : -1), q->qhull_run_id, 0.0, qhullqh); @@ -120,7 +120,7 @@ UsingQhullLib(Qhull *q, int noThrow) }else{ // qh.old_qhstat is zero at initialization // qh.old_tempstack is zero when empty - // QhullQh() and UsingQhullLib() are the same + // QhullQh() and UsingLibQhull() are the same #if qh_QHpointer if(qh_qh){ qh old_qhstat= qh_qhstat; @@ -136,37 +136,37 @@ UsingQhullLib(Qhull *q, int noThrow) s_qhull_output= q; // set s_qhull_output for qh_fprintf() qh NOerrexit= False; // assumes setjmp called next } -}//UsingQhullLib qhull noThrow +}//UsingLibQhull qhull noThrow //! Reuses current global state (qh_qh) from prior UsingQhull //! Errors if runId is not the same -UsingQhullLib:: -UsingQhullLib(int qhRunId) +UsingLibQhull:: +UsingLibQhull(int qhRunId) : my_qhull(0) , qh_exitcode(0) { - checkUsingQhullLib(); + checkUsingLibQhull(); #if qh_QHpointer if(!qh_qh || !qh_qhstat){ - throw QhullError(10024, "Qhull error: UsingQhullLIb is not active (qh_qh %x or qh_qhstat is not defined)", 0,0,0.0, qh_qh); + throw QhullError(10024, "Qhull error: UsingLibQhull is not active (qh_qh %x or qh_qhstat is not defined)", 0,0,0.0, qh_qh); } #endif if(qh run_id!=qhRunId){ throw QhullError(10036, "Qhull error: qhRunId %d != qh_qh.runId %d. Is another Qhull active?", qhRunId, qh run_id); } if(!s_qhull_output){ - throw QhullError(10037, "Qhull error: UsingQhullLib not active(s_qhull_output undefined). Invoke UsingQhullLIb before this call"); + throw QhullError(10037, "Qhull error: UsingLibQhull not active(s_qhull_output undefined). Invoke UsingLibQhull before this call"); } if(s_qhull_output->qhull_run_id!=qhRunId){ throw QhullError(10046, "Qhull error: qhRunId %d != s_qhull_output.runId %d. Is another Qhull active", qhRunId, s_qhull_output->qhull_run_id); } my_qhull= s_qhull_output; qh NOerrexit= False; // assumes setjmp called next -}//UsingQhullLib runId +}//UsingLibQhull runId -//Leaves QHullLib active for runId access -UsingQhullLib:: -~UsingQhullLib() +//Leaves libqhull active for runId access +UsingLibQhull:: +~UsingLibQhull() { QhullError e= checkRunId(); if(e.defined()){ @@ -180,12 +180,12 @@ UsingQhullLib:: qh NOerrexit= true; #endif } - s_using_qhulllib= false; -}//~UsingQhullLib + s_using_libqhull= false; +}//~UsingLibQhull #//Class methods -void UsingQhullLib:: +void UsingLibQhull:: checkQhullMemoryEmpty() { int curlong, totlong, curshort, totshort, maxlong, totbuffer; @@ -199,7 +199,7 @@ checkQhullMemoryEmpty() } }//checkQhullMemoryEmpty -double UsingQhullLib:: +double UsingLibQhull:: currentAngleEpsilon() { if(s_qhull_output && s_qhull_output->defined()){ @@ -207,10 +207,10 @@ currentAngleEpsilon() }else if(s_has_angle_epsilon){ return s_angle_epsilon; } - return UsingQhullLib::DEFAULTangleEpsilon; + return UsingLibQhull::DEFAULTangleEpsilon; }//currentAngleEpsilon -double UsingQhullLib:: +double UsingLibQhull:: currentDistanceEpsilon() { if(s_qhull_output && s_qhull_output->defined()){ @@ -218,10 +218,10 @@ currentDistanceEpsilon() }else if(s_has_distance_epsilon){ return s_distance_epsilon; } - return UsingQhullLib::DEFAULTdistanceEpsilon; + return UsingLibQhull::DEFAULTdistanceEpsilon; }//currentDistanceEpsilon -const coordT *UsingQhullLib:: +const coordT *UsingLibQhull:: currentPoints(int *dimension, const coordT **pointsEnd) { if(s_qhull_output && s_qhull_output->defined()){ @@ -236,7 +236,7 @@ currentPoints(int *dimension, const coordT **pointsEnd) throw QhullError(10059, "Qhull error: missing definition for currentPoints(). Need currentQhull() or setGlobalDistanceEpsilon()"); }//globalPoints -Qhull &UsingQhullLib:: +Qhull &UsingLibQhull:: currentQhull() { if(!s_qhull_output){ @@ -245,7 +245,7 @@ currentQhull() return *s_qhull_output; }//currentQhull -int UsingQhullLib:: +int UsingLibQhull:: currentVertexDimension() { if(s_qhull_output && s_qhull_output->defined()){ @@ -256,7 +256,7 @@ currentVertexDimension() throw QhullError(10057, "Qhull error: missing definition for currentVertexDimension(). Need currentQhull() or setGlobalVertexDimension()"); }//currentVertexDimension -const coordT *UsingQhullLib:: +const coordT *UsingLibQhull:: globalPoints(int *dimension, const coordT **pointsEnd) { if(s_has_points){ @@ -268,19 +268,19 @@ globalPoints(int *dimension, const coordT **pointsEnd) } }//globalPoints -bool UsingQhullLib:: +bool UsingLibQhull:: hasPoints() { return s_has_points || (s_qhull_output && s_qhull_output->defined()); } -bool UsingQhullLib:: +bool UsingLibQhull:: hasVertexDimension() { return s_has_vertex_dimension || (s_qhull_output && s_qhull_output->defined()); } -void UsingQhullLib:: +void UsingLibQhull:: setGlobals() { if(s_qhull_output && s_qhull_output->defined()){ @@ -300,7 +300,7 @@ setGlobals() } }//setGlobals -void UsingQhullLib:: +void UsingLibQhull:: unsetGlobals() { s_has_angle_epsilon= false; @@ -311,22 +311,22 @@ unsetGlobals() #// Methods -void UsingQhullLib:: +void UsingLibQhull:: maybeThrowQhullMessage(int exitCode) const { my_qhull->maybeThrowQhullMessage(exitCode); - QhullError e= checkRunId(); // Check for qhRunId after qhulllib returns. For convenience, ought to be at end of qhulllib try block + QhullError e= checkRunId(); // Check for qhRunId after libqhull returns. For convenience, ought to be at end of libqhull try block if(e.defined()){ throw e; } }//maybeThrowQhullMessage -void UsingQhullLib:: +void UsingLibQhull:: maybeThrowQhullMessage(int exitCode, int noThrow) const { my_qhull->maybeThrowQhullMessage(exitCode, noThrow); - QhullError e= checkRunId(); // Check for qhRunId after qhulllib returns. For convenience, ought to be at end of qhulllib try block + QhullError e= checkRunId(); // Check for qhRunId after libqhull returns. For convenience, ought to be at end of libqhull try block if(e.defined()){ e.logError(); } @@ -336,7 +336,7 @@ maybeThrowQhullMessage(int exitCode, int noThrow) const #//Helpers //! Return QhullError for maybeThrowFromDestructor() -QhullError UsingQhullLib:: +QhullError UsingLibQhull:: checkRunId() const { // Predeclaring QhullError results in four copy constructors, none used here @@ -354,19 +354,19 @@ checkRunId() const return QhullError(); }//checkRunId -//! Can not embed UsingQhullLib. Otherwise allocated a C++ object missed by qh_errexit -void UsingQhullLib:: -checkUsingQhullLib() const +//! Can not embed UsingLibQhull. Otherwise allocated a C++ object missed by qh_errexit +void UsingLibQhull:: +checkUsingLibQhull() const { - if(s_using_qhulllib){ + if(s_using_libqhull){ if(s_qhull_output){ - throw QhullError(10049, "Qhull error: UsingQhullLib already in use by QhullQh.runId %d", s_qhull_output->qhull_run_id); + throw QhullError(10049, "Qhull error: UsingLibQhull already in use by QhullQh.runId %d", s_qhull_output->qhull_run_id); }else{ - throw QhullError(10050, "Qhull error: UsingQhullLib already in use. No s_qhull_output"); + throw QhullError(10050, "Qhull error: UsingLibQhull already in use. No s_qhull_output"); } } - s_using_qhulllib= true; -}//checkUsingQhullLib + s_using_libqhull= true; +}//checkUsingLibQhull }//namespace orgQhull diff --git a/cpp/UsingQhullLib.h b/cpp/UsingLibQhull.h similarity index 80% rename from cpp/UsingQhullLib.h rename to cpp/UsingLibQhull.h index 03a79c55c48d975822d8b7e6d5213be06cb5e860..28c19d61a9a5e1ae8d6ab46acee94f7e72fc233c 100644 --- a/cpp/UsingQhullLib.h +++ b/cpp/UsingLibQhull.h @@ -1,35 +1,35 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/UsingQhullLib.h#16 $$Change: 1061 $ -** $DateTime: 2009/11/07 17:14:02 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/UsingLibQhull.h#1 $$Change: 1107 $ +** $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ ** ****************************************************************************/ -#ifndef USINGQHULLLIB_H -#define USINGQHULLLIB_H +#ifndef USINGlibqhull_H +#define USINGlibqhull_H #include "QhullError.h" extern "C" { -#include "../src/qhulllib.h" +#include "../src/libqhull.h" }; namespace orgQhull { #//Types - //! UsingQhullLib -- Interface into qhulllib and its 'qh' and 'qhstat' macros - //! Always use with setjmp() for qhulllib error handling. + //! UsingLibQhull -- Interface into libqhull and its 'qh' and 'qhstat' macros + //! Always use with setjmp() for libqhull error handling. /******************************* -UsingQhullLIb is stack based, but as a call +UsingLibQhull is stack based, but as a call Qhull declarations are stack-based. But can't define a -setjmp environment, since the target goes away. So must be UsingQhullLib, but can only have one +setjmp environment, since the target goes away. So must be UsingLibQhull, but can only have one setjmp at a time? Can embedded another Using as long as save/restore longjmp on exit. */ - class UsingQhullLib; + class UsingLibQhull; // Defined elsewhere class Qhull; @@ -37,7 +37,7 @@ longjmp on exit. #// Global variables extern Qhull *s_qhull_output; //! Provide qh_fprintf (Qhull.cpp) access to Qhull -class UsingQhullLib { +class UsingLibQhull { private: #//Fields @@ -46,7 +46,7 @@ private: #//Class globals //! Global flags - static bool s_using_qhulllib; //! True if UsingQhullLib is in scope + static bool s_using_libqhull; //! True if UsingLibQhull is in scope //! Use global values if s_has_... is set static bool s_has_angle_epsilon; //! True if s_angle_epsilon defined @@ -71,10 +71,10 @@ public: static const double DEFAULTangleEpsilon; //! ~ANGLEround*FACTORepsilon for unit cube #//Constructors - UsingQhullLib(Qhull *p); - UsingQhullLib(Qhull *p, int noThrow); - UsingQhullLib(int qhRunId); - ~UsingQhullLib(); + UsingLibQhull(Qhull *p); + UsingLibQhull(Qhull *p, int noThrow); + UsingLibQhull(int qhRunId); + ~UsingLibQhull(); public: #//Class members @@ -110,30 +110,30 @@ public: #//Helpers private: QhullError checkRunId() const; - void checkUsingQhullLib() const; + void checkUsingLibQhull() const; /*********************************** -You may use global variables in 'qh' after declaring UsingQhullLib. For example +You may use global variables in 'qh' after declaring UsingLibQhull. For example - UsingQhullLib q(qhRunId); - // NOerrors -- no calls that throw qhulllib errors + UsingLibQhull q(qhRunId); + // NOerrors -- no calls that throw libqhull errors cout << "Delaunay Mode: " << qh DELAUNAY; -To trap errors from qhulllib, UsingQhullLib must be followed by +To trap errors from libqhull, UsingLibQhull must be followed by -UsingQhullLib q(qhRunId); +UsingLibQhull q(qhRunId); int exitCode = setjmp(qh errexit); if(!exitCode){ // no object creation -- destructors skipped on longjmp() - calls to qhulllib + calls to libqhull } q.maybeThrowQhullMessage(exitCode); -The call to setjmp() can not be moved to a method. The stack must be preserved for error exits from qhulllib. +The call to setjmp() can not be moved to a method. The stack must be preserved for error exits from libqhull. */ -};//UsingQhullLib +};//UsingLibQhull }//namespace orgQhull -#endif // USINGQHULLLIB_H +#endif // USINGlibqhull_H diff --git a/cpp/qhulltest/QhullFacetList_test.cpp b/cpp/qhulltest/QhullFacetList_test.cpp index 4b9dc174c67d02fc9bd15145655ee578cb63b498..75263d11620df7fc39840e8d8d4db771da2ad000 100644 --- a/cpp/qhulltest/QhullFacetList_test.cpp +++ b/cpp/qhulltest/QhullFacetList_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetList_test.cpp#10 $$Change: 1049 $ -** $DateTime: 2009/09/27 09:56:18 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetList_test.cpp#11 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -47,7 +47,7 @@ add_QhullFacetList_test() void QhullFacetList_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullFacetSet_test.cpp b/cpp/qhulltest/QhullFacetSet_test.cpp index a402a85f5b57145c4fffc94b0a0ad03281c8bfc7..fcbda0ebc183b19f219e752b435d6b04ce714001 100644 --- a/cpp/qhulltest/QhullFacetSet_test.cpp +++ b/cpp/qhulltest/QhullFacetSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetSet_test.cpp#7 $$Change: 1047 $ -** $DateTime: 2009/09/12 21:08:23 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacetSet_test.cpp#8 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -47,7 +47,7 @@ void QhullFacetSet_test:: cleanup() { RoadTest::cleanup(); - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); } void QhullFacetSet_test:: diff --git a/cpp/qhulltest/QhullFacet_test.cpp b/cpp/qhulltest/QhullFacet_test.cpp index ad8c7232b51db2030d68c45d180bdf0aa24c44ea..c8f1b6777a1e0920787f467b4877560d1bee976d 100644 --- a/cpp/qhulltest/QhullFacet_test.cpp +++ b/cpp/qhulltest/QhullFacet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacet_test.cpp#25 $$Change: 1061 $ -** $DateTime: 2009/11/07 17:14:02 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullFacet_test.cpp#26 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -52,7 +52,7 @@ add_QhullFacet_test() void QhullFacet_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } @@ -166,7 +166,7 @@ t_getSet() if(f.isGood()){ QhullPoint p= f.voronoiVertex(q3.runId()); cout << p.print(q3.runId(), "Voronoi vertex: ") - << " DistanceEpsilon " << UsingQhullLib::globalDistanceEpsilon() << endl; + << " DistanceEpsilon " << UsingLibQhull::globalDistanceEpsilon() << endl; QCOMPARE(p, q3.origin()); } } diff --git a/cpp/qhulltest/QhullHyperplane_test.cpp b/cpp/qhulltest/QhullHyperplane_test.cpp index 984b5ee4922f978e5bc79e9b03693ce27b8c4e69..6c7e544006b0383dc3dc656974effdbb91ca608a 100644 --- a/cpp/qhulltest/QhullHyperplane_test.cpp +++ b/cpp/qhulltest/QhullHyperplane_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2009-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullHyperplane_test.cpp#5 $$Change: 1057 $ -** $DateTime: 2009/10/22 20:38:42 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullHyperplane_test.cpp#6 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -58,7 +58,7 @@ add_QhullHyperplane_test() void QhullHyperplane_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullLinkedList_test.cpp b/cpp/qhulltest/QhullLinkedList_test.cpp index d5fbae2ebf45a83fd1fd14b915acc6bcb66f5976..0653d5e3aa6e3e81059dc10298947030cb863558 100644 --- a/cpp/qhulltest/QhullLinkedList_test.cpp +++ b/cpp/qhulltest/QhullLinkedList_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (f) 2009-2009 f. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullLinkedList_test.cpp#9 $$Change: 1047 $ -** $DateTime: 2009/09/12 21:08:23 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullLinkedList_test.cpp#10 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -41,7 +41,7 @@ add_QhullLinkedList_test() void QhullLinkedList_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullPointSet_test.cpp b/cpp/qhulltest/QhullPointSet_test.cpp index f9053996d681cd64a82ea813086cd7ca40aa6d17..2f94b24a57c58c0d108b8dd66e91f0427023193b 100644 --- a/cpp/qhulltest/QhullPointSet_test.cpp +++ b/cpp/qhulltest/QhullPointSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (p) 2009-2009 p. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPointSet_test.cpp#3 $$Change: 1047 $ -** $DateTime: 2009/09/12 21:08:23 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPointSet_test.cpp#4 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -50,7 +50,7 @@ add_QhullPointSet_test() void QhullPointSet_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullPoint_test.cpp b/cpp/qhulltest/QhullPoint_test.cpp index 9548fd63ee661a79a8c53421d2dc98db811071ec..0a7766cb6951a9e6bbd85b0d191911353a6ba629 100644 --- a/cpp/qhulltest/QhullPoint_test.cpp +++ b/cpp/qhulltest/QhullPoint_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoint_test.cpp#9 $$Change: 1058 $ -** $DateTime: 2009/10/29 22:11:06 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoint_test.cpp#10 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -55,7 +55,7 @@ add_QhullPoint_test() void QhullPoint_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullPoints_test.cpp b/cpp/qhulltest/QhullPoints_test.cpp index d54bd1c0669440970ac11d5a2736bb77227ded05..666e602844d0c2585a04027b25e2eabf8d0f006d 100644 --- a/cpp/qhulltest/QhullPoints_test.cpp +++ b/cpp/qhulltest/QhullPoints_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (p) 2009-2009 p. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoints_test.cpp#11 $$Change: 1095 $ -** $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullPoints_test.cpp#13 $$Change: 1107 $ +** $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ ** ****************************************************************************/ @@ -48,7 +48,7 @@ add_QhullPoints_test() void QhullPoints_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } @@ -377,7 +377,7 @@ t_search() QCOMPARE(ps.count(p4), 0); QCOMPARE(ps.count(p6), 1); QCOMPARE(ps.indexOf(&ps[0][0]), 0); - QCOMPARE(ps.indexOf(ps.end()), -1); + //QCOMPARE(ps.indexOf(ps.end()), -1); //ps.end() is a QhullPoint which may match QCOMPARE(ps.indexOf(0), -1); QCOMPARE(ps.indexOf(&ps[3][0]), 3); QCOMPARE(ps.indexOf(&ps[3][1], QhullError::NOthrow), 3); diff --git a/cpp/qhulltest/QhullRidge_test.cpp b/cpp/qhulltest/QhullRidge_test.cpp index 648b542720591383322abb349dbc90f203703cba..ca0b0e288d31b132ad6f90fb5c63bd15cda23273 100644 --- a/cpp/qhulltest/QhullRidge_test.cpp +++ b/cpp/qhulltest/QhullRidge_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullRidge_test.cpp#6 $$Change: 1047 $ -** $DateTime: 2009/09/12 21:08:23 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullRidge_test.cpp#7 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -47,7 +47,7 @@ add_QhullRidge_test() void QhullRidge_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullSet_test.cpp b/cpp/qhulltest/QhullSet_test.cpp index 126b11546789ca7e9e687d6ea7830c2ca0742525..8ab9bacba8935e6af27771a7132a905e2a1b4ab0 100644 --- a/cpp/qhulltest/QhullSet_test.cpp +++ b/cpp/qhulltest/QhullSet_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (f) 2009-2009 f. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullSet_test.cpp#14 $$Change: 1047 $ -** $DateTime: 2009/09/12 21:08:23 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullSet_test.cpp#15 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -45,7 +45,7 @@ add_QhullSet_test() void QhullSet_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/QhullVertex_test.cpp b/cpp/qhulltest/QhullVertex_test.cpp index 4265a95dc99d30ae0a9a971f523312709f71957e..b201a553afeb639b53efb32116fd043c3d57d899 100644 --- a/cpp/qhulltest/QhullVertex_test.cpp +++ b/cpp/qhulltest/QhullVertex_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullVertex_test.cpp#6 $$Change: 1049 $ -** $DateTime: 2009/09/27 09:56:18 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/QhullVertex_test.cpp#7 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -50,7 +50,7 @@ add_QhullVertex_test() void QhullVertex_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } diff --git a/cpp/qhulltest/Qhull_test.cpp b/cpp/qhulltest/Qhull_test.cpp index dd23b4b695a17e2cad31b4d327fe7afc54fb6005..dc19d68e3c91fc444e580fc130d86fa8725f7120 100644 --- a/cpp/qhulltest/Qhull_test.cpp +++ b/cpp/qhulltest/Qhull_test.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/Qhull_test.cpp#30 $$Change: 1095 $ -** $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/Qhull_test.cpp#32 $$Change: 1102 $ +** $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ ** ****************************************************************************/ @@ -49,7 +49,7 @@ add_Qhull_test() void Qhull_test:: cleanup() { - UsingQhullLib::checkQhullMemoryEmpty(); + UsingLibQhull::checkQhullMemoryEmpty(); RoadTest::cleanup(); } @@ -135,10 +135,11 @@ t_message() }catch (const std::exception &e) { const char *s= e.what(); cout<< "INFO : Caught " << s; - QVERIFY(!q.hasQhullMessage()); // Removed when copied to QhullError - // QCOMPARE(q.qhullMessage(), QString::fromStdString(s).remove(0, 7)); QCOMPARE(QString::fromStdString(s).left(6), QString("QH6029")); - QCOMPARE(q.qhullStatus(), 6029); + // Cleared when copied to QhullError + QVERIFY(!q.hasQhullMessage()); + // QCOMPARE(q.qhullMessage(), QString::fromStdString(s).remove(0, 7)); + // QCOMPARE(q.qhullStatus(), 6029); q.clearQhullMessage(); // FIXUP -- review decision to clearQhullMessage at QhullError() QVERIFY(!q.hasQhullMessage()); } @@ -161,10 +162,11 @@ t_message() QFAIL("runQhull Fd did not fail."); }catch (const QhullError &e) { cout<< "INFO : Caught " << e; + QCOMPARE(e.errorCode(), 6029); } - QVERIFY(q.hasQhullMessage()); - QCOMPARE(QString::fromStdString(q.qhullMessage()).left(17), QString("qhull: no message")); - QCOMPARE(q.qhullStatus(), 6029); + //FIXUP Qhullmessage cleared when QhullError thrown. Switched to e + //QVERIFY(q.hasQhullMessage()); + //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(6), QString("QH6029")); q.clearQhullMessage(); QVERIFY(!q.hasQhullMessage()); } @@ -179,10 +181,12 @@ t_message() }catch (const std::exception &e) { const char *s= e.what(); cout<< "INFO : Caught " << s; + QCOMPARE(QString::fromAscii(s).left(6), QString("QH6023")); } - QVERIFY(q.hasQhullMessage()); - QCOMPARE(QString::fromStdString(q.qhullMessage()).left(17), QString("qhull: no message")); - QCOMPARE(q.qhullStatus(), 6023); + //FIXUP Qhullmessage cleared when QhullError thrown. Switched to e + //QVERIFY(q.hasQhullMessage()); + //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(17), QString("qhull: no message")); + //QCOMPARE(q.qhullStatus(), 6023); q.clearQhullMessage(); QVERIFY(!q.hasQhullMessage()); } @@ -197,10 +201,12 @@ t_message() }catch (const std::exception &e) { const char *s= e.what(); cout<< "INFO : Caught " << s; + QCOMPARE(QString::fromAscii(s).left(6), QString("QH6029")); } - QVERIFY(q.hasQhullMessage()); - QCOMPARE(QString::fromStdString(q.qhullMessage()).left(9), QString("qhull err")); - QCOMPARE(q.qhullStatus(), 6029); + //FIXUP Qhullmessage cleared when QhullError thrown. Switched to e + //QVERIFY(q.hasQhullMessage()); + //QCOMPARE(QString::fromStdString(q.qhullMessage()).left(9), QString("qhull err")); + //QCOMPARE(q.qhullStatus(), 6029); q.clearQhullMessage(); QVERIFY(!q.hasQhullMessage()); } @@ -229,8 +235,8 @@ t_getSet() q.setOutputStream(&cout); q.outputQhull(); } - // qhullQh -- UsingQhullLib [Qhull.cpp] - // runId -- UsingQhullLib [Qhull.cpp] + // qhullQh -- UsingLibQhull [Qhull.cpp] + // runId -- UsingLibQhull [Qhull.cpp] }//t_getSet void Qhull_test:: @@ -244,7 +250,7 @@ t_getQh() QCOMPARE(QString(q.rboxCommand()), QString("rbox \"c\"")); QCOMPARE(q.facetCount(), 6); QCOMPARE(q.vertexCount(), 8); - // Sample fields from Qhull's qhT [qhulllib.h] + // Sample fields from Qhull's qhT [libqhull.h] QCOMPARE(q.qhullQh()->ALLpoints, 0u); QCOMPARE(q.qhullQh()->GOODpoint, 0); QCOMPARE(q.qhullQh()->IStracing, 0); diff --git a/cpp/qhulltest/UsingLibQhull_test.cpp b/cpp/qhulltest/UsingLibQhull_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e182002db4325562ecb1f649a27152030f644708 --- /dev/null +++ b/cpp/qhulltest/UsingLibQhull_test.cpp @@ -0,0 +1,210 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. +** $Id: //product/qhull/main/rel/cpp/qhulltest/UsingLibQhull_test.cpp#1 $$Change: 1107 $ +** $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ +** +****************************************************************************/ + +#include <iostream> +#include "../road/RoadTest.h" // QT_VERSION + +#include "Qhull.h" +#include "QhullError.h" +#include "UsingLibQhull.h" + +using std::cout; +using std::endl; +using std::string; + +namespace orgQhull { + +//! Test C++ interface to Qhull +//! See eg/q_test for tests of Qhull commands +class UsingLibQhull_test : public RoadTest +{ + Q_OBJECT + +#//Test slots +private slots: + void cleanup(); + void t_classMembers(); + void t_globalPoints(); + void t_UsingLibQhull(); + void t_methods(); + void t_cleanuptestcase(); +};//UsingLibQhull_test + +void +add_UsingLibQhull_test() +{ + new UsingLibQhull_test(); +} + +//Executed after each testcase +void UsingLibQhull_test:: +cleanup() +{ + UsingLibQhull::checkQhullMemoryEmpty(); + RoadTest::cleanup(); +} + +void UsingLibQhull_test:: +t_classMembers() +{ + { + //checkQhullMemoryEmpty tested by cleanup() + QCOMPARE(UsingLibQhull::globalMachineEpsilon()+1.0, 1.0); + RboxPoints r10("10"); + Qhull q(r10,"v"); // voronoi diagram of 10 points + UsingLibQhull::unsetGlobalAngleEpsilon(); + UsingLibQhull::unsetGlobalDistanceEpsilon(); + cout << "MachineEpsilon " << UsingLibQhull::globalMachineEpsilon() + << " angleEpsilon " << UsingLibQhull::globalAngleEpsilon() + << " distanceEpsilon " << UsingLibQhull::globalDistanceEpsilon() + << endl; + QCOMPARE(UsingLibQhull::currentAngleEpsilon()+1.0, 1.0); + QVERIFY(UsingLibQhull::currentAngleEpsilon() > UsingLibQhull::globalMachineEpsilon()); + QCOMPARE(UsingLibQhull::currentDistanceEpsilon()+1.0, 1.0); + QVERIFY(UsingLibQhull::currentDistanceEpsilon() >= UsingLibQhull::currentAngleEpsilon()); + QCOMPARE(UsingLibQhull::currentQhull().runId(), q.runId()); + QCOMPARE(UsingLibQhull::globalAngleEpsilon()+1.0, UsingLibQhull::currentAngleEpsilon()+1.0); + QCOMPARE(UsingLibQhull::currentVertexDimension(), q.dimension()); + QCOMPARE(UsingLibQhull::globalDistanceEpsilon()+1.0, UsingLibQhull::currentDistanceEpsilon()+1.0); + UsingLibQhull::setGlobalAngleEpsilon(1.0); + UsingLibQhull::setGlobalDistanceEpsilon(1.0); + cout << " Global angleEpsilon " << UsingLibQhull::globalAngleEpsilon() + << " distanceEpsilon " << UsingLibQhull::globalDistanceEpsilon() + << endl; + QCOMPARE(UsingLibQhull::globalAngleEpsilon(), UsingLibQhull::globalDistanceEpsilon()); + QVERIFY(UsingLibQhull::currentAngleEpsilon() != UsingLibQhull::globalAngleEpsilon()); + UsingLibQhull::setGlobalVertexDimension(3); + QCOMPARE(UsingLibQhull::globalVertexDimension(), UsingLibQhull::currentVertexDimension()); + UsingLibQhull::setGlobalVertexDimension(2); + QCOMPARE(UsingLibQhull::globalVertexDimension(), 2); + QCOMPARE(UsingLibQhull::currentVertexDimension(), q.dimension()); + QVERIFY(UsingLibQhull::currentDistanceEpsilon() != UsingLibQhull::globalDistanceEpsilon()); + UsingLibQhull::unsetGlobalAngleEpsilon(); + UsingLibQhull::unsetGlobalVertexDimension(); + UsingLibQhull::unsetGlobalDistanceEpsilon(); + QCOMPARE(UsingLibQhull::currentAngleEpsilon()+1.0, UsingLibQhull::globalAngleEpsilon()+1.0); + QCOMPARE(UsingLibQhull::globalVertexDimension(), UsingLibQhull::currentVertexDimension()); + QCOMPARE(UsingLibQhull::currentDistanceEpsilon()+1.0, UsingLibQhull::globalDistanceEpsilon()+1.0); + UsingLibQhull::setGlobals(); + } + QCOMPARE(UsingLibQhull::globalAngleEpsilon()+1.0, 1.0); + QCOMPARE(UsingLibQhull::globalVertexDimension(), 4); // 'v'. VertexDimension is only used for QhullVertex where dim>15 + QCOMPARE(UsingLibQhull::globalDistanceEpsilon()+1.0, 1.0); + UsingLibQhull::unsetGlobals(); + try{ + cout<< UsingLibQhull::globalVertexDimension(); + QFAIL("Did not throw error for undefined dimension."); + }catch(const std::exception &e){ + cout<< "INFO Caught error -- " << e.what() << endl; + } +}//t_classMembers + +void UsingLibQhull_test:: +t_globalPoints() +{ + const coordT *r10PointsBegin; + { + RboxPoints r10("10"); + Qhull q(r10,"v"); // voronoi diagram of 10 points + UsingLibQhull::unsetGlobalPoints(); + int dimension; + const coordT *pointsEnd; + const coordT *pointsBegin= UsingLibQhull::globalPoints(&dimension, &pointsEnd); + cout << "pointsBegin " << pointsBegin + << " pointsEnd " << pointsEnd + << " dimension " << dimension + << endl; + int dimension2; + const coordT *pointsEnd2; + const coordT *pointsBegin2= UsingLibQhull::currentPoints(&dimension2, &pointsEnd2); + QCOMPARE(pointsBegin2, pointsBegin); + QCOMPARE(pointsEnd2, pointsEnd); + QCOMPARE(dimension2, dimension); + coordT c[]= { 1.0,2.0, 3.0,4.0, 5.0,6.0 }; + UsingLibQhull::setGlobalPoints(2, c, c+3*2); + pointsBegin= UsingLibQhull::globalPoints(&dimension, &pointsEnd); + QCOMPARE(pointsBegin, c); + QCOMPARE(pointsEnd[-1], 6.0); + QCOMPARE(dimension, 2); + UsingLibQhull::unsetGlobalPoints(); + pointsBegin= UsingLibQhull::globalPoints(&dimension, &pointsEnd); + QCOMPARE(pointsBegin, pointsBegin2); + QCOMPARE(pointsEnd, pointsEnd2); + QCOMPARE(dimension, dimension2); + UsingLibQhull::setGlobals(); + r10PointsBegin= pointsBegin; + } + int dimension3; + const coordT *pointsEnd3; + const coordT *pointsBegin3= UsingLibQhull::currentPoints(&dimension3, &pointsEnd3); + QCOMPARE(pointsBegin3, r10PointsBegin); // Memory was freed + QCOMPARE(pointsEnd3, r10PointsBegin+10*4); + QCOMPARE(dimension3, 4); + UsingLibQhull::unsetGlobals(); + try{ + pointsBegin3= UsingLibQhull::globalPoints(&dimension3, &pointsEnd3); + QFAIL("Did not throw error for undefined global points."); + }catch(const std::exception &e){ + cout<< "INFO Caught error -- " << e.what() << endl; + } +}//t_globalPoints + +void UsingLibQhull_test:: +t_UsingLibQhull() +{ + { + Qhull q; + UsingLibQhull uq(&q); // Normally created in a method using 'this' + + try{ + Qhull q2; // If qh_QHpointer, QhullQh() calls usinlibqhull() + UsingLibQhull uq2(&q2); + QFAIL("UsingLibQhull did not fail."); + }catch (const std::exception &e) { + cout<< "INFO : Caught " << e.what(); + } + } + Qhull q3; + UsingLibQhull uq3(&q3); +}//t_UsingLibQhull + +void UsingLibQhull_test:: +t_methods() +{ + Qhull q; + UsingLibQhull u(&q); // Normally created in a method using 'this' + QVERIFY(u.defined()); + u.maybeThrowQhullMessage(0); // Nothing thrown + try{ + u.maybeThrowQhullMessage(1); + QFAIL("maybeThrowQhullMessage(1) did not fail."); + }catch (const std::exception &e) { + cout<< "INFO : Caught " << e.what(); + } + // Can not check checkRunId() in maybeThrowQhullMessage(). Requires another thread. + u.maybeThrowQhullMessage(2, UsingLibQhull::NOthrow); + try{ + throw QhullError(10054, "Report previous NOthrow error"); + }catch (const std::exception &e) { + cout<< "INFO : " << e.what(); + } +}//t_methods + +// Executed after last test +void UsingLibQhull_test:: +t_cleanuptestcase() +{ + UsingLibQhull::unsetGlobals(); +}//t_cleanuptestcase + + + +}//orgQhull + +#include "moc/UsingLibQhull_test.moc" + diff --git a/cpp/qhulltest/UsingQhullLib_test.cpp b/cpp/qhulltest/UsingQhullLib_test.cpp deleted file mode 100644 index ae42686b5403e5ef1ca47a9e9964035fd1c6f92f..0000000000000000000000000000000000000000 --- a/cpp/qhulltest/UsingQhullLib_test.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/UsingQhullLib_test.cpp#11 $$Change: 1091 $ -** $DateTime: 2009/11/23 22:13:59 $$Author: bbarber $ -** -****************************************************************************/ - -#include <iostream> -#include "../road/RoadTest.h" // QT_VERSION - -#include "Qhull.h" -#include "QhullError.h" -#include "UsingQhullLib.h" - -using std::cout; -using std::endl; -using std::string; - -namespace orgQhull { - -//! Test C++ interface to Qhull -//! See eg/q_test for tests of Qhull commands -class UsingQhullLib_test : public RoadTest -{ - Q_OBJECT - -#//Test slots -private slots: - void cleanup(); - void t_classMembers(); - void t_globalPoints(); - void t_UsingQhullLib(); - void t_methods(); - void t_cleanuptestcase(); -};//UsingQhullLib_test - -void -add_UsingQhullLib_test() -{ - new UsingQhullLib_test(); -} - -//Executed after each testcase -void UsingQhullLib_test:: -cleanup() -{ - UsingQhullLib::checkQhullMemoryEmpty(); - RoadTest::cleanup(); -} - -void UsingQhullLib_test:: -t_classMembers() -{ - { - //checkQhullMemoryEmpty tested by cleanup() - QCOMPARE(UsingQhullLib::globalMachineEpsilon()+1.0, 1.0); - RboxPoints r10("10"); - Qhull q(r10,"v"); // voronoi diagram of 10 points - UsingQhullLib::unsetGlobalAngleEpsilon(); - UsingQhullLib::unsetGlobalDistanceEpsilon(); - cout << "MachineEpsilon " << UsingQhullLib::globalMachineEpsilon() - << " angleEpsilon " << UsingQhullLib::globalAngleEpsilon() - << " distanceEpsilon " << UsingQhullLib::globalDistanceEpsilon() - << endl; - QCOMPARE(UsingQhullLib::currentAngleEpsilon()+1.0, 1.0); - QVERIFY(UsingQhullLib::currentAngleEpsilon() > UsingQhullLib::globalMachineEpsilon()); - QCOMPARE(UsingQhullLib::currentDistanceEpsilon()+1.0, 1.0); - QVERIFY(UsingQhullLib::currentDistanceEpsilon() >= UsingQhullLib::currentAngleEpsilon()); - QCOMPARE(UsingQhullLib::currentQhull().runId(), q.runId()); - QCOMPARE(UsingQhullLib::globalAngleEpsilon()+1.0, UsingQhullLib::currentAngleEpsilon()+1.0); - QCOMPARE(UsingQhullLib::currentVertexDimension(), q.dimension()); - QCOMPARE(UsingQhullLib::globalDistanceEpsilon()+1.0, UsingQhullLib::currentDistanceEpsilon()+1.0); - UsingQhullLib::setGlobalAngleEpsilon(1.0); - UsingQhullLib::setGlobalDistanceEpsilon(1.0); - cout << " Global angleEpsilon " << UsingQhullLib::globalAngleEpsilon() - << " distanceEpsilon " << UsingQhullLib::globalDistanceEpsilon() - << endl; - QCOMPARE(UsingQhullLib::globalAngleEpsilon(), UsingQhullLib::globalDistanceEpsilon()); - QVERIFY(UsingQhullLib::currentAngleEpsilon() != UsingQhullLib::globalAngleEpsilon()); - UsingQhullLib::setGlobalVertexDimension(3); - QCOMPARE(UsingQhullLib::globalVertexDimension(), UsingQhullLib::currentVertexDimension()); - UsingQhullLib::setGlobalVertexDimension(2); - QCOMPARE(UsingQhullLib::globalVertexDimension(), 2); - QCOMPARE(UsingQhullLib::currentVertexDimension(), q.dimension()); - QVERIFY(UsingQhullLib::currentDistanceEpsilon() != UsingQhullLib::globalDistanceEpsilon()); - UsingQhullLib::unsetGlobalAngleEpsilon(); - UsingQhullLib::unsetGlobalVertexDimension(); - UsingQhullLib::unsetGlobalDistanceEpsilon(); - QCOMPARE(UsingQhullLib::currentAngleEpsilon()+1.0, UsingQhullLib::globalAngleEpsilon()+1.0); - QCOMPARE(UsingQhullLib::globalVertexDimension(), UsingQhullLib::currentVertexDimension()); - QCOMPARE(UsingQhullLib::currentDistanceEpsilon()+1.0, UsingQhullLib::globalDistanceEpsilon()+1.0); - UsingQhullLib::setGlobals(); - } - QCOMPARE(UsingQhullLib::globalAngleEpsilon()+1.0, 1.0); - QCOMPARE(UsingQhullLib::globalVertexDimension(), 4); // 'v'. VertexDimension is only used for QhullVertex where dim>15 - QCOMPARE(UsingQhullLib::globalDistanceEpsilon()+1.0, 1.0); - UsingQhullLib::unsetGlobals(); - try{ - cout<< UsingQhullLib::globalVertexDimension(); - QFAIL("Did not throw error for undefined dimension."); - }catch(const std::exception &e){ - cout<< "INFO Caught error -- " << e.what() << endl; - } -}//t_classMembers - -void UsingQhullLib_test:: -t_globalPoints() -{ - const coordT *r10PointsBegin; - { - RboxPoints r10("10"); - Qhull q(r10,"v"); // voronoi diagram of 10 points - UsingQhullLib::unsetGlobalPoints(); - int dimension; - const coordT *pointsEnd; - const coordT *pointsBegin= UsingQhullLib::globalPoints(&dimension, &pointsEnd); - cout << "pointsBegin " << pointsBegin - << " pointsEnd " << pointsEnd - << " dimension " << dimension - << endl; - int dimension2; - const coordT *pointsEnd2; - const coordT *pointsBegin2= UsingQhullLib::currentPoints(&dimension2, &pointsEnd2); - QCOMPARE(pointsBegin2, pointsBegin); - QCOMPARE(pointsEnd2, pointsEnd); - QCOMPARE(dimension2, dimension); - coordT c[]= { 1.0,2.0, 3.0,4.0, 5.0,6.0 }; - UsingQhullLib::setGlobalPoints(2, c, c+3*2); - pointsBegin= UsingQhullLib::globalPoints(&dimension, &pointsEnd); - QCOMPARE(pointsBegin, c); - QCOMPARE(pointsEnd[-1], 6.0); - QCOMPARE(dimension, 2); - UsingQhullLib::unsetGlobalPoints(); - pointsBegin= UsingQhullLib::globalPoints(&dimension, &pointsEnd); - QCOMPARE(pointsBegin, pointsBegin2); - QCOMPARE(pointsEnd, pointsEnd2); - QCOMPARE(dimension, dimension2); - UsingQhullLib::setGlobals(); - r10PointsBegin= pointsBegin; - } - int dimension3; - const coordT *pointsEnd3; - const coordT *pointsBegin3= UsingQhullLib::currentPoints(&dimension3, &pointsEnd3); - QCOMPARE(pointsBegin3, r10PointsBegin); // Memory was freed - QCOMPARE(pointsEnd3, r10PointsBegin+10*4); - QCOMPARE(dimension3, 4); - UsingQhullLib::unsetGlobals(); - try{ - pointsBegin3= UsingQhullLib::globalPoints(&dimension3, &pointsEnd3); - QFAIL("Did not throw error for undefined global points."); - }catch(const std::exception &e){ - cout<< "INFO Caught error -- " << e.what() << endl; - } -}//t_globalPoints - -void UsingQhullLib_test:: -t_UsingQhullLib() -{ - { - Qhull q; - UsingQhullLib uq(&q); // Normally created in a method using 'this' - - try{ - Qhull q2; // If qh_QHpointer, QhullQh() calls usinQhullLib() - UsingQhullLib uq2(&q2); - QFAIL("UsingQhullLib did not fail."); - }catch (const std::exception &e) { - cout<< "INFO : Caught " << e.what(); - } - } - Qhull q3; - UsingQhullLib uq3(&q3); -}//t_UsingQhullLib - -void UsingQhullLib_test:: -t_methods() -{ - Qhull q; - UsingQhullLib u(&q); // Normally created in a method using 'this' - QVERIFY(u.defined()); - u.maybeThrowQhullMessage(0); // Nothing thrown - try{ - u.maybeThrowQhullMessage(1); - QFAIL("maybeThrowQhullMessage(1) did not fail."); - }catch (const std::exception &e) { - cout<< "INFO : Caught " << e.what(); - } - // Can not check checkRunId() in maybeThrowQhullMessage(). Requires another thread. - u.maybeThrowQhullMessage(2, UsingQhullLib::NOthrow); - try{ - throw QhullError(10054, "Report previous NOthrow error"); - }catch (const std::exception &e) { - cout<< "INFO : " << e.what(); - } -}//t_methods - -// Executed after last test -void UsingQhullLib_test:: -t_cleanuptestcase() -{ - UsingQhullLib::unsetGlobals(); -}//t_cleanuptestcase - - - -}//orgQhull - -#include "moc/UsingQhullLib_test.moc" - diff --git a/cpp/qhulltest/qhulltest.cpp b/cpp/qhulltest/qhulltest.cpp index 3d7ad9746693c6cb4301338c676ebc618f695e80..5a7669204fda08c2d9c9d2f6bbe3f109aa2d27ab 100644 --- a/cpp/qhulltest/qhulltest.cpp +++ b/cpp/qhulltest/qhulltest.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/qhulltest/qhulltest.cpp#45 $$Change: 1095 $ -** $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/qhulltest/qhulltest.cpp#47 $$Change: 1107 $ +** $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ ** ****************************************************************************/ @@ -21,7 +21,7 @@ namespace orgQhull { void addQhullTests(QStringList &args) { - TESTadd_(add_Qhull_test); //copy + TESTadd_(add_QhullPoints_test); //copy if(args.contains("--all")){ args.removeAll("--all"); @@ -40,7 +40,7 @@ void addQhullTests(QStringList &args) TESTadd_(add_QhullSet_test); TESTadd_(add_QhullVertex_test); TESTadd_(add_RboxPoints_test); - TESTadd_(add_UsingQhullLib_test); + TESTadd_(add_UsingLibQhull_test); // needs review // qhullStat TESTadd_(add_Qhull_test); diff --git a/cpp/road/RoadError.cpp b/cpp/road/RoadError.cpp index 886327bd249ab5c7267fa0e70606e351ed53e771..a85acd211c58832cdf8a383a6f8cf7aaf18e4807 100644 --- a/cpp/road/RoadError.cpp +++ b/cpp/road/RoadError.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2008-2009 C. Bradford Barber. All rights reserved. -** $Id: //product/qhull/main/rel/cpp/road/RoadError.cpp#11 $$Change: 1096 $ -** $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ +** $Id: //product/qhull/main/rel/cpp/road/RoadError.cpp#12 $$Change: 1100 $ +** $DateTime: 2009/12/06 22:53:01 $$Author: bbarber $ ** ****************************************************************************/ diff --git a/cpp/user_eg3.cpp b/cpp/user_eg3.cpp index 40dbb0575cbf05c8327969b22ace1e4f8253456e..ea2325e57f6f695232fe872d85bdb4ede8e15ba7 100644 --- a/cpp/user_eg3.cpp +++ b/cpp/user_eg3.cpp @@ -38,6 +38,8 @@ user_eg3 -- demonstrate calling rbox and qhull from C++.\n\ qhull-cout \"o\" ... Run qhull and produce output to cout\n\ \n\ For example\n\ + user_eg3 rbox qhull\n\ + user_eg3 rbox qhull d\n\ user_eg3 rbox \"10 D2\" \"2 D2\" qhull \"s p\"\n\ \n\ "; @@ -125,13 +127,23 @@ int user_eg3(int argc, char **argv) if(readingRbox){ cout<< rbox; return 0; - }else if(qhull.useOutputStream){ + } + if(readingQhull==1){ // e.g., rbox 10 qhull + if(rbox.isEmpty()){ + rbox.appendPoints("10 D2"); + } + qhull.runQhull(rbox, ""); + qhull.outputQhull(); + if(qhull.hasQhullMessage()){ + cerr << "\nResults of qhull\n" << qhull.qhullMessage(); + qhull.clearQhullMessage(); + } + } + if(qhull.useOutputStream){ return 0; - }else{ - QhullFacetList facets= qhull.facetList(); - cout<< "\nFacets created by Qhull::runQhull()\n" << facets; } + QhullFacetList facets= qhull.facetList(); + cout<< "\nFacets created by Qhull::runQhull()\n" << facets; return 0; }//user_eg3 - diff --git a/html/qh-code.htm b/html/qh-code.htm index 7051f064d04a3373131a50ba47498840ea68489d..02330f8c563cf8aff5e14d4df76a52ef599c83af 100644 --- a/html/qh-code.htm +++ b/html/qh-code.htm @@ -66,7 +66,7 @@ Contents </a></h2> <li><a href="#vertexlist-cpp">QhullVertexList</a></li> <li><a href="#vertexset-cpp">QhullVertexSet</a></li> <li><a href="#rbox-cpp">RboxPoints</a></li> - <li><a href="#usingqhull-cpp">UsingQhullLib</a></li> + <li><a href="#usingqhull-cpp">UsingLibQhull</a></li> </ul> <li><a href="#library">Calling Qhull</a> from C programs <ul> @@ -218,7 +218,7 @@ command. <p> Qhull's C++ interface provides wrapper classes for Qhull and Rbox. It provides access to Qhull's data structures. Most of the classes derive from the corresponding qhull data structure. -For example, <a href="#facet-cpp">QhullFacet</a> is an instance of Qhull's <a href="../src/qhulllib.h#facetT">facetT</a>. +For example, <a href="#facet-cpp">QhullFacet</a> is an instance of Qhull's <a href="../src/libqhull.h#facetT">facetT</a>. </p> The main methods are @@ -267,7 +267,7 @@ to bradb@shore.net for incorporation into Qhull. <p> With care, you may create multiple Qhull instances, but only one instance may be active at time. The Qhull library refers to Qhull's data structures through a global pointer <code>qh_qh</code> that -points to <a href="#qh-cpp">QhullQh</a>. The class <a href="#usingqhull-cpp">UsingQhullLib</a> checks +points to <a href="#qh-cpp">QhullQh</a>. The class <a href="#usingqhull-cpp">UsingLibQhull</a> checks that qh_qh is correct. The QhullQh functions <code>startQhullAccess()</code> and <code>stopQhullAccess()</code> acquire and release the <code>qh_qh</code> pointer. </p> @@ -297,7 +297,7 @@ QhullError is derived from <code>std::exception</code>. It reports errors from <p> If error handling is not set up, Qhull exits with a code from 1 to 5 -[qh_ERR* in qhulllib.h via qh_exit() in usermem.c]. The C++ interface does not report the +[qh_ERR* in libqhull.h via qh_exit() in usermem.c]. The C++ interface does not report the captured output in QhullError. Call Qhull::setErrorStream to send output to cerr instead. </p> @@ -411,10 +411,10 @@ It's iterator is <a href="#coordinate-cpp">CoordinateIterator</a>. It can also append a cube's vertices or specific points. </p> -<h3><a href="#TOC">»</a><a name="usingqhull-cpp">UsingQhullLib</a></h3> +<h3><a href="#TOC">»</a><a name="usingqhull-cpp">UsingLibQhull</a></h3> <p> -UsingQhullLib checks that the current thread owns Qhull's global data structure, <a href="#qh-cpp">QhullQh</a>. +UsingLibQhull checks that the current thread owns Qhull's global data structure, <a href="#qh-cpp">QhullQh</a>. It is required while calling the Qhull library. Otherwise two threads may be updating and reading the same data structure. </p> @@ -455,16 +455,16 @@ read the results from the output file.</p> <p>When you read the code, be aware of the macros "qh" and "qhstat", e.g., "qh hull_dim". They are -defined in <tt>qhulllib.h</tt>. They allow the global data +defined in <tt>libqhull.h</tt>. They allow the global data structures to be pre-allocated (faster access) or dynamically allocated (allows multiple copies). </p> <p>Qhull's <tt>Makefile</tt> produces a library, <tt>libqhull.a</tt>, -for inclusion in your programs. First review <tt>qhulllib.h</tt>. +for inclusion in your programs. First review <tt>libqhull.h</tt>. This defines the data structures used by Qhull and provides prototypes for the top-level functions. -Most users will only need qhulllib.h in their programs. For -example, the Qhull program is defined with <tt>qhulllib.h</tt> and <tt>unix.c</tt>. +Most users will only need libqhull.h in their programs. For +example, the Qhull program is defined with <tt>libqhull.h</tt> and <tt>unix.c</tt>. To access all functions, use <tt>qhull_a.h</tt>. Include the file with "<tt>#include <qhull/qhull_a.h>".</tt> This avoids potential name conflicts.</p> @@ -586,7 +586,7 @@ For the on-line construction of convex hulls and halfspace intersections, Qhull may use an exhaustive search (qh_findbestfacet). </p> -<p>You may use qh_findbestfacet and qh_addpoint (<tt>qhulllib.c</tt>) to add a point to +<p>You may use qh_findbestfacet and qh_addpoint (<tt>libqhull.c</tt>) to add a point to a convex hull. Do not modify the point's coordinates since qh_addpoint does not make a copy of the coordinates. For Delaunay triangulations, you need to lift the point to a paraboloid by diff --git a/html/qh-opto.htm b/html/qh-opto.htm index 3004f25f9d83f8c70d87258db88143e42db03f28..309d1a9e2b0ea8347a9c77cf9773f1a77f75b86a 100644 --- a/html/qh-opto.htm +++ b/html/qh-opto.htm @@ -87,7 +87,7 @@ Other outputs may be specified as follows. </p> <h3><a href="#output">»</a><a name="f">f - print all fields of all facets </a></h3> -<p>Print <a href=../src/qhulllib.h#facetT>all fields</a> of all facets. +<p>Print <a href=../src/libqhull.h#facetT>all fields</a> of all facets. The facet is the primary <a href=index.htm#structure>data structure</a> for Qhull. @@ -301,7 +301,7 @@ simplicial. </p> <p>Qhull starts counting CPU seconds after it has read and projected the input points. It stops counting before producing output. In the code, CPU seconds measures the execution time of -function qhull() in <tt>qhulllib.c</tt>. If the number of CPU +function qhull() in <tt>libqhull.c</tt>. If the number of CPU seconds is clearly wrong, check qh_SECticks in <tt>user.h</tt>. </p> <p>The last two figures measure the maximum distance from a point diff --git a/qtpro/qhulllib/qhulllib.pro b/qtpro/libqhull/libqhull.pro similarity index 96% rename from qtpro/qhulllib/qhulllib.pro rename to qtpro/libqhull/libqhull.pro index 416b9dc6576089aa6b4cac749e14b76346502054..7c3d279f6f9f617a121a3a286372f5f305924170 100644 --- a/qtpro/qhulllib/qhulllib.pro +++ b/qtpro/libqhull/libqhull.pro @@ -21,7 +21,7 @@ SOURCES += src/mem.c SOURCES += src/merge.c SOURCES += src/poly2.c SOURCES += src/poly.c -SOURCES += src/qhulllib.c +SOURCES += src/libqhull.c SOURCES += src/qset.c SOURCES += src/random.c SOURCES += src/rboxlib.c @@ -51,7 +51,7 @@ HEADERS += src/merge.h HEADERS += src/poly.h # qhull.h is for backwards compatibility -HEADERS += src/qhulllib.h +HEADERS += src/libqhull.h HEADERS += src/qhull_a.h HEADERS += src/qset.h HEADERS += src/random.h diff --git a/qtpro/qhull-qt/qhull-qt.pro b/qtpro/qhull-qt/qhull-qt.pro index 62b6612c375d3676d4062ec533318aa3f2acb240..035403d7eccafe95a2078a740bfaa02b3b1bdaa8 100644 --- a/qtpro/qhull-qt/qhull-qt.pro +++ b/qtpro/qhull-qt/qhull-qt.pro @@ -32,7 +32,7 @@ SOURCES += cpp/QhullSet.cpp SOURCES += cpp/QhullStat.cpp SOURCES += cpp/QhullVertex.cpp SOURCES += cpp/RboxPoints.cpp -SOURCES += cpp/UsingQhullLib.cpp +SOURCES += cpp/UsingLibQhull.cpp SOURCES += cpp/road/RoadError.cpp SOURCES += cpp/road/RoadLogEvent.cpp SOURCES += cpp/road/RoadTest.cpp @@ -51,7 +51,7 @@ SOURCES += cpp/qhulltest/QhullRidge_test.cpp SOURCES += cpp/qhulltest/QhullSet_test.cpp SOURCES += cpp/qhulltest/qhulltest.cpp SOURCES += cpp/qhulltest/QhullVertex_test.cpp -SOURCES += cpp/qhulltest/UsingQhullLib_test.cpp +SOURCES += cpp/qhulltest/UsingLibQhull_test.cpp SOURCES += cpp/qhulltest/RboxPoints_test.cpp HEADERS += cpp/Coordinates.h HEADERS += cpp/QhullHyperplane.h @@ -75,7 +75,7 @@ HEADERS += cpp/QhullSets.h HEADERS += cpp/QhullStat.h HEADERS += cpp/QhullVertex.h HEADERS += cpp/RboxPoints.h -HEADERS += cpp/UsingQhullLib.h +HEADERS += cpp/UsingLibQhull.h HEADERS += cpp/road/RoadError.h HEADERS += cpp/road/RoadLogEvent.h HEADERS += cpp/road/RoadTest.h diff --git a/qtpro/qhull/qhull.pro b/qtpro/qhull/qhull.pro index 7ddc9996f262b033c3d28fe9d2bbbd3829ccff6d..300f7697b15bedf202d46e5eb517d677562d392d 100644 --- a/qtpro/qhull/qhull.pro +++ b/qtpro/qhull/qhull.pro @@ -14,4 +14,4 @@ RCC_DIR = ../../tmp/rcc INCLUDEPATH = ../../cpp;../../cpp/road;../../tmp VPATH = ../.. SOURCES += src/unix.c -HEADERS += src/qhulllib.h +HEADERS += src/libqhull.h diff --git a/qtpro/qhulltest/qhulltest.pro b/qtpro/qhulltest/qhulltest.pro index 681364b20edcd9df3afd942dd69d05a3bb44ad1b..e40f1ec5f691a03fe605917966dc55ec024bc8ba 100644 --- a/qtpro/qhulltest/qhulltest.pro +++ b/qtpro/qhulltest/qhulltest.pro @@ -31,7 +31,7 @@ SOURCES += cpp/QhullSet.cpp SOURCES += cpp/QhullStat.cpp SOURCES += cpp/QhullVertex.cpp SOURCES += cpp/RboxPoints.cpp -SOURCES += cpp/UsingQhullLib.cpp +SOURCES += cpp/UsingLibQhull.cpp SOURCES += cpp/road/RoadError.cpp SOURCES += cpp/road/RoadLogEvent.cpp SOURCES += cpp/road/RoadTest.cpp @@ -50,7 +50,7 @@ SOURCES += cpp/qhulltest/QhullRidge_test.cpp SOURCES += cpp/qhulltest/QhullSet_test.cpp SOURCES += cpp/qhulltest/qhulltest.cpp SOURCES += cpp/qhulltest/QhullVertex_test.cpp -SOURCES += cpp/qhulltest/UsingQhullLib_test.cpp +SOURCES += cpp/qhulltest/UsingLibQhull_test.cpp SOURCES += cpp/qhulltest/RboxPoints_test.cpp HEADERS += cpp/Coordinates.h HEADERS += cpp/QhullHyperplane.h @@ -74,7 +74,7 @@ HEADERS += cpp/QhullSets.h HEADERS += cpp/QhullStat.h HEADERS += cpp/QhullVertex.h HEADERS += cpp/RboxPoints.h -HEADERS += cpp/UsingQhullLib.h +HEADERS += cpp/UsingLibQhull.h HEADERS += cpp/road/RoadError.h HEADERS += cpp/road/RoadLogEvent.h HEADERS += cpp/road/RoadTest.h @@ -95,7 +95,7 @@ SOURCES += src/mem.c SOURCES += src/merge.c SOURCES += src/poly2.c SOURCES += src/poly.c -SOURCES += src/qhulllib.c +SOURCES += src/libqhull.c SOURCES += src/qset.c SOURCES += src/random.c SOURCES += src/rboxlib.c @@ -125,7 +125,7 @@ HEADERS += src/merge.h HEADERS += src/poly.h # qhull.h is for backwards compatibility -HEADERS += src/qhulllib.h +HEADERS += src/libqhull.h HEADERS += src/qhull_a.h HEADERS += src/qset.h HEADERS += src/random.h diff --git a/qtpro/rbox/rbox.pro b/qtpro/rbox/rbox.pro index 6872b22776976e643ddaca341a643766b8fe4e21..44388106f8b18cc2160f4ef161fce0c90773f511 100644 --- a/qtpro/rbox/rbox.pro +++ b/qtpro/rbox/rbox.pro @@ -14,4 +14,4 @@ RCC_DIR = ../../tmp/rcc INCLUDEPATH = ../../cpp;../../cpp/road;../../tmp VPATH = ../.. SOURCES += src/rbox.c -HEADERS += src/qhulllib.h +HEADERS += src/libqhull.h diff --git a/qtpro/user_eg3/user_eg3.pro b/qtpro/user_eg3/user_eg3.pro index 1bd7ceeeaa1c8df736774918435defa904445c84..65c5e86722fe625ae74d181ce9628bbd475fb246 100644 --- a/qtpro/user_eg3/user_eg3.pro +++ b/qtpro/user_eg3/user_eg3.pro @@ -32,7 +32,7 @@ SOURCES += cpp/QhullSet.cpp SOURCES += cpp/QhullStat.cpp SOURCES += cpp/QhullVertex.cpp SOURCES += cpp/RboxPoints.cpp -SOURCES += cpp/UsingQhullLib.cpp +SOURCES += cpp/UsingLibQhull.cpp SOURCES += cpp/road/RoadError.cpp SOURCES += cpp/road/RoadLogEvent.cpp @@ -58,7 +58,7 @@ HEADERS += cpp/QhullSets.h HEADERS += cpp/QhullStat.h HEADERS += cpp/QhullVertex.h HEADERS += cpp/RboxPoints.h -HEADERS += cpp/UsingQhullLib.h +HEADERS += cpp/UsingLibQhull.h HEADERS += cpp/road/RoadError.h HEADERS += cpp/road/RoadLogEvent.h @@ -76,7 +76,7 @@ SOURCES += src/mem.c SOURCES += src/merge.c SOURCES += src/poly2.c SOURCES += src/poly.c -SOURCES += src/qhulllib.c +SOURCES += src/libqhull.c SOURCES += src/qset.c SOURCES += src/random.c SOURCES += src/rboxlib.c @@ -92,7 +92,7 @@ HEADERS += src/merge.h HEADERS += src/poly.h # qhull.h is for backwards compatibility -HEADERS += src/qhulllib.h +HEADERS += src/libqhull.h HEADERS += src/qhull_a.h HEADERS += src/qset.h HEADERS += src/random.h diff --git a/src/Changes.txt b/src/Changes.txt index 999118654430835d265dd6cf23d4e680a9f3aa2b..3edb772b9cf2dfb7fd547be73f0cab11b5cc77ff 100644 --- a/src/Changes.txt +++ b/src/Changes.txt @@ -43,8 +43,8 @@ Qhull cpp questions - change qh_printf() to a virtual function - Figure out RoadError::global_log. clearQhullMessage currently clearGlobalLog - Should cout << !point.defined() be blank or 'undefined' - - Interface for UsingQhullLib::globalAngleEpsilon(), globalDistanceEpsilon, etc. - - Interface for UsingQhullLib::globalDimension + - Interface for UsingLibQhull::globalAngleEpsilon(), globalDistanceEpsilon, etc. + - Interface for UsingLibQhull::globalDimension - Infinite point as !defined() - qlist and qlinkedlist define pointer, reference, size_type, difference_type, const_pointer, const_reference for the class but not for iterator and const_iterator @@ -71,8 +71,7 @@ To do - Redo Coordinates w/o vector<> - Change #include to specific -> general - Remove class-static code, check K_GLOBAL_STATIC - - Rename rboxlib and qhulllib to librbox and libqhull - user_eg3 rbox 10 qhull does nothing + - Rename libqhull to libqhull libqhull.h UsingLibQhull etc. ConvexHull is a submodule to git. How to get rid of? qhull 2009.1 2008/03/20 @@ -153,7 +152,7 @@ qhull 2009.1 2008/03/20 - Add sln and vcproj files for building Qhull -- add to README notes - Removed extra spaces at end of line - Fixed warnings at VC8, level 4 - - In qhulllib.c, added explicit casts from long to float, Avoids warning + - In libqhull.c, added explicit casts from long to float, Avoids warning - In global.c, cast time() to int for QRandom-seed. Avoids warning - Replaced exit, malloc, free, fprintf, and fputs with qh_malloc,...[J.W. Ratcliff] - Added qh_fprintf, qh_malloc, qh_free, ph_printhelp_narrowhull to user.c @@ -243,7 +242,7 @@ Bug fixes: - Fixed sign of coefficients for cdd halfspaces ('FD','Fd') [T. Abraham] Changes to code: - - Replace qh_version with qh_VERSION in qhulllib.h. + - Replace qh_version with qh_VERSION in libqhull.h. Allows shared libraries and single point of definition - Added qh.TESTpoints for future implementation of tsearch @@ -332,7 +331,7 @@ Changes to documentation - Removed unnecessary #TOP links - Added source links to the qh-quick.htm's header and footer - qh-geom.htm, qh-poly.htm: add links to Voronoi functions in io.c - - src/index.htm: Added how to search qhulllib.h for qhull options + - src/index.htm: Added how to search libqhull.h for qhull options - qvoronoi.htm/qdelaun.htm: 'Fc' and 'FN' includes deleted vertices Changes to URLs @@ -546,7 +545,7 @@ qhull 2.5 1998/1/28 - add unpacking instructions to README.txt - updated discussion of forced output, 'Po' - sorted the options alphabetically - - removed __STDC__ check from qhulllib.h for VisualC++ + - removed __STDC__ check from libqhull.h for VisualC++ - moved qh_markvoronoi from qh_printvoronoi and cleared facet->seen flags - added facet->seen2 flag for 'Fv' @@ -608,7 +607,7 @@ Changes for the Qhull library - added header to user_eg.c to avoid its incorporation into qhull [C. Begnis] - added qh_nearcoplanar() calls to user_eg.c only needed if use 'QJ' - - expanded __STDC__ warning message in qhulllib.h [C. Begnis] + - expanded __STDC__ warning message in libqhull.h [C. Begnis] - renamed qh maxmaxcoord to qh MAXabs_coord - replaced qh MAXlowcoord with qh MAXabs_coord - random seed ('QR-n') is reset in qh_initqhull_globals after testing @@ -922,7 +921,7 @@ qhull V2.1 95/9/25 other documentation changes: - new URLs for graphics images - - fixed comment for facetT.neighbors in qhulllib.h [P. Soikkonen] + - fixed comment for facetT.neighbors in libqhull.h [P. Soikkonen] - changed recommendations for precision errors in qh_printhelp_degenerate() - added recommendation for 'V0' (facet is visible if distance >= 0) - added note about 'long double' to user.h [S. Grundmann] @@ -1045,8 +1044,8 @@ qhull V2.1 beta 5/15/95 - forcing output on error ('Po') fixed for options 'n' 'o' 'i' 's' - fixed optimization error on HP machines [fprintf(... *p++)] - ======== changes to qhulllib.h for user code ======= - - qh_collectstatistics and qh_printstatistics removed from qhulllib.h. + ======== changes to libqhull.h for user code ======= + - qh_collectstatistics and qh_printstatistics removed from libqhull.h. should use qh_printallstatistics instead - qh_findbest uses boolT for newfacets - added qh_findbestnew for non-simplicial facets. qh_findbest is @@ -1188,7 +1187,7 @@ Converting from qhull 1.01 to qhull 2.00 - 'qhull f' is now 'qhull Qf' - 'qhull o' is now 'qhull Po' - 'qhull b' is now always done - - qhull and rbox now use floats, change REALfloat in qhulllib.h for doubles + - qhull and rbox now use floats, change REALfloat in libqhull.h for doubles - qhull 2.00 fixes several initialization errors and performanace errors e.g., "singular input" on data with lots of 0 coordinates - 'rbox b' is now 'rbox c G0.48' diff --git a/src/Make-config.sh b/src/Make-config.sh index b567bae0e9f785e322c7fc3abfcb5dc891b2b1f4..e84b64dbac22c1cc9b9393fcd233a459c69c10cc 100644 --- a/src/Make-config.sh +++ b/src/Make-config.sh @@ -25,7 +25,7 @@ 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/qhulllib.c) +AC_INIT(src/libqhull.c) AM_INIT_AUTOMAKE(qhull, 2002.1) AC_PROG_CC @@ -191,7 +191,7 @@ libqhull_la_SOURCES = \ geom2.c \ poly2.c \ merge.c \ - qhulllib.c \ + libqhull.c \ geom.c \ poly.c \ qset.c \ @@ -231,7 +231,7 @@ pkginclude_HEADERS = \ stat.h \ io.h \ merge.h \ - qhulllib.h \ + libqhull.h \ qset.h \ user.h diff --git a/src/Makefile.txt b/src/Makefile.txt index 5e9d4f4c55ef6758e6331533b7243ababa05394f..e681a3bd545311647c2486df57d1152ff5e921ba 100644 --- a/src/Makefile.txt +++ b/src/Makefile.txt @@ -61,13 +61,13 @@ CCOPTS1 = -O2 -ansi # for loader, ld CCOPTS2 = $(CCOPTS1) -# OBJS in execution frequency order. CFILES after qhulllib.c are alphabetical +# OBJS in execution frequency order. CFILES after libqhull.c are alphabetical OBJS = user.o global.o random.o stat.o io.o geom2.o poly2.o \ merge.o qhull.o geom.o poly.o qset.o mem.o -CFILES= unix.c qhulllib.c geom.c geom2.c global.c io.c mem.c merge.c poly.c \ +CFILES= unix.c libqhull.c geom.c geom2.c global.c io.c mem.c merge.c poly.c \ poly2.c random.c qset.c stat.c user.c qconvex.c qdelaun.c qhalf.c qvoronoi.c -HFILES= user.h qhulllib.h qhull_a.h geom.h io.h mem.h merge.h poly.h random.h qset.h stat.h +HFILES= user.h libqhull.h qhull_a.h geom.h io.h mem.h merge.h poly.h random.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 @@ -81,11 +81,11 @@ HTMFILES= qhull.man rbox.man qh-code.htm qh-optg.htm qh-optt.htm qh-optp.htm \ all: rbox qconvex qdelaunay qhalf qvoronoi qhull -unix.o: qhulllib.h user.h mem.h -qconvex.o: qhulllib.h user.h mem.h -qdelaun.o: qhulllib.h user.h mem.h -qhalf.o: qhulllib.h user.h mem.h -qvoronoi.o: qhulllib.h user.h mem.h +unix.o: libqhull.h user.h mem.h +qconvex.o: libqhull.h user.h mem.h +qdelaun.o: libqhull.h user.h mem.h +qhalf.o: libqhull.h user.h mem.h +qvoronoi.o: libqhull.h user.h mem.h qhull.o: $(HFILES) geom.o: $(HFILES) geom2.o: $(HFILES) @@ -95,7 +95,7 @@ mem.o: mem.h merge.o: $(HFILES) poly.o: $(HFILES) poly2.o: $(HFILES) -random.o: qhulllib.h random.h +random.o: libqhull.h random.h qset.o: qset.h mem.h stat.o: $(HFILES) user.o: $(HFILES) diff --git a/src/Mborland b/src/Mborland index 94c970520288811fbace44561d0e2ae6f50bbd0c..7d52fa7180a537b94120f2b2dbea4d5995f21498 100644 --- a/src/Mborland +++ b/src/Mborland @@ -45,7 +45,7 @@ TMPFILE = BCC32tmp.cfg OBJS1 = global.obj random.obj stat.obj geom2.obj poly2.obj io.obj OBJS2 = merge.obj qhull.obj mem.obj qset.obj poly.obj geom.obj -HFILES1 = qhulllib.h stat.h qhull_a.h user.h +HFILES1 = libqhull.h stat.h qhull_a.h user.h # General rules @@ -172,16 +172,16 @@ new: cleanall all # Header file dependencies qhull.obj stat.obj user.obj global.obj: $(HFILES1) -random.obj: qhulllib.h random.h +random.obj: libqhull.h random.h geom.obj geom2.obj: $(HFILES1) geom.h poly.obj poly2.obj: $(HFILES1) poly.h io.obj: $(HFILES1) io.h merge.obj: $(HFILES1) merge.h mem.obj: mem.h qset.obj: qset.h mem.h -unix.obj: qhulllib.h user.h -qconvex.obj: qhulllib.h user.h -qdelaun.obj: qhulllib.h user.h -qhalf.obj: qhulllib.h user.h -qvoronoi.obj: qhulllib.h user.h +unix.obj: libqhull.h user.h +qconvex.obj: libqhull.h user.h +qdelaun.obj: libqhull.h user.h +qhalf.obj: libqhull.h user.h +qvoronoi.obj: libqhull.h user.h rbox.obj: user.h diff --git a/src/geom.h b/src/geom.h index a4028438885d707712c35f747212d1a584db62da..038a0360adcd5e8371bc029ab300ef45b59bdee3 100644 --- a/src/geom.h +++ b/src/geom.h @@ -7,14 +7,14 @@ see qh-geom.htm and geom.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/geom.h#14 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/geom.h#15 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFgeom #define qhDEFgeom 1 -#include "qhulllib.h" +#include "libqhull.h" /* ============ -macros- ======================== */ diff --git a/src/global.c b/src/global.c index 44156f928a17feb128cf190609a653b2bc8c2522..852650de5640651225efd711c9becc9433de8e77 100644 --- a/src/global.c +++ b/src/global.c @@ -7,18 +7,18 @@ see README - see qhulllib.h for qh.globals and function prototypes + see libqhull.h for qh.globals and function prototypes see qhull_a.h for internal functions copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/global.c#45 $$Change: 1096 $ - $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/global.c#46 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "qhull_a.h" -/*========= qh definition -- globals defined in qhulllib.h =======================*/ +/*========= qh definition -- globals defined in libqhull.h =======================*/ int qhull_inuse= 0; /* not used */ @@ -44,7 +44,7 @@ qhT qh_qh; /* all global variables. change version: README.txt, qh-get.htm, File_id.diz, Makefile.txt change year: Copying.txt check download size - recompile user_eg.c, rbox.c, qhulllib.c, qconvex.c, qdelaun.c qvoronoi.c, qhalf.c + recompile user_eg.c, rbox.c, libqhull.c, qconvex.c, qdelaun.c qvoronoi.c, qhalf.c */ char *qh_version = "2003.1 2003/12/30"; @@ -1881,7 +1881,7 @@ void qh_initqhull_start2(FILE *infile, FILE *outfile, FILE *errfile) { qh tracevertex_id= UINT_MAX; /* recompile to trace a vertex */ seed= (int)time(&timedata); qh_RANDOMseed_(seed); - qh run_id= qh_RANDOMint+1; /* disallow 0 [UsingQhullLib::NOqhRunId] */ + qh run_id= qh_RANDOMint+1; /* disallow 0 [UsingLibQhull::NOqhRunId] */ qh_option("run-id", &qh run_id, NULL); strcat(qh qhull, "qhull"); } /* initqhull_start2 */ @@ -2053,7 +2053,7 @@ void qh_option(char *option, int *i, realT *r) { is complicated. The procedures will be redesigned. see: - qh_save_qhull(), UsingQhullLib + qh_save_qhull(), UsingLibQhull */ void qh_restore_qhull(qhT **oldqh) { diff --git a/src/index.htm b/src/index.htm index 02d546cbf3baa352c84590909e32d1203a0f32a9..94eba872ad206ad4feb50c1fd15f9b7ba9b862ca 100644 --- a/src/index.htm +++ b/src/index.htm @@ -69,10 +69,10 @@ When reading code with an editor, a search for will locate the header of <i>qh_procedure</i>. A search for <i>* procedure</i> will locate the tail of <i>qh_procedure</i>. -<p>A useful starting point is <a href="qhulllib.h">qhulllib.h</a>. It defines most +<p>A useful starting point is <a href="libqhull.h">libqhull.h</a>. It defines most of Qhull data structures and top-level functions. Search for <i>'PFn'</i> to determine the corresponding constant in Qhull. Search for <i>'Fp'</i> to -determine the corresponding <a href="qhulllib.h#qh_PRINT">qh_PRINT...</a> constant. +determine the corresponding <a href="libqhull.h#qh_PRINT">qh_PRINT...</a> constant. Search <a href="io.c">io.c</a> to learn how the print function is implemented.</p> <p>If your web browser loads .c and .h files with an external application, @@ -98,7 +98,7 @@ refer to these files for detailed information.</p> <blockquote> <dl> -<dt><a href="qhulllib.h"><b>qhulllib.h</b></a> </dt> +<dt><a href="libqhull.h"><b>libqhull.h</b></a> </dt> <dd>Include file for the Qhull library, <tt>qhull.a</tt>. Data structures are documented under <a href="qh-poly.htm">Poly</a>. Global variables are documented under <a href="qh-globa.htm">Global</a>. @@ -121,7 +121,7 @@ in <tt>geom.c</tt> while infrequent ones are in <tt>geom2.c</tt>. <dt> </dt> <dt><a href="qh-globa.htm"><b>Global</b></a><b>, </b> <a href="global.c"><b>global.c</b></a><b>, </b> -<a href="qhulllib.h"><b>qhulllib.h</b></a> </dt> +<a href="libqhull.h"><b>libqhull.h</b></a> </dt> <dd>Global routines. Qhull uses a global data structure, <tt>qh</tt>, to store globally defined constants, lists, sets, and variables. @@ -155,7 +155,7 @@ rename redundant vertices.</dd> <a href="poly.h"><b>poly.h</b></a><b>, </b> <a href="poly.c"><b>poly.c</b></a><b>, </b> <a href="poly2.c"><b>poly2.c</b></a><b>, </b> -<a href="qhulllib.h"><b>qhulllib.h</b></a> </dt> +<a href="libqhull.h"><b>libqhull.h</b></a> </dt> <dd>Polyhedral routines. Qhull produces a polyhedron as a list of facets with vertices, neighbors, ridges, and geometric information. <tt>Qhull.h</tt> defines the main @@ -164,8 +164,8 @@ while infrequent ones are in <tt>poly2.c</tt>.</dd> <dt> </dt> <dt><a href="qh-qhull.htm#TOC"><b>Qhull</b></a><b>, </b> -<a href="qhulllib.c"><b>qhulllib.c</b></a><b>, </b> -<a href="qhulllib.h"><b>qhulllib.h</b></a><b>, </b> +<a href="libqhull.c"><b>libqhull.c</b></a><b>, </b> +<a href="libqhull.h"><b>libqhull.h</b></a><b>, </b> <a href="qhull_a.h"><b>qhull_a.h</b></a><b>, </b> <a href="unix.c"><b>unix.c</b></a> <b>, </b> <a href="qconvex.c"><b>qconvex.c</b></a> <b>, </b> @@ -173,7 +173,7 @@ while infrequent ones are in <tt>poly2.c</tt>.</dd> <a href="qhalf.c"><b>qhalf.c</b></a> <b>, </b> <a href="qvoronoi.c"><b>qvoronoi.c</b></a> </dt> <dd>Top-level routines. The Quickhull algorithm is -implemented by <tt>qhulllib.c</tt>. <tt>qhull_a.h</tt> +implemented by <tt>libqhull.c</tt>. <tt>qhull_a.h</tt> includes all header files. </dd> <dt> </dt> diff --git a/src/io.c b/src/io.c index 94910ed71146e8a1daed002aceacde5e922576a1..e8b95ecfa8f87d56742fee8b12ad711ff1c1d158 100644 --- a/src/io.c +++ b/src/io.c @@ -14,8 +14,8 @@ This allows the user to avoid loading io.o from qhull.a copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/io.c#29 $$Change: 1095 $ - $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/io.c#30 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "qhull_a.h" @@ -3106,7 +3106,7 @@ INST geom {define vsphere OFF\n\ /*---------------------------------------------- -printsummary- - see qhulllib.c + see libqhull.c */ /*-<a href="qh-io.htm#TOC" diff --git a/src/io.h b/src/io.h index 2ed4b1d1f3d74ed7081eec38bc8eff69f1f9c469..9e238673a63911aef973a147b018e923e6df65ac 100644 --- a/src/io.h +++ b/src/io.h @@ -4,17 +4,17 @@ io.h declarations of Input/Output functions - see README, qhulllib.h and io.c + see README, libqhull.h and io.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/io.h#21 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/io.h#22 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFio #define qhDEFio 1 -#include "qhulllib.h" +#include "libqhull.h" /*============ constants and flags ==================*/ diff --git a/src/qhulllib.c b/src/libqhull.c similarity index 99% rename from src/qhulllib.c rename to src/libqhull.c index 76563b2b6568435c344567d22779335a9b2d8b7e..7dfe78f1070ca562d0ed83245decc71b0036043b 100644 --- a/src/qhulllib.c +++ b/src/libqhull.c @@ -1,18 +1,18 @@ /*<html><pre> -<a href="qh-qhull.htm" >-------------------------------</a><a name="TOP">-</a> - qhulllib.c + libqhull.c Quickhull algorithm for convex hulls qhull() and top-level routines - see qh-qhull.htm, qhulllib.h, unix.c + see qh-qhull.htm, libqhull.h, unix.c see qhull_a.h for internal functions copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/qhulllib.c#3 $$Change: 1095 $ - $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/libqhull.c#1 $$Change: 1107 $ + $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ */ #include "qhull_a.h" diff --git a/src/qhulllib.h b/src/libqhull.h similarity index 99% rename from src/qhulllib.h rename to src/libqhull.h index abcb8e539b47c562551c2b9b2c4bc75095b4f467..45a7d0ef275ff4b1a79ead2328a5df4a2d150c76 100644 --- a/src/qhulllib.h +++ b/src/libqhull.h @@ -1,14 +1,14 @@ /*<html><pre> -<a href="qh-qhull.htm" >-------------------------------</a><a name="TOP">-</a> - qhulllib.h + libqhull.h user-level header file for using qhull.a library see qh-qhull.htm, qhull_a.h copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/qhulllib.h#8 $$Change: 1096 $ - $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/libqhull.h#1 $$Change: 1107 $ + $DateTime: 2009/12/07 21:05:37 $$Author: bbarber $ NOTE: access to qh_qh is via the 'qh' macro. This allows qh_qh to be either a pointer or a structure. An example @@ -16,18 +16,18 @@ field of qh_qh. Similarly, access to qh_qhstat is via the 'qhstat' macro. - includes function prototypes for qhulllib.c, geom.c, global.c, io.c, user.c + includes function prototypes for libqhull.c, geom.c, global.c, io.c, user.c use mem.h for mem.c use qset.h for qset.c - see unix.c for an example of using qhulllib.h + see unix.c for an example of using libqhull.h recompile qhull if you change this file */ -#ifndef qhDEFqhulllib -#define qhDEFqhulllib 1 +#ifndef qhDEFlibqhull +#define qhDEFlibqhull 1 /*=========================== -included files ==============*/ @@ -49,7 +49,7 @@ #if !_MSC_VER #error Neither __STDC__ nor __cplusplus is defined. Please use strict ANSI C or C++ to compile #error Qhull. You may need to turn off compiler extensions in your project configuration. If -#error your compiler is a standard C compiler, you can delete this warning from qhulllib.h +#error your compiler is a standard C compiler, you can delete this warning from libqhull.h #endif #endif #endif @@ -755,7 +755,7 @@ struct qhT { realT last_newhigh; unsigned lastreport; /* for qh_buildtracing */ int mergereport; /* for qh_tracemerging */ - void *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingQhullLib. Free with qh_free() */ + void *old_qhstat; /* for saving qh_qhstat in save_qhull() and UsingLibQhull. Free with qh_free() */ setT *old_tempstack; /* for saving qhmem.tempstack in save_qhull */ int ridgeoutnum; /* number of ridges for 4OFF output (qh_printbegin,etc) */ }; @@ -985,7 +985,7 @@ struct qhT { */ #define FOREACHvertex_i_(vertices) FOREACHsetelement_i_(vertexT, vertices,vertex) -/********* -qhulllib.c prototypes (duplicated from qhull_a.h) **********************/ +/********* -libqhull.c prototypes (duplicated from qhull_a.h) **********************/ void qh_qhull(void); boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist); @@ -1091,4 +1091,4 @@ void qh_errexit_rbox(int exitcode); void qh_collectstatistics(void); void qh_printallstatistics(FILE *fp, char *string); -#endif /* qhDEFqhulllib */ +#endif /* qhDEFlibqhull */ diff --git a/src/mem.c b/src/mem.c index 4bca6826bf6cce4fa5b0b4b2c9d3ffd068204a39..ad1bc4eda05bbe575523edfabffb34bb3497a8dc 100644 --- a/src/mem.c +++ b/src/mem.c @@ -30,8 +30,8 @@ global.c (qh_initbuffers) for an example of using mem.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/mem.c#26 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/mem.c#27 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "mem.h" @@ -39,7 +39,7 @@ #include <stdio.h> #include <stdlib.h> -#ifndef qhDEFqhulllib +#ifndef qhDEFlibqhull typedef struct ridgeT ridgeT; typedef struct facetT facetT; #ifdef _MSC_VER /* Microsoft Visual C++ -- warning level 4 */ @@ -525,7 +525,7 @@ void qh_memstatistics(FILE *fp) { Returns the total current bytes of long and short allocations Returns the current count of long and short allocations Returns the maximum long memory and total short buffer (minus one link per buffer) - Does not error (UsingQhullLib.cpp) + Does not error (UsingLibQhull.cpp) */ void qh_memtotal(int *totlong, int *curlong, int *totshort, int *curshort, int *maxlong, int *totbuffer) { *totlong= qhmem .totlong; diff --git a/src/mem.h b/src/mem.h index a0e6741273100636e1d4f733f39264c53723984e..3d2d997a88937d81d7f4a56d25cccc1f1925def4 100644 --- a/src/mem.h +++ b/src/mem.h @@ -12,8 +12,8 @@ qh_errexit(qhmem_ERRqhull, NULL, NULL) otherwise copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/mem.h#21 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/mem.h#22 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFmem @@ -59,8 +59,8 @@ Trace short and quick memory allocations at T5 see <a href="user.h#MEMalign">qh_MEMalign</a> in user.h for qhull's alignment */ -#define qhmem_ERRmem 4 /* matches qh_ERRmem in qhulllib.h */ -#define qhmem_ERRqhull 5 /* matches qh_ERRqhull in qhulllib.h */ +#define qhmem_ERRmem 4 /* matches qh_ERRmem in libqhull.h */ +#define qhmem_ERRqhull 5 /* matches qh_ERRqhull in libqhull.h */ /*-<a href="qh-mem.htm#TOC" >--------------------------------</a><a name="ptr_intT">-</a> diff --git a/src/merge.c b/src/merge.c index 660358cf95b0f2914bde5a6e211ff0927f6c9e70..13435c438ffac6f2f841400ffc664defbf219c01 100644 --- a/src/merge.c +++ b/src/merge.c @@ -10,7 +10,7 @@ the user may call qh_postmerge() to perform additional merges. - To remove deleted facets and vertices (qhull() in qhulllib.c): + To remove deleted facets and vertices (qhull() in libqhull.c): qh_partitionvisible(!qh_ALL, &numoutside); // visible_list, newfacet_list qh_deletevisible(); // qh.visible_list qh_resetlists(False, qh_RESETvisible); // qh.visible_list newvertex_list newfacet_list @@ -21,8 +21,8 @@ vertex->neighbors not set until the first merge occurs copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/merge.c#21 $$Change: 1095 $ - $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/merge.c#22 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "qhull_a.h" diff --git a/src/merge.h b/src/merge.h index d8cd71b5220fab8dc569d56a1383b67cab9c16f7..00861c260683a49820d55d49ac24639b58075121 100644 --- a/src/merge.h +++ b/src/merge.h @@ -7,14 +7,14 @@ see qh-merge.htm and merge.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/merge.h#16 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/merge.h#17 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFmerge #define qhDEFmerge 1 -#include "qhulllib.h" +#include "libqhull.h" /*============ -constants- ==============*/ diff --git a/src/poly.c b/src/poly.c index 21867864ed717a0d0bc20a1e8337086e07feb9f5..6682ea3f8b81ea2eb83d9b2ae072e51b497fdd69 100644 --- a/src/poly.c +++ b/src/poly.c @@ -4,14 +4,14 @@ poly.c implements polygons and simplices - see qh-poly.htm, poly.h and qhulllib.h + see qh-poly.htm, poly.h and libqhull.h infrequent code is in poly2.c (all but top 50 and their callers 12/3/95) copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly.c#20 $$Change: 1095 $ - $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly.c#21 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "qhull_a.h" diff --git a/src/poly.h b/src/poly.h index 1ab18e67ada4998bd92b9b9899edefc2543db273..cc2506f029c8bc196bb9368d608f019705e919f1 100644 --- a/src/poly.h +++ b/src/poly.h @@ -4,17 +4,17 @@ poly.h header file for poly.c and poly2.c - see qh-poly.htm, qhulllib.h and poly.c + see qh-poly.htm, libqhull.h and poly.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly.h#18 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly.h#19 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFpoly #define qhDEFpoly 1 -#include "qhulllib.h" +#include "libqhull.h" /*=============== constants ========================== */ diff --git a/src/poly2.c b/src/poly2.c index 42ec7c4f07bdc69826d8f3a85ec850bc4d0c4c62..57abb2ff8bbe771495878987c38b1883f8fcbccb 100644 --- a/src/poly2.c +++ b/src/poly2.c @@ -4,13 +4,13 @@ poly2.c implements polygons and simplices - see qh-poly.htm, poly.h and qhulllib.h + see qh-poly.htm, poly.h and libqhull.h frequently used code is in poly.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/poly2.c#32 $$Change: 1095 $ - $DateTime: 2009/12/01 22:40:56 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/poly2.c#33 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "qhull_a.h" diff --git a/src/qh-geom.htm b/src/qh-geom.htm index 908502c8b65e4a35546b3271a60033a6a7dd0482..c3119cf611f2ed5f0d33f7bc3bdf6faaa4c3a780 100644 --- a/src/qh-geom.htm +++ b/src/qh-geom.htm @@ -83,9 +83,9 @@ distance from vertices to the halfspace. </p> and constants</a></h3> <ul> -<li><a href="qhulllib.h#coordT">coordT</a> coordinates and +<li><a href="libqhull.h#coordT">coordT</a> coordinates and coefficients are stored as realT</li> -<li><a href="qhulllib.h#pointT">pointT</a> a point is an array +<li><a href="libqhull.h#pointT">pointT</a> a point is an array of <tt>DIM3</tt> coordinates </li> </ul> diff --git a/src/qh-globa.htm b/src/qh-globa.htm index 3c07569542caf2ed6569ff57ad776f42a687e3fa..ff9650ef996ac2803af9d467036d880f63b713b6 100644 --- a/src/qh-globa.htm +++ b/src/qh-globa.htm @@ -52,7 +52,7 @@ dynamically allocated with malloc(). See <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> <h3>Index to <a href="global.c">global.c</a> and -<a href="qhulllib.h">qhulllib.h</a></h3> +<a href="libqhull.h">libqhull.h</a></h3> <ul> <li><a href="#ovar">Qhull's global variables</a> </li> @@ -65,24 +65,24 @@ variables</a></h3> <ul> <li><a href=global.c#qh_version>qh_version</a> version string -<li><a href="qhulllib.h#qh">qh</a> all global variables for +<li><a href="libqhull.h#qh">qh</a> all global variables for qhull are in <tt>qh,qhmem</tt>, and <tt>qhstat</tt></li> -<li><a href="qhulllib.h#qh-const">qh constants</a> configuration +<li><a href="libqhull.h#qh-const">qh constants</a> configuration flags and constants for Qhull </li> -<li><a href="qhulllib.h#qh-prec">qh precision constants</a> +<li><a href="libqhull.h#qh-prec">qh precision constants</a> precision constants for Qhull </li> -<li><a href="qhulllib.h#qh-codetern">qh internal constants</a> +<li><a href="libqhull.h#qh-codetern">qh internal constants</a> internal constants for Qhull </li> -<li><a href="qhulllib.h#qh-lists">qh facet and vertex lists</a> +<li><a href="libqhull.h#qh-lists">qh facet and vertex lists</a> lists of facets and vertices </li> -<li><a href="qhulllib.h#qh-var">qh global variables</a> minimum +<li><a href="libqhull.h#qh-var">qh global variables</a> minimum and maximum distances, next visit ids, several flags, and other global variables. </li> -<li><a href="qhulllib.h#qh-set">qh global sets</a> global sets +<li><a href="libqhull.h#qh-set">qh global sets</a> global sets for merging, hashing, input, etc. </li> -<li><a href="qhulllib.h#qh-buf">qh global buffers</a> buffers +<li><a href="libqhull.h#qh-buf">qh global buffers</a> buffers for matrix operations and input </li> -<li><a href="qhulllib.h#qh-static">qh static variables</a> +<li><a href="libqhull.h#qh-static">qh static variables</a> static variables for individual functions </li> </ul> diff --git a/src/qh-io.htm b/src/qh-io.htm index b772db185a7628523aa7d8673d6c52167fe52bd6..7d6dd61660f4abae5abc009ded42e3f2bd6736b2 100644 --- a/src/qh-io.htm +++ b/src/qh-io.htm @@ -98,7 +98,7 @@ prepare Qhull for output (called by qh_produce_output()) prints descriptive message for precision error </li> <li><a href="io.c#printhelp_singular">qh_printhelp_singular</a> print help message for singular data </li> -<li><a href="qhulllib.c#printsummary">qh_printsummary</a> print +<li><a href="libqhull.c#printsummary">qh_printsummary</a> print summary ('s')</li> <li><a href="io.c#produce_output">qh_produce_output</a> prints out the result of qhull()</li> diff --git a/src/qh-merge.htm b/src/qh-merge.htm index c69bb6afd725479ca1407895ddaec444419d916b..976e2f41182c836d6797a52c2e6386f1be787c35 100644 --- a/src/qh-merge.htm +++ b/src/qh-merge.htm @@ -136,7 +136,7 @@ types, macros, and global sets</a></h3> identify a merge of two facets</li> <li><a href="merge.h#FOREACHmerge_">FOREACHmerge_</a> assign 'merge' to each merge in merges </li> -<li><a href="qhulllib.h#qh-set">qh global sets</a> +<li><a href="libqhull.h#qh-set">qh global sets</a> qh.facet_mergeset contains non-convex merges while qh.degen_mergeset contains degenerate and redundant facets</li> @@ -144,7 +144,7 @@ redundant facets</li> <h3><a href="qh-merge.htm#TOC">»</a><a name="mconst">merge.h constants</a></h3> <ul> -<li><a href="qhulllib.h#qh-prec">qh precision constants</a> +<li><a href="libqhull.h#qh-prec">qh precision constants</a> precision constants for Qhull </li> <li><a href="merge.h#MRG">MRG...</a> indicates the type of a merge (mergeT->type)</li> diff --git a/src/qh-poly.htm b/src/qh-poly.htm index 435301c6b7672a47d79eab1cc079631da98d72d5..97e566a7338beca82968e686b3e3b079f04781a8 100644 --- a/src/qh-poly.htm +++ b/src/qh-poly.htm @@ -130,7 +130,7 @@ may have zero area or flipped orientation. </p> <h3>Index to <a href="poly.c">poly.c</a>, <a href="poly2.c">poly2.c</a>, <a href="poly.h">poly.h</a>, -and <a href="qhulllib.h">qhulllib.h</a></h3> +and <a href="libqhull.h">libqhull.h</a></h3> <ul> <li><a href="#ptype">Data types and global lists for polyhedrons</a> </li> @@ -152,15 +152,15 @@ functions</a> </li> <h3><a href="qh-poly.htm#TOC">»</a><a name="ptype">Data types and global lists for polyhedrons</a></h3> <ul> -<li><a href="qhulllib.h#facetT">facetT</a> defines a +<li><a href="libqhull.h#facetT">facetT</a> defines a facet </li> -<li><a href="qhulllib.h#ridgeT">ridgeT</a> defines a +<li><a href="libqhull.h#ridgeT">ridgeT</a> defines a ridge </li> -<li><a href="qhulllib.h#vertexT">vertexT</a> defines a +<li><a href="libqhull.h#vertexT">vertexT</a> defines a vertex </li> -<li><a href="qhulllib.h#qh-lists">qh facet and vertex +<li><a href="libqhull.h#qh-lists">qh facet and vertex lists</a> lists of facets and vertices </li> -<li><a href="qhulllib.h#qh-set">qh global sets</a> +<li><a href="libqhull.h#qh-set">qh global sets</a> global sets for merging, hashing, input, etc. </li> </ul> <h3><a href="qh-poly.htm#TOC">»</a><a name="pconst">poly.h constants</a></h3> @@ -179,24 +179,24 @@ a merged ridge </li> <h3><a href="qh-poly.htm#TOC">»</a><a name="pgall">Global FORALL macros</a></h3> <ul> -<li><a href="qhulllib.h#FORALLfacets">FORALLfacets</a> +<li><a href="libqhull.h#FORALLfacets">FORALLfacets</a> assign 'facet' to each facet in qh.facet_list </li> <li><a href="poly.h#FORALLnew_facets">FORALLnew_facets</a> assign 'facet' to each facet in qh.newfacet_list </li> <li><a href="poly.h#FORALLvisible_facets">FORALLvisible_facets</a> assign 'visible' to each visible facet in qh.visible_list </li> -<li><a href="qhulllib.h#FORALLpoints">FORALLpoints</a> +<li><a href="libqhull.h#FORALLpoints">FORALLpoints</a> assign 'point' to each point in qh.first_point, qh.num_points </li> -<li><a href="qhulllib.h#FORALLvertices">FORALLvertices</a> +<li><a href="libqhull.h#FORALLvertices">FORALLvertices</a> assign 'vertex' to each vertex in qh.vertex_list </li> </ul> <h3><a href="qh-poly.htm#TOC">»</a><a name="pall">FORALL macros</a></h3> <ul> <li><a href="poly.h#FORALLfacet_">FORALLfacet_</a> assign 'facet' to each facet in facetlist </li> -<li><a href="qhulllib.h#FORALLpoint_">FORALLpoint_</a> +<li><a href="libqhull.h#FORALLpoint_">FORALLpoint_</a> assign 'point' to each point in points array</li> <li><a href="poly.h#FORALLsame_">FORALLsame_</a> assign 'same' to each facet in samecycle</li> @@ -207,18 +207,18 @@ assign 'vertex' to each vertex in vertexlist </li> </ul> <h3><a href="qh-poly.htm#TOC">»</a><a name="peach">FOREACH macros</a></h3> <ul> -<li><a href="qhulllib.h#FOREACHfacet_">FOREACHfacet_</a> +<li><a href="libqhull.h#FOREACHfacet_">FOREACHfacet_</a> assign 'facet' to each facet in facets </li> -<li><a href="qhulllib.h#FOREACHneighbor_">FOREACHneighbor_</a> +<li><a href="libqhull.h#FOREACHneighbor_">FOREACHneighbor_</a> assign 'neighbor' to each facet in facet->neighbors or vertex->neighbors</li> <li><a href="poly.h#FOREACHnewfacet_">FOREACHnewfacet_</a> assign 'newfacet' to each facet in facet set </li> -<li><a href="qhulllib.h#FOREACHpoint_">FOREACHpoint_</a> +<li><a href="libqhull.h#FOREACHpoint_">FOREACHpoint_</a> assign 'point' to each point in points set </li> -<li><a href="qhulllib.h#FOREACHridge_">FOREACHridge_</a> +<li><a href="libqhull.h#FOREACHridge_">FOREACHridge_</a> assign 'ridge' to each ridge in ridge set </li> -<li><a href="qhulllib.h#FOREACHvertex_">FOREACHvertex_</a> +<li><a href="libqhull.h#FOREACHvertex_">FOREACHvertex_</a> assign 'vertex' to each vertex in vertex set </li> <li><a href="poly.h#FOREACHvertexA_">FOREACHvertexA_</a> assign 'vertexA' to each vertex in vertex set</li> @@ -228,19 +228,19 @@ assign 'visible' to each facet in facet set </li> <h3><a href="qh-poly.htm#TOC">»</a><a name="pieach">Indexed FOREACH macros</a></h3> <ul> -<li><a href="qhulllib.h#FOREACHfacet_i_">FOREACHfacet_i_</a> +<li><a href="libqhull.h#FOREACHfacet_i_">FOREACHfacet_i_</a> assign 'facet' and 'facet_i' to each facet in facet set </li> -<li><a href="qhulllib.h#FOREACHneighbor_i_">FOREACHneighbor_i_</a> +<li><a href="libqhull.h#FOREACHneighbor_i_">FOREACHneighbor_i_</a> assign 'neighbor' and 'neighbor_i' to each facet in facet->neighbors or vertex->neighbors</li> -<li><a href="qhulllib.h#FOREACHpoint_i_">FOREACHpoint_i_</a> +<li><a href="libqhull.h#FOREACHpoint_i_">FOREACHpoint_i_</a> assign 'point' and 'point_i' to each point in points set </li> -<li><a href="qhulllib.h#FOREACHridge_i_">FOREACHridge_i_</a> +<li><a href="libqhull.h#FOREACHridge_i_">FOREACHridge_i_</a> assign 'ridge' and 'ridge_i' to each ridge in ridges set </li> -<li><a href="qhulllib.h#FOREACHvertex_i_">FOREACHvertex_i_</a> +<li><a href="libqhull.h#FOREACHvertex_i_">FOREACHvertex_i_</a> assign 'vertex' and 'vertex_i' to each vertex in vertices set </li> <li><a href="poly.h#FOREACHvertexreverse12_">FOREACHvertexreverse12_</a> @@ -249,9 +249,9 @@ reverse the order of first two vertices </li> </ul> <h3><a href="qh-poly.htm#TOC">»</a><a name="pmacro">Other macros for polyhedrons</a></h3> <ul> -<li><a href="qhulllib.h#getid_">getid_</a> return ID for +<li><a href="libqhull.h#getid_">getid_</a> return ID for a facet, ridge, or vertex </li> -<li><a href="qhulllib.h#otherfacet_">otherfacet_</a> +<li><a href="libqhull.h#otherfacet_">otherfacet_</a> return neighboring facet for a ridge in a facet </li> </ul> <h3><a href="qh-poly.htm#TOC">»</a><a name="plist">Facetlist diff --git a/src/qh-qhull.htm b/src/qh-qhull.htm index 8275883bdb1bd49210dfbdb72e578ad226289579..5d88bdacd3bf1785f0e3f7a46030fe1ce3b3525c 100644 --- a/src/qh-qhull.htm +++ b/src/qh-qhull.htm @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -<title>qhulllib.c -- top-level functions and basic data types</title> +<title>libqhull.c -- top-level functions and basic data types</title> </head> <body> @@ -30,7 +30,7 @@ href="http://www.qhull.org">Home page</a> for Qhull<br> </p> <hr> -<h2>qhulllib.c -- top-level functions and basic data types</h2> +<h2>libqhull.c -- top-level functions and basic data types</h2> <blockquote> <p>Qhull implements the Quickhull algorithm for computing the convex hull. The Quickhull algorithm combines two @@ -38,7 +38,7 @@ well-known algorithms: the 2-d quickhull algorithm and the n-d beneath-beyond algorithm. See <a href="../html/index.htm#description">Description of Qhull</a>. </p> <p>This section provides an index to the top-level -functions and base data types. The top-level header file, <tt>qhulllib.h</tt>, +functions and base data types. The top-level header file, <tt>libqhull.h</tt>, contains prototypes for these functions.</p> </blockquote> <p><b>Copyright © 1995-2009 The Geometry Center, Minneapolis MN</b></p> @@ -50,13 +50,13 @@ contains prototypes for these functions.</p> • <b>Qhull</b> • <a href="qh-set.htm#TOC">Set</a> • <a href="qh-stat.htm#TOC">Stat</a> • <a href="qh-user.htm#TOC">User</a> </p> -<h3>Index to <a href="qhulllib.c">qhulllib.c</a>, -<a href="qhulllib.h">qhulllib.h</a>, and +<h3>Index to <a href="libqhull.c">libqhull.c</a>, +<a href="libqhull.h">libqhull.h</a>, and <a href="unix.c">unix.c</a></h3> <ul> -<li><a href="#qtype">qhulllib.h and unix.c data types and +<li><a href="#qtype">libqhull.h and unix.c data types and constants</a> </li> -<li><a href="#qmacro">qhulllib.h other macros</a> </li> +<li><a href="#qmacro">libqhull.h other macros</a> </li> <li><a href="#qfunc">Quickhull routines in call order</a> </li> <li><a href="#qinit">Top-level routines for initializing and terminating Qhull</a></li> <li><a href="#qin">Top-level routines for reading and modifying the input</a></li> @@ -65,22 +65,22 @@ constants</a> </li> <li><a href="#qtest">Top-level routines for testing and debugging</a></li> </ul> -<h3><a href="qh-qhull.htm#TOC">»</a><a name="qtype">qhulllib.h and unix.c +<h3><a href="qh-qhull.htm#TOC">»</a><a name="qtype">libqhull.h and unix.c data types and constants</a></h3> <ul> -<li><a href="qhulllib.h#flagT">flagT</a> Boolean flag as +<li><a href="libqhull.h#flagT">flagT</a> Boolean flag as a bit </li> -<li><a href="qhulllib.h#boolT">boolT</a> boolean value, +<li><a href="libqhull.h#boolT">boolT</a> boolean value, either True or False </li> -<li><a href="qhulllib.h#CENTERtype">CENTERtype</a> to +<li><a href="libqhull.h#CENTERtype">CENTERtype</a> to distinguish facet->center </li> -<li><a href="qhulllib.h#qh_PRINT">qh_PRINT</a> output +<li><a href="libqhull.h#qh_PRINT">qh_PRINT</a> output formats for printing (qh.PRINTout) </li> -<li><a href="qhulllib.h#qh_ALL">qh_ALL</a> argument flag +<li><a href="libqhull.h#qh_ALL">qh_ALL</a> argument flag for selecting everything </li> -<li><a href="qhulllib.h#qh_ERR">qh_ERR</a> Qhull exit +<li><a href="libqhull.h#qh_ERR">qh_ERR</a> Qhull exit codes for indicating errors </li> -<li><a href="qhulllib.h#qh_FILEstderr">qh_FILEstderr</a> Fake stderr +<li><a href="libqhull.h#qh_FILEstderr">qh_FILEstderr</a> Fake stderr to distinguish error output from normal output [C++ only]</li> <li><a href="unix.c#prompt">qh_prompt</a> version and long prompt for Qhull</li> <li><a href="unix.c#prompt2">qh_prompt2</a> synopsis for Qhull</li> @@ -88,7 +88,7 @@ to distinguish error output from normal output [C++ only]</li> <li><a href="global.c#qh_version">qh_version</a> version stamp</li> </ul> -<h3><a href="qh-qhull.htm#TOC">»</a><a name="qmacro">qhulllib.h other +<h3><a href="qh-qhull.htm#TOC">»</a><a name="qmacro">libqhull.h other macros</a></h3> <ul> <li><a href="qhull_a.h#traceN">traceN</a> print trace @@ -101,34 +101,34 @@ routines in call order</a></h3> <li><a href="unix.c#main">main</a> processes the command line, calls qhull() to do the work, and exits </li> -<li><a href="qhulllib.c#qhull">qh_qhull</a> construct +<li><a href="libqhull.c#qhull">qh_qhull</a> construct the convex hull of a set of points </li> -<li><a href="qhulllib.c#build_withrestart">qh_build_withrestart</a> +<li><a href="libqhull.c#build_withrestart">qh_build_withrestart</a> allow restarts while calling qh_buildhull</li> <li><a href="poly2.c#initbuild">qh_initbuild</a> initialize hull and outside sets with point array</li> -<li><a href="qhulllib.c#partitionall">qh_partitionall</a> +<li><a href="libqhull.c#partitionall">qh_partitionall</a> partition all points into outside sets </li> -<li><a href="qhulllib.c#buildhull">qh_buildhull</a> +<li><a href="libqhull.c#buildhull">qh_buildhull</a> construct a convex hull by adding points one at a time </li> -<li><a href="qhulllib.c#nextfurthest">qh_nextfurthest</a> +<li><a href="libqhull.c#nextfurthest">qh_nextfurthest</a> return next furthest point for processing </li> -<li><a href="qhulllib.c#buildtracing">qh_buildtracing</a> +<li><a href="libqhull.c#buildtracing">qh_buildtracing</a> trace an iteration of buildhull </li> -<li><a href="qhulllib.c#addpoint">qh_addpoint</a> add a +<li><a href="libqhull.c#addpoint">qh_addpoint</a> add a point to the convex hull </li> -<li><a href="qhulllib.c#findhorizon">qh_findhorizon</a> +<li><a href="libqhull.c#findhorizon">qh_findhorizon</a> find the horizon and visible facets for a point </li> -<li><a href="qhulllib.c#partitionvisible">qh_partitionvisible</a> +<li><a href="libqhull.c#partitionvisible">qh_partitionvisible</a> partition points from facets in qh.visible_list to facets in qh.newfacet_list </li> -<li><a href="qhulllib.c#partitionpoint">qh_partitionpoint</a> +<li><a href="libqhull.c#partitionpoint">qh_partitionpoint</a> partition a point as inside, coplanar with, or outside a facet </li> -<li><a href="qhulllib.c#partitioncoplanar">qh_partitioncoplanar</a> +<li><a href="libqhull.c#partitioncoplanar">qh_partitioncoplanar</a> partition coplanar point into a facet </li> -<li><a href="qhulllib.c#precision">qh_precision</a> restart on precision errors if not merging and if 'QJn'</li> +<li><a href="libqhull.c#precision">qh_precision</a> restart on precision errors if not merging and if 'QJn'</li> </ul> <h3><a href="qh-qhull.htm#TOC">»</a><a name="qinit">Top-level routines for initializing and terminating Qhull (in other modules)</a></h3> @@ -181,13 +181,13 @@ point </li> <h3><a href="qh-qhull.htm#TOC">»</a><a name="qcall">Top-level routines for calling Qhull (in other modules)</a></h3> <ul> -<li><a href="qhulllib.c#addpoint">qh_addpoint</a> add +<li><a href="libqhull.c#addpoint">qh_addpoint</a> add point to convex hull </li> <li><a href="poly2.c#findbestfacet">qh_findbestfacet</a> find facet that is furthest below a point </li> <li><a href="poly2.c#findfacet_all">qh_findfacet_all</a> exhaustive search for facet below a point </li> -<li><a href="qhulllib.c#qhull">qh_qhull</a> construct +<li><a href="libqhull.c#qhull">qh_qhull</a> construct the convex hull of a set of points </li> </ul> @@ -210,7 +210,7 @@ return vertices (if any) for all points</li> print all statistics </li> <li><a href="io.c#printneighborhood">qh_printneighborhood</a> print neighborhood of one or two facets </li> -<li><a href="qhulllib.c#printsummary">qh_printsummary</a> +<li><a href="libqhull.c#printsummary">qh_printsummary</a> print summary </li> <li><a href="io.c#produce_output">qh_produce_output</a> print the results of qh_qhull() </li> @@ -231,7 +231,7 @@ verify that all points are inside the convex hull </li> <li><a href="user.c#errexit">qh_errexit</a> report error with a facet and a ridge</li> -<li><a href="qhulllib.c#errexit2">qh_errexit2</a> report +<li><a href="libqhull.c#errexit2">qh_errexit2</a> report error with two facets </li> <li><a href="user.c#errprint">qh_errprint</a> print erroneous facets, ridge, and vertex </li> diff --git a/src/qh-set.htm b/src/qh-set.htm index c8ce814e72180340c6f02e20e095dc214f2b3a8c..bbd162b3dfb0d262a919c20fbffbabfcdf329bca 100644 --- a/src/qh-set.htm +++ b/src/qh-set.htm @@ -94,7 +94,7 @@ constants</a></h3> of a set element in bytes </li> <li><a href="qset.h#setT">setT</a> a set with a maximum size and a current size</li> -<li><a href="qhulllib.h#qh-set">qh global sets</a> +<li><a href="libqhull.h#qh-set">qh global sets</a> global sets for temporary sets, etc. </li> </ul> <h3><a href="qh-set.htm#TOC">»</a><a name="seach">FOREACH macros</a></h3> diff --git a/src/qhull.h b/src/qhull.h index a57bbe15cece49164413c9d24df7d18dbecef027..877bda884f5b2dc8410b094886a105c6205e184f 100644 --- a/src/qhull.h +++ b/src/qhull.h @@ -3,16 +3,16 @@ qhull.h - Proxy for qhulllib.h for backwards compatability + Proxy for libqhull.h for backwards compatability copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/qhull.h#48 $$Change: 1087 $ - $DateTime: 2009/11/22 23:02:55 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/qhull.h#49 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFqhull #define qhDEFqhull 1 -#include "qhulllib.h +#include "libqhull.h #endif /* qhDEFqhull */ diff --git a/src/qhull_a.h b/src/qhull_a.h index f5842a21702233022c265393f90c82a859ab563f..41895e9c966759e51c9e9e4f6cfa6be39d963bca 100644 --- a/src/qhull_a.h +++ b/src/qhull_a.h @@ -6,15 +6,15 @@ see qh-qhull.htm - see qhulllib.h for user-level definitions + see libqhull.h for user-level definitions see user.h for user-defineable constants - defines internal functions for qhulllib.c global.c + defines internal functions for libqhull.c global.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/qhull_a.h#22 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/qhull_a.h#23 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ Notes: grep for ((" and (" to catch fprintf("lkasdjf"); full parens around (x?y:z) @@ -24,7 +24,7 @@ #ifndef qhDEFqhulla #define qhDEFqhulla 1 -#include "qhulllib.h" /* Defines data types */ +#include "libqhull.h" /* Defines data types */ #include "stat.h" #include "random.h" @@ -49,7 +49,7 @@ #include <memory.h> */ -#if qh_CLOCKtype == 2 /* defined in user.h from qhulllib.h */ +#if qh_CLOCKtype == 2 /* defined in user.h from libqhull.h */ #include <sys/types.h> #include <sys/times.h> #include <unistd.h> @@ -89,7 +89,7 @@ #define trace5(args) {} #endif /* qh_NOtrace */ -/***** -qhulllib.c prototypes (alphabetical after qhull) ********************/ +/***** -libqhull.c prototypes (alphabetical after qhull) ********************/ void qh_qhull(void); boolT qh_addpoint(pointT *furthest, facetT *facet, boolT checkdist); diff --git a/src/qset.c b/src/qset.c index 7cbe5c1e0468b5e31584b10c4fe8c3e895ed0ac3..1c8c0275c51fe48489b5bd73abfee265b908bc93 100644 --- a/src/qset.c +++ b/src/qset.c @@ -8,8 +8,8 @@ see qh-set.htm and qset.h copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/qset.c#23 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/qset.c#24 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "qset.h" @@ -21,7 +21,7 @@ #include <memory.h> */ -#ifndef qhDEFqhulllib +#ifndef qhDEFlibqhull typedef struct ridgeT ridgeT; typedef struct facetT facetT; void qh_errexit(int exitcode, facetT *, ridgeT *); diff --git a/src/random.c b/src/random.c index 127a6f8db84972398eb19aea7c2060ef4adac2e7..7772c8cdc0b04365f6131e761d5d4491123ca23a 100644 --- a/src/random.c +++ b/src/random.c @@ -6,7 +6,7 @@ argc/argv conversion */ -#include "qhulllib.h" +#include "libqhull.h" #include <string.h> #include <stdio.h> #include <stdlib.h> diff --git a/src/random.h b/src/random.h index 11c3f921d57849c020a6172f0b79591a3fb24a07..9eacdd945369a8fd3455207b58efdca6cd80a3a1 100644 --- a/src/random.h +++ b/src/random.h @@ -7,14 +7,14 @@ see qh-geom.htm and random.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/random.h#8 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/random.h#9 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #ifndef qhDEFrandom #define qhDEFrandom 1 -#include "qhulllib.h" +#include "libqhull.h" /*============= prototypes in alphabetical order ======= */ diff --git a/src/rbox.c b/src/rbox.c index 4a31bfa9c5ab62db8fb3eec1dc95964d4ff9aa2d..886c6a138097497edecef51be55259d15d18fcfc 100644 --- a/src/rbox.c +++ b/src/rbox.c @@ -10,7 +10,7 @@ */ #include "random.h" -#include "qhulllib.h" +#include "libqhull.h" #include <stdarg.h> #include <stdio.h> diff --git a/src/rboxlib.c b/src/rboxlib.c index fcd146f75f60195fea874384e61ef0bb2a10719b..f74fcd2cb83dfd17316df2301e880eaeaa6f8d7c 100644 --- a/src/rboxlib.c +++ b/src/rboxlib.c @@ -13,7 +13,7 @@ */ #include "random.h" -#include "qhulllib.h" +#include "libqhull.h" #include <ctype.h> #include <limits.h> diff --git a/src/stat.h b/src/stat.h index 1e0eeb63a150ea75f98ac2691b448319749ddfab..6dcb90ddfab10ccf40b62dfcb86437533a545c32 100644 --- a/src/stat.h +++ b/src/stat.h @@ -7,8 +7,8 @@ see qh-stat.htm and stat.c copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/stat.h#21 $$Change: 1099 $ - $DateTime: 2009/12/04 22:49:19 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/stat.h#22 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ recompile qhull if you change this file @@ -21,7 +21,7 @@ #ifndef qhDEFstat #define qhDEFstat 1 -#include "qhulllib.h" +#include "libqhull.h" /*-<a href="qh-stat.htm#TOC" >-------------------------------</a><a name="KEEPstatistics">-</a> @@ -475,7 +475,7 @@ union intrealT { = 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 qhulllib.h + qh_QHpointer is defined in libqhull.h allocated in stat.c using qh_malloc() */ diff --git a/src/unix.c b/src/unix.c index 898f98e9f6f665b4db20e21028e2ea4ec02bd5ae..be6b3cfc6667b7fd041a3c5ee82b399987795496 100644 --- a/src/unix.c +++ b/src/unix.c @@ -8,13 +8,13 @@ see qh-qhull.htm copyright (c) 1993-2009 The Geometry Center. - $Id: //product/qhull/main/rel/src/unix.c#23 $$Change: 1096 $ - $DateTime: 2009/12/04 21:52:01 $$Author: bbarber $ + $Id: //product/qhull/main/rel/src/unix.c#24 $$Change: 1102 $ + $DateTime: 2009/12/07 20:26:04 $$Author: bbarber $ */ #include "mem.h" #include "qset.h" -#include "qhulllib.h" +#include "libqhull.h" #include <ctype.h> #include <math.h> diff --git a/src/user.c b/src/user.c index fc6d7af1b49ce652daef1820d6baad213b7a0aa4..a6742ed8f02db759ab028cecf17ed89e23c56f87 100644 --- a/src/user.c +++ b/src/user.c @@ -8,7 +8,7 @@ see README.txt see COPYING.txt for copyright information. - see qhulllib.h for data structures, macros, and user-callable functions. + see libqhull.h for data structures, macros, and user-callable functions. see user_eg.c, unix.c, and qhull_interface.cpp for examples. @@ -52,7 +52,7 @@ remove #if 0, #endif to compile returns: - exit code(see qh_ERR... in qhulllib.h) + exit code(see qh_ERR... in libqhull.h) all memory freed notes: @@ -178,7 +178,7 @@ int qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc, set qh.FORCEoutput to print neighborhood of facet see: - qh_errexit2() in qhulllib.c for printing 2 facets + qh_errexit2() in libqhull.c for printing 2 facets design: check for error within error processing @@ -482,7 +482,7 @@ may determine an initial simplex:\n\ qh DISTround); #if REALfloat qh_fprintf(fp, 9388, "\ - - recompile qhull for realT precision(#define REALfloat 0 in qhulllib.h).\n"); + - recompile qhull for realT precision(#define REALfloat 0 in libqhull.h).\n"); #endif qh_fprintf(fp, 9389, "\n\ If the input is lower dimensional:\n\ diff --git a/src/user.h b/src/user.h index adcfa6625f26bb049723c4455374708c8da778d7..472144d268d37f766361d7db6e86263d1faaca00 100644 --- a/src/user.h +++ b/src/user.h @@ -6,7 +6,7 @@ see qh-user.htm. see COPYING for copyright information. - before reading any code, review qhulllib.h for data structure definitions and + before reading any code, review libqhull.h for data structure definitions and the "qh" macro. Sections: @@ -49,7 +49,7 @@ Code flags -- def counters = [27, 1047, 2059, 3025, 4068, 5003, 6232, 7078, 8143, 9410] - See: qh_ERR* [qhulllib.h] + See: qh_ERR* [libqhull.h] */ #define MSG_TRACE0 0 @@ -577,7 +577,7 @@ stop after qh_JOGGLEmaxretry attempts notes: all global variables for qhull are in qh, qhmem, and qhstat - qh is defined in qhulllib.h + qh is defined in libqhull.h qhmem is defined in mem.h qhstat is defined in stat.h diff --git a/src/usermem.c b/src/usermem.c index cdaae05659cae55082f2f0269a8313304d8f15bf..82b7a43bb773ea20ec0139fdc547affc27c7f53e 100644 --- a/src/usermem.c +++ b/src/usermem.c @@ -10,7 +10,7 @@ If you recompile and load this file, then usermem.o will not be loaded from qhull.a or qhull.lib - See qhulllib.h for data structures, macros, and user-callable functions. + See libqhull.h for data structures, macros, and user-callable functions. See user.c for qhull-related, redefinable functions see user.h for user-definable constants See userprintf.c for qh_fprintf and qh_fprintf_rbox @@ -18,7 +18,7 @@ Please report any errors that you fix to qhull@qhull.org */ -#include "qhulllib.h" +#include "libqhull.h" #include <stdlib.h> diff --git a/src/userprintf.c b/src/userprintf.c index 2afe46ce2e066cb048ecc6a6e882b094f70aacba..1b4fbc90a90f602e4cd65eb9ed02e4b25eabe146 100644 --- a/src/userprintf.c +++ b/src/userprintf.c @@ -10,7 +10,7 @@ If you recompile and load this file, then userprintf.o will not be loaded from qhull.a or qhull.lib - See qhulllib.h for data structures, macros, and user-callable functions. + See libqhull.h for data structures, macros, and user-callable functions. See user.c for qhull-related, redefinable functions see user.h for user-definable constants See usermem.c for qh_exit(), qh_free(), and qh_malloc() @@ -19,7 +19,7 @@ Please report any errors that you fix to qhull@qhull.org */ -#include "qhulllib.h" +#include "libqhull.h" #include <stdarg.h> #include <stdio.h>