Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:40

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_TEveCalo3DGL
0013 #define ROOT_TEveCalo3DGL
0014 
0015 #include "TGLObject.h"
0016 #include "TEveCaloData.h"
0017 #include <vector>
0018 
0019 class TEveCalo3D;
0020 
0021 class TEveCalo3DGL : public TGLObject
0022 {
0023 private:
0024    TEveCalo3DGL(const TEveCalo3DGL&) = delete;
0025    TEveCalo3DGL& operator=(const TEveCalo3DGL&) = delete;
0026 
0027    void    CrossProduct(const Float_t a[3], const Float_t b[3], const Float_t c[3], Float_t out[3]) const;
0028 
0029    void    RenderBox(const Float_t pnts[8]) const;
0030    void    RenderGridEndCap() const;
0031    void    RenderGridBarrel() const;
0032    void    RenderGrid(TGLRnrCtx & rnrCtx) const;
0033    void    RenderBarrelCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t& offset) const;
0034    void    RenderEndCapCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t& offset) const;
0035 
0036    void    DrawSelectedCells(TEveCaloData::vCellId_t cells) const;
0037 
0038 protected:
0039    TEveCalo3D     *fM;  // Model object.
0040 
0041    mutable std::vector<Float_t>     fOffset;
0042 
0043 public:
0044    TEveCalo3DGL();
0045    ~TEveCalo3DGL() override {}
0046 
0047    Bool_t SetModel(TObject* obj, const Option_t *opt = nullptr) override;
0048    void   SetBBox() override;
0049 
0050    void   DirectDraw(TGLRnrCtx & rnrCtx) const override;
0051    void   DrawHighlight(TGLRnrCtx & rnrCtx, const TGLPhysicalShape* ps, Int_t lvl=-1) const override;
0052 
0053    Bool_t ShouldDLCache(const TGLRnrCtx& rnrCtx) const override;
0054    Bool_t SupportsSecondarySelect() const override { return kTRUE; }
0055    Bool_t AlwaysSecondarySelect()   const override { return kTRUE; }
0056    void   ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec) override;
0057 
0058    ClassDefOverride(TEveCalo3DGL, 0); // GL renderer class for TEveCalo.
0059 };
0060 
0061 #endif