]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
9 | ||
a15e6d7d | 10 | #ifndef AliEveTPCSector2DGL_H |
11 | #define AliEveTPCSector2DGL_H | |
d810d0de | 12 | |
13 | #include <TGLObject.h> | |
d810d0de | 14 | class TGLViewer; |
15 | class TGLScene; | |
16 | ||
a15e6d7d | 17 | #include <EveDet/AliEveTPCSectorData.h> |
18 | class AliEveTPCSector2D; | |
19 | ||
20 | //------------------------------------------------------------------------------ | |
21 | // AliEveTPCSector2DGL | |
22 | // | |
23 | // GL renderer for AliEveTPCSector2D. | |
24 | // | |
d810d0de | 25 | |
26 | class AliEveTPCSector2DGL : public TGLObject | |
27 | { | |
4b456ebb | 28 | public: |
29 | AliEveTPCSector2DGL(); | |
30 | virtual ~AliEveTPCSector2DGL(); | |
31 | ||
32 | virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0); | |
33 | virtual void SetBBox(); | |
34 | virtual Bool_t SupportsSecondarySelect() const { return kTRUE; } | |
35 | ||
36 | virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec); | |
37 | ||
38 | static void TraceStepsUp (const AliEveTPCSectorData::SegmentInfo& s); | |
39 | static void TraceStepsDown(const AliEveTPCSectorData::SegmentInfo& s); | |
d810d0de | 40 | |
41 | protected: | |
42 | virtual void DirectDraw(TGLRnrCtx & rnrCtx) const; | |
43 | ||
a15e6d7d | 44 | void LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t row, Int_t colOff) const; |
d810d0de | 45 | void CreateTexture() const; |
46 | ||
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; | |
54 | ||
55 | UChar_t* GetRowCol(Int_t row, Int_t col) const; | |
56 | ||
a97abca8 | 57 | AliEveTPCSector2D *fSector; // Model object. |
58 | mutable AliEveTPCSectorData *fSectorData; // Data of displayed sector. | |
d810d0de | 59 | |
a97abca8 | 60 | mutable UChar_t *fImage; // Texture data. |
61 | mutable UInt_t fTexture; // Texture id. | |
62 | mutable UInt_t fRTS; // Render time-stamp. | |
51346b82 | 63 | |
a15e6d7d | 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. | |
67 | ||
4b456ebb | 68 | private: |
69 | AliEveTPCSector2DGL(const AliEveTPCSector2DGL&); // Not implemented | |
70 | AliEveTPCSector2DGL& operator=(const AliEveTPCSector2DGL&); // Not implemented | |
d810d0de | 71 | |
a15e6d7d | 72 | ClassDef(AliEveTPCSector2DGL, 0); // GL renderer for AliEveTPCSector2D. |
a97abca8 | 73 | }; |
51346b82 | 74 | |
d810d0de | 75 | |
76 | inline UChar_t* AliEveTPCSector2DGL::GetRowCol(Int_t row, Int_t col) const | |
77 | { | |
78 | return fImage + 4*(row*fgkTextureWidth + col); | |
79 | } | |
80 | ||
81 | ||
82 | #endif |