]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveTPCSector2DGL.h
From Massimo: remove usage of AliITSgeom, use AliITSgeomTGeo instead.
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveTPCSector2DGL.h
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #ifndef ALIEVE_TPCSector2DGL_H
11 #define ALIEVE_TPCSector2DGL_H
12
13 #include <TGLObject.h>
14
15 #include <EveDet/AliEveTPCSector2D.h>
16 #include <EveDet/AliEveTPCSectorData.h>
17
18 class TGLViewer;
19 class TGLScene;
20
21
22 class AliEveTPCSector2DGL : public TGLObject
23 {
24   AliEveTPCSector2DGL(const AliEveTPCSector2DGL&);            // Not implemented
25   AliEveTPCSector2DGL& operator=(const AliEveTPCSector2DGL&); // Not implemented
26
27 protected:
28   virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
29
30   void LoadPadrow(AliEveTPCSectorData::RowIterator& iter, Int_t row, Int_t off) const;
31   void CreateTexture() const;
32
33   void DisplayTexture(const AliEveTPCSectorData::SegmentInfo& seg,
34                       Int_t startCol, Int_t startRow) const;
35   void DisplayQuads(const AliEveTPCSectorData::SegmentInfo& seg,
36                     Int_t startCol, Int_t startRow) const;
37   void DisplayNamedQuads(const AliEveTPCSectorData::SegmentInfo& seg,
38                          Int_t startCol, Int_t startRow) const;
39   void DisplayFrame() const;
40
41   UChar_t* GetRowCol(Int_t row, Int_t col) const;
42
43   AliEveTPCSector2D              *fSector;     // Model object.
44   mutable AliEveTPCSectorData    *fSectorData; // Data of displayed sector.
45
46   mutable UChar_t                *fImage;      // Texture data.
47   mutable UInt_t                  fTexture;    // Texture id.
48   mutable UInt_t                  fRTS;        // Render time-stamp.
49
50 public:
51   AliEveTPCSector2DGL();
52   virtual ~AliEveTPCSector2DGL();
53
54   virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
55   virtual void   SetBBox();
56   virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
57
58   virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
59
60   static void TraceStepsUp  (const AliEveTPCSectorData::SegmentInfo& s);
61   static void TraceStepsDown(const AliEveTPCSectorData::SegmentInfo& s);
62
63   static const Int_t fgkTextureWidth;     // Width of the texture.
64   static const Int_t fgkTextureHeight;    // Height of the texture.
65   static const Int_t fgkTextureByteSize;  // Size of the texture in bytes.
66
67   ClassDef(AliEveTPCSector2DGL, 0); // GL renderer for TPCSector2D.
68 };
69
70
71 inline UChar_t* AliEveTPCSector2DGL::GetRowCol(Int_t row, Int_t col) const
72 {
73   return fImage + 4*(row*fgkTextureWidth + col);
74 }
75
76
77 #endif