Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
REveGluTess.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, 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 
13 #ifndef ROOT7_REveGluTess
14 #define ROOT7_REveGluTess
15 
16 #include "Rtypes.h"
17 
18 #include <vector>
19 
20 struct GLUtesselator;
21 
22 namespace ROOT {
23 namespace Experimental {
24 namespace EveGlu {
25 
26 //==============================================================================
27 // TriangleCollector
28 //==============================================================================
29 
30 class TestTriangleHandler;
31 
32 class TriangleCollector {
33  friend class TestTriangleHandler;
34 protected:
35  GLUtesselator *fTess{nullptr};
36  Int_t fNTriangles{0};
37  Int_t fNVertices{0};
38  Int_t fV0{-1}, fV1{-1};
39  Int_t fType{0};
40  std::vector<Int_t> fPolyDesc;
41 
42  void add_triangle(Int_t v0, Int_t v1, Int_t v2);
43  void process_vertex(Int_t vi);
44 
45 public:
46  TriangleCollector();
47  ~TriangleCollector();
48 
49  // Process polygons
50  void ProcessData(const std::vector<Double_t> &verts, const std::vector<Int_t> &polys, const Int_t n_polys);
51 
52  // Get output
53  Int_t GetNTrianlges() { return fNTriangles; }
54  std::vector<Int_t> &RefPolyDesc() { return fPolyDesc; }
55 };
56 
57 } // namespace EveGlu
58 } // namespace Experimental
59 } // namespace ROOT
60 
61 #endif