00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TParallelCoord
00013 #define ROOT_TParallelCoord
00014
00015 #ifndef ROOT_TAttLine
00016 #include "TAttLine.h"
00017 #endif
00018 #ifndef ROOT_TNamed
00019 #include "TNamed.h"
00020 #endif
00021
00022 class TTree;
00023 class TPaveText;
00024 class TEntryList;
00025 class TParallelCoordSelect;
00026 class TParallelCoordVar;
00027 class TParallelCoordRange;
00028 class TList;
00029 class TGaxis;
00030 class TSelectorDraw;
00031
00032 class TParallelCoord : public TNamed {
00033 public:
00034 enum {
00035 kVertDisplay =BIT(14),
00036 kCurveDisplay =BIT(15),
00037 kPaintEntries =BIT(16),
00038 kLiveUpdate =BIT(17),
00039 kGlobalScale =BIT(19),
00040 kCandleChart =BIT(20),
00041 kGlobalLogScale =BIT(21)
00042 };
00043
00044 private:
00045 UInt_t fNvar;
00046 Long64_t fCurrentFirst;
00047 Long64_t fCurrentN;
00048 Long64_t fNentries;
00049 Int_t fDotsSpacing;
00050 Color_t fLineColor;
00051 Width_t fLineWidth;
00052 Int_t fWeightCut;
00053 TEntryList *fCurrentEntries;
00054 TEntryList *fInitEntries;
00055 TTree *fTree;
00056 TString fTreeName;
00057 TString fTreeFileName;
00058 TList *fVarList;
00059 TList *fSelectList;
00060 TParallelCoordSelect* fCurrentSelection;
00061 TGaxis *fCandleAxis;
00062
00063 void Init();
00064 void PaintEntries(TParallelCoordSelect* sel=NULL);
00065 void SetAxesPosition();
00066
00067 public:
00068 TParallelCoord();
00069 TParallelCoord(Long64_t nentries);
00070 TParallelCoord(TTree* tree, Long64_t nentries);
00071 ~TParallelCoord();
00072
00073 void AddVariable(Double_t* val, const char* title="");
00074 void AddVariable(const char* varexp);
00075 void AddSelection(const char* title);
00076 void ApplySelectionToTree();
00077 static void BuildParallelCoord(TSelectorDraw* selector, Bool_t candle);
00078 void CleanUpSelections(TParallelCoordRange* range);
00079 void RemoveVariable(TParallelCoordVar* var);
00080 TParallelCoordVar* RemoveVariable(const char* var);
00081 void DeleteSelection(TParallelCoordSelect* sel);
00082 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00083 virtual void Draw(Option_t* options="");
00084 virtual void ExecuteEvent(Int_t entry, Int_t px, Int_t py);
00085 Bool_t GetCandleChart() {return TestBit(kCandleChart);}
00086 Long64_t GetCurrentFirst() {return fCurrentFirst;}
00087 Long64_t GetCurrentN() {return fCurrentN;}
00088 TParallelCoordSelect* GetCurrentSelection();
00089 Bool_t GetCurveDisplay() const {return TestBit(kCurveDisplay);}
00090 Int_t GetDotsSpacing() const {return fDotsSpacing;}
00091 TEntryList *GetEntryList(Bool_t sel=kTRUE);
00092 Double_t GetGlobalMin();
00093 Double_t GetGlobalMax();
00094 Bool_t GetGlobalScale() {return TestBit(kGlobalScale);}
00095 Bool_t GetGlobalLogScale() {return TestBit(kGlobalLogScale);}
00096 Color_t GetLineColor() {return fLineColor;}
00097 Width_t GetLineWidth() {return fLineWidth;}
00098 Int_t GetNbins();
00099 UInt_t GetNvar() {return fNvar;}
00100 Long64_t GetNentries() {return fNentries;}
00101 TList *GetSelectList() {return fSelectList;}
00102 TParallelCoordSelect* GetSelection(const char* title);
00103 TTree *GetTree();
00104 Double_t *GetVariable(const char* var);
00105 Double_t *GetVariable(Int_t i);
00106 TList *GetVarList() {return fVarList;}
00107 Bool_t GetVertDisplay() const {return TestBit(kVertDisplay);}
00108 Int_t GetWeightCut() const {return fWeightCut;};
00109 virtual void Paint(Option_t* options="");
00110 void ResetTree();
00111 void SaveEntryLists(const char* filename="", Bool_t overwrite=kFALSE);
00112 void SavePrimitive(ostream & out,Option_t *options);
00113 void SaveTree(const char* filename="", Bool_t overwrite=kFALSE);
00114 void SetAxisHistogramBinning(Int_t n=100);
00115 void SetAxisHistogramHeight(Double_t h=0.5);
00116 void SetAxisHistogramLineWidth(Int_t lw=2);
00117 void SetCandleChart(Bool_t can);
00118 virtual void SetCurveDisplay(Bool_t curve=1) {SetBit(kCurveDisplay,curve);}
00119 void SetCurrentEntries(TEntryList* entries) {fCurrentEntries = entries;}
00120 void SetCurrentFirst(Long64_t);
00121 void SetCurrentN(Long64_t);
00122 TParallelCoordSelect* SetCurrentSelection(const char* title);
00123 void SetCurrentSelection(TParallelCoordSelect* sel);
00124 void SetDotsSpacing(Int_t s=0);
00125 static void SetEntryList(TParallelCoord* para, TEntryList* enlist);
00126 void SetGlobalScale(Bool_t gl);
00127 void SetGlobalLogScale(Bool_t);
00128 void SetGlobalMin(Double_t min);
00129 void SetGlobalMax(Double_t max);
00130 void SetInitEntries(TEntryList* entries) {fInitEntries = entries;}
00131 void SetLineColor(Color_t col) {fLineColor = col;}
00132 void SetLineWidth(Width_t wid) {fLineWidth = wid;}
00133 void SetLiveRangesUpdate(Bool_t);
00134 void SetNentries(Long64_t n) {fNentries = n;}
00135 void SetTree(TTree* tree) {fTree = tree;}
00136 void SetVertDisplay(Bool_t vert=kTRUE);
00137 void SetWeightCut(Int_t w=0) {fWeightCut = w;}
00138 void UnzoomAll();
00139
00140 ClassDef(TParallelCoord,1);
00141 };
00142
00143 #endif