QhullFacetList.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/QhullFacetList.h#2 $$Change: 1342 $
00005 ** $DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
00006 **
00007 ****************************************************************************/
00008 
00009 #ifndef QHULLFACETLIST_H
00010 #define QHULLFACETLIST_H
00011 
00012 #include "QhullLinkedList.h"
00013 #include "QhullFacet.h"
00014 
00015 #include <ostream>
00016 
00017 namespace orgQhull {
00018 
00019 #//ClassRef
00020     class               QhullFacet;
00021 
00022 #//Types
00023 
00024     class               QhullFacetList;
00026     typedef QhullLinkedListIterator<QhullFacet>
00027                         QhullFacetListIterator;
00028 
00029 class QhullFacetList : public QhullLinkedList<QhullFacet> {
00030 
00031 #// Fields
00032 private:
00033     bool                select_all;   
00034 
00035 #//Constructors
00036 public:
00037                         QhullFacetList(QhullFacet b, QhullFacet e) : QhullLinkedList<QhullFacet>(b, e), select_all(false) {}
00038                         //Copy constructor copies pointer but not contents.  Needed for return by value and parameter passing.
00039                         QhullFacetList(const QhullFacetList &o) : QhullLinkedList<QhullFacet>(*o.begin(), *o.end()), select_all(o.select_all) {}
00040                        ~QhullFacetList() {}
00041 
00042 private:
00044                         QhullFacetList();
00045     QhullFacetList     &operator=(const QhullFacetList &);
00046 public:
00047 
00048 #//Conversion
00049 #ifndef QHULL_NO_STL
00050     std::vector<QhullFacet> toStdVector() const;
00051     std::vector<QhullVertex> vertices_toStdVector(int qhRunId) const;
00052 #endif //QHULL_NO_STL
00053 #ifdef QHULL_USES_QT
00054     QList<QhullFacet>   toQList() const;
00055     QList<QhullVertex>  vertices_toQList(int qhRunId) const;
00056 #endif //QHULL_USES_QT
00057 
00058 #//GetSet
00059     bool                isSelectAll() const { return select_all; }
00060     void                selectAll() { select_all= true; }
00061     void                selectGood() { select_all= false; }
00062 
00063 #//Read-only
00064 
00065     int                 count() const;
00066     bool                contains(const QhullFacet &f) const;
00067     int                 count(const QhullFacet &f) const;
00069 
00070 #//IO
00071     struct PrintFacetList{
00072         const QhullFacetList *facet_list;
00073         int             run_id;
00074                         PrintFacetList(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {}
00075     };//PrintFacetList
00076     PrintFacetList     print(int qhRunId) const  { return PrintFacetList(qhRunId, *this); }
00077 
00078     struct PrintFacets{
00079         const QhullFacetList *facet_list;
00080         int             run_id;
00081                         PrintFacets(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {}
00082     };//PrintFacets
00083     PrintFacets     printFacets(int qhRunId) const { return PrintFacets(qhRunId, *this); }
00084 
00085     struct PrintVertices{
00086         const QhullFacetList *facet_list;
00087         int             run_id;   
00088                         PrintVertices(int qhRunId, const QhullFacetList &fl) : facet_list(&fl), run_id(qhRunId) {}
00089     };//PrintVertices
00090     PrintVertices   printVertices(int qhRunId) const { return PrintVertices(qhRunId, *this); }
00091 };//class QhullFacetList
00092 
00093 }//namespace orgQhull
00094 
00095 #//== Global namespace =========================================
00096 
00097 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacetList &p);
00098 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintFacets &p);
00099 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList::PrintVertices &p);
00100 std::ostream &operator<<(std::ostream &os, const orgQhull::QhullFacetList &fs);
00101 
00102 #endif // QHULLFACETLIST_H


libqhull-ours
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:32:11