ROOT   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 "TGraph2D.h"
13#include "TGraphDelaunay2D.h"
14
16
17
18/** \class TGraphDelaunay2D
19 \ingroup Graphs
20TGraphDelaunay2D generates a Delaunay triangulation of a TGraph2D.
21The algorithm used for finding the triangles is based on on
22**Triangle**, a two-dimensional quality mesh generator and
23Delaunay triangulator from Jonathan Richard Shewchuk.
24See [http://www.cs.cmu.edu/~quake/triangle.html]
25The ROOT::Math::Delaunay2D class provides a wrapper for using
26the **Triangle** library.
27
28This implementation provides large improvements in terms of computational performances
29compared to the legacy one available in TGraphDelaunay, and it is by default
30used in TGraph2D. The old, legacy implementation can be still used when calling
31TGraph2D::GetHistogram and TGraph2D::Draw with the old option.
32
33Definition of Delaunay triangulation (After B. Delaunay):
34For a set S of points in the Euclidean plane, the unique triangulation DT(S)
35of S such that no point in S is inside the circumcircle of any triangle in
36DT(S). DT(S) is the dual of the Voronoi diagram of S. If n is the number of
37points in S, the Voronoi diagram of S is the partitioning of the plane
38containing S points into n convex polygons such that each polygon contains
39exactly one point and every point in a given polygon is closer to its
40central point than to any other. A Voronoi diagram is sometimes also known
41as a Dirichlet tessellation.
42
43\image html tgraph2d_delaunay.png
44
45[This applet](http://www.cs.cornell.edu/Info/People/chew/Delaunay.html)
46gives a nice practical view of Delaunay triangulation and Voronoi diagram.
47*/
48
49/// TGraphDelaunay2D normal constructor
51 TNamed("TGraphDelaunay2D","TGraphDelaunay2D"),
52 fGraph2D(g),
53 fDelaunay((g) ? g->GetN() : 0, (g) ? g->GetX() : nullptr, (g) ? g->GetY() : nullptr, (g) ? g->GetZ() : nullptr ,
54 (g) ? g->GetXmin() : 0, (g) ? g->GetXmax() : 0,
55 (g) ? g->GetYmin() : 0, (g) ? g->GetYmax() : 0 )
56
57{}
58
#define ClassImp(name)
Definition: Rtypes.h:375
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
Graphics object made of three arrays X, Y and Z with the same number of points each.
Definition: TGraph2D.h:41
TGraphDelaunay2D generates a Delaunay triangulation of a TGraph2D.
TGraphDelaunay2D(const TGraphDelaunay2D &)=delete
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29