Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:39

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007, 2018
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 
0013 #ifndef ROOT7_REveGluTess
0014 #define ROOT7_REveGluTess
0015 
0016 #include "Rtypes.h"
0017 
0018 #include <vector>
0019 
0020 struct GLUtesselator;
0021 
0022 namespace ROOT {
0023 namespace Experimental {
0024 namespace EveGlu {
0025 
0026 //==============================================================================
0027 // TriangleCollector
0028 //==============================================================================
0029 
0030 class TestTriangleHandler;
0031 
0032 class TriangleCollector {
0033    friend class TestTriangleHandler;
0034 protected:
0035    GLUtesselator *fTess{nullptr};
0036    Int_t fNTriangles{0};
0037    Int_t fNVertices{0};
0038    Int_t fV0{-1}, fV1{-1};
0039    Int_t fType{0};
0040    std::vector<UInt_t> fPolyDesc;
0041 
0042    void add_triangle(UInt_t v0, UInt_t v1, UInt_t v2);
0043    void process_vertex(UInt_t vi);
0044 
0045 public:
0046    TriangleCollector();
0047    ~TriangleCollector();
0048 
0049    // Process polygons
0050    void ProcessData(const std::vector<Double_t> &verts, const std::vector<UInt_t> &polys, const Int_t n_polys);
0051 
0052    // Get output
0053    Int_t GetNTrianlges() { return fNTriangles; }
0054    std::vector<UInt_t> &RefPolyDesc() { return fPolyDesc; }
0055 };
0056 
0057 } // namespace EveGlu
0058 } // namespace Experimental
0059 } // namespace ROOT
0060 
0061 #endif