]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add some class docs.
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Nov 2007 20:20:31 +0000 (20:20 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Nov 2007 20:20:31 +0000 (20:20 +0000)
34 files changed:
EVE/Reve/BoxSet.cxx
EVE/Reve/GridStepper.cxx
EVE/Reve/GridStepper.h
EVE/Reve/GridStepperEditor.h
EVE/Reve/LineEditor.h
EVE/Reve/LinkDef.h
EVE/Reve/NLTProjector.cxx
EVE/Reve/NLTProjector.h
EVE/Reve/PODs.h
EVE/Reve/Pad.cxx
EVE/Reve/Pad.h
EVE/Reve/Plex.h
EVE/Reve/PointSet.cxx
EVE/Reve/PointSet.h
EVE/Reve/PointSetArrayEditor.cxx
EVE/Reve/PointSetArrayEditor.h
EVE/Reve/RGBAPalette.h
EVE/Reve/RGBAPaletteEditor.h
EVE/Reve/RenderElement.cxx
EVE/Reve/RenderElement.h
EVE/Reve/ReveManager.cxx
EVE/Reve/ReveManager.h
EVE/Reve/Scene.h
EVE/Reve/SceneInfo.h
EVE/Reve/StraightLineSet.h
EVE/Reve/Track.cxx
EVE/Reve/Track.h
EVE/Reve/TriangleSet.cxx
EVE/Reve/TriangleSet.h
EVE/Reve/TriangleSetEditor.h
EVE/Reve/TriangleSetGL.cxx
EVE/Reve/TriangleSetGL.h
EVE/Reve/Viewer.h
EVE/Reve/ZTransEditor.h

index 89e2f93e22b855e355ccda3ce444b5c7e8c8e7c3..0d67a17d4ca872265c7b28df2becf1583e66ff4d 100644 (file)
@@ -44,7 +44,7 @@ BoxSet::BoxSet(const Text_t* n, const Text_t* t) :
   fDisableLigting = kFALSE;
 }
 
-/**************************************************************************/
+/******************************************************************************/
 
 //______________________________________________________________________________
 Int_t BoxSet::SizeofAtom(BoxSet::BoxType_e bt)
index 12ce84873fb9ba3b9fed869557670e9f303f9c6a..4efb821c3fe9e6238bdc4a9026b6a8514929db14 100644 (file)
@@ -8,6 +8,8 @@ using namespace Reve;
 //______________________________________________________________________
 // GridStepper
 //
+// Provide position coordinates for regular-grid placement of objects.
+//
 
 ClassImp(GridStepper)
 
@@ -51,19 +53,19 @@ void GridStepper::Subtract(GridStepper& s)
 }
 /**************************************************************************/
 
-bool GridStepper::Step()
+Bool_t GridStepper::Step()
 {
   (*ns[0])++;
-  if(*ns[0] >= *ls[0]) {
+  if (*ns[0] >= *ls[0]) {
     *ns[0] = 0; (*ns[1])++;
-    if(*ns[1] >= *ls[1]) {
+    if (*ns[1] >= *ls[1]) {
       *ns[1] = 0; (*ns[2])++;
-      if(*ns[2] >= *ls[2]) {
-       return false;
+      if (*ns[2] >= *ls[2]) {
+       return kFALSE;
       }
     }
   }
-  return true;
+  return kTRUE;
 }
 
 /**************************************************************************/
index b52d56b26f01b63251fa8cd5a312785185b53481..a3a5e335fa294dbabca1995f934604ee03be784b 100644 (file)
@@ -13,19 +13,20 @@ class ZTrans;
 
 class GridStepper : public TObject
 {
-  Int_t *ls[3], *ns[3];
 private:
+  Int_t *ls[3], *ns[3]; //! Internal traversal variables.
+
   GridStepper(const GridStepper&);            // Not implemented
   GridStepper& operator=(const GridStepper&); // Not implemented
 
 public: 
   enum StepMode_e { SM_XYZ, SM_YXZ, SM_XZY };
-  StepMode_e Mode; 
+  StepMode_e Mode;      // Stepping mode, order of filling.
 
-  Int_t   nx, ny, nz;
-  Int_t   Nx, Ny, Nz;
-  Float_t Dx, Dy, Dz;
-  Float_t Ox, Oy, Oz;
+  Int_t   nx, ny, nz;   // Current positions during filling / traversal.
+  Int_t   Nx, Ny, Nz;   // Number of slots in eaxh direction.
+  Float_t Dx, Dy, Dz;   // Step size in each direction.
+  Float_t Ox, Oy, Oz;   // Initial offset for each direction.
 
   GridStepper(Int_t sm=SM_XYZ);
   virtual ~GridStepper() {}
@@ -39,7 +40,7 @@ public:
   void SetOs(Float_t ox, Float_t oy, Float_t oz=0)
   { Ox = ox; Oy = oy; Oz = oz; }
   
-  bool Step();
+  Bool_t Step();
 
   void GetPosition(Float_t* p);
 
index e42a3fe734373d6da4324e7545d826dc791d6bff..38f166bffd50b901be84ed773c637144c8f3dbcc 100644 (file)
@@ -22,14 +22,14 @@ private:
   GridStepperSubEditor& operator=(const GridStepperSubEditor&); // Not implemented
 
 protected:
-  GridStepper   *fM;
+  GridStepper   *fM;    // Model object.
 
-  RGValuator    *fNx;
-  RGValuator    *fNy;
-  RGValuator    *fNz;    
-  RGValuator    *fDx; 
-  RGValuator    *fDy; 
-  RGValuator    *fDz;
+  RGValuator    *fNx;   // Number of slots along x.
+  RGValuator    *fNy;   // Number of slots along y.
+  RGValuator    *fNz;   // Number of slots along z.
+  RGValuator    *fDx;   // Step in the x direction.
+  RGValuator    *fDy;   // Step in the y direction.
+  RGValuator    *fDz;   // Step in the z direction.
 
 public:
   GridStepperSubEditor(const TGWindow* p);
@@ -42,7 +42,7 @@ public:
   void DoNs();
   void DoDs();
 
-  ClassDef(GridStepperSubEditor, 0) // Sub-editor for GridStepper
+  ClassDef(GridStepperSubEditor, 0) // Sub-editor for GridStepper class.
 };
 
 
@@ -53,8 +53,8 @@ private:
   GridStepperEditor& operator=(const GridStepperEditor&); // Not implemented
 
 protected:
-  GridStepper            *fM;  // fModel dynamic-casted to GridStepper
-  GridStepperSubEditor   *fSE;
+  GridStepper            *fM;   // Model object.
+  GridStepperSubEditor   *fSE;  // Sub-editor containg GUI controls.
 
 public:
   GridStepperEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
@@ -62,7 +62,7 @@ public:
 
   virtual void SetModel(TObject* obj);
 
-  ClassDef(GridStepperEditor, 0) // Editor for GridStepper
+  ClassDef(GridStepperEditor, 0) // Editor for GridStepper class.
 };
 
 }
index b1f461e4a900f25ac1cecad30356ac64c55b2bd3..48d9849061edecbe46f7efbf545f32f0d72dedc4 100644 (file)
@@ -20,10 +20,10 @@ private:
   LineEditor& operator=(const LineEditor&); // Not implemented
 
 protected:
-  Line* fM; // fModel dynamic-casted to LineEditor
+  Line              *fM;          // Model object.
 
-  TGCheckButton     *fRnrLine;
-  TGCheckButton     *fRnrPoints;
+  TGCheckButton     *fRnrLine;    // Checkbox for line-rendering.
+  TGCheckButton     *fRnrPoints;  // Checkbox for point-rendering.
 
 public:
   LineEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
@@ -34,7 +34,7 @@ public:
   void DoRnrLine();
   void DoRnrPoints();
 
-  ClassDef(LineEditor, 1); // Editor for Line
+  ClassDef(LineEditor, 1); // Editor for Line class.
 }; // endclass LineEditor
 
 }
index 6c0894e03c2643673328db14fdf251f01ed315ad..1840895da171075733605d7a014719c3abd3eea9 100644 (file)
@@ -39,7 +39,6 @@
 #pragma link C++ class Reve::Vector+;
 #pragma link C++ class Reve::PathMark+;
 #pragma link C++ class Reve::MCTrack+;
-#pragma link C++ class Reve::MCTrackRef+;
 #pragma link C++ class Reve::Hit+;
 #pragma link C++ class Reve::Cluster+;
 #pragma link C++ class Reve::RecTrack+;
index 05d1b8f916e83d5811b0bd1b7795c50fc5029111..4a619b85a2249077d339b771a92ef4a007b659f1 100644 (file)
@@ -13,6 +13,7 @@ using namespace Reve;
 
 Float_t NLTProjection::fgEps = 0.005f;
 
+
 //______________________________________________________________________________
 // NLTProjection
 //
@@ -20,7 +21,6 @@ Float_t NLTProjection::fgEps = 0.005f;
 // Enables to define an external center of distortion and a scale to
 // fixate a bounding box of a projected point.
 
-
 ClassImp(Reve::NLTProjection)
 
 //______________________________________________________________________________
@@ -156,14 +156,13 @@ Float_t NLTProjection::GetScreenVal(Int_t i, Float_t x)
   return dv[i];
 }
 
+
 //______________________________________________________________________________
-//
 // NLTRhoZ
 //
 // Transformation from 3D to 2D. X axis represent Z coordinate. Y axis have value of
 // radius with a sign of Y coordinate.
 
-
 ClassImp(Reve::NLTRhoZ)
 
 //______________________________________________________________________________
@@ -246,22 +245,23 @@ Bool_t NLTRhoZ::AcceptSegment(Vector& v1, Vector& v2, Float_t tolerance)
   return val;
 }
 
+
 //______________________________________________________________________________
-//
 // NLTCircularFishEye
 //
 // XY projection with distortion around given center.
 
-ClassImp(Reve:: NLTCircularFishEye)
+ClassImp(Reve::NLTCircularFishEye)
 
 //______________________________________________________________________________
-void  NLTCircularFishEye::ProjectPoint(Float_t& x, Float_t& y, Float_t& z, PProc_e proc)
+void NLTCircularFishEye::ProjectPoint(Float_t& x, Float_t& y, Float_t& z,
+                                     PProc_e proc)
 {
   // Project point.
 
   using namespace TMath;
 
-  if(proc !=  PP_Plane)
+  if (proc != PP_Plane)
   {
     x -= fCenter.x;
     y -= fCenter.y;
@@ -275,15 +275,16 @@ void  NLTCircularFishEye::ProjectPoint(Float_t& x, Float_t& y, Float_t& z, PProc
   z = 0.0f;
 }
 
+
+ClassImp(NLTProjector)
+
 //______________________________________________________________________________
-//
 // NLTProjector
 //
 // Recursively projects RenderElement and draws axis in the projected scene.
 // It enables to interactivly set NLTProjection parameters and updates
 // projected scene accordingly.
 
-ClassImp(NLTProjector)
 
 NLTProjector::NLTProjector():
   RenderElementList("NLTProjector",""),
@@ -507,4 +508,3 @@ void NLTProjector::ComputeBBox()
 
   BBoxInit();
 }
-
index 7fe410893498e56d01a16dee41b3062bd1585e5b..8cc9312ca252b63a16ab14ab40d5f7d45bd3f55c 100644 (file)
@@ -98,9 +98,11 @@ public:
   ClassDef(NLTCircularFishEye, 0); // XY non-linear projection.
 };
 
+
 /**************************************************************************/
 //  NLTProjector
 /**************************************************************************/
+
 class NLTProjector : public RenderElementList,
                     public TAttBBox,
                      public TAtt3D
@@ -159,7 +161,7 @@ public:
   virtual void    ComputeBBox();
   virtual void    Paint(Option_t* option = "");
 
-  ClassDef(NLTProjector, 0); // Project NLTProjectable object.
+  ClassDef(NLTProjector, 0); // Manages and steers NLT projections.
 };
 
 }
index d4a7997deb9dab8f0e0e82704bf6f5a7656bca5a..b5479799cf8e681abf20b06bbcc7ec1d8a463752 100644 (file)
@@ -79,7 +79,7 @@ public:
   Vector& Mult(const Vector&a, Float_t af) { x = a.x*af; y = a.y*af; z = a.z*af; return *this; }
 
 
-  ClassDef(Vector, 1);
+  ClassDef(Vector, 1); // VSD float three-vector.
 };
 
 inline Float_t Vector::Phi() const
@@ -130,7 +130,7 @@ class PathMark
 
   const char* type_name();
 
-  ClassDef(PathMark, 1);
+  ClassDef(PathMark, 1); // VSD special-point on track.
 };
 
 /**************************************************************************/
@@ -159,30 +159,7 @@ public:
 
   void ResetPdgCode() { fPdgCode = 0; }
 
-  ClassDef(MCTrack, 1);
-};
-
-
-/**************************************************************************/
-// MCTrackRef
-/**************************************************************************/
-
-// Not used.
-
-class MCTrackRef : public TObject
-{
-public:
-  Int_t   label;
-  Int_t   status;
-  Vector  V;
-  Vector  P;
-  Float_t length;
-  Float_t time;
-
-  MCTrackRef() : label(-1), status(-1), V(), P(), length(0), time(0) {}
-  virtual ~MCTrackRef() {}
-
-  ClassDef(MCTrackRef, 1)
+  ClassDef(MCTrack, 1); // VSD Monte Carlo track.
 };
 
 
@@ -203,15 +180,15 @@ public:
   UShort_t det_id;    // Custom detector id
   UShort_t subdet_id; // Custom sub-detector id
   Int_t    label;     // Label of particle that produced the hit
-  Int_t    eva_label;
-  Vector   V;         // Vertex
+  Int_t    eva_label; // Label of primary particle, ancestor of label
+  Vector   V;         // Hit position
 
-  // ?? Float_t charge. Probably specific.
+  // Float_t charge; Probably specific.
 
   Hit() : det_id(0), subdet_id(0), label(0), eva_label(0), V() {}
   virtual ~Hit() {}
 
-  ClassDef(Hit, 1);
+  ClassDef(Hit, 1); // VSD Monte Carlo hit.
 };
 
 
@@ -238,7 +215,7 @@ public:
   Cluster() : det_id(0), subdet_id(0), V() { label[0] = label[1] = label [2] = 0; }
   virtual ~Cluster() {}
 
-  ClassDef(Cluster, 1);
+  ClassDef(Cluster, 1); // VSD reconstructed cluster.
 };
 
 
@@ -252,7 +229,7 @@ public:
   Int_t   label;       // Label of the track
   Int_t   index;       // Index of the track (in some source array)
   Int_t   status;      // Status as exported from reconstruction
-  Int_t   sign;
+  Int_t   sign;        // Charge of the track
   Vector  V;           // Start vertex from reconstruction
   Vector  P;           // Reconstructed momentum at start vertex
   Float_t beta;
@@ -264,7 +241,7 @@ public:
 
   Float_t Pt() { return P.Perp(); }
 
-  ClassDef(RecTrack, 1);
+  ClassDef(RecTrack, 1); // VSD reconstructed track.
 };
 
 // Another class with specified points/clusters
@@ -285,7 +262,7 @@ public:
   RecKink() : RecTrack(), label_sec(0), V_end(), V_kink(), P_sec() {}
   virtual ~RecKink() {}
 
-  ClassDef(RecKink, 1);
+  ClassDef(RecKink, 1); // VSD reconstructed track.
 };
 
 
@@ -316,7 +293,7 @@ public:
   { d_label[0] = d_label[1] = 0; }
   virtual ~RecV0() {}
 
-  ClassDef(RecV0, 1);
+  ClassDef(RecV0, 1); // VSD reconstructed V0.
 };
 
 /**************************************************************************/
@@ -340,13 +317,13 @@ public:
               label(0), n_hits(0), n_clus(0) {}
   virtual ~GenInfo() {}
 
-  ClassDef(GenInfo, 1);
+  ClassDef(GenInfo, 1); // VSD cross-reference of sim/rec data per particle.
 };
 
 /**************************************************************************/
 /**************************************************************************/
 
-// This whole construction is highly embarrassing. It requires
+// This whole construction is somewhat doubtable. It requires
 // shameless copying of experiment data. What is good about this
 // scheme:
 //
index d06ed5c2527f7d652c113f9b728da926a62cc325..86241b5df0e7592e6c25a0d429f388d73f5137a6 100644 (file)
@@ -10,7 +10,6 @@
 // This was intended as a TPad wrapper to allow smart updates of
 // groups of pads. Uses THashList instead of TList for faster removal
 // of objects from the pad.
-// Currently not used ...
 
 using namespace Reve;
 
index ee143e5bb0684dc61566e0b31b3ddaa457875dc6..0ce36a38fd6ba97bad98544c83e65911384c0094 100644 (file)
@@ -23,7 +23,7 @@ public:
   virtual TVirtualViewer3D *GetViewer3D(Option_t * /*type*/ = "")
   { return fViewer3D; }
 
-  ClassDef(Pad, 1); // Wrapper for TPad
+  ClassDef(Pad, 1); // Internal Reve pad (sub-class of TPad).
 };
 
 }
index 40a025f789f03e40aa74a2f9298973061b6b1f41..9de25b87a39cca939db2814675f248dd5a56f0da 100644 (file)
@@ -23,8 +23,8 @@ private:
   VoidCPlex& operator=(const VoidCPlex&); // Not implemented
 
 protected:
-  Int_t fS; // Size of atom
-  Int_t fN; // Number of atoms in a chunk
+  Int_t fS;        // Size of atom
+  Int_t fN;        // Number of atoms in a chunk
 
   Int_t fSize;     // Size of container, number of atoms
   Int_t fVecSize;  // Number of allocated chunks
@@ -80,10 +80,12 @@ public:
     Int_t   index()      { return fAtomIndex; }
   };
 
-
-  ClassDef(VoidCPlex, 1)
+  ClassDef(VoidCPlex, 1); // Vector-like container with chunked memory allocation.
 };
 
+
+/******************************************************************************/
+
 inline Char_t* VoidCPlex::NewAtom()
 {
   Char_t *a = (fSize >= fCapacity) ? NewChunk() : Atom(fSize);
@@ -111,7 +113,7 @@ inline Bool_t VoidCPlex::iterator::next()
 
 
 /**************************************************************************/
-// Some-class CPlex
+// Templated some-class CPlex
 /**************************************************************************/
 
 template<class T>
@@ -131,7 +133,7 @@ public:
   T* At(Int_t idx)  { return reinterpret_cast<T*>(Atom(idx)); }
   T& Ref(Int_t idx) { return *At(idx); }
 
-  ClassDef(CPlex, 1)
+  ClassDef(CPlex, 1); // Templated class for specific atom classes (given as template argument).
 }; // endclass CPlex
 
 }
index b15ed9f81a998d3c7d4f27fbe41b117ad349c98e..53d4b3d21d23cc0e87b0f916e21523f11ed242da 100644 (file)
@@ -19,7 +19,7 @@ using namespace Reve;
 //
 // PointSet is a render-element holding a collection of 3D points with
 // optional per-point TRef and an arbitrary number of integer ids (to
-// be used for signal, volume id, track-id, etc).
+// be used for signal, volume-id, track-id, etc).
 //
 // 3D point representation is implemented in base-class TPolyMarker3D.
 // Per-point TRef is implemented in base-class TPointSet3D.
@@ -33,6 +33,7 @@ using namespace Reve;
 
 ClassImp(PointSet)
 
+//______________________________________________________________________________
 PointSet::PointSet(Int_t n_points, TreeVarType_e tv_type) :
   RenderElement(fMarkerColor),
   TPointSet3D(n_points),
@@ -47,6 +48,7 @@ PointSet::PointSet(Int_t n_points, TreeVarType_e tv_type) :
   fMarkerStyle = 20;
 }
 
+//______________________________________________________________________________
 PointSet::PointSet(const Text_t* name, Int_t n_points, TreeVarType_e tv_type) :
   RenderElement(fMarkerColor),
   TPointSet3D(n_points),
@@ -62,6 +64,7 @@ PointSet::PointSet(const Text_t* name, Int_t n_points, TreeVarType_e tv_type) :
   SetName(name);
 }
 
+//______________________________________________________________________________
 PointSet::~PointSet()
 {
   // Destructor.
@@ -71,6 +74,7 @@ PointSet::~PointSet()
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSet::ComputeBBox()
 {
   // Override of virtual method from TAttBBox.
@@ -79,6 +83,7 @@ void PointSet::ComputeBBox()
   AssertBBoxExtents(0.1);
 }
 
+//______________________________________________________________________________
 void PointSet::Reset(Int_t n_points, Int_t n_int_ids)
 {
   // Drop all data and set-up the data structures to recive new data.
@@ -97,6 +102,7 @@ void PointSet::Reset(Int_t n_points, Int_t n_int_ids)
   ResetBBox();
 }
 
+//______________________________________________________________________________
 Int_t PointSet::GrowFor(Int_t n_points)
 {
   // Resizes internal array to allow additional n_points to be stored.
@@ -114,6 +120,7 @@ Int_t PointSet::GrowFor(Int_t n_points)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 inline void PointSet::AssertIntIdsSize()
 {
   // Assert that size of IntId array is compatible with the size of
@@ -124,6 +131,7 @@ inline void PointSet::AssertIntIdsSize()
     fIntIds->Set(exp_size);
 }
 
+//______________________________________________________________________________
 Int_t* PointSet::GetPointIntIds(Int_t p) const
 {
   // Return a pointer to integer ids of point with index p.
@@ -136,6 +144,7 @@ Int_t* PointSet::GetPointIntIds(Int_t p) const
   return 0;
 }
 
+//______________________________________________________________________________
 Int_t PointSet::GetPointIntId(Int_t p, Int_t i) const
 {
   // Return i-th integer id of point with index p.
@@ -148,6 +157,7 @@ Int_t PointSet::GetPointIntId(Int_t p, Int_t i) const
   return kMinInt;
 }
 
+//______________________________________________________________________________
 void PointSet::SetPointIntIds(Int_t* ids)
 {
   // Set integer ids for the last point that was registerd (most
@@ -156,8 +166,11 @@ void PointSet::SetPointIntIds(Int_t* ids)
   SetPointIntIds(fLastPoint, ids);
 }
 
+//______________________________________________________________________________
 void PointSet::SetPointIntIds(Int_t n, Int_t* ids)
 {
+  // Set integer ids for point with index n.
+
   if (!fIntIds) return;
   AssertIntIdsSize();
   Int_t* x = fIntIds->GetArray() + n*fIntIdsPerPoint;
@@ -167,16 +180,23 @@ void PointSet::SetPointIntIds(Int_t n, Int_t* ids)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSet::SetRnrElNameTitle(const Text_t* name, const Text_t* title)
 {
+  // Set name and title of point-set.
+  // Virtual in RenderElement.
+
   SetName(name);
   SetTitle(title);
 }
 
-/**************************************************************************/
+/******************************************************************************/
 
+//______________________________________________________________________________
 void PointSet::Paint(Option_t* option)
 {
+  // Paint point-set.
+
   if(fRnrSelf == kFALSE) return;
 
   TPointSet3D::Paint(option);
@@ -184,8 +204,13 @@ void PointSet::Paint(Option_t* option)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSet::InitFill(Int_t subIdNum)
 {
+  // Initialize point-set for new filling.
+  // subIdNum gives the number of integer ids that can be assigned to
+  // each point.
+
   if (subIdNum > 0) {
     fIntIdsPerPoint = subIdNum;
     if (!fIntIds)
@@ -198,8 +223,13 @@ void PointSet::InitFill(Int_t subIdNum)
   }
 }
 
+//______________________________________________________________________________
 void PointSet::TakeAction(TPointSelector* sel)
 {
+  // Called from TPointSelector when internal arrays of the tree-selector
+  // are filled up and need to be processed.
+  // Virtual from TPointSelectorConsumer.
+
   static const Exc_t eH("PointSet::TakeAction ");
 
   if(sel == 0)
@@ -255,8 +285,11 @@ void PointSet::TakeAction(TPointSelector* sel)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 TClass* PointSet::ProjectedClass() const
 {
+  // Virtual from NLTProjectable, returns NLTPointSet class.
+
   return NLTPointSet::Class();
 }
 
@@ -264,12 +297,27 @@ TClass* PointSet::ProjectedClass() const
 /**************************************************************************/
 /**************************************************************************/
 
-//______________________________________________________________________
+//______________________________________________________________________________
 // PointSetArray
 //
+// An array of point-sets with each point-set playing a role of a bin
+// in a histogram. When a new point is added to a PointSetArray, an
+// additional separating quantity needs to be specified: it determines
+// into which PointSet (bin) the point will actually be stored.
+//
+// By using the TPointSelector the points and the separating
+// quantities can be filled directly from a TTree holding the source
+// data.
+// Setting of per-point TRef's is not supported.
+//
+// After the filling, the range of separating variable can be
+// controlled with a slider to choose a sub-set of PointSets that are
+// actually shown.
+//
 
 ClassImp(PointSetArray)
 
+//______________________________________________________________________________
 PointSetArray::PointSetArray(const Text_t* name,
                             const Text_t* title) :
   RenderElement(fMarkerColor),
@@ -279,8 +327,11 @@ PointSetArray::PointSetArray(const Text_t* name,
   fMin(0), fCurMin(0), fMax(0), fCurMax(0),
   fBinWidth(0),
   fQuantName()
-{}
+{
+  // Constructor.
+}
 
+//______________________________________________________________________________
 PointSetArray::~PointSetArray()
 {
   // Destructor: deletes the fBins array. Actual removal of
@@ -290,58 +341,70 @@ PointSetArray::~PointSetArray()
   delete [] fBins; fBins = 0;
 }
 
+//______________________________________________________________________________
 void PointSetArray::Paint(Option_t* option)
 {
-  if(fRnrSelf) {
-    for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
-      if((*i)->GetRnrSelf())
+  // Paint the subjugated PointSet's.
+
+  if (fRnrSelf) {
+    for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+      if ((*i)->GetRnrSelf())
        (*i)->GetObject()->Paint(option);
     }
   }
 }
 
+//______________________________________________________________________________
 void PointSetArray::RemoveElementLocal(RenderElement* el)
 {
-  for(Int_t i=0; i<fNBins; ++i) {
-    if(fBins[i] == el) {
+  // Virtual from RenderElement, provide bin management.
+
+  for (Int_t i=0; i<fNBins; ++i) {
+    if (fBins[i] == el) {
       fBins[i] = 0;
       break;
     }
   }
 }
 
+//______________________________________________________________________________
 void PointSetArray::RemoveElementsLocal()
 {
+  // Virtual from RenderElement, provide bin management.
+
   delete [] fBins; fBins = 0; fLastBin = -1;
 }
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArray::SetMarkerColor(Color_t tcolor)
 {
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
     TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject());
-    if(m && m->GetMarkerColor() == fMarkerColor)
+    if (m && m->GetMarkerColor() == fMarkerColor)
       m->SetMarkerColor(tcolor);
   }
   TAttMarker::SetMarkerColor(tcolor);
 }
 
+//______________________________________________________________________________
 void PointSetArray::SetMarkerStyle(Style_t mstyle)
 {
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
     TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject());
-    if(m && m->GetMarkerStyle() == fMarkerStyle)
+    if (m && m->GetMarkerStyle() == fMarkerStyle)
       m->SetMarkerStyle(mstyle);
   }
   TAttMarker::SetMarkerStyle(mstyle);
 }
 
+//______________________________________________________________________________
 void PointSetArray::SetMarkerSize(Size_t msize)
 {
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
     TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject());
-    if(m && m->GetMarkerSize() == fMarkerSize)
+    if (m && m->GetMarkerSize() == fMarkerSize)
       m->SetMarkerSize(msize);
   }
   TAttMarker::SetMarkerSize(msize);
@@ -349,11 +412,16 @@ void PointSetArray::SetMarkerSize(Size_t msize)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArray::TakeAction(TPointSelector* sel)
 {
+  // Called from TPointSelector when internal arrays of the tree-selector
+  // are filled up and need to be processed.
+  // Virtual from TPointSelectorConsumer.
+
   static const Exc_t eH("PointSetArray::TakeAction ");
 
-  if(sel == 0)
+  if (sel == 0)
     throw(eH + "selector is <null>.");
 
   Int_t n = sel->GetNfill();
@@ -386,14 +454,15 @@ void PointSetArray::TakeAction(TPointSelector* sel)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArray::InitBins(const Text_t* quant_name,
                             Int_t nbins, Double_t min, Double_t max,
                             Bool_t addRe)
 {
   static const Exc_t eH("PointSetArray::InitBins ");
 
-  if(nbins < 1) throw(eH + "nbins < 1.");
-  if(min > max) throw(eH + "min > max.");
+  if (nbins < 1) throw(eH + "nbins < 1.");
+  if (min > max) throw(eH + "min > max.");
 
   RemoveElements();
 
@@ -405,39 +474,42 @@ void PointSetArray::InitBins(const Text_t* quant_name,
   fBinWidth  = (fMax - fMin)/fNBins;
 
   fBins = new Reve::PointSet*[fNBins];
-  for(Int_t i=0; i<fNBins; ++i) {
+  for (Int_t i=0; i<fNBins; ++i) {
     fBins[i] = new Reve::PointSet
       (Form("Slice %d [%4.3lf, %4.3lf]", i, fMin + i*fBinWidth, fMin + (i+1)*fBinWidth),
        fDefPointSetCapacity);
     fBins[i]->SetMarkerColor(fMarkerColor);
     fBins[i]->SetMarkerStyle(fMarkerStyle);
     fBins[i]->SetMarkerSize(fMarkerSize);
-    if(addRe)
+    if (addRe)
       gReve->AddRenderElement(fBins[i], this);
     else
       AddElement(fBins[i]);
   }
 }
 
+//______________________________________________________________________________
 void PointSetArray::Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
 {
   fLastBin = Int_t( (quant - fMin)/fBinWidth );
-  if(fLastBin >= 0 && fLastBin < fNBins && fBins[fLastBin] != 0)
+  if (fLastBin >= 0 && fLastBin < fNBins && fBins[fLastBin] != 0)
     fBins[fLastBin]->SetNextPoint(x, y, z);
   else
     fLastBin = -1;
 }
 
+//______________________________________________________________________________
 void PointSetArray::SetPointId(TObject* id)
 {
   if (fLastBin >= 0)
     fBins[fLastBin]->SetPointId(id);
 }
 
+//______________________________________________________________________________
 void PointSetArray::CloseBins()
 {
-  for(Int_t i=0; i<fNBins; ++i) {
-    if(fBins[i] != 0) {
+  for (Int_t i=0; i<fNBins; ++i) {
+    if (fBins[i] != 0) {
       // HACK! PolyMarker3D does half-management of array size.
       // In fact, the error is mine, in pointset3d(gl) i use fN instead of Size().
       // Fixed in my root, but not elsewhere.
@@ -451,17 +523,19 @@ void PointSetArray::CloseBins()
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArray::SetOwnIds(Bool_t o)
 {
-  for(Int_t i=0; i<fNBins; ++i)
+  for (Int_t i=0; i<fNBins; ++i)
   {
-    if(fBins[i] != 0)
+    if (fBins[i] != 0)
       fBins[i]->SetOwnIds(o);
   }
 }
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArray::SetRange(Double_t min, Double_t max)
 {
   using namespace TMath;
@@ -469,28 +543,31 @@ void PointSetArray::SetRange(Double_t min, Double_t max)
   fCurMin = min; fCurMax = max;
   Int_t  low_b = (Int_t) Max(Double_t(0),       Floor((min-fMin)/fBinWidth));
   Int_t high_b = (Int_t) Min(Double_t(fNBins-1), Ceil((max-fMin)/fBinWidth));
-  for(Int_t i=0; i<fNBins; ++i) {
-    if(fBins[i] != 0)
+  for (Int_t i=0; i<fNBins; ++i) {
+    if (fBins[i] != 0)
       fBins[i]->SetRnrSelf(i>=low_b && i<=high_b);
   }
 }
 
 
-/**************************************************************************/
-/**************************************************************************/
-
+/******************************************************************************/
+/******************************************************************************/
 
-//______________________________________________________________________
+//______________________________________________________________________________
 // NLTPointSet
 //
 
 ClassImp(NLTPointSet)
 
+//______________________________________________________________________________
 NLTPointSet::NLTPointSet() :
   PointSet     (),
   NLTProjected ()
-{}
+{
+  // Default contructor.
+}
 
+//______________________________________________________________________________
 void NLTPointSet::SetProjection(NLTProjector* proj, NLTProjectable* model)
 {
   NLTProjected::SetProjection(proj, model);
@@ -498,6 +575,7 @@ void NLTPointSet::SetProjection(NLTProjector* proj, NLTProjectable* model)
   * (TAttMarker*)this = * dynamic_cast<TAttMarker*>(fProjectable);
 }
 
+//______________________________________________________________________________
 void NLTPointSet::UpdateProjection()
 {
   NLTProjection& proj = * fProjector->GetProjection();
@@ -506,7 +584,7 @@ void NLTPointSet::UpdateProjection()
   Int_t n = ps.GetN();
   Reset(n);
   Float_t *o = ps.GetP(), *p = GetP();
-  for(Int_t i = 0; i < n; ++i, o+=3, p+=3)
+  for (Int_t i = 0; i < n; ++i, o+=3, p+=3)
   {
     p[0] = o[0]; p[1] = o[1]; p[2] = o[2];
     proj.ProjectPoint(p[0], p[1], p[2]);
index 3b9d4e0b25aa87bbe2d433ad5d0054aca1ec26d1..2159563eeb93bf8b39ff0debb5e94300fbbb00ed 100644 (file)
@@ -85,10 +85,10 @@ protected:
   Int_t        fDefPointSetCapacity;  //  Default capacity of subjugated PointSet's.
   Int_t        fNBins;                //  Number of subjugated PointSet's.
   Int_t        fLastBin;              //! Index of the last filled PointSet.
-  Double_t     fMin, fCurMin;
-  Double_t     fMax, fCurMax;
-  Double_t     fBinWidth;
-  TString      fQuantName;
+  Double_t     fMin, fCurMin;         //  Overall and current minimum value of the separating quantity.
+  Double_t     fMax, fCurMax;         //  Overall and current maximum value of the separating quantity.
+  Double_t     fBinWidth;             //  Separating quantity bin-width.
+  TString      fQuantName;            //  Name of the separating quantity.
 
 public:
   PointSetArray(const Text_t* name="PointSetArray", const Text_t* title="");
@@ -127,7 +127,7 @@ public:
 
   void SetRange(Double_t min, Double_t max);
 
-  ClassDef(PointSetArray, 1);
+  ClassDef(PointSetArray, 1); // Array of centrally managed PointSet's.
 };
 
 /**************************************************************************/
@@ -149,7 +149,7 @@ public:
 
   virtual void UpdateProjection();
 
-  ClassDef(NLTPointSet, 1);
+  ClassDef(NLTPointSet, 1); // NLT projected PointSet.
 }; // endclass NLTPointSet
 
 }
index 8fac7968bedb6692b585a7dc2564722c953f7150..7d36b4bc0dec7bbe1328732d06f2fcb540285713 100644 (file)
@@ -21,6 +21,7 @@ using namespace Reve;
 
 ClassImp(PointSetArrayEditor)
 
+//______________________________________________________________________________
 PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p,
                                         Int_t width, Int_t height,
                                         UInt_t options, Pixel_t back) :
@@ -28,6 +29,8 @@ PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p,
   fM(0),
   fRange(0)
 {
+  // Constructor.
+
   fM = 0;
   MakeTitle("PointSetArray");
 
@@ -41,13 +44,19 @@ PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p,
   AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
 }
 
+//______________________________________________________________________________
 PointSetArrayEditor::~PointSetArrayEditor()
-{}
+{
+  // Destructor.
+}
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArrayEditor::SetModel(TObject* obj)
 {
+  // Set model object.
+
   fM = dynamic_cast<PointSetArray*>(obj);
 
   // printf("FullRange(%f, %f) Selected(%f,%f)\n",
@@ -59,8 +68,11 @@ void PointSetArrayEditor::SetModel(TObject* obj)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void PointSetArrayEditor::DoRange()
 {
+  // Slot for setting the range of the separating quantity.
+
   fM->SetRange(fRange->GetMin(), fRange->GetMax());
   Update();
 }
index db7f0b03912e02caa4c90219632f93b571de6dc9..cce703e0d1a28e68f5003bcbdaeb7ffc8f7b9d25 100644 (file)
@@ -22,9 +22,9 @@ class PointSetArrayEditor : public TGedFrame
   PointSetArrayEditor& operator=(const PointSetArrayEditor&); // Not implemented
 
 protected:
-  PointSetArray* fM; // fModel dynamic-casted to PointSetArrayEditor
+  PointSetArray          *fM;       // Model object.
 
-  Reve::RGDoubleValuator* fRange;
+  Reve::RGDoubleValuator *fRange;   // Control for displayed range of the separating quantity.
 
 public:
   PointSetArrayEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
@@ -35,7 +35,7 @@ public:
 
   void DoRange();
 
-  ClassDef(PointSetArrayEditor, 1); // Editor for PointSetArray
+  ClassDef(PointSetArrayEditor, 1); // Editor for PointSetArray class.
 }; // endclass PointSetArrayEditor
 
 }
index 43294e281a8ca91d9504bd522576e429f27aef46..7e1ffc1ccf373acdd01c9bb30ef08bdb4748ea83 100644 (file)
@@ -122,7 +122,7 @@ public:
   // ?? Should we emit some *SIGNALS* ??
   // ?? Should we have a RendererTimeStamp ??
 
-  ClassDef(RGBAPalette, 1);
+  ClassDef(RGBAPalette, 1); // A generic mapping from value to RGBA color.
 }; // endclass RGBAPalette
 
 
index cfbc463f9a0b35a74d6670594267a45a7c2141a6..5a2b2a9c1f3fc2af7ddfdf3bfb45f22af9649a56 100644 (file)
@@ -54,7 +54,7 @@ public:
   void DoUnderflowAction(Int_t mode);
   void DoOverflowAction(Int_t mode);
 
-  ClassDef(RGBAPaletteSubEditor, 1); // SubEditor for RGBAPalette
+  ClassDef(RGBAPaletteSubEditor, 1); // Sub-editor for RGBAPalette class.
 }; // endclass RGBAPaletteSubEditor
 
 
@@ -77,7 +77,7 @@ public:
 
   virtual void SetModel(TObject* obj);
 
-  ClassDef(RGBAPaletteEditor, 1); // Editor for RGBAPalette
+  ClassDef(RGBAPaletteEditor, 1); // Editor for RGBAPalette class.
 }; // endclass RGBAPaletteEditor
 
 }
index 23d64ffbe6476dfca3695206b8d5ec0114230e44..f228fbdac605c1380e12c002c74db0f89f0f9e3e 100644 (file)
@@ -13,7 +13,7 @@
 
 using namespace Reve;
 
-//______________________________________________________________________
+//______________________________________________________________________________
 // RenderElement
 //
 //
@@ -23,6 +23,7 @@ ClassImp(RenderElement)
 const TGPicture* RenderElement::fgRnrIcons[4] = { 0 };
 const TGPicture* RenderElement::fgListTreeIcons[8] = { 0 };
 
+//______________________________________________________________________________
 RenderElement::RenderElement() :
   fRnrSelf             (kTRUE),
   fRnrChildren         (kTRUE),
@@ -32,8 +33,11 @@ RenderElement::RenderElement() :
   fDestroyOnZeroRefCnt (kTRUE),
   fDenyDestroy         (0),
   fChildren            ()
-{}
+{
+  // Default contructor.
+}
 
+//______________________________________________________________________________
 RenderElement::RenderElement(Color_t& main_color) :
   fRnrSelf             (kTRUE),
   fRnrChildren         (kTRUE),
@@ -43,62 +47,83 @@ RenderElement::RenderElement(Color_t& main_color) :
   fDestroyOnZeroRefCnt (kTRUE),
   fDenyDestroy         (0),
   fChildren            ()
-{}
+{
+  // Constructor.
+}
 
+//______________________________________________________________________________
 RenderElement::~RenderElement()
 {
+  // Destructor.
+
   static const Exc_t _eh("RenderElement::RenderElement ");
 
   RemoveElements();
 
-  for(List_i p=fParents.begin(); p!=fParents.end(); ++p)
+  for (List_i p=fParents.begin(); p!=fParents.end(); ++p)
   {
     (*p)->RemoveElementLocal(this);
     (*p)->fChildren.remove(this);
   }
   fParents.clear();
 
-  for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
+  for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
     i->fTree->DeleteItem(i->fItem);
-  }
 }
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void RenderElement::SetRnrElNameTitle(const Text_t* name, const Text_t* title)
 {
+  // Virtual function for setting of name and title of render element.
+  // Here we attempt to cast the assigned object into TNamed and call
+  // SetNameTitle() there.
+
   TNamed* named = dynamic_cast<TNamed*>(GetObject());
   if (named)
     named->SetNameTitle(name, title);
 }
 
-/**************************************************************************/
+//______________________________________________________________________________
 const Text_t* RenderElement::GetRnrElName() const
 {
+  // Virtual function for retrieveing name of the render-element.
+  // Here we attempt to cast the assigned object into TNamed and call
+  // GetName() there.
+
   TObject* named = dynamic_cast<TObject*>(GetObject());
-  return named ? named->GetName() : "<noo-nom>";
+  return named ? named->GetName() : "<no-name>";
 }
 
-/**************************************************************************/
+//______________________________________________________________________________
 const Text_t*  RenderElement::GetRnrElTitle() const
 {
+  // Virtual function for retrieveing title of the render-element.
+  // Here we attempt to cast the assigned object into TNamed and call
+  // GetTitle() there.
+
   TObject* named = dynamic_cast<TObject*>(GetObject());
-  return named ? named->GetTitle() : "<noo-tit>";
+  return named ? named->GetTitle() : "<no-title>";
 }
-/**************************************************************************/
 
+/******************************************************************************/
+
+//______________________________________________________________________________
 void RenderElement::AddParent(RenderElement* re)
 {
+  // Add re into the list parents.
   // Adding parent is subordinate to adding an element.
-  // Consider this an internal function.
+  // This is an internal function.
 
   fParents.push_back(re);
 }
 
 void RenderElement::RemoveParent(RenderElement* re)
 {
+  // Remove re from the list of parents.
   // Removing parent is subordinate to removing an element.
-  // Consider this an internal function.
+  // This is an internal function.
 
   static const Exc_t eH("RenderElement::RemoveParent ");
 
@@ -106,8 +131,14 @@ void RenderElement::RemoveParent(RenderElement* re)
   CheckReferenceCount(eH);
 }
 
+/******************************************************************************/
+
+//______________________________________________________________________________
 void RenderElement::CheckReferenceCount(const Reve::Exc_t& eh)
 {
+  // Check external references to this and eventually auto-destruct
+  // the render-element.
+
   if(fParents.empty()   &&  fItems.empty()         &&
      fDenyDestroy <= 0  &&  fDestroyOnZeroRefCnt)
   {
@@ -119,6 +150,7 @@ void RenderElement::CheckReferenceCount(const Reve::Exc_t& eh)
   }
 }
 
+//______________________________________________________________________________
 void RenderElement::CollectSceneParents(List_t& scenes)
 {
   // Collect all parents of class Reve::Scene. This is needed to
@@ -130,6 +162,7 @@ void RenderElement::CollectSceneParents(List_t& scenes)
     (*p)->CollectSceneParents(scenes);
 }
 
+//______________________________________________________________________________
 void RenderElement::CollectSceneParentsFromChildren(List_t& scenes, RenderElement* parent)
 {
   // Collect scene-parents from all children. This is needed to
@@ -138,21 +171,22 @@ void RenderElement::CollectSceneParentsFromChildren(List_t& scenes, RenderElemen
   // Argument parent specifies parent in traversed hierarchy for which we can
   // skip the upwards search.
 
-  for(List_i p=fParents.begin(); p!=fParents.end(); ++p)
+  for (List_i p=fParents.begin(); p!=fParents.end(); ++p)
   {
     if (*p != parent) (*p)->CollectSceneParents(scenes);
   }
 
-  for(List_i c=fChildren.begin(); c!=fChildren.end(); ++c)
+  for (List_i c=fChildren.begin(); c!=fChildren.end(); ++c)
   {
     (*c)->CollectSceneParentsFromChildren(scenes, this);
   }
 }
 
-/**************************************************************************/
+/******************************************************************************/
 // List-tree stuff
-/**************************************************************************/
+/******************************************************************************/
 
+//______________________________________________________________________________
 Int_t RenderElement::ExpandIntoListTree(TGListTree* ltree,
                                        TGListTreeItem* parent)
 {
@@ -165,16 +199,17 @@ Int_t RenderElement::ExpandIntoListTree(TGListTree* ltree,
   // search through fItems to get parent here.
   // Anyhow, it is probably known as it must have been selected by the user.
 
-  if(parent->GetFirstChild() != 0)
+  if (parent->GetFirstChild() != 0)
     return 0;
   Int_t n = 0;
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
     (*i)->AddIntoListTree(ltree, parent);
     ++n;
   }
   return n;
 }
 
+//______________________________________________________________________________
 Int_t RenderElement::DestroyListSubTree(TGListTree* ltree,
                                        TGListTreeItem* parent)
 {
@@ -190,8 +225,7 @@ Int_t RenderElement::DestroyListSubTree(TGListTree* ltree,
   return n;
 }
 
-/**************************************************************************/
-
+//______________________________________________________________________________
 TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
                                               TGListTreeItem* parent_lti)
 {
@@ -209,7 +243,7 @@ TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
   item->SetPictures(GetListTreeIcon(),GetListTreeIcon());
   item->CheckItem(fRnrSelf);
 
-  if(fMainColorPtr != 0) item->SetColor(GetMainColor());
+  if (fMainColorPtr != 0) item->SetColor(GetMainColor());
   item->SetTipText(tobj->GetTitle());
 
   fItems.insert(ListTreeInfo(ltree, item));
@@ -218,6 +252,7 @@ TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
   return item;
 }
 
+//______________________________________________________________________________
 TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
                                               RenderElement* parent)
 {
@@ -229,15 +264,16 @@ TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
   if (parent == 0) {
     lti = AddIntoListTree(ltree, (TGListTreeItem*) 0);
   } else {
-    for(sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
+    for (sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
     {
-      if(i->fTree == ltree)
+      if (i->fTree == ltree)
        lti = AddIntoListTree(ltree, i->fItem);
     }
   }
   return lti;
 }
 
+//______________________________________________________________________________
 TGListTreeItem* RenderElement::AddIntoListTrees(RenderElement* parent)
 {
   // Add this render element into all list-trees and all items
@@ -245,20 +281,21 @@ TGListTreeItem* RenderElement::AddIntoListTrees(RenderElement* parent)
   // register entry (but we use a set for that so it can be anything).
 
   TGListTreeItem* lti = 0;
-  for(sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
+  for (sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
   {
     lti = AddIntoListTree(i->fTree, i->fItem);
   }
   return lti;
 }
 
+//______________________________________________________________________________
 Bool_t RenderElement::RemoveFromListTree(TGListTree* ltree,
                                         TGListTreeItem* parent_lti)
 {
   static const Exc_t eH("RenderElement::RemoveFromListTree ");
 
   sLTI_i i = FindItem(ltree, parent_lti);
-  if(i != fItems.end()) {
+  if (i != fItems.end()) {
     DestroyListSubTree(ltree, i->fItem);
     ltree->DeleteItem(i->fItem);
     ltree->ClearViewPort();
@@ -270,6 +307,7 @@ Bool_t RenderElement::RemoveFromListTree(TGListTree* ltree,
   }
 }
 
+//______________________________________________________________________________
 Int_t RenderElement::RemoveFromListTrees(RenderElement* parent)
 {
   Int_t count = 0;
@@ -292,77 +330,91 @@ Int_t RenderElement::RemoveFromListTrees(RenderElement* parent)
   return count;
 }
 
-/**************************************************************************/
-
+//______________________________________________________________________________
 RenderElement::sLTI_i RenderElement::FindItem(TGListTree* ltree)
 {
-  for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
-    if(i->fTree == ltree)
+  for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+    if (i->fTree == ltree)
       return i;
   return fItems.end();
 }
 
+//______________________________________________________________________________
 RenderElement::sLTI_i RenderElement::FindItem(TGListTree* ltree,
                                              TGListTreeItem* parent_lti)
 {
-  for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
-    if(i->fTree == ltree && i->fItem->GetParent() == parent_lti)
+  for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+    if (i->fTree == ltree && i->fItem->GetParent() == parent_lti)
       return i;
   return fItems.end();
 }
 
+//______________________________________________________________________________
 TGListTreeItem* RenderElement::FindListTreeItem(TGListTree* ltree)
 {
-  for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
-    if(i->fTree == ltree)
+  for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+    if (i->fTree == ltree)
       return i->fItem;
   return 0;
 }
 
+//______________________________________________________________________________
 TGListTreeItem* RenderElement::FindListTreeItem(TGListTree* ltree,
                                                TGListTreeItem* parent_lti)
 {
-  for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
-    if(i->fTree == ltree && i->fItem->GetParent() == parent_lti)
+  for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+    if (i->fTree == ltree && i->fItem->GetParent() == parent_lti)
       return i->fItem;
   return 0;
 }
 
-/**************************************************************************/
-
+//______________________________________________________________________________
 void RenderElement::UpdateItems()
 {
+  // Update list-tree-items representing this render-element.
+
   static const Exc_t eH("RenderElement::UpdateItems ");
 
   TObject* tobj = GetObject(eH);
 
-  for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
+  for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
     i->fItem->Rename(tobj->GetName());
     i->fItem->SetTipText(tobj->GetTitle());
     i->fItem->CheckItem(fRnrSelf);
-    if(fMainColorPtr != 0) i->fItem->SetColor(GetMainColor());
+    if (fMainColorPtr != 0) i->fItem->SetColor(GetMainColor());
     i->fTree->ClearViewPort();
   }
 }
 
-/**************************************************************************/
+/******************************************************************************/
 
+//______________________________________________________________________________
 TObject* RenderElement::GetObject(Exc_t eh) const
 {
+  // Get a TObject associated with this render-element.
+  // Most cases uses double-inheritance from RenderElement and TObject
+  // so we just do a dynamic cast here.
+  // If some RenderElement descendant implements a different scheme,
+  // this virtual method should be overriden accordingly.
+
   const TObject* obj = dynamic_cast<const TObject*>(this);
-  if(obj == 0)
+  if (obj == 0)
     throw(eh + "not a TObject.");
   return const_cast<TObject*>(obj);
 }
 
+//______________________________________________________________________________
 void RenderElement::SpawnEditor()
 {
+  // Show GUI editor for this object.
+
   gReve->EditRenderElement(this);
 }
 
+//______________________________________________________________________________
 void RenderElement::ExportToCINT(Text_t* var_name)
 {
-  static const Exc_t eH("RenderElement::ExportToCINT ");
+  // Export render-element to CINT with variable name var_name.
 
   const char* cname = IsA()->GetName();
   gROOT->ProcessLine(Form("%s* %s = (%s*)0x%lx;", cname, var_name, cname, this));
@@ -370,14 +422,17 @@ void RenderElement::ExportToCINT(Text_t* var_name)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void RenderElement::PadPaint(Option_t* option)
 {
+  // Paint self and/or children into currently active pad.
+
   if (GetRnrSelf() && GetObject()) 
     GetObject()->Paint(option);
   
 
   if (GetRnrChildren()) {
-    for(List_i i=BeginChildren(); i!=EndChildren(); ++i) {
+    for (List_i i=BeginChildren(); i!=EndChildren(); ++i) {
       (*i)->PadPaint(option);
     }
   }
@@ -385,15 +440,16 @@ void RenderElement::PadPaint(Option_t* option)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void RenderElement::SetRnrSelf(Bool_t rnr)
 {
-  if(rnr != fRnrSelf)
+  if (rnr != fRnrSelf)
   {
     fRnrSelf = rnr;
     
-    for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) 
+    for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) 
     {
-      if(i->fItem->IsChecked() != rnr) {
+      if (i->fItem->IsChecked() != rnr) {
         i->fItem->SetCheckBoxPictures(GetCheckBoxPicture(1, fRnrChildren),
                                      GetCheckBoxPicture(0, fRnrChildren));
         i->fItem->CheckItem(fRnrSelf);
@@ -403,13 +459,14 @@ void RenderElement::SetRnrSelf(Bool_t rnr)
   }
 }
 
+//______________________________________________________________________________
 void RenderElement::SetRnrChildren(Bool_t rnr)
 {
-  if(rnr != fRnrChildren)
+  if (rnr != fRnrChildren)
   {
     fRnrChildren = rnr; 
 
-    for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) 
+    for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) 
     {
       i->fItem->SetCheckBoxPictures(GetCheckBoxPicture(fRnrSelf, fRnrChildren),
                                    GetCheckBoxPicture(fRnrSelf, fRnrChildren));
@@ -418,6 +475,7 @@ void RenderElement::SetRnrChildren(Bool_t rnr)
   }
 }
 
+//______________________________________________________________________________
 void RenderElement::SetRnrState(Bool_t rnr)
 {
   if (fRnrSelf != rnr || fRnrChildren != rnr)
@@ -435,17 +493,21 @@ void RenderElement::SetRnrState(Bool_t rnr)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void RenderElement::SetMainColor(Color_t color)
 {
+  // Set main color of the render-element.
+  // List-tree-items are updated.
+
   Color_t oldcol = GetMainColor();
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
-    if((*i)->GetMainColor() == oldcol) (*i)->SetMainColor(color);
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+    if ((*i)->GetMainColor() == oldcol) (*i)->SetMainColor(color);
   }
 
   if (fMainColorPtr) {
     *fMainColorPtr = color;
-    for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
-      if(i->fItem->GetColor() != color) {
+    for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
+      if (i->fItem->GetColor() != color) {
         i->fItem->SetColor(GetMainColor());
        i->fTree->ClearViewPort();
       }
@@ -453,15 +515,27 @@ void RenderElement::SetMainColor(Color_t color)
   }
 }
 
+//______________________________________________________________________________
 void RenderElement::SetMainColor(Pixel_t pixel)
 {
+  // Convert pixel to Color_t and call the above function.
+
   SetMainColor(Color_t(TColor::GetColor(pixel)));
 }
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 TGListTreeItem* RenderElement::AddElement(RenderElement* el)
 {
+  // Add el to the list of children.
+
+  static const Exc_t eH("RenderElement::AddElement ");
+
+  if ( ! AcceptRenderElement(el))
+    throw(eH + Form("parent '%s' rejects '%s'.",
+                    GetRnrElName(), el->GetRnrElName()));
+
   el->AddParent(this);
   fChildren.push_back(el);
   TGListTreeItem* ret = el->AddIntoListTrees(this);
@@ -469,6 +543,7 @@ TGListTreeItem* RenderElement::AddElement(RenderElement* el)
   return ret;
 }
 
+//______________________________________________________________________________
 void RenderElement::RemoveElement(RenderElement* el)
 {
   // Remove el from the list of children.
@@ -480,6 +555,7 @@ void RenderElement::RemoveElement(RenderElement* el)
   ElementChanged();
 }
 
+//______________________________________________________________________________
 void RenderElement::RemoveElementLocal(RenderElement* /*el*/)
 {
   // Perform additional local removal of el.
@@ -487,23 +563,24 @@ void RenderElement::RemoveElementLocal(RenderElement* /*el*/)
   // Put into special function as framework-related handling of
   // element removal should really be common to all classes and
   // clearing of local structures happens in between removal
-  // of list-tree-items and final untangling.
+  // of list-tree-items and final removal.
   // If you override this, you should also override
   // RemoveElementsLocal().
 }
 
+//______________________________________________________________________________
 void RenderElement::RemoveElements()
 {
   // Remove all elements. This assumes removing of all elements can be
   // done more efficiently then looping over them and removing one by
   // one.
 
-  for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
+  for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
   {
     DestroyListSubTree(i->fTree, i->fItem);
   }
   RemoveElementsLocal();
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
   {
     (*i)->RemoveParent(this);
   }
@@ -511,6 +588,7 @@ void RenderElement::RemoveElements()
   ElementChanged();
 }
 
+//______________________________________________________________________________
 void RenderElement::RemoveElementsLocal()
 {
   // Perform additional local removal of all elements.
@@ -519,9 +597,13 @@ void RenderElement::RemoveElementsLocal()
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void RenderElement::EnableListElements(Bool_t rnr_self,  Bool_t rnr_children)
 {
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
+  // Enable rendering of children and their list contents.
+  // Arguments control how to set self/child rendering.
+
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
   {
     (*i)->SetRnrSelf(rnr_self);
     (*i)->SetRnrChildren(rnr_children);
@@ -530,9 +612,16 @@ void RenderElement::EnableListElements(Bool_t rnr_self,  Bool_t rnr_children)
   ElementChanged(kTRUE, kTRUE);
 }
 
+//______________________________________________________________________________
 void RenderElement::DisableListElements(Bool_t rnr_self,  Bool_t rnr_children)
 {
-  for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
+  // Disable rendering of children and their list contents.
+  // Arguments control how to set self/child rendering.
+  //
+  // Same as above function, but default arguments are different. This
+  // is convenient for calls via context menu.
+
+  for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
   {
     (*i)->SetRnrSelf(rnr_self);
     (*i)->SetRnrChildren(rnr_children);
@@ -543,6 +632,7 @@ void RenderElement::DisableListElements(Bool_t rnr_self,  Bool_t rnr_children)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void RenderElement::Destroy()
 {
   static const Exc_t eH("RenderElement::Destroy ");
@@ -555,18 +645,19 @@ void RenderElement::Destroy()
   gReve->Redraw3D();
 }
 
+//______________________________________________________________________________
 void RenderElement::DestroyElements()
 {
   static const Exc_t eH("RenderElement::DestroyElements ");
 
-  while( ! fChildren.empty()) {
+  while ( ! fChildren.empty()) {
     RenderElement* c = fChildren.front();
     if (c->fDenyDestroy <= 0)
     {
       try {
         c->Destroy();
       }
-      catch(Exc_t exc) {
+      catch (Exc_t exc) {
         Warning(eH, Form("element destruction failed: '%s'.", exc.Data()));
         RemoveElement(c);
       }
@@ -583,6 +674,7 @@ void RenderElement::DestroyElements()
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 Bool_t RenderElement::HandleElementPaste(RenderElement* el)
 {
   // React to element being pasted or dnd-ed.
@@ -592,6 +684,7 @@ Bool_t RenderElement::HandleElementPaste(RenderElement* el)
   return kTRUE;
 }
 
+//______________________________________________________________________________
 void RenderElement::ElementChanged(Bool_t update_scenes, Bool_t redraw)
 {
   if (update_scenes)
@@ -604,12 +697,13 @@ void RenderElement::ElementChanged(Bool_t update_scenes, Bool_t redraw)
 // Statics
 /**************************************************************************/
 
+//______________________________________________________________________________
 const TGPicture*
 RenderElement::GetCheckBoxPicture(Bool_t rnrSelf, Bool_t rnrDaughters)
 {
   Int_t idx = 0;
-  if(rnrSelf)       idx = 2;
-  if(rnrDaughters ) idx++;
+  if (rnrSelf)       idx = 2;
+  if (rnrDaughters ) idx++;
 
   return fgRnrIcons[idx];
 }
@@ -618,33 +712,47 @@ RenderElement::GetCheckBoxPicture(Bool_t rnrSelf, Bool_t rnrDaughters)
 /**************************************************************************/
 /**************************************************************************/
 
-//______________________________________________________________________
+//______________________________________________________________________________
 // Reve::RenderElementObjPtr
 //
 
 ClassImp(RenderElementObjPtr)
 
+//______________________________________________________________________________
 RenderElementObjPtr::RenderElementObjPtr(TObject* obj, Bool_t own) :
   RenderElement(),
   fObject(obj),
   fOwnObject(own)
-{}
+{
+  // Constructor.
+}
 
+//______________________________________________________________________________
 RenderElementObjPtr::RenderElementObjPtr(TObject* obj, Color_t& mainColor, Bool_t own) :
   RenderElement(mainColor),
   fObject(obj),
   fOwnObject(own)
-{}
+{
+  // Constructor.
+}
 
+//______________________________________________________________________________
 TObject* RenderElementObjPtr::GetObject(Reve::Exc_t eh) const
 {
+  // Return external object.
+  // Virtual from RenderElement.
+
   if(fObject == 0)
     throw(eh + "fObject not set.");
   return fObject;
 }
 
+//______________________________________________________________________________
 void RenderElementObjPtr::ExportToCINT(Text_t* var_name)
 {
+  // Export external object to CINT with variable name var_name.
+  // Virtual from RenderElement.
+
   static const Exc_t eH("RenderElementObjPtr::ExportToCINT ");
 
   TObject* obj = GetObject(eH);
@@ -652,25 +760,33 @@ void RenderElementObjPtr::ExportToCINT(Text_t* var_name)
   gROOT->ProcessLine(Form("%s* %s = (%s*)0x%lx;", cname, var_name, cname, obj));
 }
 
+//______________________________________________________________________________
 RenderElementObjPtr::~RenderElementObjPtr()
 {
+  // Destructor.
+
   if(fOwnObject)
     delete fObject;
 }
 
 
-/**************************************************************************/
-/**************************************************************************/
+/******************************************************************************/
+/******************************************************************************/
 
-//______________________________________________________________________
+//______________________________________________________________________________
 // Reve::RenderElementList
 //
+// A list of render elements.
+// Class of acceptable children can be limited by setting the
+// fChildClass member.
+// 
 
 // !!! should have two ctors (like in RenderElement), one with Color_t&
 // and set fDoColor automatically, based on which ctor is called.
 
 ClassImp(RenderElementList)
 
+//______________________________________________________________________________
 RenderElementList::RenderElementList(const Text_t* n, const Text_t* t, Bool_t doColor) :
   RenderElement(),
   TNamed(n, t),
@@ -678,13 +794,19 @@ RenderElementList::RenderElementList(const Text_t* n, const Text_t* t, Bool_t do
   fDoColor(doColor),
   fChildClass(0)
 {
+  // Constructor.
+
   if(fDoColor) {
     SetMainColorPtr(&fColor);
   }
 }
 
+//______________________________________________________________________________
 Bool_t RenderElementList::AcceptRenderElement(RenderElement* el)
 {
+  // Check if RenderElement el is inherited from fChildClass.
+  // Virtual from RenderElement.
+
   if (fChildClass && ! el->IsA()->InheritsFrom(fChildClass))
     return kFALSE;
   return kTRUE;
index a43cd53611d3d3619f7caba9dcd6757ee5379fe8..8936221ddf15e447e9353f6f6f5f92a8970d2b58 100644 (file)
@@ -16,6 +16,11 @@ namespace Reve {
 
 class ZTrans;
 
+
+/******************************************************************************/
+// RenderElement
+/******************************************************************************/
+
 class RenderElement
 {
   friend class ReveManager;
@@ -43,7 +48,7 @@ public:
     bool operator<(const ListTreeInfo& x) const
     { return fTree == x.fTree ? fItem < x.fItem : fTree < x.fTree; }
 
-    ClassDef(ListTreeInfo, 0);
+    ClassDef(ListTreeInfo, 0); // Structure agregating data for a render element image in a list tree.
   };
 
   static const TGPicture*                      fgRnrIcons[4];
@@ -59,17 +64,17 @@ public:
 protected:
   // TRef     fSource;
 
-  Bool_t   fRnrSelf;
-  Bool_t   fRnrChildren;
-  Color_t* fMainColorPtr;
+  Bool_t   fRnrSelf;              // Render this element.
+  Bool_t   fRnrChildren;          // Render children of this element.
+  Color_t* fMainColorPtr;         // Pointer to main-color variable.
 
-  sLTI_t fItems;
-  List_t fParents;
+  sLTI_t fItems;                  // Set of list-tree-items.
+  List_t fParents;                // List of parents.
 
-  Bool_t fDestroyOnZeroRefCnt;
-  Int_t  fDenyDestroy;
+  Bool_t fDestroyOnZeroRefCnt;    // Auto-destruct when ref-count reaches zero.
+  Int_t  fDenyDestroy;            // Deny-destroy count.
 
-  List_t fChildren;
+  List_t fChildren;               // List of children.
 
 public:
   RenderElement();
@@ -159,8 +164,8 @@ public:
   virtual Bool_t HandleElementPaste(RenderElement* el);
   virtual void   ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE);
 
-  virtual Bool_t CanEditRnrElement()   { return kTRUE; }
-  virtual Bool_t GetRnrSelf() const { return fRnrSelf; }
+  virtual Bool_t CanEditRnrElement()    { return kTRUE; }
+  virtual Bool_t GetRnrSelf()     const { return fRnrSelf; }
   virtual Bool_t GetRnrChildren() const { return fRnrChildren; }
   virtual void   SetRnrSelf(Bool_t rnr);
   virtual void   SetRnrChildren(Bool_t rnr);
@@ -184,10 +189,13 @@ public:
   static  const TGPicture* GetCheckBoxPicture(Bool_t rnrElement, Bool_t rnrDaughter);
   virtual const TGPicture* GetListTreeIcon() { return fgListTreeIcons[0]; }
 
-  ClassDef(RenderElement, 1);
+  ClassDef(RenderElement, 1); // Base class for visualization elements.
 }; // endclass RenderElement
 
-/**************************************************************************/
+
+/******************************************************************************/
+// RenderElementObjPtr
+/******************************************************************************/
 
 class RenderElementObjPtr : public RenderElement,
                             public TObject
@@ -196,8 +204,8 @@ class RenderElementObjPtr : public RenderElement,
   RenderElementObjPtr& operator=(const RenderElementObjPtr&); // Not implemented
 
 protected:
-  TObject* fObject;
-  Bool_t   fOwnObject;
+  TObject* fObject;     // External object holding the visual data.
+  Bool_t   fOwnObject;  // Is object owned / should be deleted on destruction.
 
 public:
   RenderElementObjPtr(TObject* obj, Bool_t own=kTRUE);
@@ -210,18 +218,21 @@ public:
   Bool_t GetOwnObject() const   { return fOwnObject; }
   void   SetOwnObject(Bool_t o) { fOwnObject = o; }
 
-  ClassDef(RenderElementObjPtr, 1);
+  ClassDef(RenderElementObjPtr, 1); // Render element with external TObject as visualization data holder.
 }; // endclass RenderElementObjPtr
 
-/**************************************************************************/
+
+/******************************************************************************/
+// RenderElementList
+/******************************************************************************/
 
 class RenderElementList : public RenderElement,
                           public TNamed
 {
 protected:
-  Color_t   fColor;
-  Bool_t    fDoColor;
-  TClass   *fChildClass;
+  Color_t   fColor;       // Color of the object.
+  Bool_t    fDoColor;     // Should serve fColor as the main color of the object.
+  TClass   *fChildClass;  // Class of acceptable children, others are rejected.
 
 public:
   RenderElementList(const Text_t* n="RenderElementList", const Text_t* t="",
@@ -235,7 +246,7 @@ public:
 
   virtual Bool_t AcceptRenderElement(RenderElement* el);
 
-  ClassDef(RenderElementList, 1);
+  ClassDef(RenderElementList, 1); // List of render elements.
 };
 
 }
index 0ccc31b2bd343bc92b03521756058dcb5e17c743..475cc4685b200f1b6b0cc643b087a3ba2d6a3001 100644 (file)
@@ -71,6 +71,8 @@ ReveManager::ReveManager(UInt_t w, UInt_t h) :
 
   fGeometries     ()
 {
+  // Constructor.
+
   static const Exc_t eH("ReveManager::ReveManager ");
 
   if (gReve != 0)
@@ -141,12 +143,16 @@ ReveManager::ReveManager(UInt_t w, UInt_t h) :
 }
 
 ReveManager::~ReveManager()
-{}
+{
+  // Destructor.
+}
 
 /**************************************************************************/
 
 TCanvas* ReveManager::AddCanvasTab(const char* name)
 {
+  // Add a new canvas tab.
+
   fBrowser->StartEmbedding(1, -1);
   TCanvas* c = new TCanvas;
   fBrowser->StopEmbedding();
@@ -157,16 +163,23 @@ TCanvas* ReveManager::AddCanvasTab(const char* name)
 
 TGWindow* ReveManager::GetMainWindow() const
 {
+  // Get the main window, i.e. the first created reve-browser.
+
   return fBrowser;
 }
 
 TGLViewer* ReveManager::GetGLViewer() const
 {
+  // Get default TGLViewer.
+
   return fViewer->GetGLViewer();
 }
 
-Viewer* ReveManager::SpawnNewViewer(const Text_t* name, const Text_t* title, Bool_t embed)
+Viewer* ReveManager::SpawnNewViewer(const Text_t* name, const Text_t* title,
+                                   Bool_t embed)
 {
+  // Create a new GL viewer.
+
   Viewer* v = new Viewer(name, title);
 
   if (embed)  fBrowser->StartEmbedding(1);
@@ -179,6 +192,8 @@ Viewer* ReveManager::SpawnNewViewer(const Text_t* name, const Text_t* title, Boo
 
 Scene* ReveManager::SpawnNewScene(const Text_t* name, const Text_t* title)
 {
+  // Create a new scene.
+
   Scene* s = new Scene(name, title);
   AddRenderElement(s, fScenes);
   return s;
@@ -210,12 +225,17 @@ void ReveManager::EditRenderElement(RenderElement* rnr_element)
 
 void ReveManager::RegisterRedraw3D()
 {
+  // Register a request for 3D redraw.
+
   fRedrawTimer.Start(0, kTRUE);
   fTimerActive = true;
 }
 
 void ReveManager::DoRedraw3D()
 {
+  // Perform 3D redraw of scenes and viewers whose contents has
+  // changed.
+
   // printf("ReveManager::DoRedraw3D redraw triggered\n");
 
   fScenes ->RepaintChangedScenes();
@@ -229,6 +249,8 @@ void ReveManager::DoRedraw3D()
 
 void ReveManager::FullRedraw3D(Bool_t resetCameras, Bool_t dropLogicals)
 {
+  // Perform 3D redraw of all scenes and viewers.
+
   fScenes ->RepaintAllScenes();
   fViewers->RepaintAllViewers(resetCameras, dropLogicals);
 }
@@ -327,43 +349,22 @@ TGListTreeItem* ReveManager::AddEvent(EventBase* event)
 TGListTreeItem* ReveManager::AddRenderElement(RenderElement* rnr_element,
                                             RenderElement* parent)
 {
-  static const Exc_t eH("ReveManager::AddRenderElement ");
-
-  if (parent && ! parent->AcceptRenderElement(rnr_element)) {
-    throw(eH + Form("parent '%s' rejects '%s'.",
-                    parent->GetRnrElName(), rnr_element->GetRnrElName()));
-  }
-
   if (parent == 0) {
     if (fCurrentEvent == 0)
       AddEvent(new EventBase("Event", "Auto-created event directory"));
     parent = fCurrentEvent;
   }
 
-  TGListTreeItem* newitem = parent->AddElement(rnr_element);
-
-  return newitem;
+  return parent->AddElement(rnr_element);
 }
 
 TGListTreeItem* ReveManager::AddGlobalRenderElement(RenderElement* rnr_element,
-                                                  RenderElement* parent)
+                                                    RenderElement* parent)
 {
-  static const Exc_t eH("ReveManager::AddGlobalRenderElement ");
-
-  if (parent && ! parent->AcceptRenderElement(rnr_element)) {
-    throw(eH + "parent '%s' rejects '%s'.",
-         parent->GetObject()->GetName(), rnr_element->GetObject()->GetName());
-  }
-
   if (parent == 0)
     parent = fGlobalScene;
 
-  parent->AddElement(rnr_element);
-
-  TGListTreeItem* newitem =
-    rnr_element->AddIntoListTrees(parent);
-
-  return newitem;
+  return parent->AddElement(rnr_element);
 }
 
 /**************************************************************************/
@@ -399,9 +400,8 @@ void ReveManager::RenderElementChecked(RenderElement* rnrEl, Bool_t state)
 {
   rnrEl->SetRnrState(state);
 
-  if(fEditor->GetModel() == rnrEl->GetEditorObject()) {
+  if (fEditor->GetModel() == rnrEl->GetEditorObject())
     fEditor->DisplayRenderElement(rnrEl);
-  }
 
   rnrEl->ElementChanged();
 }
@@ -411,7 +411,7 @@ void ReveManager::RenderElementChecked(RenderElement* rnrEl, Bool_t state)
 void ReveManager::NotifyBrowser(TGListTreeItem* parent_lti)
 {
   TGListTree* lt = GetListTree();
-  if(parent_lti)
+  if (parent_lti)
     lt->OpenItem(parent_lti);
   lt->ClearViewPort();
 }
@@ -436,14 +436,14 @@ TGeoManager* ReveManager::GetGeometry(const TString& filename)
         filename.Data(), exp_filename.Data());
 
   std::map<TString, TGeoManager*>::iterator g = fGeometries.find(filename);
-  if(g != fGeometries.end()) {
+  if (g != fGeometries.end()) {
     return g->second;
   } else {
-    if(gSystem->AccessPathName(exp_filename, kReadPermission))
+    if (gSystem->AccessPathName(exp_filename, kReadPermission))
       throw(eH + "file '" + exp_filename + "' not readable.");
     gGeoManager = 0;
     TGeoManager::Import(filename); 
-    if(gGeoManager == 0)
+    if (gGeoManager == 0)
       throw(eH + "GeoManager import failed.");
     gGeoManager->GetTopVolume()->VisibleDaughters(1);
 
@@ -452,7 +452,7 @@ TGeoManager* ReveManager::GetGeometry(const TString& filename)
       TFile f(exp_filename, "READ");
       TObjArray* collist = (TObjArray*) f.Get("ColorList");
       f.Close();
-      if(collist != 0) {
+      if (collist != 0) {
        TIter next(gGeoManager->GetListOfVolumes());
        TGeoVolume* vol;
        while ((vol = (TGeoVolume*) next()) != 0)
index c87ce09e261a8e589630473cd8f14cfab94eb3da..07f197b1cb9daf1141cc45b6c183384a8e15f116 100644 (file)
@@ -166,7 +166,7 @@ public:
   void SetStatusLine(const char* text);
   void ThrowException(const char* text="foo");
 
-  ClassDef(ReveManager, 0);
+  ClassDef(ReveManager, 0); // Reve application manager.
 };
 
 } // namespace Reve
index 8ac74b1150d4b9f4aa5e42a56c93cc9145e9f8b0..8066990864f95ae828f424526e5b10dad866ef4e 100644 (file)
@@ -44,7 +44,8 @@ public:
   virtual void Paint(Option_t* option = "");
 
   virtual const TGPicture* GetListTreeIcon() { return RenderElement::fgListTreeIcons[2]; }
-  ClassDef(Scene, 0);
+
+  ClassDef(Scene, 0); // Reve representation of TGLScene.
 }; // endclass Scene
 
 
@@ -67,7 +68,7 @@ public:
   void RepaintChangedScenes();
   void RepaintAllScenes();
 
-  ClassDef(SceneList, 0);
+  ClassDef(SceneList, 0); // List of Scenes.
 }; // endclass SceneList
 
 }
index c485821d58fac2d543f42d56884039d2db9bc11e..f27ae7ec2fe802e6f746889f30861c5ad49b7fa7 100644 (file)
@@ -40,7 +40,7 @@ public:
   virtual Bool_t AcceptRenderElement(RenderElement* el);
   virtual Bool_t HandleElementPaste(RenderElement* el);
 
-  ClassDef(SceneInfo, 0);
+  ClassDef(SceneInfo, 0); // Reve representation of TGLSceneInfo.
 }; // endclass SceneInfo
 
 }
index 88dd917d76a1f17565c0583a6cf6ab97418c14d9..46af2810fe78796b2c12d1fb068d9ce13c993dbe 100644 (file)
@@ -104,7 +104,7 @@ public:
 
   virtual TClass* ProjectedClass() const;
 
-  ClassDef(StraightLineSet, 1);
+  ClassDef(StraightLineSet, 1); // Set of lines and optional markers.
 }; // endclass StraightLineSet
 
 
@@ -130,7 +130,7 @@ public:
 
   virtual void UpdateProjection();
 
-  ClassDef(NLTSLineSet, 1);
+  ClassDef(NLTSLineSet, 1); // NLT projected StraightLineSet.
 }; // endclass NLTSLineSet
 
 } // Reve
index 37e56959902617a07f1d5bc39c4b7825d2987570..67769a4cb1bc319d75d5e65384cde0c9fa1ebb3f 100644 (file)
@@ -44,7 +44,9 @@ Track::Track() :
   fPathMarks(),
 
   fRnrStyle(0)
-{}
+{
+  // Default constructor.
+}
 
 //______________________________________________________________________________
 Track::Track(TParticle* t, Int_t label, TrackRnrStyle* rs):
@@ -61,6 +63,8 @@ Track::Track(TParticle* t, Int_t label, TrackRnrStyle* rs):
 
   fRnrStyle(0)
 {
+  // Constructor from TParticle.
+
   SetRnrStyle(rs);
   fMainColorPtr = &fLineColor;
 
@@ -88,6 +92,8 @@ Track::Track(Reve::MCTrack* t, TrackRnrStyle* rs):
 
   fRnrStyle(0)
 {
+  // Constructor from Reve Monte Carlo track.
+
   SetRnrStyle(rs);
   fMainColorPtr = &fLineColor;
 
@@ -115,6 +121,8 @@ Track::Track(Reve::RecTrack* t, TrackRnrStyle* rs) :
 
   fRnrStyle(0)
 {
+  // Constructor from Reve reconstructed track.
+
   SetRnrStyle(rs);
   fMainColorPtr = &fLineColor;
 
@@ -152,6 +160,8 @@ Track::Track(const Track& t) :
 //______________________________________________________________________________
 Track::~Track()
 {
+  // Destructor.
+
   SetRnrStyle(0);
   for (vpPathMark_i i=fPathMarks.begin(); i!=fPathMarks.end(); ++i)
     delete *i;
@@ -215,7 +225,10 @@ void Track::SetPathMarks(const Track& t)
 //______________________________________________________________________________
 void Track::SetRnrStyle(TrackRnrStyle* rs)
 {
- if (fRnrStyle == rs) return;
+  // Set track's render style.
+  // Reference counts of old and new render-style are updated.
+
+  if (fRnrStyle == rs) return;
   if (fRnrStyle) fRnrStyle->DecRefCount(this);
   fRnrStyle = rs;
   if (fRnrStyle) rs->IncRefCount(this);
@@ -226,6 +239,8 @@ void Track::SetRnrStyle(TrackRnrStyle* rs)
 //______________________________________________________________________________
 void Track::SetAttLineAttMarker(TrackList* tl)
 {
+  // Set line and marker attributes from TrackList.
+
   SetLineColor(tl->GetLineColor());
   SetLineStyle(tl->GetLineStyle());
   SetLineWidth(tl->GetLineWidth());
@@ -240,6 +255,10 @@ void Track::SetAttLineAttMarker(TrackList* tl)
 //______________________________________________________________________________
 void Track::MakeTrack(Bool_t recurse)
 {
+  // Calculate track representation based on track data and current
+  // settings of the render-style.
+  // If recurse is true, descend into children.
+
   TrackRnrStyle& RS((fRnrStyle != 0) ? *fRnrStyle : TrackRnrStyle::fgDefStyle);
 
   Float_t px = fP.x, py = fP.y, pz = fP.z;  
@@ -394,6 +413,8 @@ make_polyline:
 //______________________________________________________________________________
 TClass* Track::ProjectedClass() const
 {
+  // Virtual from NLTProjectable, return NLTTrack class.
+
   return NLTTrack::Class();
 }
 
@@ -412,6 +433,8 @@ struct cmp_pathmark
 //______________________________________________________________________________
 void Track::SortPathMarksByTime()
 {
+  // Sort registerd pat-marks by time.
+
   std::sort(fPathMarks.begin(), fPathMarks.end(), cmp_pathmark());
 }
 
@@ -420,6 +443,9 @@ void Track::SortPathMarksByTime()
 //______________________________________________________________________________
 void Track::ImportHits()
 {
+  // Import hits with same label as the track.
+  // Uses macro "hits_from_label.C".
+
   Reve::LoadMacro("hits_from_label.C");
   gROOT->ProcessLine(Form("hits_from_label(%d, (Reve::RenderElement*)%p);", 
                          fLabel, this));
@@ -428,6 +454,9 @@ void Track::ImportHits()
 //______________________________________________________________________________
 void Track::ImportClusters()
 {
+  // Import clusters with same label as the track.
+  // Uses macro "clusters_from_label.C".
+
   Reve::LoadMacro("clusters_from_label.C");
   gROOT->ProcessLine(Form("clusters_from_label(%d, (Reve::RenderElement*)%p);", 
                          fLabel, this));
@@ -436,6 +465,9 @@ void Track::ImportClusters()
 //______________________________________________________________________________
 void Track::ImportClustersFromIndex()
 {
+  // Import clusters marked with same reconstructed track index as the track.
+  // Uses macro "clusters_from_index.C".
+
   static const Exc_t eH("Track::ImportClustersFromIndex ");
 
   if (fIndex == kMinInt)
@@ -451,6 +483,9 @@ void Track::ImportClustersFromIndex()
 //______________________________________________________________________________
 void Track::ImportKine()
 {
+  // Import kinematics of the track's label recursively.
+  // Uses macro "kine_tracks.C".
+
   static const Exc_t eH("Track::ImportKine ");
 
   if (fLabel == kMinInt)
@@ -474,6 +509,14 @@ void Track::ImportKine()
 void Track::ImportKineWithArgs(Bool_t importMother, Bool_t importDaugters,
                               Bool_t colorPdg,     Bool_t recurse)
 {
+  // Import kinematics of the track's label. Arguments steer the
+  // import process:
+  //   importMother     import particle with track's label
+  //   importDaugters   import direct daughters of label
+  //   colorPdg         color kinematics by PDG code
+  //   recurse          recursive import of daughters' daughters
+  // Uses macro "kine_tracks.C".
+
   static const Exc_t eH("Track::ImportKineWithArgs ");
 
   if (fLabel == kMinInt)
@@ -497,6 +540,9 @@ void Track::ImportKineWithArgs(Bool_t importMother, Bool_t importDaugters,
 //______________________________________________________________________________
 void Track::PrintKineStack()
 {
+  // Print kinematics pertaining to track's label.
+  // Uses macro "print_kine_from_label.C".
+
   static const Exc_t eH("Track::PrintKineStack ");
 
   if (fLabel == kMinInt)
@@ -517,6 +563,8 @@ void Track::PrintKineStack()
 //______________________________________________________________________________
 void Track::PrintPathMarks()
 {
+  // Print registered path-marks.
+
   static const Exc_t eH("Track::PrintPathMarks ");
 
   printf("Track '%s', number of path marks %d, label %d\n",
@@ -539,12 +587,18 @@ void Track::PrintPathMarks()
 //______________________________________________________________________________
 void Track::CtrlClicked(Reve::Track* track)
 {
+  // Emits "CtrlClicked(Reve::Track*)" signal.
+  // Called from TrackGL on secondary-selection.
+
   Emit("CtrlClicked(Reve::Track*)", (Long_t)track);
 }
 
 //______________________________________________________________________________
 void Track::SetLineStyle(Style_t lstyle)
 {
+  // Set line-style of the track.
+  // The style is propagated to projected tracks.
+
   TAttLine::SetLineStyle(lstyle);
   std::list<NLTProjected*>::iterator pi = fProjectedList.begin();
   while (pi != fProjectedList.end())
@@ -1155,6 +1209,10 @@ void TrackList::SetMarkerSize(Size_t size, RenderElement* el)
 //______________________________________________________________________________
 void TrackList::SelectByPt(Float_t min_pt, Float_t max_pt)
 {
+  // Select visibility of tracks by transverse momentum.
+  // If data-member fRecurse is set, the selection is applied
+  // recursively to all children.
+
   fMinPt = min_pt;
   fMaxPt = max_pt;
 
@@ -1174,6 +1232,8 @@ void TrackList::SelectByPt(Float_t min_pt, Float_t max_pt)
 //______________________________________________________________________________
 void TrackList::SelectByPt(Float_t min_pt, Float_t max_pt, RenderElement* el)
 {
+  // Select visibility of el's children tracks by transverse momentum.
+
   const Float_t minptsq = min_pt*min_pt;
   const Float_t maxptsq = max_pt*max_pt;
 
@@ -1194,6 +1254,10 @@ void TrackList::SelectByPt(Float_t min_pt, Float_t max_pt, RenderElement* el)
 //______________________________________________________________________________
 void TrackList::SelectByP(Float_t min_p, Float_t max_p)
 {
+  // Select visibility of tracks by momentum.
+  // If data-member fRecurse is set, the selection is applied
+  // recursively to all children.
+
   fMinP = min_p;
   fMaxP = max_p;
 
@@ -1213,6 +1277,8 @@ void TrackList::SelectByP(Float_t min_p, Float_t max_p)
 //______________________________________________________________________________
 void TrackList::SelectByP(Float_t min_p, Float_t max_p, RenderElement* el)
 {
+  // Select visibility of el's children tracks by momentum.
+
   const Float_t minpsq = min_p*min_p;
   const Float_t maxpsq = max_p*max_p;
 
@@ -1277,6 +1343,8 @@ Track* TrackList::FindTrackByIndex(Int_t index)
 //______________________________________________________________________________
 void TrackList::ImportHits()
 {
+  // Import hits for all track.
+
   for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
     ((Track*)(*i))->ImportHits();
   }
@@ -1285,6 +1353,8 @@ void TrackList::ImportHits()
 //______________________________________________________________________________
 void TrackList::ImportClusters()
 {
+  // Import clusters for all track.
+
   for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
     ((Track*)(*i))->ImportClusters();
   }
@@ -1295,6 +1365,8 @@ void TrackList::ImportClusters()
 //______________________________________________________________________________
 TClass* TrackList::ProjectedClass() const
 {
+  // Virtual from NLTProjectable, returns NLTTrackList class.
+
   return NLTTrackList::Class();
 }
 
@@ -1307,11 +1379,20 @@ TClass* TrackList::ProjectedClass() const
 //______________________________________________________________________________
 // TrackCounter
 //
+// Provides event-based method for tagging of good / bad (or primary /
+// secondary) tracks. A report can be written into a text file.
+//
+// Track status is toggled by using secondary-selection / ctrl-click
+// functionality of the GL viewer.
+//
+// Some of the functionality is implemented in TrackCounterEditor
+// class.
 
 ClassImp(TrackCounter)
 
 TrackCounter* TrackCounter::fgInstance = 0;
 
+//______________________________________________________________________________
 TrackCounter::TrackCounter(const Text_t* name, const Text_t* title) :
   RenderElement(),
   TNamed(name, title),
@@ -1322,21 +1403,31 @@ TrackCounter::TrackCounter(const Text_t* name, const Text_t* title) :
   fGoodTracks   (0),
   fTrackLists   ()
 {
+  // Constructor.
+  // Connects to global signal "Reve::Track", "CtrlClicked(Reve::Track*)".
+
   if (fgInstance == 0) fgInstance = this;
   TQObject::Connect("Reve::Track", "CtrlClicked(Reve::Track*)",
                    "Reve::TrackCounter", this, "DoTrackAction(Reve::Track*)");
 }
 
+//______________________________________________________________________________
 TrackCounter::~TrackCounter()
 {
+  // Destructor.
+  // Disconnect from the global track signals.
+
   TQObject::Disconnect("Reve::Track", "DoTrackAction(Reve::Track*)");
   if (fgInstance == this) fgInstance = 0;
 }
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void TrackCounter::Reset()
 {
+  // Reset internal track-counters and track-list.
+
   printf("TrackCounter::Reset()\n");
   fAllTracks  = 0;
   fGoodTracks = 0;
@@ -1347,10 +1438,12 @@ void TrackCounter::Reset()
   fTrackLists.Clear("nodelete");
 }
 
+//______________________________________________________________________________
 void TrackCounter::RegisterTracks(TrackList* tlist, Bool_t goodTracks)
 {
-  // printf("TrackCounter::RegisterTracks '%s', %s\n",
-  //   tlist->GetObject()->GetName(), goodTracks ? "good" : "bad");
+  // Register tracks from tlist and tlist itself.
+  // If goodTracks is true, they are considered as primary/good
+  // tracks.
 
   tlist->IncDenyDestroy();
   fTrackLists.Add(tlist);
@@ -1373,11 +1466,17 @@ void TrackCounter::RegisterTracks(TrackList* tlist, Bool_t goodTracks)
   }
 }
 
+//______________________________________________________________________________
 void TrackCounter::DoTrackAction(Track* track)
 {
-  // !!!! No check done if ok.
-  // !!!! Should also override RemoveElementLocal
-  // !!!! But then ... should also store local information if track is ok.
+  // Slot called when track is ctrl-clicked.
+  //
+  // No check is done if track actually belongs to one of the
+  // registered track-lists.
+  //
+  // Probably it would be safer to copy good/bad tracks into special
+  // sub-containers.
+  // In this case one should also override RemoveElementLocal.
 
   switch (fClickAction)
   {
@@ -1419,8 +1518,14 @@ void TrackCounter::DoTrackAction(Track* track)
 
 /**************************************************************************/
 
+//______________________________________________________________________________
 void TrackCounter::OutputEventTracks(FILE* out)
 {
+  // Print good-track summary into a plain-text file by iteration
+  // through all registered track-lists.
+  // State of each track is determined by its line-style, it is
+  // considered a good track if it's line style is solid.
+
   if (out == 0)
   {
     out = stdout;
index eba7bde08b79575637a61f17d7f2d6b7789b5649..cd9bcc968ed3b767eefa42806e290a5fc7fbc786 100644 (file)
@@ -273,15 +273,15 @@ private:
   TrackCounter& operator=(const TrackCounter&); // Not implemented
 
 protected:
-  Int_t fBadLineStyle;
-  Int_t fClickAction;
+  Int_t fBadLineStyle;  // Line-style used for secondary/bad tracks.
+  Int_t fClickAction;   // Action to take when a track is ctrl-clicked.
 
-  Int_t fEventId;
+  Int_t fEventId;       // Current event-id.
 
-  Int_t fAllTracks;
-  Int_t fGoodTracks;
+  Int_t fAllTracks;     // Counter of all tracks.
+  Int_t fGoodTracks;    // Counter of good tracks.
 
-  TList fTrackLists;
+  TList fTrackLists;    // List of TrackLists registered for management.
 
 public:
   TrackCounter(const Text_t* name="TrackCounter", const Text_t* title="");
index 0e425f01e8c67faa670842720477e146ca5bf0b4..a0e63d57a6953721cfc9b86facfd3b2cca367120 100644 (file)
@@ -39,6 +39,7 @@ using namespace Reve;
 // 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)
 
@@ -50,6 +51,8 @@ TriangleSet::TriangleSet(Int_t nv, Int_t nt, Bool_t norms, Bool_t cols) :
   fColor   (2),  fTransp(0),
   fHMTrans ()
 {
+  // Constructor.
+
   fVerts  = new Float_t[3*fNVerts];
   fTrings = new Int_t  [3*fNTrings];
   fTringNorms = (norms) ? new Float_t[3*fNTrings] : 0;
@@ -58,6 +61,8 @@ TriangleSet::TriangleSet(Int_t nv, Int_t nt, Bool_t norms, Bool_t cols) :
 
 TriangleSet::~TriangleSet()
 {
+  // Destructor.
+
   delete [] fVerts;
   delete [] fTrings;
   delete [] fTringNorms;
@@ -68,6 +73,8 @@ TriangleSet::~TriangleSet()
 
 void TriangleSet::GenerateTriangleNormals()
 {
+  // Generate triangle normals via cross product of triangle edges.
+
   if (fTringNorms == 0)  fTringNorms = new Float_t[3*fNTrings];
 
   TVector3 e1, e2, n;
@@ -88,6 +95,8 @@ void TriangleSet::GenerateTriangleNormals()
 
 void TriangleSet::GenerateRandomColors()
 {
+  // Assign random colors to all triangles.
+
   if (fTringCols == 0)  fTringCols = new UChar_t[3*fNTrings];
 
   TRandom r;
@@ -104,6 +113,9 @@ void TriangleSet::GenerateRandomColors()
 void TriangleSet::GenerateZNormalColors(Float_t fac, Int_t min, Int_t max,
                                        Bool_t interp, Bool_t wrap)
 {
+  // Generate triangle colors by the z-component of the normal.
+  // Current palette is taken from gStyle.
+
   if (fTringCols  == 0)  fTringCols = new UChar_t[3*fNTrings];
   if (fTringNorms == 0)  GenerateTriangleNormals();
 
index 59780219d96bace4821b9bfe2edcaab94fe951bf..d63c45e5d1477e08e1bac7e98a919be451b46627 100644 (file)
@@ -82,7 +82,7 @@ public:
 
   static TriangleSet* ReadTrivialFile(const char* file);
 
-  ClassDef(TriangleSet, 0)
+  ClassDef(TriangleSet, 0); // Generic triangle mesh or soup.
 }; // endclass TriangleSet
 
 }
index abb2f8994b9dd18397172273a496777949de162a..00358bd87b4f01e1ae9547c327fa7982cb96d06d 100644 (file)
@@ -21,9 +21,9 @@ private:
   TriangleSetEditor& operator=(const TriangleSetEditor&); // Not implemented
 
 protected:
-  TriangleSet* fM; // fModel dynamic-casted to TriangleSetEditor
+  TriangleSet     *fM;        // Model object.
 
-  ZTransSubEditor *fHMTrans;
+  ZTransSubEditor *fHMTrans;  // Sub-editor of transforamtion matrix.
 
 public:
   TriangleSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
@@ -31,7 +31,7 @@ public:
 
   virtual void SetModel(TObject* obj);
 
-  ClassDef(TriangleSetEditor, 1); // Editor for TriangleSet
+  ClassDef(TriangleSetEditor, 1); // Editor for TriangleSet class.
 }; // endclass TriangleSetEditor
 
 }
index b28d3198321d2690ce070b3e906184c5d8b22390..eec0242c014e9beb5ab0cc7c28509261ef83703d 100644 (file)
@@ -9,6 +9,9 @@
 //______________________________________________________________________
 // TriangleSetGL
 //
+// GL-renderer for TriangleSet class.
+//
+// See also: TGLObject, TGLLogicalShape.
 
 using namespace Reve;
 
@@ -16,16 +19,22 @@ ClassImp(TriangleSetGL)
 
 TriangleSetGL::TriangleSetGL() : TGLObject(), fM(0)
 {
+  // Constructor.
+
   // fDLCache = false; // Disable display list.
 }
 
 TriangleSetGL::~TriangleSetGL()
-{}
+{
+  // Destructor.
+}
 
 /**************************************************************************/
 
 Bool_t TriangleSetGL::SetModel(TObject* obj, const Option_t* /*opt*/)
 {
+  // Set model object.
+
   if(SetModelCheckClass(obj, TriangleSet::Class())) {
     fM = dynamic_cast<TriangleSet*>(obj);
     return kTRUE;
@@ -35,6 +44,8 @@ Bool_t TriangleSetGL::SetModel(TObject* obj, const Option_t* /*opt*/)
 
 void TriangleSetGL::SetBBox()
 {
+  // Set bounding-box from the model.
+
   // !! This ok if master sub-classed from TAttBBox
   SetAxisAlignedBBox(((TriangleSet*)fExternalObj)->AssertBBox());
 }
@@ -43,6 +54,8 @@ void TriangleSetGL::SetBBox()
 
 void TriangleSetGL::DirectDraw(TGLRnrCtx & /*rnrCtx*/) const
 {
+  // Low-level GL rendering.
+
   TriangleSet& TS = *fM;
   Bool_t isScaled = TS.fHMTrans.IsScale();
 
index 7474779b5673432334c9b94201121b6a8ac62dc5..b61afa95b96999f43fcca4e4c555aa955c81a3f1 100644 (file)
@@ -18,7 +18,7 @@ private:
   TriangleSetGL& operator=(const TriangleSetGL&); // Not implemented
 
 protected:
-  TriangleSet* fM; // fModel dynamic-casted to TriangleSetGL
+  TriangleSet* fM; // Model object.
 
   virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
 
@@ -33,7 +33,7 @@ public:
   // virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
   // virtual void ProcessSelection(UInt_t* ptr, TGLViewer*, TGLScene*);
 
-  ClassDef(TriangleSetGL, 0);
+  ClassDef(TriangleSetGL, 0); // GL-renderer for TriangleSet class.
 }; // endclass TriangleSetGL
 
 }
index 66342367ef73ea56a4ad06900cf9dfc5edb6c25b..4c5905c86684e1fcf16b3c34aae04de9bb6a0e85 100644 (file)
@@ -45,7 +45,7 @@ public:
 
   virtual const TGPicture* GetListTreeIcon() { return RenderElement::fgListTreeIcons[1]; }
 
-  ClassDef(Viewer, 0);
+  ClassDef(Viewer, 0); // Reve representation of TGLViewer.
 }; // endclass Viewer
 
 
@@ -70,7 +70,7 @@ public:
 
   void SceneDestructing(Scene* scene);
 
-  ClassDef(ViewerList, 0);
+  ClassDef(ViewerList, 0); // List of Viewers.
 }; // endclass ViewerList
 
 }
index ff1437db0f9f1feb17098556377c379bccaf8ff4..5e1b04fbf8a17ae26285890b3912b1cb2a20a845 100644 (file)
@@ -49,7 +49,7 @@ public:
   void DoEditTrans();
   void DoTransChanged();
 
-  ClassDef(ZTransSubEditor, 0)
+  ClassDef(ZTransSubEditor, 0); // Sub-editor for ZTrans class.
 };
 
 class ZTransEditor : public TGedFrame
@@ -59,10 +59,7 @@ private:
   ZTransEditor& operator=(const ZTransEditor&); // Not implemented
 
 protected:
-  ZTrans* fM; // fModel dynamic-casted to ZTransEditor
-
-  // Declare widgets
-  // TGSomeWidget*   fXYZZ;
+  ZTrans* fM; // Model object.
 
 public:
   ZTransEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
@@ -70,10 +67,7 @@ public:
 
   virtual void SetModel(TObject* obj);
 
-  // Declare callback/slot methods
-  // void DoXYZZ();
-
-  ClassDef(ZTransEditor, 1); // Editor for ZTrans
+  ClassDef(ZTransEditor, 1); // Editor for ZTrans class.
 }; // endclass ZTransEditor
 
 }