QhullVertex.cpp
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/QhullVertex.cpp#2 $$Change: 1342 $
00005 ** $DateTime: 2011/03/07 21:55:47 $$Author: bbarber $
00006 **
00007 ****************************************************************************/
00008 
00009 #//! QhullVertex -- Qhull's vertex structure, vertexT, as a C++ class
00010 
00011 #include "UsingLibQhull.h"
00012 #include "QhullPoint.h"
00013 #include "QhullFacetSet.h"
00014 #include "QhullVertex.h"
00015 #include "QhullVertexSet.h"
00016 #include "QhullFacet.h"
00017 
00018 #ifdef _MSC_VER  // Microsoft Visual C++ -- warning level 4
00019 #pragma warning( disable : 4611)  // interaction between '_setjmp' and C++ object destruction is non-portable
00020 #pragma warning( disable : 4996)  // function was declared deprecated(strcpy, localtime, etc.)
00021 #endif
00022 
00023 namespace orgQhull {
00024 
00025 #//class statics
00026 vertexT QhullVertex::
00027 s_empty_vertex= {0,0,0,0,0,
00028                  0,0,0,0,0,
00029                  0,0};
00030 
00031 #//ForEach
00032 
00035 QhullFacetSet QhullVertex::
00036 neighborFacets() const
00037 {
00038     if(!neighborFacetsDefined()){
00039         throw QhullError(10034, "Qhull error: neighboring facets of vertex %d not defined.  Please call Qhull::defineVertexNeighborFacets() beforehand.", id());
00040     }
00041     return QhullFacetSet(qh_vertex->neighbors);
00042 }//neighborFacets
00043 
00044 }//namespace orgQhull
00045 
00046 #//Global functions
00047 
00048 using std::endl;
00049 using std::ostream;
00050 using std::string;
00051 using std::vector;
00052 using orgQhull::QhullPoint;
00053 using orgQhull::QhullFacet;
00054 using orgQhull::QhullFacetSet;
00055 using orgQhull::QhullFacetSetIterator;
00056 using orgQhull::QhullVertex;
00057 using orgQhull::UsingLibQhull;
00058 
00060 ostream &
00061 operator<<(ostream &os, const QhullVertex::PrintVertex &pr)
00062 {
00063     QhullVertex v= *pr.vertex;
00064     QhullPoint p= v.point();
00065     os << "- p" << p.id(pr.run_id) << " (v" << v.id() << "): ";
00066     const realT *c= p.coordinates();
00067     for(int k= p.dimension(); k--; ){
00068         os << " " << *c++; // FIXUP QH11010 %5.2g
00069     }
00070     if(v.getVertexT()->deleted){
00071         os << " deleted";
00072     }
00073     if(v.getVertexT()->delridge){
00074         os << " ridgedeleted";
00075     }
00076     os << endl;
00077     if(v.neighborFacetsDefined()){
00078         QhullFacetSetIterator i= v.neighborFacets();
00079         if(i.hasNext()){
00080             os << " neighborFacets:";
00081             int count= 0;
00082             while(i.hasNext()){
00083                 if(++count % 100 == 0){
00084                     os << endl << "     ";
00085                 }
00086                 QhullFacet f= i.next();
00087                 os << " f" << f.id();
00088             }
00089             os << endl;
00090         }
00091     }
00092     return os;
00093 }//<< PrintVertex
00094 


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