Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:56

0001 /****************************************************************************
0002 **
0003 ** Copyright (c) 2009-2020 C.B. Barber. All rights reserved.
0004 ** $Id: //main/2019/qhull/src/libqhullcpp/QhullPointSet.h#3 $$Change: 3001 $
0005 ** $DateTime: 2020/07/24 20:43:28 $$Author: bbarber $
0006 **
0007 ****************************************************************************/
0008 
0009 #ifndef QHULLPOINTSET_H
0010 #define QHULLPOINTSET_H
0011 
0012 #include "libqhull_r/qhull_ra.h"
0013 #include "libqhullcpp/QhullSet.h"
0014 #include "libqhullcpp/QhullPoint.h"
0015 
0016 #include <ostream>
0017 
0018 namespace orgQhull {
0019 
0020 #//!\name Used here
0021     class Qhull;
0022     class QhullPoint;
0023 
0024 #//!\name Defined here
0025     //! QhullPointSet -- a set of coordinate pointers with input dimension
0026     //! Includes const_iterator and iterator
0027     class QhullPointSet;
0028 
0029     //! QhullPointSetIterator is a Java-style iterator for QhullPoint in a QhullPointSet
0030     //! QhullPointSetIterator may be used on temporary results.  It copies the pointers in QhullPointSet
0031     typedef QhullSetIterator<QhullPoint>  QhullPointSetIterator;
0032 
0033 class QhullPointSet : public QhullSet<QhullPoint> {
0034 
0035 private:
0036 #//!\name Fields
0037     // no fields
0038 public:
0039 
0040 #//!\name Construct
0041                         QhullPointSet(const Qhull &q, setT *s) : QhullSet<QhullPoint>(q, s) {}
0042                         //Conversion from setT* is not type-safe.  Implicit conversion for void* to T
0043                         QhullPointSet(QhullQh *qqh, setT *s) : QhullSet<QhullPoint>(qqh, s) {}
0044                         //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
0045                         QhullPointSet(const QhullPointSet &other) : QhullSet<QhullPoint>(other) {}
0046                         //!Assignment copies pointers but not contents.
0047     QhullPointSet &     operator=(const QhullPointSet &other) { QhullSet<QhullPoint>::operator=(other); return *this; }
0048                         ~QhullPointSet() {}
0049 
0050                         //!Default constructor disabled.
0051 private:
0052                         QhullPointSet();
0053 public:
0054 
0055 #//!\name IO
0056     struct PrintIdentifiers{
0057         const QhullPointSet *point_set;
0058         const char *    print_message; //!< non-null message
0059         PrintIdentifiers(const char *message, const QhullPointSet *s) : point_set(s), print_message(message) {}
0060     };//PrintIdentifiers
0061     PrintIdentifiers printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
0062 
0063     struct PrintPointSet{
0064         const QhullPointSet *point_set;
0065         const char *    print_message;  //!< non-null message
0066         PrintPointSet(const char *message, const QhullPointSet &s) : point_set(&s), print_message(message) {}
0067     };//PrintPointSet
0068     PrintPointSet       print(const char *message) const { return PrintPointSet(message, *this); }
0069 
0070 };//QhullPointSet
0071 
0072 }//namespace orgQhull
0073 
0074 #//!\name Global
0075 
0076 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPointSet::PrintIdentifiers &pr);
0077 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullPointSet::PrintPointSet &pr);
0078 
0079 #endif // QHULLPOINTSET_H