ROOT  6.06/09
Reference Guide
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 "TMath.h"
13 #include "TGraph2D.h"
14 #include "TGraphDelaunay2D.h"
15 
16 //#include <thread>
17 
19 
20 
21 //______________________________________________________________________________
22 //
23 // TGraphDelaunay2D generates a Delaunay triangulation of a TGraph2D. This
24 // triangulation code derives from an implementation done by Luke Jones
25 // (Royal Holloway, University of London) in April 2002 in the PAW context.
26 //
27 // This software cannot be guaranteed to work under all circumstances. They
28 // were originally written to work with a few hundred points in an XY space
29 // with similar X and Y ranges.
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 //Begin_Html
41 /*
42 <img src="gif/dtvd.gif">
43 <br>
44 <a href="http://www.cs.cornell.edu/Info/People/chew/Delaunay.html">This applet</a>
45 gives a nice practical view of Delaunay triangulation and Voronoi diagram.
46 */
47 //End_Html
48 
49 
50 
51 
52 /// TGraphDelaunay2D normal constructor
54  TNamed("TGraphDelaunay2D","TGraphDelaunay2D"),
55  fGraph2D(g),
56  fDelaunay((g) ? g->GetN() : 0, (g) ? g->GetX() : nullptr, (g) ? g->GetY() : nullptr, (g) ? g->GetZ() : nullptr ,
57  (g) ? g->GetXmin() : 0, (g) ? g->GetXmax() : 0,
58  (g) ? g->GetYmin() : 0, (g) ? g->GetYmax() : 0 )
59 
60 {}
61 
ClassImp(TGraphDelaunay2D) TGraphDelaunay2D
TGraphDelaunay2D normal constructor.
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Graphics object made of three arrays X, Y and Z with the same number of points each.
Definition: TGraph2D.h:50