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