00001 //STARTHEADER 00002 // $Id: Triangulation.hh 293 2006-08-17 19:38:38Z salam $ 00003 // 00004 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam 00005 // 00006 //---------------------------------------------------------------------- 00007 // This file is part of FastJet. 00008 // 00009 // FastJet is free software; you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation; either version 2 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // The algorithms that underlie FastJet have required considerable 00015 // development and are described in hep-ph/0512210. If you use 00016 // FastJet as part of work towards a scientific publication, please 00017 // include a citation to the FastJet paper. 00018 // 00019 // FastJet is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 // GNU General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with FastJet; if not, write to the Free Software 00026 // Foundation, Inc.: 00027 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00028 //---------------------------------------------------------------------- 00029 //ENDHEADER 00030 00031 00032 #ifndef DROP_CGAL // in case we do not have the code for CGAL 00033 #ifndef __FASTJET_TRIANGULATION__ 00034 #define __FASTJET_TRIANGULATION__ 00035 00036 // file: examples/Triangulation_2/Voronoi.C 00037 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> 00038 #include <CGAL/Delaunay_triangulation_2.h> 00039 #include <CGAL/Triangulation_hierarchy_2.h> 00040 #include <CGAL/Triangulation_vertex_base_with_info_2.h> 00041 #include "fastjet/internal/base.hh" 00042 00043 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh 00044 00047 #ifdef CGAL_SIMPLE_KERNEL 00048 struct K : CGAL::Simple_cartesian<double> {}; 00049 #else 00050 struct K : CGAL::Exact_predicates_inexact_constructions_kernel {}; 00051 #endif // CGAL_SIMPLE_KERNEL 00052 00053 // our extras to help us navigate, find distance, etc. 00054 const int INFINITE_VERTEX=-1; 00055 const int NEW_VERTEX=-2; 00056 const double HUGE_DOUBLE=1e300; 00057 00059 class InitialisedInt { 00060 private: 00061 int _val; 00062 public: 00063 inline InitialisedInt () {_val=NEW_VERTEX;}; 00064 inline InitialisedInt& operator= (int value) {_val = value; return *this;}; 00065 inline int val() const {return _val;}; 00066 }; 00067 00068 00069 // We can have triangulations with and without hierarchies -- those with 00070 // are able to guarantee N ln N time for the construction of a large 00071 // triangulation, whereas those without go as N^{3/2} for points 00072 // sufficiently uniformly distributed in a plane. 00073 // 00074 //#define NOHIERARCHY 00075 #ifdef NOHIERARCHY 00076 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vb; 00077 typedef CGAL::Triangulation_face_base_2<K> Fb; 00078 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds; 00079 typedef CGAL::Delaunay_triangulation_2<K,Tds> Triangulation; 00080 #else 00081 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vbb; 00082 typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbb> Vb; 00083 typedef CGAL::Triangulation_face_base_2<K> Fb; 00084 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds; 00085 typedef CGAL::Delaunay_triangulation_2<K,Tds> Dt; 00086 typedef CGAL::Triangulation_hierarchy_2<Dt> Triangulation; 00087 #endif 00088 00089 typedef Triangulation::Vertex_handle Vertex_handle; 00090 typedef Triangulation::Point Point; 00091 typedef Triangulation::Vertex_circulator Vertex_circulator; 00092 typedef Triangulation::Face_circulator Face_circulator; 00093 typedef Triangulation::Face_handle Face_handle; 00094 00095 00096 00097 FASTJET_END_NAMESPACE 00098 00099 #endif // __FASTJET_TRIANGULATION__ 00100 #endif // DROP_CGAL