QhullFacetSet.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (c) 2008-2011 C.B. Barber. All rights reserved.
00004 ** $Id: //main/2011/qhull/src/libqhullcpp/QhullFacetSet.h#4 $$Change: 1382 $
00005 ** $DateTime: 2011/05/14 10:45:42 $$Author: bbarber $
00006 **
00007 ****************************************************************************/
00008 
00009 #ifndef QHULLFACETSET_H
00010 #define QHULLFACETSET_H
00011 
00012 #include "QhullSet.h"
00013 
00014 #include <ostream>
00015 
00016 namespace orgQhull {
00017 
00018 #//ClassRef
00019     class               QhullFacet;
00020 
00021 #//Types
00022 
00023     class               QhullFacetSet;
00024     typedef QhullSetIterator<QhullFacet>
00025                         QhullFacetSetIterator;
00026 
00027 class QhullFacetSet : public QhullSet<QhullFacet> {
00028 
00029 private:
00030 #//Fields
00031     bool                select_all;   
00032 
00033 public:
00034 #//Constructor
00035                         //Conversion from setT* is not type-safe.  Implicit conversion for void* to T
00036    explicit             QhullFacetSet(setT *s) : QhullSet<QhullFacet>(s), select_all(false) {}
00037                         //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
00038                         QhullFacetSet(const QhullFacetSet &o) : QhullSet<QhullFacet>(o), select_all(o.select_all) {}
00039 
00040 private:
00042                         QhullFacetSet();
00043     QhullFacetSet      &operator=(const QhullFacetSet &);
00044 public:
00045 
00046 #//Conversion
00047 #ifndef QHULL_NO_STL
00048     std::vector<QhullFacet> toStdVector() const;
00049 #endif //QHULL_NO_STL
00050 #ifdef QHULL_USES_QT
00051     QList<QhullFacet>   toQList() const;
00052 #endif //QHULL_USES_QT
00053 
00054 #//GetSet
00055     bool                isSelectAll() const { return select_all; }
00056     void                selectAll() { select_all= true; }
00057     void                selectGood() { select_all= false; }
00058 
00059 #//Read-only
00060 
00061     int                 count() const;
00062     bool                contains(const QhullFacet &f) const;
00063     int                 count(const QhullFacet &f) const;
00065 
00066 #//IO
00067     // Not same as QhullFacetList#IO.  A QhullFacetSet is a component of a QhullFacetList.
00068 
00069     struct PrintFacetSet{
00070         const QhullFacetSet *facet_set;
00071         const char     *print_message;
00072         int             run_id;
00073                         PrintFacetSet(int qhRunId, const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message), run_id(qhRunId) {}
00074     };//PrintFacetSet
00075     const PrintFacetSet       print(int qhRunId, const char *message) const { return PrintFacetSet(qhRunId, message, this); }
00076 
00077     struct PrintIdentifiers{
00078         const QhullFacetSet *facet_set;
00079         const char     *print_message;
00080                         PrintIdentifiers(const char *message, const QhullFacetSet *s) : facet_set(s), print_message(message) {}
00081     };//PrintIdentifiers
00082     PrintIdentifiers    printIdentifiers(const char *message) const { return PrintIdentifiers(message, this); }
00083 
00084 };//class QhullFacetSet
00085 
00086 }//namespace orgQhull
00087 
00088 #//== Global namespace =========================================
00089 
00090 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet &fs);
00091 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintFacetSet &pr);
00092 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetSet::PrintIdentifiers &p);
00093 
00094 #endif // QHULLFACETSET_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


libqhull
Author(s): Robert Krug
autogenerated on Tue Jun 18 2013 12:38:50