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 | Protected Member Functions | Protected Attributes
PStockLine Class Reference

#include <ObjectStock.h>

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

Public Member Functions

 PStockLine ()
 
 PStockLine (UInt_t size)
 
 PStockLine (std::string name, unsigned size)
 
virtual ~PStockLine ()
 
virtual std::vector< std::string > MakeStringForStatusBar (int px, int py) const
 create the string for the StatusBar More...
 
virtual unsigned int GetSize () const
 
virtual void Resize (unsigned int new_size)
 
virtual void GetExtrema (double &min, double &max) const
 override the Abstract base class More...
 
virtual void SetValues (UInt_t bin, std::vector< double > values, Double_t xmin, Double_t xmax, time_t date, UInt_t opt_value=0)
 Set the values
. More...
 
virtual void ClearObjectStock ()
 different from Candle/Bar, delete the PstockLine. More...
 
virtual int DistancetoPrimitive (int px, int py, AbstractObjectStock **obj)
 used for selection of object, for const need attention to the pointer More...
 
int DistancetoPoint (int, int py, double &yvalue, int) const
 called by THStock for anchoring. More...
 
virtual void Paint (const Option_t *="")
 Paint the object. More...
 
virtual void SetObjectStock (ListDataStockBase *ldata, CommonXAxis *fcommon_xaxis_th, Hparam_stock_t &Hparam_stock)
 used for from the listdata More...
 
 ClassDef (PStockLine, 1)
 
- Public Member Functions inherited from IndicatorObjectStock
 IndicatorObjectStock ()
 
 IndicatorObjectStock (std::string name)
 
virtual ~IndicatorObjectStock ()
 
virtual std::string GetNameObject () const
 
virtual void SetNameObject (std::string &new_name)
 
virtual void AddToVecObject (AbstractObjectStock *)
 for all indicators, size and if update need to resize More...
 
virtual void SetLineColorObject (Color_t lcolor)
 called by THStock::SetColor More...
 
- Public Member Functions inherited from AbstractObjectStock
 AbstractObjectStock ()
 default constructor More...
 
virtual ~AbstractObjectStock ()
 virtual default destructor, needed More...
 
virtual THStockGetParent () const
 public access to parent THStock More...
 
virtual void SetParent (THStock *thstock)
 
virtual void SetToPaint (bool k)
 Public access to kPaint. More...
 
virtual bool ToPaint () const
 
virtual void SetValues (unsigned int bin, std::vector< double > values, double xmin, double ymax, time_t date, unsigned int opt_value=0)=0
 more general call for setting the values, even ObjectLine ?? no use/need but maybe if protected probelm compilation (private inherintence??) More...
 
 ClassDef (AbstractObjectStock, 1)
 

Protected Member Functions

float ExtrapolateYPad (int px, int bin0, int bin1, float x0, float x1) const
 
std::vector< float > GetValues (int px, int py, time_t &date) const
 protected version, used by MakeStringForStatusBar difficult to extrapolate..., need optional bin2 More...
 
- Protected Member Functions inherited from IndicatorObjectStock
void ComputeBinRange (ListDataStockBase *ldata, CommonXAxis *fcommon_xaxis_th, Hparam_stock_t &Hparam_stock, unsigned int &xfirst, unsigned int &xlast, int &shift_left)
 set up bin first/ last. More...
 

Protected Attributes

std::vector< double > plvalues
 
std::vector< double > fx
 x coordinates, middle of the bin for painting More...
 
std::vector< time_t > dates
 easy if date is here, still extrapolate data More...
 
- Protected Attributes inherited from IndicatorObjectStock
std::string name_indic
 add a name to the base class
convenient to get a indicator, can retrieve from the name... More...
 
- Protected Attributes inherited from AbstractObjectStock
THStockfParentTHStock
 
bool kPaint
 set to true if the object need be draw or not depend on common_xaxis and user input ( slider ) used by SetObject as well, good, efficient More...
 

Detailed Description

Definition at line 140 of file ObjectStock.h.

Constructor & Destructor Documentation

PStockLine::PStockLine ( )
inline

Definition at line 158 of file ObjectStock.h.

PStockLine::PStockLine ( UInt_t  size)

Definition at line 409 of file ObjectStock.cxx.

References fx, and plvalues.

PStockLine::PStockLine ( std::string  name,
unsigned  size 
)
virtual PStockLine::~PStockLine ( )
inlinevirtual

Definition at line 164 of file ObjectStock.h.

Member Function Documentation

PStockLine::ClassDef ( PStockLine  ,
 
)
void PStockLine::ClearObjectStock ( )
virtual

different from Candle/Bar, delete the PstockLine.


overload the base function

Reimplemented from IndicatorObjectStock.

Definition at line 586 of file ObjectStock.cxx.

References fx, and plvalues.

int PStockLine::DistancetoPoint ( int  ,
int  ,
double &  ,
int  bin 
) const
virtual

called by THStock for anchoring.


keep main idea from ROOT, add optional bin if provides faster access

Implemented only for Indicator

Parameters
pxin pixel
py
value,updatethe new value
bin
Returns
minimum distance to the closest point

Implements AbstractObjectStock.

Definition at line 639 of file ObjectStock.cxx.

References plvalues.

int PStockLine::DistancetoPrimitive ( int  ,
int  ,
AbstractObjectStock **   
)
virtual

used for selection of object, for const need attention to the pointer

Implements AbstractObjectStock.

Definition at line 604 of file ObjectStock.cxx.

References fx, and plvalues.

float PStockLine::ExtrapolateYPad ( int  px,
int  bin0,
int  bin1,
float  x0,
float  x1 
) const
protected

Definition at line 439 of file ObjectStock.cxx.

References AbstractObjectStock::fParentTHStock, and THStock::GetXPadFromBin().

Referenced by GetValues().

Here is the call graph for this function:

Here is the caller graph for this function:

void PStockLine::GetExtrema ( double &  min,
double &  max 
) const
virtual

override the Abstract base class

Implements AbstractObjectStock.

Definition at line 526 of file ObjectStock.cxx.

References plvalues.

virtual unsigned int PStockLine::GetSize ( ) const
inlinevirtual

Reimplemented from AbstractObjectStock.

Definition at line 168 of file ObjectStock.h.

References plvalues.

std::vector< float > PStockLine::GetValues ( int  px,
int  py,
time_t &  date 
) const
protected

protected version, used by MakeStringForStatusBar difficult to extrapolate..., need optional bin2

Definition at line 458 of file ObjectStock.cxx.

References dates, ExtrapolateYPad(), AbstractObjectStock::fParentTHStock, THStock::GetBinFromPixel(), THStock::GetCommonXAxis(), CommonXAxis::GetNbins(), CommonXAxis::GetShift(), plvalues, and values.

Referenced by MakeStringForStatusBar().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > PStockLine::MakeStringForStatusBar ( int  ,
int   
) const
virtual

create the string for the StatusBar

Reimplemented from IndicatorObjectStock.

Definition at line 500 of file ObjectStock.cxx.

References IndicatorObjectStock::GetNameObject(), GetValues(), Utils::Time_tToString(), and values.

Here is the call graph for this function:

void PStockLine::Paint ( const Option_t *  = "")
virtual

Paint the object.

Paint everything which is set by SetObjectStock.

Caller of this function is THStock::PaintObjectStock() It will check if the object need to be painted

Parameters
Option_t

Implements AbstractObjectStock.

Definition at line 658 of file ObjectStock.cxx.

References fx, plvalues, and AbstractObjectStock::ToPaint().

Here is the call graph for this function:

void PStockLine::Resize ( unsigned int  new_size)
virtual

Reimplemented from AbstractObjectStock.

Definition at line 570 of file ObjectStock.cxx.

References fx, and plvalues.

void PStockLine::SetObjectStock ( ListDataStockBase ,
CommonXAxis ,
Hparam_stock_t  
)
virtual

used for from the listdata

Reimplemented from AbstractObjectStock.

Definition at line 687 of file ObjectStock.cxx.

References IndicatorObjectStock::ComputeBinRange(), DataStock::GetDate(), ListDataStockBase::GetSize(), DataStock::GetValues(), CommonXAxis::GetXAxis(), ListDataStockBase::NoChronologicAt(), SetValues(), and values.

Here is the call graph for this function:

void PStockLine::SetValues ( UInt_t  bin,
std::vector< double >  values,
Double_t  xmin,
Double_t  xmax,
time_t  date,
UInt_t  opt_value = 0 
)
virtual

Set the values
.

Contrarely to Candle and Bar, ToPaint is not used.
Every time recreate all data points which need to be printed.

Definition at line 555 of file ObjectStock.cxx.

References dates, fx, and plvalues.

Referenced by SetObjectStock().

Here is the caller graph for this function:

Field Documentation

std::vector<time_t> PStockLine::dates
protected

easy if date is here, still extrapolate data

Definition at line 147 of file ObjectStock.h.

Referenced by GetValues(), and SetValues().

std::vector<double> PStockLine::fx
protected

x coordinates, middle of the bin for painting

Definition at line 145 of file ObjectStock.h.

Referenced by ClearObjectStock(), DistancetoPrimitive(), Paint(), PStockLine(), Resize(), and SetValues().

std::vector<double> PStockLine::plvalues
protected

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