ROOT
master
Reference Guide
Loading...
Searching...
No Matches
TGraphDelaunay2D.cxx
Go to the documentation of this file.
1
// @(#)root/hist:$Id: TGraphDelaunay2D.cxx,v 1.00
2
// Author: Olivier Couet, Luke Jones (Royal Holloway, University of London)
3
4
/*************************************************************************
5
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#include "
TGraph2D.h
"
13
#include "
TGraphDelaunay2D.h
"
14
15
16
17
/** \class TGraphDelaunay2D
18
\ingroup Graphs
19
TGraphDelaunay2D generates a Delaunay triangulation of a TGraph2D.
20
The algorithm used for finding the triangles is based on [CDT](https://github.com/artem-ogre/CDT),
21
a C++ library for generating constraint or conforming Delaunay triangulations.
22
23
The ROOT::Math::Delaunay2D class provides a wrapper for using
24
the **CDT** library.
25
26
This implementation provides large improvements in terms of computational performances
27
compared to the legacy one available in TGraphDelaunay, and it is by default
28
used in TGraph2D. The old, legacy implementation can be still used when calling
29
`TGraph2D::GetHistogram` and `TGraph2D::Draw` with the `old` option.
30
31
Definition of Delaunay triangulation (After B. Delaunay):
32
For a set S of points in the Euclidean plane, the unique triangulation DT(S)
33
of S such that no point in S is inside the circumcircle of any triangle in
34
DT(S). DT(S) is the dual of the Voronoi diagram of S. If n is the number of
35
points in S, the Voronoi diagram of S is the partitioning of the plane
36
containing S points into n convex polygons such that each polygon contains
37
exactly one point and every point in a given polygon is closer to its
38
central point than to any other. A Voronoi diagram is sometimes also known
39
as a Dirichlet tessellation.
40
41
\image html tgraph2d_delaunay.png
42
43
[This applet](http://www.cs.cornell.edu/Info/People/chew/Delaunay.html)
44
gives a nice practical view of Delaunay triangulation and Voronoi diagram.
45
*/
46
47
/// TGraphDelaunay2D normal constructor
48
TGraphDelaunay2D::TGraphDelaunay2D
(
TGraph2D
*
g
) :
49
TNamed
(
"TGraphDelaunay2D"
,
"TGraphDelaunay2D"
),
50
fGraph2D(
g
),
51
fDelaunay((
g
) ?
g
->GetN() : 0, (
g
) ?
g
->GetX() : nullptr, (
g
) ?
g
->GetY() : nullptr, (
g
) ?
g
->GetZ() : nullptr ,
52
(
g
) ?
g
->GetXmin() : 0, (
g
) ?
g
->GetXmax() : 0,
53
(
g
) ?
g
->GetYmin() : 0, (
g
) ?
g
->GetYmax() : 0 )
54
55
{}
56
g
#define g(i)
Definition
RSha256.hxx:105
TGraph2D.h
TGraphDelaunay2D.h
TGraph2D
Graphics object made of three arrays X, Y and Z with the same number of points each.
Definition
TGraph2D.h:41
TGraphDelaunay2D::TGraphDelaunay2D
TGraphDelaunay2D(const TGraphDelaunay2D &)=delete
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition
TNamed.h:29
hist
hist
src
TGraphDelaunay2D.cxx
ROOT master - Reference Guide Generated on Sat Oct 4 2025 15:05:02 (GVA Time) using Doxygen 1.10.0