ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
THStock Class Reference

Derive from TH1 will draw the graph. More...

#include <THStock.h>

Inheritance diagram for THStock:
Inheritance graph
[legend]
Collaboration diagram for THStock:
Collaboration graph
[legend]

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 ()
 
THStockoperator= (const THStock &ht)
 assignement operator tested ?? needed by dictionary ?? More...
 
virtual void Copy (TObject &hnew) const
 
virtual THStockDrawCopy (Option_t *option="") const
 
void SetCommonXAxis (CommonXAxis *new_xaxis)
 called by CanvasStock to set a common axis for all thstock More...
 
CommonXAxisGetCommonXAxis ()
 
void SetSizeTitle (Float_t new_size)
 
Float_t GetSizeTitle () const
 
ListDataStockBaseGetFirstListData () const
 Get the first inserted ListDataStock, by THistPainterStock, needeed for size should add check. More...
 
ListDataStockBaseGetListDataStock (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...
 
CommonXAxisfcommon_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...
 

Detailed Description

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

Definition at line 59 of file THStock.h.

Member Typedef Documentation

typedef std::vector< std::pair<ListDataStockBase*, AbstractObjectStock*> >::const_iterator THStock::cit_pair
private

Definition at line 65 of file THStock.h.

typedef std::vector< std::pair<ListDataStockBase*, AbstractObjectStock*> >::iterator THStock::it_pair
private

typedef for iterators

Definition at line 64 of file THStock.h.

Constructor & Destructor Documentation

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().

Here is the call graph for this function:

THStock::THStock ( const THStock ht)

Definition at line 75 of file THStock.cxx.

THStock::~THStock ( )
virtual

Definition at line 82 of file THStock.cxx.

References fcommon_xaxis_th, and vect_pair_obj.

Member Function Documentation

void THStock::Add ( ObjectLine obj_stock)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void THStock::Add ( ListDataStockBase ldata)
inlinevirtual

copy from diff, ok was missing, called by CanvasStock

Definition at line 128 of file THStock.h.

References AddPairToVector().

Here is the call graph for this function:

void THStock::AddPairToVector ( ListDataStockBase ldata)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
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().

Here is the call graph for this function:

Here is the caller graph for this function:

THStock::ClassDef ( THStock  ,
 
)
void THStock::Copy ( TObject hnew) const
virtual

Definition at line 99 of file THStock.cxx.

Referenced by operator=().

Here is the caller graph for this function:

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

Parameters
px
py
&yvalue

Definition at line 632 of file THStock.cxx.

References fcommon_xaxis_th, CommonXAxis::GetXAxis(), and vect_pair_obj.

Referenced by AnchorToIndicator().

Here is the call graph for this function:

Here is the caller graph for this function:

Int_t THStock::DistancetoPrimitive ( Int_t  px,
Int_t  py,
TObject **  obj 
)

call by THistPainterStock, broadcast call to all objects.


override TH1 ??

Parameters
px
py
**obj
Returns
distance int in pixel

Definition at line 581 of file THStock.cxx.

References vect_pair_obj.

THStock * THStock::DrawCopy ( Option_t *  option = "") const
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().

Here is the call graph for this function:

Here is the caller graph for this function:

CommonXAxis* THStock::GetCommonXAxis ( )
inline

Definition at line 101 of file THStock.h.

References fcommon_xaxis_th.

Referenced by PStockLine::GetValues().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

ListDataStockBase * THStock::GetListDataStock ( std::string  shortname) const

want to retrieve from which pad is the fullname, call by CanvasStock

Parameters
fullname
Returns
ListDataStockBase *

Definition at line 145 of file THStock.cxx.

References ListDataStockBase::GetName(), and vect_pair_obj.

Here is the call graph for this function:

unsigned int THStock::GetNTHStockToPaint ( ) const

return the number of object to paint called by CanvasStock, but Why ?? want bool ??

Returns
nb_paint

Definition at line 340 of file THStock.cxx.

References vect_pair_obj.

Referenced by CanvasStock::CreateNPad(), CanvasStock::HideListData(), and CanvasStock::ShowListData().

Here is the caller graph for this function:

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.

Float_t THStock::GetSizeTitle ( ) const
inline

Definition at line 106 of file THStock.h.

References fsize_title.

unsigned int THStock::GetSizeVectPair ( ) const
inline

get size of the container

Definition at line 121 of file THStock.h.

References vect_pair_obj.

double THStock::GetXPadFromBin ( int  bin)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

THStock & THStock::operator= ( const THStock ht)

assignement operator tested ?? needed by dictionary ??

Definition at line 132 of file THStock.cxx.

References Copy().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the caller graph for this function:

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.

Here is the call graph for this function:

void THStock::SetSizeTitle ( Float_t  new_size)
inline

Definition at line 103 of file THStock.h.

References fsize_title.

Referenced by CanvasStock::AddListDataStockToMap().

Here is the caller graph for this function:

void THStock::ShowNameListData ( std::string  fullname) const

Definition at line 393 of file THStock.cxx.

References vect_pair_obj.

Referenced by CanvasStock::ShowListData().

Here is the caller graph for this function:

void THStock::UpdateObjectStock ( )
virtual

to redefine

Definition at line 293 of file THStock.cxx.

References vect_pair_obj.

Field Documentation

const int THStock::DIST_ANCHOR = 15
staticprivate

maybe modifiable later

Definition at line 68 of file THStock.h.

Referenced by AnchorToIndicator().

CommonXAxis* THStock::fcommon_xaxis_th
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().

Float_t THStock::fsize_title
private

size depend on the layout, used by THsitPainterStock

Definition at line 78 of file THStock.h.

Referenced by GetSizeTitle(), SetSizeTitle(), and THStock().

std::vector< std::pair<ListDataStockBase*, AbstractObjectStock*> > THStock::vect_pair_obj
private

The documentation for this class was generated from the following files: