Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEveGeoPolyShape.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/eve:$Id$
0002 // Author: Matevz Tadel 2007
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2007, 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 #ifndef ROOT_TEveGeoPolyShape
0013 #define ROOT_TEveGeoPolyShape
0014 
0015 #include "TGeoBBox.h"
0016 
0017 #include <vector>
0018 
0019 class TBuffer3D;
0020 class TGLFaceSet;
0021 class TGeoCompositeShape;
0022 
0023 class TEveGeoPolyShape : public TGeoBBox
0024 {
0025    friend class TEveGeoPolyShapeGL;
0026 
0027 private:
0028    TEveGeoPolyShape(const TEveGeoPolyShape&);            // Not implemented
0029    TEveGeoPolyShape& operator=(const TEveGeoPolyShape&); // Not implemented
0030 
0031 protected:
0032    std::vector<Double_t> fVertices;
0033    std::vector<Int_t>    fPolyDesc;
0034    UInt_t                fNbPols;
0035 
0036    void FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const override;
0037 
0038    struct Edge_t
0039    {
0040       Int_t fI, fJ;
0041       Edge_t(Int_t i, Int_t j)
0042       {
0043          if (i <= j) { fI = i; fJ = j; }
0044          else        { fI = j; fJ = i; }
0045       }
0046 
0047       bool operator<(const Edge_t& e) const
0048       {
0049          if (fI == e.fI)
0050             return fJ < e.fJ;
0051          else
0052             return fI < e.fI;
0053       }
0054    };
0055 
0056 public:
0057    TEveGeoPolyShape();
0058    ~TEveGeoPolyShape() override {}
0059 
0060    static TEveGeoPolyShape* Construct(TGeoCompositeShape *cshp, Int_t n_seg);
0061 
0062    void SetFromFaceSet(TGLFaceSet* fs);
0063 
0064    const TBuffer3D& GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override;
0065          TBuffer3D* MakeBuffer3D() const override;
0066 
0067    ClassDefOverride(TEveGeoPolyShape, 1); // A shape with arbitrary tesselation for visualization of CSG shapes.
0068 };
0069 
0070 #endif