void graph2D_mod2() { TCanvas *c = new TCanvas("c","Graph2D example",0,0,700,600); Double_t x, y, z, P = 15.; Int_t np = 100; TGraph2D *graph = new TGraph2D(); TRandom *r = new TRandom(); //Int_t const m[10], n[10],p[10]; //Int_t *m; for (Int_t N=0; NRndm(N))-P; y = 2*P*(r->Rndm(N))-P; // z=0; // setting z=0 causes problem with 3d graphics. z=1.0; // this is ok, but is not ideal suitable for 2D image segmentation graph->SetPoint(N,x,y,z); } // gStyle->SetPalette(1); graph->Draw("TRIW"); c->Update(); TGraphDelaunay *triangle=new TGraphDelaunay(graph); triangle->FindAllTriangles(); // try to get all the triangles Int_t nfound= triangle->GetNdt(); Int_t* m= triangle->GetMTried(); Int_t* n=triangle->GetNTried(); Int_t* p=triangle->GetPTried(); printf("Number of triangles found=%d\n",nfound); for (Int_t k=0; k