]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added triangulation time-stamp: update model state when needed; use PointSet::Size...
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Jul 2006 17:45:31 +0000 (17:45 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Jul 2006 17:45:31 +0000 (17:45 +0000)
EVE/Alieve/TPCSector3DGL.cxx
EVE/Alieve/TPCSector3DGL.h

index 634158804ad9e45a1338be46bf71692aaa2586ed..a8c082579c3ff8f9fd530e05b5e41d24306489cd 100644 (file)
@@ -25,6 +25,7 @@ ClassImp(TPCSector3DGL)
 TPCSector3DGL::TPCSector3DGL() : fSector(0), fBoxRnr(0)
 {
   // fCached = false; // Disable display list.
+  fRTS = 0;
 }
 
 TPCSector3DGL::~TPCSector3DGL()
@@ -66,14 +67,21 @@ void TPCSector3DGL::DirectDraw(const TGLDrawFlags & flags) const
 {
   // printf("TPCSector3DGL::DirectDraw Style %d, LOD %d\n", flags.Style(), flags.LOD());
 
-  if(fSector->fTPCData != 0)
+  if(fRTS < fSector->fRTS) {
+    fSector->UpdateBoxes();
+    fRTS = fSector->fRTS;
+  }  
+
+  Bool_t hasData = (fSector->GetSectorData() != 0);
+
+  if(hasData)
     fBoxRnr->Render(flags);
 
   glPushAttrib(GL_CURRENT_BIT | GL_POINT_BIT | GL_ENABLE_BIT);
   glDisable(GL_LIGHTING);
   UChar_t col[4];
 
-  if(fSector->fTPCData != 0 && fSector->fPointSetOn) {
+  if(hasData && fSector->fPointSetOn) {
     glEnable(GL_BLEND);
     glEnable(GL_POINT_SMOOTH);
     glPointSize(fSector->fPointSize);
@@ -84,12 +92,12 @@ void TPCSector3DGL::DirectDraw(const TGLDrawFlags & flags) const
     const Reve::PointSetArray& psa = fSector->fPointSetArray;
     for(Int_t b=0; b<psa.GetNBins(); ++b) {
       Reve::PointSet* ps = psa.GetBin(b);
-      ColorFromIdx(ps->GetMarkerColor(), col);
-      glColor4ubv(col);
+      if(ps->Size() > 0) {
+       ColorFromIdx(ps->GetMarkerColor(), col);
+       glColor4ubv(col);
 
-      if(ps->GetN() > 0) {
        glVertexPointer(3, GL_FLOAT, 0, ps->GetP());
-       glDrawArrays(GL_POINTS, 0, ps->GetN());
+       glDrawArrays(GL_POINTS, 0, ps->Size());
       }
     }
 
index a383b1865f166c916f85be67f90f778cddbf91d8..b8aa5a0fed58a9c8a7cfd96f1bf8d0d576c88156 100644 (file)
@@ -21,6 +21,8 @@ protected:
   TPCSector3D*    fSector; // fModel dynamic-casted to TPCSector3DGL
   Reve::BoxSetGL* fBoxRnr;
 
+  mutable UInt_t  fRTS;
+
   virtual void DirectDraw(const TGLDrawFlags & flags) const;
 
 public: