25 #include <QtCore/QList> 49 static setT s_empty_set; 53 QhullSetBase(const Qhull &q, setT *s); 66 countT count() const { return QhullSetBase::count(qh_set); } 105 static setT s_empty_set; 110 class const_iterator;
115 QhullSet<T>(const Qhull &q, setT *s) : QhullSetBase(q, s) { } 131 std::vector<T> toStdVector()
const;
134 QList<typename T> toQList()
const;
138 using QhullSetBase::count; 145 // Constructs T. Cannot return reference. 146 const T
at(
countT idx)
const {
return operator[](idx); }
148 const T
back()
const {
return last(); }
151 const typename T::base_type *
constData()
const {
return reinterpret_cast<const typename T::base_type *
>(
beginPointer()); }
152 typename T::base_type *
data() {
return reinterpret_cast<typename T::base_type *
>(
beginPointer()); }
153 const typename T::base_type *
data()
const {
return reinterpret_cast<const typename T::base_type *
>(
beginPointer()); }
154 typename T::base_type *
endData() {
return reinterpret_cast<typename T::base_type *
>(
endPointer()); }
155 const typename T::base_type *
endData()
const {
return reinterpret_cast<const typename T::base_type *
>(
endPointer()); }
160 const T
front()
const {
return first(); }
169 const T
second()
const {
return operator[](1); }
172 T value(
countT idx,
const T &defaultValue)
const;
177 iterator begin() { return iterator(qh(), reinterpret_cast<typename T::base_type *>(beginPointer())); } 178 const_iterator
begin()
const {
return const_iterator(
qh(),
data()); }
180 const_iterator
constEnd()
const {
return const_iterator(
qh(), endData()); }
181 iterator
end() {
return iterator(
qh(), endData()); }
182 const_iterator
end()
const {
return const_iterator(
qh(), endData()); }
185 bool contains(const T &t) const; 188 countT lastIndexOf(
const T &t)
const;
194 typename T::base_type *
i;
240 const typename T::base_type *
i;
282 template <
typename T>
286 typedef typename QhullSet<T>::const_iterator const_iterator; 290 const typename T::base_type * i; // e.g., facetT**, first for debugger 292 const typename T::base_type *
end_i;
297 QhullSetIterator<T>(const QhullSet<T> &s) : i(s.data()), begin_i(i), end_i(s.endData()), qh_qh(s.qh()) {} 302 countT countRemaining() { return (countT)(end_i-i); } // WARN64 305 bool findNext(const T &t); 306 bool findPrevious(
const T &t);
309 bool hasNext() const { return i != end_i; } 311 T
next() {
return T(qh_qh, *i++); }
313 T
peekPrevious()
const {
const typename T::base_type *p = i;
return T(qh_qh, *--p); }
326 template <
typename T>
338 #endif //QHULL_NO_STL 341 template <
typename T>
357 template <
typename T>
362 const typename T::base_type *p=
reinterpret_cast<const typename T::base_type *
>(&
SETelem_(
getSetT(), idx));
363 return (idx>=0 && p<endData()) ? T(
qh(), *p) : T(
qh());
366 template <
typename T>
371 const typename T::base_type *p=
reinterpret_cast<const typename T::base_type *
>(&
SETelem_(
getSetT(), idx));
372 return (idx>=0 && p<endData() ? T(
qh(), *p) : defaultValue);
377 template <
typename T>
382 void *p= t.getBaseT();
387 template <
typename T>
392 const typename T::base_type *i=
data();
393 const typename T::base_type *e= endData();
394 typename T::base_type p= t.getBaseT();
404 template <
typename T>
408 const typename T::base_type *
b=
data();
409 const typename T::base_type *i= endData();
410 typename T::base_type p= t.getBaseT();
421 template <
typename T>
425 typename T::base_type p= t.getBaseT();
434 template <
typename T>
438 typename T::base_type p= t.getBaseT();
452 template <
typename T>
454 operator<<(std::ostream &os, const orgQhull::QhullSet<T> &qs)
456 const typename T::base_type *i= qs.data();
457 const typename T::base_type *e= qs.endData();
459 os << T(qs.qh(), *i++);
const T::base_type * endData() const
countT indexOf(const T &t) const
bool operator==(const const_iterator &o) const
iterator(const iterator &o)
bool operator>=(const iterator &o) const
const_iterator(const iterator &o)
std::vector< T > toStdVector() const
countT lastIndexOf(const T &t) const
const_iterator(const const_iterator &o)
const T operator[](countT idx) const
No error checking.
const T::base_type * constData() const
end element is NULL
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
bool operator>(const iterator &o) const
const_iterator & operator+=(int j)
iterator operator-(countT j) const
QhullSet< T > & operator=(const QhullSet< T > &other)
POD type equivalent to qhT. No virtual members.
QhullSetBase(QhullQh *qqh, setT *s)
T operator[](countT idx) const
No error checking.
T value(countT idx) const
QhullSet< T >::const_iterator ConstIterator
Faster then interator/const_iterator due to T::base_type.
QhullSetBase()
disabled since memory allocation for QhullSet not defined
bool findPrevious(const T &t)
const T operator[](countT idx) const
bool operator==(const const_iterator &o) const
void ** beginPointer() const
const T::base_type * begin_i
int qh_setindex(setT *set, void *atelem)
bool operator<(const const_iterator &o) const
const T::base_type * end_i
bool operator>=(const const_iterator &o) const
No error checking.
ptrdiff_t difference_type
bool operator>(const const_iterator &o) const
std::random_access_iterator_tag iterator_category
int qh_setin(setT *set, void *setelem)
std::bidirectional_iterator_tag iterator_category
ptrdiff_t difference_type
countT operator-(const const_iterator &o)
Assumes same point set.
iterator & operator-=(countT j)
iterator(QhullQh *qqh, typename T::base_type *p)
bool operator<(const const_iterator &o) const
bool contains(const T &t) const
const_iterator(QhullQh *qqh, const typename T::base_type *p)
countT operator-(const iterator &o) const
Assumes same point set.
bool operator<=(const const_iterator &o) const
iterator & operator+=(countT j)
const_iterator constEnd() const
const_iterator begin() const
const T::base_type * data() const
const T operator*() const
const_iterator & operator-=(int j)
bool operator!=(const const_iterator &o) const
const_iterator operator--(int)
bool operator==(const QhullSet< T > &other) const
const_iterator & operator--()
bool operator<=(const iterator &o) const
const_iterator operator+(int j) const
void ** elementPointer(countT idx) const
void ** qh_setendpointer(setT *set)
bool operator<(const iterator &o) const
void defineAs(setT *s)
Not type-safe since setT may contain any type.
static bool isEmpty(const setT *s)
bool operator!=(const QhullSet< T > &other) const
QhullSet< T >::iterator Iterator
void ** endPointer() const
Always points to 0.
bool operator==(const iterator &o) const
QhullSetBase & operator=(const QhullSetBase &other)
bool findNext(const T &t)
iterator & operator=(const iterator &o)
QhullSetBase(const QhullSetBase &other)
Copy constructor copies the pointer but not the set. Needed for return by value and parameter passing...
const_iterator constBegin() const
bool operator!=(const const_iterator &o) const
bool operator!=(const iterator &o) const
const_iterator operator++(int)
const_iterator & operator=(const const_iterator &o)
const_iterator operator-(int j) const
const T at(countT idx) const
bool operator<=(const const_iterator &o) const
const_iterator & operator++()
iterator & operator++()
No error checking.
bool operator>(const const_iterator &o) const
int qh_setequal(setT *setA, setT *setB)
const_iterator end() const
QhullSetIterator< T > & operator=(const QhullSetIterator< T > &o)
iterator operator+(countT j) const
bool operator>=(const const_iterator &o) const