FastJet  3.0.6
Triangulation.hh
1 #ifndef DROP_CGAL // in case we do not have the code for CGAL
2 #ifndef __FASTJET_TRIANGULATION__
3 #define __FASTJET_TRIANGULATION__
4 
5 //STARTHEADER
6 // $Id: Triangulation.hh 2595 2011-09-23 09:05:04Z salam $
7 //
8 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
9 //
10 //----------------------------------------------------------------------
11 // This file is part of FastJet.
12 //
13 // FastJet is free software; you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation; either version 2 of the License, or
16 // (at your option) any later version.
17 //
18 // The algorithms that underlie FastJet have required considerable
19 // development and are described in hep-ph/0512210. If you use
20 // FastJet as part of work towards a scientific publication, please
21 // include a citation to the FastJet paper.
22 //
23 // FastJet is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 // GNU General Public License for more details.
27 //
28 // You should have received a copy of the GNU General Public License
29 // along with FastJet. If not, see <http://www.gnu.org/licenses/>.
30 //----------------------------------------------------------------------
31 //ENDHEADER
32 
33 
34 // file: examples/Triangulation_2/Voronoi.C
35 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
36 #include <CGAL/Delaunay_triangulation_2.h>
37 #include <CGAL/Triangulation_hierarchy_2.h>
38 #include <CGAL/Triangulation_vertex_base_with_info_2.h>
39 #include "fastjet/internal/base.hh"
40 
41 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
42 
43 /// \if internal_doc
44 /// @ingroup internal
45 /// \struct K
46 /// the basic geometrical kernel that lies at the base of all CGAL
47 /// operations
48 /// \endif
49 #ifdef CGAL_SIMPLE_KERNEL
50 struct K : CGAL::Simple_cartesian<double> {};
51 #else
52 struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
53 #endif // CGAL_SIMPLE_KERNEL
54 
55 // our extras to help us navigate, find distance, etc.
56 const int INFINITE_VERTEX=-1;
57 const int NEW_VERTEX=-2;
58 const double HUGE_DOUBLE=1e300;
59 
60 /// \if internal_doc
61 /// @ingroup internal
62 /// \struct InitialisedInt
63 /// A class to provide an "int" with an initial value.
64 /// \endif
65 class InitialisedInt {
66  private:
67  int _val;
68  public:
69  inline InitialisedInt () {_val=NEW_VERTEX;};
70  inline InitialisedInt& operator= (int value) {_val = value; return *this;};
71  inline int val() const {return _val;};
72 };
73 
74 
75 // We can have triangulations with and without hierarchies -- those with
76 // are able to guarantee N ln N time for the construction of a large
77 // triangulation, whereas those without go as N^{3/2} for points
78 // sufficiently uniformly distributed in a plane.
79 //
80 //#define NOHIERARCHY
81 #ifdef NOHIERARCHY
82 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vb;
83 typedef CGAL::Triangulation_face_base_2<K> Fb;
84 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
85 typedef CGAL::Delaunay_triangulation_2<K,Tds> Triangulation;
86 #else
87 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vbb;
88 typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
89 typedef CGAL::Triangulation_face_base_2<K> Fb;
90 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
91 typedef CGAL::Delaunay_triangulation_2<K,Tds> Dt;
92 typedef CGAL::Triangulation_hierarchy_2<Dt> Triangulation;
93 #endif
94 
95 typedef Triangulation::Vertex_handle Vertex_handle;
96 typedef Triangulation::Point Point; /// CGAL Point structure
97 typedef Triangulation::Vertex_circulator Vertex_circulator;
98 typedef Triangulation::Face_circulator Face_circulator;
99 typedef Triangulation::Face_handle Face_handle;
100 
101 
102 
103 FASTJET_END_NAMESPACE
104 
105 #endif // __FASTJET_TRIANGULATION__
106 #endif // DROP_CGAL
Triangulation::Vertex_circulator Vertex_circulator
CGAL Point structure.