]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/Reve/TriangleSet.cxx
Dealing with two different loaders for simulation and reconstruction if necessary...
[u/mrichter/AliRoot.git] / EVE / Reve / TriangleSet.cxx
index 982c13b9189b879e58f13fbb2bb5c3ec9b3d098e..16aef602694b98b74f29a97842bb551e69292952 100644 (file)
@@ -1,7 +1,25 @@
-// $Header$
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
 
 #include "TriangleSet.h"
+#include "RGBAPalette.h"
 
+#include <TMath.h>
 #include <TVector3.h>
 #include <TRandom3.h>
 #include <TVirtualPad.h>
 
 using namespace Reve;
 
+//______________________________________________________________________
+// TriangleSet
+//
+// Made from a list of vertices and a list of triangles (triplets of
+// vertex indices).
+//
+// If input is composed from triangles with direct vertex coordinates
+// one should consider finding all occurences of the same vertex
+// and specifying it only once.
 
 ClassImp(TriangleSet)
 
 TriangleSet::TriangleSet(Int_t nv, Int_t nt, Bool_t norms, Bool_t cols) :
   RenderElement(fColor),
   TNamed("TriangleSet", 0),
-  fNVerts  (nv),
-  fNTrings (nt),
-  fColor   (2)
+  fNVerts  (nv), fVerts(0),
+  fNTrings (nt), fTrings(0), fTringNorms(0), fTringCols(0),
+  fColor   (2),
+  fHMTrans ()
 {
   fVerts  = new Float_t[3*fNVerts];
   fTrings = new Int_t  [3*fNTrings];
@@ -78,13 +106,13 @@ void TriangleSet::GenerateZNormalColors(Float_t fac, Int_t min, Int_t max,
   if (fTringCols  == 0)  fTringCols = new UChar_t[3*fNTrings];
   if (fTringNorms == 0)  GenerateTriangleNormals();
 
-  Reve::RGBAPalette pal(min, max, interp, wrap);
+  RGBAPalette pal(min, max, interp, wrap);
   UChar_t *C = fTringCols;
   Float_t *N = fTringNorms;
   for(Int_t t=0; t<fNTrings; ++t, C+=3, N+=3)
     {
       Int_t v = TMath::Nint(fac * N[2]);
-      pal.ColorFromArray(v, C, kFALSE);
+      pal.ColorFromValue(v, C, kFALSE);
     }
   gPad->Modified(); gPad->Update();
 }