/usr/include/libqhullcpp/QhullRidge.h is in libqhull-dev 2012.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | /****************************************************************************
**
** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
** $Id: //main/2011/qhull/src/libqhullcpp/QhullRidge.h#6 $$Change: 1464 $
** $DateTime: 2012/01/25 22:58:41 $$Author: bbarber $
**
****************************************************************************/
#ifndef QHULLRIDGE_H
#define QHULLRIDGE_H
#include "QhullSet.h"
#include "QhullVertex.h"
#include "QhullVertexSet.h"
#include "QhullFacet.h"
extern "C" {
#include "libqhull/qhull_a.h"
}
#include <ostream>
namespace orgQhull {
#//ClassRef
class QhullVertex;
class QhullVertexSet;
class QhullFacet;
#//Types
//! QhullRidge -- Qhull's ridge structure, ridgeT [libqhull.h], as a C++ class
class QhullRidge;
typedef QhullSet<QhullRidge> QhullRidgeSet;
typedef QhullSetIterator<QhullRidge> QhullRidgeSetIterator;
// see QhullSets.h for QhullRidgeSet and QhullRidgeSetIterator -- avoids circular references
/************************
a ridge is hull_dim-1 simplex between two neighboring facets. If the
facets are non-simplicial, there may be more than one ridge between
two facets. E.G. a 4-d hypercube has two triangles between each pair
of neighboring facets.
topological information:
vertices a set of vertices
top,bottom neighboring facets with orientation
geometric information:
tested True if ridge is clearly convex
nonconvex True if ridge is non-convex
*/
class QhullRidge {
#//Fields
ridgeT *qh_ridge;
#//Class objects
static ridgeT s_empty_ridge;
public:
#//Constants
#//Constructors
QhullRidge() : qh_ridge(&s_empty_ridge) {}
// Creates an alias. Does not copy QhullRidge. Needed for return by value and parameter passing
QhullRidge(const QhullRidge &o) : qh_ridge(o.qh_ridge) {}
// Creates an alias. Does not copy QhullRidge. Needed for vector<QhullRidge>
QhullRidge &operator=(const QhullRidge &o) { qh_ridge= o.qh_ridge; return *this; }
~QhullRidge() {}
#//Conversion
//Implicit conversion from ridgeT
QhullRidge(ridgeT *r) : qh_ridge(r ? r : &s_empty_ridge) {}
ridgeT *getRidgeT() const { return qh_ridge; }
#//QhullSet<QhullRidge>
ridgeT *getBaseT() const { return getRidgeT(); }
#//getSet
QhullFacet bottomFacet() const { return QhullFacet(qh_ridge->bottom); }
int dimension() const { return QhullSetBase::count(qh_ridge->vertices); }
int id() const { return qh_ridge->id; }
bool isDefined() const { return qh_ridge != &s_empty_ridge; }
bool operator==(const QhullRidge &o) const { return qh_ridge==o.qh_ridge; }
bool operator!=(const QhullRidge &o) const { return !operator==(o); }
QhullFacet otherFacet(QhullFacet f) const { return QhullFacet(qh_ridge->top==f.getFacetT() ? qh_ridge->bottom : qh_ridge->top); }
QhullFacet topFacet() const { return QhullFacet(qh_ridge->top); }
#//forEach
bool hasNextRidge3d(const QhullFacet f) const;
QhullRidge nextRidge3d(const QhullFacet f) const { return nextRidge3d(f, 0); }
QhullRidge nextRidge3d(const QhullFacet f, QhullVertex *nextVertex) const;
QhullVertexSet vertices() const { return QhullVertexSet(qh_ridge->vertices); }
#//IO
struct PrintRidge{
const QhullRidge *ridge;
int run_id;
PrintRidge(int qhRunId, const QhullRidge &r) : ridge(&r), run_id(qhRunId) {}
};//PrintRidge
PrintRidge print(int qhRunId) const { return PrintRidge(qhRunId, *this); }
};//class QhullRidge
}//namespace orgQhull
std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge &r);
std::ostream &operator<<(std::ostream &os, const orgQhull::QhullRidge::PrintRidge &pr);
#endif // QHULLRIDGE_H
|