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