File indexing completed on 2025-12-16 10:19:28
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef QHULLQH_H
0010 #define QHULLQH_H
0011
0012 #include "libqhull_r/qhull_ra.h"
0013
0014 #include <string>
0015
0016 #ifdef _MSC_VER
0017 #pragma warning( disable : 4611)
0018
0019 #endif
0020
0021
0022
0023
0024
0025
0026
0027 #define QH_TRY_ERROR 10071
0028
0029 #define QH_TRY_(qh) \
0030 int QH_TRY_status; \
0031 if(qh->NOerrexit){ \
0032 qh->NOerrexit= False; \
0033 QH_TRY_status= setjmp(qh->errexit); \
0034 }else{ \
0035 throw QhullError(QH_TRY_ERROR, "Cannot invoke QH_TRY_() from inside a QH_TRY_. Or missing 'qh->NOerrexit=true' after previously called QH_TRY_(qh){...}"); \
0036 } \
0037 if(!QH_TRY_status)
0038
0039 #define QH_TRY_NO_THROW_(qh) \
0040 int QH_TRY_status; \
0041 if(qh->NOerrexit){ \
0042 qh->NOerrexit= False; \
0043 QH_TRY_status= setjmp(qh->errexit); \
0044 }else{ \
0045 QH_TRY_status= QH_TRY_ERROR; \
0046 } \
0047 if(!QH_TRY_status)
0048
0049 namespace orgQhull {
0050
0051 #
0052
0053 class QhullQh;
0054
0055
0056 class QhullQh : public qhT {
0057
0058 #
0059
0060 #
0061 private:
0062 int qhull_status;
0063 std::string qhull_message;
0064 std::ostream * error_stream;
0065 std::ostream * output_stream;
0066 double factor_epsilon;
0067 bool use_output_stream;
0068
0069
0070 friend void ::qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... );
0071
0072 static const double default_factor_epsilon;
0073
0074 #
0075 public:
0076 QhullQh();
0077 ~QhullQh();
0078 private:
0079
0080 QhullQh(const QhullQh &);
0081 QhullQh & operator=(const QhullQh &);
0082 public:
0083
0084 #
0085 double factorEpsilon() const { return factor_epsilon; }
0086 void setFactorEpsilon(double a) { factor_epsilon= a; }
0087 void disableOutputStream() { use_output_stream= false; }
0088 void enableOutputStream() { use_output_stream= true; }
0089
0090 #
0091 void appendQhullMessage(const std::string &s);
0092 void clearQhullMessage();
0093 std::string qhullMessage() const;
0094 bool hasOutputStream() const { return use_output_stream; }
0095 bool hasQhullMessage() const;
0096 void maybeThrowQhullMessage(int exitCode);
0097 void maybeThrowQhullMessage(int exitCode, int noThrow) throw();
0098 int qhullStatus() const;
0099 void setErrorStream(std::ostream *os);
0100 void setOutputStream(std::ostream *os);
0101
0102 #
0103 double angleEpsilon() const { return this->ANGLEround*factor_epsilon; }
0104 void checkAndFreeQhullMemory();
0105 double distanceEpsilon() const { return this->DISTround*factor_epsilon; }
0106
0107 };
0108
0109 }
0110
0111 #endif