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
CanvasStock Class Reference

Owns a vector of THStock. More...

#include <CanvasStock.h>

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

Public Member Functions

 CanvasStock ()
 used this constructor ?? may be usefull for test code ?? I/ O need default constructor anyway More...
 
 CanvasStock (const char *name, Int_t ww, Int_t wh, Int_t winid)
 call by THStockFrame, specific call for EmbeddedCanvas ( winid ), used by GUI More...
 
 CanvasStock (const char *name, const char *title, Int_t ww, Int_t wh)
 make a constructor for direct use ( without GUI) More...
 
virtual ~CanvasStock ()
 destructor More...
 
CommonXAxisGetCommonAxis () const
 
void UpdateTHStock ()
 to redefine More...
 
void SetRangeCommonAxis (Double_t MinPos, Double_t MaxPos)
 interface to CommonXaxis. More...
 
void UpdateCommonAxis (int new_size)
 Resize CommonXaxis, increase size of the axis Update the range (bins) of the Axis (fFirst,fLast) if needed after an update. More...
 
void HideListData (std::string fullname, Int_t npad, bool toDelete=false)
 Used for showing listdatastock indicator. More...
 
void ShowListData (std::string fullname, Int_t npad)
 Used for Hide and Delete, with option. More...
 
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 here which pad to paint, if forcepad is zero name of listdata maybe wrong, taken by default from the indicator. More...
 
void CreateNPad ()
 clean all and recreate all pads, can improve More...
 
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, GUI more dependent More...
 
void UpdateAllPad ()
 group function to update all thstock More...
 
void PrintVector ()
 for info More...
 
 ClassDef (CanvasStock, 0)
 

Private Types

typedef std::vector< THStock * >
::iterator 
it_vthstock
 define typedef for the vector More...
 
typedef std::vector< THStock * >
::const_iterator 
it_c_vthstock
 

Private Member Functions

UInt_t GetNPadToPaint () const
 function to return the number of pad needed More...
 
void DeleteOneTHStock (Int_t npad)
 delete a complete Pad More...
 

Private Attributes

CommonXAxisfcommon_xaxis_cs
 owns a common axis More...
 
std::vector< THStock * > vecTHStock
 store the THStocks. More...
 

Detailed Description

Owns a vector of THStock.


but do not store any information, pointer on what is draw and in which pad.

Associated to THistPainterStock

Definition at line 53 of file CanvasStock.h.

Member Typedef Documentation

typedef std::vector<THStock *>::const_iterator CanvasStock::it_c_vthstock
private

Definition at line 58 of file CanvasStock.h.

typedef std::vector<THStock *>::iterator CanvasStock::it_vthstock
private

define typedef for the vector

Definition at line 57 of file CanvasStock.h.

Constructor & Destructor Documentation

CanvasStock::CanvasStock ( )
inline

used this constructor ?? may be usefull for test code ?? I/ O need default constructor anyway

Definition at line 78 of file CanvasStock.h.

References fcommon_xaxis_cs.

CanvasStock::CanvasStock ( const char *  name,
Int_t  ww,
Int_t  wh,
Int_t  winid 
)

call by THStockFrame, specific call for EmbeddedCanvas ( winid ), used by GUI

CanvasStock::CanvasStock ( const char *  name,
const char *  title,
Int_t  ww,
Int_t  wh 
)

make a constructor for direct use ( without GUI)

Definition at line 39 of file CanvasStock.cxx.

References fcommon_xaxis_cs.

CanvasStock::~CanvasStock ( )
virtual

destructor

Definition at line 69 of file CanvasStock.cxx.

References fcommon_xaxis_cs, and vecTHStock.

Member Function Documentation

Int_t CanvasStock::AddListDataStockToMap ( ListDataStockBase p_listdata,
Int_t  npad = 0 
)

Add a ListDataStock, decide if new pad is created Add a pointeur to the new ListDataStock now decides here which pad to paint, if forcepad is zero name of listdata maybe wrong, taken by default from the indicator.

std::cout << "not the first pad, setcommon_axis anyway " << std::endl;

Definition at line 344 of file CanvasStock.cxx.

References THStock::Add(), CreateNPad(), fcommon_xaxis_cs, ShortName::GetIndicator(), ListDataStockBase::GetName(), ListDataStockBase::GetSize(), CommonXAxis::SetCommonXAxis(), THStock::SetCommonXAxis(), THStock::SetSizeTitle(), Utils::splitline(), and vecTHStock.

Referenced by ControllerIndicatorTHStock::AddData().

Here is the call graph for this function:

Here is the caller graph for this function:

CanvasStock::ClassDef ( CanvasStock  ,
 
)
void CanvasStock::CreateNPad ( )

clean all and recreate all pads, can improve

new added, first test, would avoid pad number in indicatorlabel Return the pad number from the name, a priori only one with the same name in each thstock.

Can we retrieve the wanted data ??

Parameters
fullname
Returns

Definition at line 606 of file CanvasStock.cxx.

References GetNPadToPaint(), THStock::GetNTHStockToPaint(), PrintVector(), and vecTHStock.

Referenced by AddListDataStockToMap(), HideListData(), and ShowListData().

Here is the call graph for this function:

Here is the caller graph for this function:

void CanvasStock::DeleteOneTHStock ( Int_t  npad)
private

delete a complete Pad

Todo:
stupid loop here !!

Definition at line 126 of file CanvasStock.cxx.

References vecTHStock.

Referenced by HideListData().

Here is the caller graph for this function:

CommonXAxis* CanvasStock::GetCommonAxis ( ) const
inline

Definition at line 88 of file CanvasStock.h.

References fcommon_xaxis_cs.

Referenced by THStockFrame::HandleButton().

Here is the caller graph for this function:

UInt_t CanvasStock::GetNPadToPaint ( ) const
private

function to return the number of pad needed

Definition at line 102 of file CanvasStock.cxx.

References vecTHStock.

Referenced by CreateNPad().

Here is the caller graph for this function:

void CanvasStock::HideListData ( std::string  fullname,
Int_t  npad,
bool  toDelete = false 
)

Used for showing listdatastock indicator.

Parameters
fullname: of listdata
npad
bAll
toDelete

Definition at line 294 of file CanvasStock.cxx.

References CreateNPad(), DeleteOneTHStock(), THStock::GetNTHStockToPaint(), THStock::HideNameListData(), and vecTHStock.

Referenced by ControllerIndicatorTHStock::UpdateIndicator().

Here is the call graph for this function:

Here is the caller graph for this function:

void CanvasStock::PrintVector ( )

for info

Definition at line 828 of file CanvasStock.cxx.

References vecTHStock.

Referenced by CreateNPad().

Here is the caller graph for this function:

void CanvasStock::SetColor ( UInt_t  npad,
std::string  fullname,
unsigned long  color 
)

new version with fname, really Needed ?? GetPad ( nb_pad ) from Controller not so good, GUI more dependent

Definition at line 761 of file CanvasStock.cxx.

References vecTHStock.

Referenced by ControllerIndicatorTHStock::ModifyColorIndic().

Here is the caller graph for this function:

void CanvasStock::SetRangeCommonAxis ( Double_t  MinPos,
Double_t  MaxPos 
)

interface to CommonXaxis.


called by THStockFrame for slider. set Range with integer approximated to porcent. update indirectly fFirst and fLast of TAxis

Definition at line 203 of file CanvasStock.cxx.

References fcommon_xaxis_cs, CommonXAxis::GetNbins(), and CommonXAxis::GetXAxis().

Referenced by THStockFrame::DoSlider(), and THStockFrame::HandleButton().

Here is the call graph for this function:

Here is the caller graph for this function:

void CanvasStock::ShowListData ( std::string  fullname,
Int_t  npad 
)

Used for Hide and Delete, with option.

Parameters
fullname
npad

Definition at line 267 of file CanvasStock.cxx.

References CreateNPad(), THStock::GetNTHStockToPaint(), THStock::ShowNameListData(), and vecTHStock.

Referenced by ControllerIndicatorTHStock::UpdateIndicator().

Here is the call graph for this function:

Here is the caller graph for this function:

void CanvasStock::UpdateAllPad ( )

group function to update all thstock

Definition at line 786 of file CanvasStock.cxx.

Referenced by UpdateTHStock().

Here is the caller graph for this function:

void CanvasStock::UpdateCommonAxis ( int  new_size)

Resize CommonXaxis, increase size of the axis Update the range (bins) of the Axis (fFirst,fLast) if needed after an update.

Definition at line 234 of file CanvasStock.cxx.

References fcommon_xaxis_cs, CommonXAxis::GetFirst(), CommonXAxis::GetLast(), CommonXAxis::GetNbins(), and CommonXAxis::GetXAxis().

Referenced by THStockFrame::HandleButton(), and UpdateTHStock().

Here is the call graph for this function:

Here is the caller graph for this function:

void CanvasStock::UpdateTHStock ( )

to redefine

new version, regroup all steps, maybe easier to check, optimize update all THStock

  1. Check if update of CommonXAxis, use by default the first in vector, may need check or new_size in parameter
  2. THStock::UpdateObjectStock, only increase the size to be correct ! bad name ! Can include in the test new size
  3. UpdateAllPad : Call modified and update on all pad, really needed ?
  4. Update() : call THistPainterStock

Definition at line 159 of file CanvasStock.cxx.

References fcommon_xaxis_cs, CommonXAxis::GetNbins(), UpdateAllPad(), UpdateCommonAxis(), and vecTHStock.

Referenced by THStockFrame::DoSlider(), THStockFrame::HandleButton(), and ControllerIndicatorTHStock::UpdateFrames().

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

CommonXAxis* CanvasStock::fcommon_xaxis_cs
private
std::vector<THStock*> CanvasStock::vecTHStock
private

store the THStocks.


one THStock by pad number, a vector keep numbering for npad as before
more tricky with list.
really needed ? convenient for hiding pad for sure, for other?

Definition at line 67 of file CanvasStock.h.

Referenced by AddListDataStockToMap(), CreateNPad(), DeleteOneTHStock(), GetNPadToPaint(), HideListData(), PrintVector(), SetColor(), ShowListData(), UpdateTHStock(), and ~CanvasStock().


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