ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
THistPainterStock.h
Go to the documentation of this file.
1 
7 //come from
8 //http://www-pnp.physics.ox.ac.uk/~rodriges/HistPainter/
9 //and copy of ROOT THistPainter
10 
11 #ifndef THISTPAINTERSTOCK_H
12 #define THISTPAINTERSTOCK_H
13 
14 #include <THistPainter.h>
15 #include <iostream>
16 
17 #ifndef ROOT_TVirtualHistPainter
18 #include "TVirtualHistPainter.h"
19 #endif
20 #ifndef ROOT_TString
21 #include "TString.h"
22 #endif
23 
24 //for textsize, could be in *cxx like THistPainter
25 #include <TPaveText.h>
26 #include <TLatex.h>
27 
28 //from doc
29 //When the canvas has to be redrawn, the Paint function of each objects in the pad is called.
30 //In case of histograms, TH1::Paint invokes directly THistPainter::Paint.
31 //
32 // Yes, TCanvasStock::Update()
33 // => THistPainterStock Constructor
34 // => THistPainterStcok::Paint()
35 
36 //Can be used in two ways:
37 // 1. derive HistPainterStock from HistPainter, keep all default values, choosen version until now
38 // 2. derive .. directly from TVirtualHistPainter, need to rewrite a lot more, (more flexible ?)
39 // not sure because I can overload all functions I want, like reading options...
40 // deriving allow to set up by default all members not used
41 
42 //In fact quite general and flexible
43 // can use it only for drawing candle DataCSV data
44 // could keep for default painting for all indicators, need more work, more function to rewrite
45 // should implement for e.g. 30-70 for particular indicator, can be added as function in normal Paint, but more difficult for feedback (pass the limit ??),
46 // much easier if different Paint, need structure in the code ( maybe a kind of new Hparam ?? )
47 //
48 // Object in separate class, here paint axis, frame, title..
49 
50 /*
51  * Bug with axis solved, 20/01/11
52  * SetBinLabel called only by PaintCandle, so PaintAxis should be done after ! Seems logic, label assigned only to StockCSV
53  * (what about StockdCSV ??)
54  *
55  * Of course should be done in PaintAxis(), need PaintAxis to set the new label, need a coherent way to design axis, graph and shift !!!
56  * Could update the axis, e.g., shift graph to future
57  *
58  */
59 
83 {
84 public:
86  virtual ~THistPainterStock();
87 
88  //main function to be overloaded if want to change the Hoption and Hparam
89  virtual Int_t MakeChopt( Option_t *choptin );
90  virtual void PaintFrame();
91  virtual void RecalculateRange();
92 
96  virtual Int_t PaintInit();
97 
98  //for adjusting FontSize
99  virtual void PaintTitle();
100  virtual void PaintAxis( Bool_t drawGridOnly = kFALSE );
101 
102  //see text in cxx, for drawing without creating object TCandle
103  virtual void Paint(Option_t* option="");
104 
105  //Separate Label of the comon axis with PaintCandle
106  //if separate should deal with common_axis or not
107  void SetLabelXAxis();
108 
109  // if present is called, will call THStock::DtP
110  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
111  //{std::cout << "THistPainterStok::DistancetoPrimitive do nothing " << std::endl;}
112 
113  void PrintInfo();
114 
116 };
117 
118 #endif /* THISTPAINTERSTOCK_H */
virtual void RecalculateRange()
ClassDef(THistPainterStock, 1)
virtual void PaintAxis(Bool_t drawGridOnly=kFALSE)
virtual Int_t MakeChopt(Option_t *choptin)
virtual void Paint(Option_t *option="")
virtual Int_t PaintInit()
setup minimum/ maximum of the frame Called by Paint()
virtual void PaintTitle()
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check distance to TAxis, broadcast to THStock, and select the object.
virtual void PaintFrame()