ROOT logo
// Author: Roel Aaij   21/07/2007

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TTreeTableInterface
#define ROOT_TTreeTableInterface

#ifndef ROOT_TVirtualTableInterface
#include "TVirtualTableInterface.h"
#endif

class TTree;
class TObjArray;
class TTreeFormula;
class TTreeFormulaManager;
class TSelectorDraw;
class TEntryList;
class TList;


class TTreeTableInterface : public TVirtualTableInterface {

private:
   TTree               *fTree;       // Data in a TTree
   TList               *fFormulas;   // Array of TTreeFormulas to display values
   Long64_t             fEntry;      // Present entry number in fTree.
   Long64_t             fNEntries;   // Number of entries in the tree.
   Long64_t             fFirstEntry; // First entry.
   TTreeFormulaManager *fManager;    // Coordinator for the formulas.
   TTreeFormula        *fSelect;     // Selection condition
   TSelectorDraw       *fSelector;   // Selector
   TList               *fInput;      // Used for fSelector.
   Bool_t               fForceDim;   // Force dimension.
   TEntryList          *fEntries;    // Currently active entries
   UInt_t               fNRows;      // Amount of rows in the data
   UInt_t               fNColumns;   // Amount of columns in the data

   void SetVariablesExpression(const char *varexp);
   void SyncFormulas();
   void InitEntries();

protected:

public:
   TTreeTableInterface(TTree *tree = 0, const char *varexp = 0,
                       const char *selection = 0, Option_t *option = 0,
                       Long64_t nentries = 0, Long64_t firstentry = 0);
   virtual ~TTreeTableInterface();

   virtual Double_t    GetValue(UInt_t row, UInt_t column);
   virtual const char *GetValueAsString(UInt_t row, UInt_t column);
   virtual const char *GetRowHeader(UInt_t row);
   virtual const char *GetColumnHeader(UInt_t column);
   virtual UInt_t      GetNRows();
   virtual UInt_t      GetNColumns();
   virtual TEntryList *GetEntryList() { return fEntries; }

   virtual void AddColumn(const char *expression, UInt_t position);
   virtual void AddColumn(TTreeFormula *formula, UInt_t position);
   virtual void RemoveColumn(UInt_t position);
   virtual void SetFormula(TTreeFormula *formula, UInt_t position);
   virtual void SetSelection(const char *selection);
   virtual void SetEntryList(TEntryList *entrylist = 0);

   ClassDef(TTreeTableInterface, 0) // Interface to data in a TTree
};

#endif
 TTreeTableInterface.h:1
 TTreeTableInterface.h:2
 TTreeTableInterface.h:3
 TTreeTableInterface.h:4
 TTreeTableInterface.h:5
 TTreeTableInterface.h:6
 TTreeTableInterface.h:7
 TTreeTableInterface.h:8
 TTreeTableInterface.h:9
 TTreeTableInterface.h:10
 TTreeTableInterface.h:11
 TTreeTableInterface.h:12
 TTreeTableInterface.h:13
 TTreeTableInterface.h:14
 TTreeTableInterface.h:15
 TTreeTableInterface.h:16
 TTreeTableInterface.h:17
 TTreeTableInterface.h:18
 TTreeTableInterface.h:19
 TTreeTableInterface.h:20
 TTreeTableInterface.h:21
 TTreeTableInterface.h:22
 TTreeTableInterface.h:23
 TTreeTableInterface.h:24
 TTreeTableInterface.h:25
 TTreeTableInterface.h:26
 TTreeTableInterface.h:27
 TTreeTableInterface.h:28
 TTreeTableInterface.h:29
 TTreeTableInterface.h:30
 TTreeTableInterface.h:31
 TTreeTableInterface.h:32
 TTreeTableInterface.h:33
 TTreeTableInterface.h:34
 TTreeTableInterface.h:35
 TTreeTableInterface.h:36
 TTreeTableInterface.h:37
 TTreeTableInterface.h:38
 TTreeTableInterface.h:39
 TTreeTableInterface.h:40
 TTreeTableInterface.h:41
 TTreeTableInterface.h:42
 TTreeTableInterface.h:43
 TTreeTableInterface.h:44
 TTreeTableInterface.h:45
 TTreeTableInterface.h:46
 TTreeTableInterface.h:47
 TTreeTableInterface.h:48
 TTreeTableInterface.h:49
 TTreeTableInterface.h:50
 TTreeTableInterface.h:51
 TTreeTableInterface.h:52
 TTreeTableInterface.h:53
 TTreeTableInterface.h:54
 TTreeTableInterface.h:55
 TTreeTableInterface.h:56
 TTreeTableInterface.h:57
 TTreeTableInterface.h:58
 TTreeTableInterface.h:59
 TTreeTableInterface.h:60
 TTreeTableInterface.h:61
 TTreeTableInterface.h:62
 TTreeTableInterface.h:63
 TTreeTableInterface.h:64
 TTreeTableInterface.h:65
 TTreeTableInterface.h:66
 TTreeTableInterface.h:67
 TTreeTableInterface.h:68
 TTreeTableInterface.h:69
 TTreeTableInterface.h:70
 TTreeTableInterface.h:71
 TTreeTableInterface.h:72
 TTreeTableInterface.h:73
 TTreeTableInterface.h:74