2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #ifndef AliEveTPCSector2DGL_H
11 #define AliEveTPCSector2DGL_H
13 #include <TGLObject.h>
17 #include <EveDet/AliEveTPCSectorData.h>
18 class AliEveTPCSector2D;
20 //------------------------------------------------------------------------------
21 // AliEveTPCSector2DGL
23 // GL renderer for AliEveTPCSector2D.
26 class AliEveTPCSector2DGL : public TGLObject
28 AliEveTPCSector2DGL(const AliEveTPCSector2DGL&); // Not implemented
29 AliEveTPCSector2DGL& operator=(const AliEveTPCSector2DGL&); // Not implemented
32 virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
34 void LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t row, Int_t colOff) const;
35 void CreateTexture() const;
37 void DisplayTexture(const AliEveTPCSectorData::SegmentInfo& seg,
38 Int_t startCol, Int_t startRow) const;
39 void DisplayQuads(const AliEveTPCSectorData::SegmentInfo& seg,
40 Int_t startCol, Int_t startRow) const;
41 void DisplayNamedQuads(const AliEveTPCSectorData::SegmentInfo& seg,
42 Int_t startCol, Int_t startRow) const;
43 void DisplayFrame() const;
45 UChar_t* GetRowCol(Int_t row, Int_t col) const;
47 AliEveTPCSector2D *fSector; // Model object.
48 mutable AliEveTPCSectorData *fSectorData; // Data of displayed sector.
50 mutable UChar_t *fImage; // Texture data.
51 mutable UInt_t fTexture; // Texture id.
52 mutable UInt_t fRTS; // Render time-stamp.
54 static const Int_t fgkTextureWidth; // Width of the texture.
55 static const Int_t fgkTextureHeight; // Height of the texture.
56 static const Int_t fgkTextureByteSize; // Size of the texture in bytes.
59 AliEveTPCSector2DGL();
60 virtual ~AliEveTPCSector2DGL();
62 virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
63 virtual void SetBBox();
64 virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
66 virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
68 static void TraceStepsUp (const AliEveTPCSectorData::SegmentInfo& s);
69 static void TraceStepsDown(const AliEveTPCSectorData::SegmentInfo& s);
71 ClassDef(AliEveTPCSector2DGL, 0); // GL renderer for AliEveTPCSector2D.
75 inline UChar_t* AliEveTPCSector2DGL::GetRowCol(Int_t row, Int_t col) const
77 return fImage + 4*(row*fgkTextureWidth + col);