third-parties
qhull
src
libqhullcpp
QhullSet.cpp
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/QhullSet.cpp#3 $$Change: 2066 $
5
** $DateTime: 2016/01/18 19:29:17 $$Author: bbarber $
6
**
7
****************************************************************************/
8
9
#
10
11
#include "
libqhullcpp/QhullSet.h
"
12
13
#include "
libqhullcpp/Qhull.h
"
14
#include "
libqhullcpp/QhullError.h
"
15
16
#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4
17
#endif
18
19
namespace
orgQhull
{
20
21
#
22
23
setT
QhullSetBase::
24
s_empty_set
;
25
26
#
27
28
QhullSetBase::
29
QhullSetBase
(
const
Qhull &q,
setT
*s)
30
: qh_set(s ? s : &s_empty_set)
31
,
qh_qh
(
q
.
qh
())
32
{
33
}
34
35
#
36
37
// Same code for qh_setsize [qset_r.c] and QhullSetBase::count [static]
38
countT
QhullSetBase::
39
count
(
const
setT
*set)
40
{
41
countT
size
;
42
const
setelemT
*sizep;
43
44
if
(!set){
45
return
(0);
46
}
47
sizep=
SETsizeaddr_
(set);
48
if
((
size
= sizep->
i
)) {
49
size
--;
50
if
(
size
> set->
maxsize
) {
51
// FIXUP QH11022 How to add additional output to a error? -- qh_setprint(qhmem.ferr, "set: ", set);
52
throw
QhullError
(10032,
"QhullSet internal error: current set size %d is greater than maximum size %d\n"
,
53
size
, set->
maxsize
);
54
}
55
}
else
{
56
size
= set->
maxsize
;
57
}
58
return
size
;
59
}
//count
60
61
}
//namespace orgQhull
62
countT
int countT
Definition:
user_r.h:182
orgQhull
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
Definition:
Coordinates.cpp:21
orgQhull::QhullSetBase::s_empty_set
static setT s_empty_set
Definition:
QhullSet.h:55
Qhull.h
setelemT::i
int i
Definition:
qset.h:80
QhullSet.h
qh_qh
qhT qh_qh
Definition:
global.c:26
orgQhull::QhullSetBase::size
size_t size() const
Definition:
QhullSet.h:79
setT
Definition:
qset.h:83
qh
#define qh
Definition:
libqhull.h:457
orgQhull::QhullSetBase::count
countT count() const
Definition:
QhullSet.h:72
setT::maxsize
int maxsize
Definition:
qset.h:84
setelemT
Definition:
qset.h:78
q
q
SETsizeaddr_
#define SETsizeaddr_(set)
Definition:
qset.h:433
orgQhull::QhullSetBase::QhullSetBase
QhullSetBase()
disabled since memory allocation for QhullSet not defined
Definition:
QhullSet.h:68
orgQhull::QhullError
Definition:
QhullError.h:26
QhullError.h
hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:15