ROOT_Application
2.0
C++ Core modules and GUIStock
|
Derive from TH1 will draw the graph. More...
#include <THStock.h>
Public Member Functions | |
THStock () | |
Constructors. More... | |
THStock (const char *name, const char *title, int size) | |
THStock (const char *name, const char *title, ListDataStockBase *ldata) | |
THStock (const THStock &ht) | |
virtual | ~THStock () |
THStock & | operator= (const THStock &ht) |
assignement operator tested ?? needed by dictionary ?? More... | |
virtual void | Copy (TObject &hnew) const |
virtual THStock * | DrawCopy (Option_t *option="") const |
void | SetCommonXAxis (CommonXAxis *new_xaxis) |
called by CanvasStock to set a common axis for all thstock More... | |
CommonXAxis * | GetCommonXAxis () |
void | SetSizeTitle (Float_t new_size) |
Float_t | GetSizeTitle () const |
ListDataStockBase * | GetFirstListData () const |
Get the first inserted ListDataStock, by THistPainterStock, needeed for size should add check. More... | |
ListDataStockBase * | GetListDataStock (std::string fullname) const |
want to retrieve from which pad is the fullname, call by CanvasStock More... | |
unsigned int | GetSizeVectPair () const |
get size of the container More... | |
virtual void | UpdateObjectStock () |
to redefine More... | |
virtual void | Add (ObjectLine *obj_stock) |
call by Factory, specific to drawable line More... | |
virtual void | Add (ListDataStockBase *ldata) |
copy from diff, ok was missing, called by CanvasStock More... | |
double | GetXPadFromBin (int bin) |
Xvalue of the bin center, called by PStockLine to Extrapolate values. More... | |
unsigned int | GetNTHStockToPaint () const |
return the number of object to paint called by CanvasStock, but Why ?? want bool ?? More... | |
void | HideNameListData (std::string fullname, bool toDelete) |
called by CanvasStock More... | |
void | ShowNameListData (std::string fullname) const |
void | SetColor (ListDataStockBase *ldata, Pixel_t color) const |
2 versions one with ldata or with fullname More... | |
void | SetColor (std::string fullname, Pixel_t color) const |
new version with name, canvasStock also More... | |
time_t | GetDateFromBin (Int_t bin) const |
called by ObjectLine need the date from a bin More... | |
Int_t | GetBinFromPixel (Int_t px, Int_t &total_bin) const |
called by ObjectStock, for StatusBar More... | |
time_t | GetDateBinFromPixel (Int_t px, Int_t py, Int_t &bin, Int_t &bin2) const |
return both the date and two bins called only ObjectLine::GetValues More... | |
void | GetObjectExtrema (Double_t &ymin, Double_t &ymax) const |
broadcast the call to all object More... | |
void | AnchorToIndicator (const int &px, const int &py, ObjectLine *obj_line, FactoryObjectStock::EStageDraw kDraw) |
set px, py to the closest indicator point More... | |
Int_t | DistancetoPrimitive (Int_t px, Int_t py, TObject **obj) |
call by THistPainterStock, broadcast call to all objects. More... | |
Int_t | DistancetoPoint (Int_t px, Int_t py, Double_t &yvalue) const |
used by anchor to find a Yvalue is close and anchor to it More... | |
void | PaintObjectStock (const Option_t *option="") |
called from THisPainter when Hparam_sock has been completed More... | |
void | SetObjectStock (Hparam_stock_t &Hparam_stock) const |
set the object, need Hparam_stock here More... | |
ClassDef (THStock, 0) | |
Private Types | |
typedef std::vector< std::pair < ListDataStockBase *, AbstractObjectStock * > >::iterator | it_pair |
typedef for iterators More... | |
typedef std::vector< std::pair < ListDataStockBase *, AbstractObjectStock * > >::const_iterator | cit_pair |
Private Member Functions | |
virtual void | AddPairToVector (ListDataStockBase *ldata) |
create a IndicatorStock and add a new pair More... | |
Private Attributes | |
std::vector< std::pair < ListDataStockBase *, AbstractObjectStock * > > | vect_pair_obj |
for storing pair<ListDataStock,ObjectStock> More... | |
CommonXAxis * | fcommon_xaxis_th |
pointer to the CommonXAxis Constructor and ownership done by CanvasStock More... | |
Float_t | fsize_title |
size depend on the layout, used by THsitPainterStock More... | |
Static Private Attributes | |
static const int | DIST_ANCHOR = 15 |
maybe modifiable later More... | |
Derive from TH1 will draw the graph.
Is responsible to check if the object must be paint or not: if object->ToPAint() not the object, role of controller yet Responsability moved into controller and ObjectStock
New: Group all in a vector of pair <ldata*,abstractobjectstock*> Owns the objectstock, not the listdatastock (stockmanager responsible)
change by default all loop with NoChronologicalAt(), to see later if can be better
|
private |
|
private |
THStock::THStock | ( | ) |
Constructors.
THStock::THStock | ( | const char * | name, |
const char * | title, | ||
int | size | ||
) |
Definition at line 41 of file THStock.cxx.
References fsize_title.
THStock::THStock | ( | const char * | name, |
const char * | title, | ||
ListDataStockBase * | ldata | ||
) |
Definition at line 58 of file THStock.cxx.
References AddPairToVector(), fcommon_xaxis_th, and CommonXAxis::GetNbins().
THStock::THStock | ( | const THStock & | ht | ) |
Definition at line 75 of file THStock.cxx.
|
virtual |
Definition at line 82 of file THStock.cxx.
References fcommon_xaxis_th, and vect_pair_obj.
|
virtual |
call by Factory, specific to drawable line
Definition at line 231 of file THStock.cxx.
References ObjectLine::GetX0(), ObjectLine::GetX1(), ObjectLine::GetY0(), ObjectLine::GetY1(), and vect_pair_obj.
Referenced by CanvasStock::AddListDataStockToMap(), TPadStock::AddToTHStock(), and FactoryObjectStock::CreateObjectStock().
|
inlinevirtual |
copy from diff, ok was missing, called by CanvasStock
Definition at line 128 of file THStock.h.
References AddPairToVector().
|
privatevirtual |
create a IndicatorStock and add a new pair
Add a listdata into vec_pair_obj and creates the object by Factory.
Definition at line 181 of file THStock.cxx.
References FactoryObjectStock::CreateObjectStock(), Indicator::GetIndicator(), ListDataStockBase::GetName(), ListDataStockBase::GetSize(), and vect_pair_obj.
Referenced by Add(), and THStock().
void THStock::AnchorToIndicator | ( | const int & | px, |
const int & | py, | ||
ObjectLine * | obj_line, | ||
FactoryObjectStock::EStageDraw | kDraw | ||
) |
set px, py to the closest indicator point
Anchor to the closest Indicator point.
Called by TPadStock::ExecuteEvent Will look for the closest point and modify the object accordingly ( first last or point ?? ) first or last should be dealed by ?? an option if not better
px | |
py | |
obj_line | |
FactoryObjectStock::EStageDraw |
Definition at line 259 of file THStock.cxx.
References DIST_ANCHOR, DistancetoPoint(), FactoryObjectStock::kBeginDraw, FactoryObjectStock::kEndDraw, ObjectLine::SetY0(), and ObjectLine::SetY1().
Referenced by TPadStock::ExecuteEvent().
THStock::ClassDef | ( | THStock | , |
0 | |||
) |
|
virtual |
Definition at line 99 of file THStock.cxx.
Referenced by operator=().
Int_t THStock::DistancetoPoint | ( | Int_t | px, |
Int_t | py, | ||
Double_t & | yvalue | ||
) | const |
used by anchor to find a Yvalue is close and anchor to it
px | |
py | |
& | yvalue |
Definition at line 632 of file THStock.cxx.
References fcommon_xaxis_th, CommonXAxis::GetXAxis(), and vect_pair_obj.
Referenced by AnchorToIndicator().
Int_t THStock::DistancetoPrimitive | ( | Int_t | px, |
Int_t | py, | ||
TObject ** | obj | ||
) |
call by THistPainterStock, broadcast call to all objects.
override TH1 ??
px | |
py | |
**obj |
Definition at line 581 of file THStock.cxx.
References vect_pair_obj.
|
virtual |
Definition at line 107 of file THStock.cxx.
Int_t THStock::GetBinFromPixel | ( | Int_t | px, |
Int_t & | total_bin | ||
) | const |
called by ObjectStock, for StatusBar
Definition at line 509 of file THStock.cxx.
References fcommon_xaxis_th, and CommonXAxis::GetXAxis().
Referenced by PStockLine::GetValues(), and ObjectLineIndicator::MakeStringForStatusBar().
|
inline |
Definition at line 101 of file THStock.h.
References fcommon_xaxis_th.
Referenced by PStockLine::GetValues().
time_t THStock::GetDateBinFromPixel | ( | Int_t | px, |
Int_t | py, | ||
Int_t & | bin, | ||
Int_t & | bin2 | ||
) | const |
return both the date and two bins called only ObjectLine::GetValues
Definition at line 531 of file THStock.cxx.
References fcommon_xaxis_th, GetDateFromBin(), and CommonXAxis::GetXAxis().
Referenced by ObjectLine::GetValues().
time_t THStock::GetDateFromBin | ( | Int_t | bin | ) | const |
called by ObjectLine need the date from a bin
Definition at line 488 of file THStock.cxx.
References ListDataStock< T, PolicyChronologic >::ChronologicAt(), GetFirstListData(), ListDataStockBase::GetName(), and Utils::Time_tToString().
Referenced by ObjectLineTendance::FinaliseDrawableLine(), GetDateBinFromPixel(), and ObjectLineIndicator::MakeStringForStatusBar().
ListDataStockBase * THStock::GetFirstListData | ( | ) | const |
Get the first inserted ListDataStock, by THistPainterStock, needeed for size should add check.
Definition at line 161 of file THStock.cxx.
References vect_pair_obj.
Referenced by GetDateFromBin().
ListDataStockBase * THStock::GetListDataStock | ( | std::string | shortname | ) | const |
want to retrieve from which pad is the fullname, call by CanvasStock
fullname |
Definition at line 145 of file THStock.cxx.
References ListDataStockBase::GetName(), and vect_pair_obj.
unsigned int THStock::GetNTHStockToPaint | ( | ) | const |
return the number of object to paint called by CanvasStock, but Why ?? want bool ??
Definition at line 340 of file THStock.cxx.
References vect_pair_obj.
Referenced by CanvasStock::CreateNPad(), CanvasStock::HideListData(), and CanvasStock::ShowListData().
void THStock::GetObjectExtrema | ( | Double_t & | ymin, |
Double_t & | ymax | ||
) | const |
broadcast the call to all object
Definition at line 553 of file THStock.cxx.
References vect_pair_obj.
|
inline |
Definition at line 106 of file THStock.h.
References fsize_title.
|
inline |
|
inline |
Xvalue of the bin center, called by PStockLine to Extrapolate values.
Definition at line 136 of file THStock.h.
References fcommon_xaxis_th, and CommonXAxis::GetXAxis().
Referenced by PStockLine::ExtrapolateYPad().
void THStock::HideNameListData | ( | std::string | fullname, |
bool | toDelete | ||
) |
called by CanvasStock
Definition at line 352 of file THStock.cxx.
References vect_pair_obj.
Referenced by CanvasStock::HideListData().
assignement operator tested ?? needed by dictionary ??
Definition at line 132 of file THStock.cxx.
References Copy().
void THStock::PaintObjectStock | ( | const Option_t * | option = "" | ) |
called from THisPainter when Hparam_sock has been completed
Definition at line 686 of file THStock.cxx.
References AbstractObjectStock::Paint(), AbstractObjectStock::ToPaint(), and vect_pair_obj.
void THStock::SetColor | ( | ListDataStockBase * | ldata, |
Pixel_t | color | ||
) | const |
2 versions one with ldata or with fullname
Definition at line 418 of file THStock.cxx.
References ListDataStockBase::GetName(), and vect_pair_obj.
void THStock::SetColor | ( | std::string | fullname, |
Pixel_t | color | ||
) | const |
new version with name, canvasStock also
Definition at line 450 of file THStock.cxx.
References vect_pair_obj.
void THStock::SetCommonXAxis | ( | CommonXAxis * | new_xaxis | ) |
called by CanvasStock to set a common axis for all thstock
Definition at line 123 of file THStock.cxx.
References fcommon_xaxis_th.
Referenced by CanvasStock::AddListDataStockToMap().
void THStock::SetObjectStock | ( | Hparam_stock_t & | Hparam_stock | ) | const |
set the object, need Hparam_stock here
Set values of the object to paint.
New version, do not paint now, need to extract extrema before to call final Paint().
Only call obj->ClearObjectStock() and obj->SetObjectStock() to set new values if needed.
Logic slightly different between ListObjectStock and PStockLine.
Definition at line 720 of file THStock.cxx.
References fcommon_xaxis_th, ListDataStockBase::GetName(), AbstractObjectStock::ToPaint(), and vect_pair_obj.
|
inline |
Definition at line 103 of file THStock.h.
References fsize_title.
Referenced by CanvasStock::AddListDataStockToMap().
void THStock::ShowNameListData | ( | std::string | fullname | ) | const |
Definition at line 393 of file THStock.cxx.
References vect_pair_obj.
Referenced by CanvasStock::ShowListData().
|
virtual |
|
staticprivate |
|
private |
pointer to the CommonXAxis Constructor and ownership done by CanvasStock
Definition at line 75 of file THStock.h.
Referenced by DistancetoPoint(), GetBinFromPixel(), GetCommonXAxis(), GetDateBinFromPixel(), GetXPadFromBin(), SetCommonXAxis(), SetObjectStock(), THStock(), and ~THStock().
|
private |
size depend on the layout, used by THsitPainterStock
Definition at line 78 of file THStock.h.
Referenced by GetSizeTitle(), SetSizeTitle(), and THStock().
|
private |
for storing pair<ListDataStock,ObjectStock>
Definition at line 71 of file THStock.h.
Referenced by Add(), AddPairToVector(), DistancetoPoint(), DistancetoPrimitive(), GetFirstListData(), GetListDataStock(), GetNTHStockToPaint(), GetObjectExtrema(), GetSizeVectPair(), HideNameListData(), PaintObjectStock(), SetColor(), SetObjectStock(), ShowNameListData(), UpdateObjectStock(), and ~THStock().