QhullQh.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (c) 2008-2015 C.B. Barber. All rights reserved.
4 ** $Id: //main/2015/qhull/src/libqhullcpp/QhullQh.h#1 $$Change: 1981 $
5 ** $DateTime: 2015/09/28 20:26:32 $$Author: bbarber $
6 **
7 ****************************************************************************/
8 
9 #ifndef QHULLQH_H
10 #define QHULLQH_H
11 
12 extern "C" {
13  #include "libqhull_r/qhull_ra.h"
14 }
15 
16 #include <string>
17 
18 #ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4
19 #pragma warning( disable : 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */
20 /* setjmp should not be implemented with 'catch' */
21 #endif
22 
28 
29 #define QH_TRY_ERROR 10071
30 
31 #define QH_TRY_(qh) \
32  int QH_TRY_status; \
33  if(qh->NOerrexit){ \
34  qh->NOerrexit= False; \
35  QH_TRY_status= setjmp(qh->errexit); \
36  }else{ \
37  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){...}"); \
38  } \
39  if(!QH_TRY_status)
40 
41 #define QH_TRY_NO_THROW_(qh) \
42  int QH_TRY_status; \
43  if(qh->NOerrexit){ \
44  qh->NOerrexit= False; \
45  QH_TRY_status= setjmp(qh->errexit); \
46  }else{ \
47  QH_TRY_status= QH_TRY_ERROR; \
48  } \
49  if(!QH_TRY_status)
50 
51 namespace orgQhull {
52 
53 #
54  class QhullQh;
56 
58 class QhullQh : public qhT {
59 
60 #
61 
62 #
63 private:
65  std::string qhull_message;
66  std::ostream * error_stream;
67  std::ostream * output_stream;
68  double factor_epsilon;
70 
71  friend void ::qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... );
72 
73  static const double default_factor_epsilon;
74 
75 #
76 public:
77  QhullQh();
78  ~QhullQh();
79 private:
81  QhullQh(const QhullQh &);
82  QhullQh & operator=(const QhullQh &);
83 public:
84 
85 #
86  double factorEpsilon() const { return factor_epsilon; }
87  void setFactorEpsilon(double a) { factor_epsilon= a; }
90 
91 #
92  void appendQhullMessage(const std::string &s);
93  void clearQhullMessage();
94  std::string qhullMessage() const;
95  bool hasOutputStream() const { return use_output_stream; }
96  bool hasQhullMessage() const;
97  void maybeThrowQhullMessage(int exitCode);
98  void maybeThrowQhullMessage(int exitCode, int noThrow) throw();
99  int qhullStatus() const;
100  void setErrorStream(std::ostream *os);
101  void setOutputStream(std::ostream *os);
102 
103 #
104  double angleEpsilon() const { return this->ANGLEround*factor_epsilon; }
105  void checkAndFreeQhullMemory();
106  double distanceEpsilon() const { return this->DISTround*factor_epsilon; }
107 
108 };//class QhullQh
109 
110 }//namespace orgQhull
111 
112 #endif // QHULLQH_H
orgQhull::QhullQh::setFactorEpsilon
void setFactorEpsilon(double a)
Definition: QhullQh.h:87
obb.fmt
fmt
Definition: obb.py:145
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition: Coordinates.cpp:21
orgQhull::QhullQh::output_stream
std::ostream * output_stream
send output to stream
Definition: QhullQh.h:67
qhT
Definition: libqhull.h:465
orgQhull::QhullQh::qhullStatus
int qhullStatus() const
Definition: QhullQh.cpp:167
orgQhull::QhullQh::hasOutputStream
bool hasOutputStream() const
Definition: QhullQh.h:95
orgQhull::QhullQh::qhull_status
int qhull_status
qh_ERRnone if valid
Definition: QhullQh.h:64
a
list a
orgQhull::QhullQh::factor_epsilon
double factor_epsilon
Factor to increase ANGLEround and DISTround for hyperplane equality.
Definition: QhullQh.h:68
qhT::DISTround
realT DISTround
Definition: libqhull.h:630
orgQhull::QhullQh::clearQhullMessage
void clearQhullMessage()
clearQhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:102
orgQhull::QhullQh::qhull_message
std::string qhull_message
Returned messages from libqhull_r.
Definition: QhullQh.h:65
orgQhull::QhullQh::QhullQh
QhullQh()
Derived from qh_new_qhull[user.c].
Definition: QhullQh.cpp:42
orgQhull::QhullQh::error_stream
std::ostream * error_stream
overrides errorMessage, use appendQhullMessage()
Definition: QhullQh.h:66
qh
#define qh
Definition: libqhull.h:457
orgQhull::QhullQh
POD type equivalent to qhT. No virtual members.
Definition: QhullQh.h:58
orgQhull::QhullQh::use_output_stream
bool use_output_stream
True if using output_stream.
Definition: QhullQh.h:69
qhull_ra.h
orgQhull::QhullQh::enableOutputStream
void enableOutputStream()
Definition: QhullQh.h:89
orgQhull::QhullQh::setErrorStream
void setErrorStream(std::ostream *os)
Definition: QhullQh.cpp:173
orgQhull::QhullQh::~QhullQh
~QhullQh()
Definition: QhullQh.cpp:58
orgQhull::QhullQh::qhullMessage
std::string qhullMessage() const
qhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:157
orgQhull::QhullQh::setOutputStream
void setOutputStream(std::ostream *os)
Updates use_output_stream.
Definition: QhullQh.cpp:180
orgQhull::QhullQh::hasQhullMessage
bool hasQhullMessage() const
hasQhullMessage does not throw errors (~Qhull)
Definition: QhullQh.cpp:111
qh_fprintf
void qh_fprintf(FILE *fp, int msgcode, const char *fmt,...)
Definition: userprintf.c:42
orgQhull::QhullQh::default_factor_epsilon
static const double default_factor_epsilon
Default factor_epsilon is 1.0, never updated.
Definition: QhullQh.h:73
orgQhull::QhullQh::maybeThrowQhullMessage
void maybeThrowQhullMessage(int exitCode)
Definition: QhullQh.cpp:118
orgQhull::QhullQh::disableOutputStream
void disableOutputStream()
Definition: QhullQh.h:88
orgQhull::QhullQh::operator=
QhullQh & operator=(const QhullQh &)


hpp-fcl
Author(s):
autogenerated on Fri Jan 26 2024 03:46:15