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
29 AliEveTPCSector2DGL();
30 virtual ~AliEveTPCSector2DGL();
32 virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
33 virtual void SetBBox();
34 virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
36 virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
38 static void TraceStepsUp (const AliEveTPCSectorData::SegmentInfo& s);
39 static void TraceStepsDown(const AliEveTPCSectorData::SegmentInfo& s);
42 virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
44 void LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t row, Int_t colOff) const;
45 void CreateTexture() const;
47 void DisplayTexture(const AliEveTPCSectorData::SegmentInfo& seg,
48 Int_t startCol, Int_t startRow) const;
49 void DisplayQuads(const AliEveTPCSectorData::SegmentInfo& seg,
50 Int_t startCol, Int_t startRow) const;
51 void DisplayNamedQuads(const AliEveTPCSectorData::SegmentInfo& seg,
52 Int_t startCol, Int_t startRow) const;
53 void DisplayFrame() const;
55 UChar_t* GetRowCol(Int_t row, Int_t col) const;
57 AliEveTPCSector2D *fSector; // Model object.
58 mutable AliEveTPCSectorData *fSectorData; // Data of displayed sector.
60 mutable UChar_t *fImage; // Texture data.
61 mutable UInt_t fTexture; // Texture id.
62 mutable UInt_t fRTS; // Render time-stamp.
64 static const Int_t fgkTextureWidth; // Width of the texture.
65 static const Int_t fgkTextureHeight; // Height of the texture.
66 static const Int_t fgkTextureByteSize; // Size of the texture in bytes.
69 AliEveTPCSector2DGL(const AliEveTPCSector2DGL&); // Not implemented
70 AliEveTPCSector2DGL& operator=(const AliEveTPCSector2DGL&); // Not implemented
72 ClassDef(AliEveTPCSector2DGL, 0); // GL renderer for AliEveTPCSector2D.
76 inline UChar_t* AliEveTPCSector2DGL::GetRowCol(Int_t row, Int_t col) const
78 return fImage + 4*(row*fgkTextureWidth + col);