ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CanvasStock.h
Go to the documentation of this file.
1 
28 #ifndef CANVASSTOCK_H_
29 #define CANVASSTOCK_H_
30 
31 #include <iostream>
32 #include <vector>
33 //#include <map>
34 
35 #include <TCanvas.h>
36 //for TObjLnk
37 #include <TList.h>
38 
39 #include "CommonXAxis.h"
40 #include "THistPainterStock.h"
41 #include "ObjectStock/TPadStock.h"
42 
43 class ListDataStockBase;
44 class THStock;
45 
53 class CanvasStock : public TCanvas {
54 
55  private:
57  typedef std::vector<THStock *>::iterator it_vthstock;
58  typedef std::vector<THStock *>::const_iterator it_c_vthstock;
59 
62 
67  std::vector<THStock*> vecTHStock;
68 
69  // new for CreateNPad(), call THStock::GetNTHstockToPaint, why just bool ??
71  UInt_t GetNPadToPaint() const;
73  void DeleteOneTHStock ( Int_t npad );
74 
75  public:
80  CanvasStock( const char *name, Int_t ww, Int_t wh, Int_t winid );
82  CanvasStock( const char *name, const char *title, Int_t ww, Int_t wh );
83  // Constructor copy, not used
84  //CanvasStock( const CanvasStock & can_st );
86  virtual ~CanvasStock();
87 
89 
91  void UpdateTHStock(); //( int new_size );
92 
98  void SetRangeCommonAxis( Double_t MinPos, Double_t MaxPos );
99 
103  void UpdateCommonAxis ( int new_size );
104 
105 
106  //not sure still working, should..
108 
114  void HideListData ( std::string fullname, Int_t npad, bool toDelete = false );
115 
121  void ShowListData ( std::string fullname, Int_t npad );
122 
128  Int_t AddListDataStockToMap( ListDataStockBase *, Int_t npad = 0 );
129 
130  // new added, need the pad number when UpdateIndicator, here better than in indicator
131  // new and not used !!
132  // unsigned int GetPadNumber( std::string fullname); // CAC40_DAY_SMA_3
133 
135 
136  void CreateNPad();
137 
138  // previous version, with ldata, not used anymore
139  //void SetColor( UInt_t npad, ListDataStockBase *listdata, Pixel_t color );
140  // new version with name, called from Indicator
145  void SetColor ( UInt_t npad, std::string fullname, unsigned long color ); //Pixel_t color
147  void UpdateAllPad();
148 
149  // now TPadStock takes the event, TCanvas base function makes almost nothing
150  // may be util later
151  // virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
153  void PrintVector();
154 
155  //signal selected from TCanvas
157 };
158 
159 #endif /* CANVASSTOCK_H_ */
CanvasStock()
used this constructor ?? may be usefull for test code ?? I/ O need default constructor anyway ...
Definition: CanvasStock.h:78
void SetColor(UInt_t npad, std::string fullname, unsigned long color)
new version with fname, really Needed ?? GetPad ( nb_pad ) from Controller not so good...
std::vector< THStock * >::const_iterator it_c_vthstock
Definition: CanvasStock.h:58
Owns a vector of THStock.
Definition: CanvasStock.h:53
Derive from TH1 will draw the graph.
Definition: THStock.h:59
std::vector< THStock * >::iterator it_vthstock
define typedef for the vector
Definition: CanvasStock.h:57
void DeleteOneTHStock(Int_t npad)
delete a complete Pad
void UpdateAllPad()
group function to update all thstock
virtual ~CanvasStock()
destructor
Definition: CanvasStock.cxx:69
Seems present because of ExecuteEvent not overloaded by CanvasStock CanvasStock contains Pad...
void PrintVector()
for info
Int_t AddListDataStockToMap(ListDataStockBase *, Int_t npad=0)
Add a ListDataStock, decide if new pad is created Add a pointeur to the new ListDataStock now decides...
CommonXAxis * fcommon_xaxis_cs
owns a common axis
Definition: CanvasStock.h:61
void SetRangeCommonAxis(Double_t MinPos, Double_t MaxPos)
interface to CommonXaxis.
ClassDef(CanvasStock, 0)
Derive a specific painter for THStock.
CommonXAxis * GetCommonAxis() const
Definition: CanvasStock.h:88
Abstract base class for the ListDataStock, for storing base pointers in vectors.
Definition: ListDataStock.h:50
UInt_t GetNPadToPaint() const
function to return the number of pad needed
std::vector< THStock * > vecTHStock
store the THStocks.
Definition: CanvasStock.h:67
void CreateNPad()
clean all and recreate all pads, can improve
void HideListData(std::string fullname, Int_t npad, bool toDelete=false)
Used for showing listdatastock indicator.
Define a proper class CommonAxis.
void UpdateCommonAxis(int new_size)
Resize CommonXaxis, increase size of the axis Update the range (bins) of the Axis (fFirst...
void UpdateTHStock()
to redefine
void ShowListData(std::string fullname, Int_t npad)
Used for Hide and Delete, with option.