]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/AliEveTPCSector2DGL.h
Put all classes in Alieve/ sub-module out of the Alieve namespace and
[u/mrichter/AliRoot.git] / EVE / Alieve / 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 <Alieve/AliEveTPCSector2D.h>
16 #include <Alieve/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;
44   mutable AliEveTPCSectorData*       fSectorData;
45
46   mutable UChar_t*             fImage;
47   mutable UInt_t               fTexture;
48   mutable UInt_t               fRTS;
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;
64   static const Int_t fgkTextureHeight;
65   static const Int_t fgkTextureByteSize;
66
67 }; // endclass TPCSector2D_GL_Rnr
68   
69
70 inline UChar_t* AliEveTPCSector2DGL::GetRowCol(Int_t row, Int_t col) const
71 {
72   return fImage + 4*(row*fgkTextureWidth + col);
73 }
74
75
76 #endif