FastJet  3.1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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 //FJSTARTHEADER
6 // $Id: Triangulation.hh 3433 2014-07-23 08:17:03Z salam $
7 //
8 // Copyright (c) 2005-2014, 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. They are described in the original FastJet paper,
20 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
21 // FastJet as part of work towards a scientific publication, please
22 // quote the version you use and include a citation to the manual and
23 // optionally also to hep-ph/0512210.
24 //
25 // FastJet is distributed in the hope that it will be useful,
26 // but WITHOUT ANY WARRANTY; without even the implied warranty of
27 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 // GNU General Public License for more details.
29 //
30 // You should have received a copy of the GNU General Public License
31 // along with FastJet. If not, see <http://www.gnu.org/licenses/>.
32 //----------------------------------------------------------------------
33 //FJENDHEADER
34 
35 
36 // file: examples/Triangulation_2/Voronoi.C
37 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
38 #include <CGAL/Delaunay_triangulation_2.h>
39 #include <CGAL/Triangulation_hierarchy_2.h>
40 #include <CGAL/Triangulation_vertex_base_with_info_2.h>
41 #include "fastjet/internal/base.hh"
42 
43 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
44 
45 /// \if internal_doc
46 /// @ingroup internal
47 /// \struct K
48 /// the basic geometrical kernel that lies at the base of all CGAL
49 /// operations
50 /// \endif
51 #ifdef CGAL_SIMPLE_KERNEL
52 struct K : CGAL::Simple_cartesian<double> {};
53 #else
54 struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
55 #endif // CGAL_SIMPLE_KERNEL
56 
57 // our extras to help us navigate, find distance, etc.
58 const int INFINITE_VERTEX=-1;
59 const int NEW_VERTEX=-2;
60 const double HUGE_DOUBLE=1e300;
61 
62 /// \if internal_doc
63 /// @ingroup internal
64 /// \struct InitialisedInt
65 /// A class to provide an "int" with an initial value.
66 /// \endif
67 class InitialisedInt {
68  private:
69  int _val;
70  public:
71  inline InitialisedInt () {_val=NEW_VERTEX;};
72  inline InitialisedInt& operator= (int value) {_val = value; return *this;};
73  inline int val() const {return _val;};
74 };
75 
76 
77 // We can have triangulations with and without hierarchies -- those with
78 // are able to guarantee N ln N time for the construction of a large
79 // triangulation, whereas those without go as N^{3/2} for points
80 // sufficiently uniformly distributed in a plane.
81 //
82 //#define NOHIERARCHY
83 #ifdef NOHIERARCHY
84 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vb;
85 typedef CGAL::Triangulation_face_base_2<K> Fb;
86 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
87 typedef CGAL::Delaunay_triangulation_2<K,Tds> Triangulation;
88 #else
89 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vbb;
90 typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
91 typedef CGAL::Triangulation_face_base_2<K> Fb;
92 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
93 typedef CGAL::Delaunay_triangulation_2<K,Tds> Dt;
94 typedef CGAL::Triangulation_hierarchy_2<Dt> Triangulation;
95 #endif
96 
97 typedef Triangulation::Vertex_handle Vertex_handle;
98 typedef Triangulation::Point Point; /// CGAL Point structure
99 typedef Triangulation::Vertex_circulator Vertex_circulator;
100 typedef Triangulation::Face_circulator Face_circulator;
101 typedef Triangulation::Face_handle Face_handle;
102 
103 
104 
105 FASTJET_END_NAMESPACE
106 
107 #endif // __FASTJET_TRIANGULATION__
108 #endif // DROP_CGAL
Triangulation::Vertex_circulator Vertex_circulator
CGAL Point structure.