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

Used for free drawing of support/tendance Add a general line description with coeef_d and origin : y = coeff_d * x + origin. More...

#include <ObjectLine.h>

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

Public Member Functions

 ObjectLineTendance ()
 default constructor More...
 
 ObjectLineTendance (TypeLine &tline, double valueX, double valueY)
 Constructor from TPadStock, use the Factory now. More...
 
virtual ~ObjectLineTendance ()
 
void FinaliseDrawableLine (CommonXAxis *fcommon_xaxis_th)
 set up all data member after drawing. More...
 
double GetCoeffD () const
 member functions specific More...
 
void SetCoeffD (double &new_coeff)
 
double GetOrigin () const
 
void SetOrigin (double &x, double &y)
 
time_t GetTimeBegin () const
 
time_t GetTimeEnd () const
 
Int_t GetBinBegin () const
 
Int_t GetBinEnd () const
 
void SetTimeT0 (time_t begin)
 
void SetTimeT1 (time_t end)
 
virtual void SetTimes (time_t begin, time_t end)
 
void SetBinBegin (Int_t bin_x0)
 
void SetBinEnd (Int_t bin_x1)
 
void SetBins (Int_t bin_x0, Int_t bin_x1)
 
void SetInitValuesY ()
 
void InitCoeff_origin (double x0, double x1, double y0, double y1)
 
virtual std::vector< std::string > MakeStringForStatusBar (int px, int py) const
 create the string for the StatusBar More...
 
virtual void ClearObjectStock ()
 general function called when drawing More...
 
virtual void SetObjectStock (ListDataStockBase *, CommonXAxis *, Hparam_stock_t &)
 used for from the listdata More...
 
virtual void Paint (const Option_t *="")
 Paint the objet, to overide. More...
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Make all drawable modification, move by mouse and arrow. More...
 
virtual void MoveObjectLine (bool kdir)
 pass the direction ( positive, negative ) to extend More...
 
 ClassDef (ObjectLineTendance, 1)
 
- Public Member Functions inherited from ObjectLine
 ObjectLine ()
 
 ObjectLine (TypeLine tline, double valuey0)
 constructor used by Factory More...
 
 ObjectLine (double x0, double y0, double x1, double y1)
 general constructor More...
 
virtual ~ObjectLine ()
 destructor, should delete TLine explicitely More...
 
virtual std::string GetNameObject () const
 pure-virtual access More...
 
virtual void SetNameObject (std::string &name)
 
double GetX0 () const
 wrapper functions to fline, need public for all ?? More...
 
double GetX1 () const
 
double GetY0 () const
 
double GetY1 () const
 
void SetX0 (double x0)
 
void SetX1 (double x1)
 
void SetY0 (double y0)
 
void SetY1 (double y1)
 
virtual void SetValues (unsigned int, std::vector< double >, double, double, time_t, UInt_t=0)
 
virtual Width_t GetLineWidth () const
 
virtual Color_t GetLineColor () const
 
virtual Style_t GetLineStyle () const
 
virtual void SetLineWidth (Width_t lwidth)
 
virtual void SetLineColor (Color_t color)
 
virtual void SetLineStyle (Style_t lstyle)
 
virtual Int_t GetModeLine () const
 
virtual bool IsLine ()
 
virtual bool IsHalfLine1 ()
 
virtual bool IsHalfLine2 ()
 
virtual bool IsSegment ()
 
virtual void SetModekLine ()
 
virtual void SetModekHalfLine1 ()
 
virtual void SetModekHalfLine2 ()
 
virtual void SetModekSegment ()
 
virtual TypeLine GetTypeLine () const
 
virtual bool IsSupport () const
 
virtual bool IsTendance () const
 
virtual void GetExtrema (double &, double &) const
 
virtual void Resize (unsigned int)
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py, AbstractObjectStock **obj)
 
virtual int DistancetoPoint (int, int, double &, int=-1) const
 called by THStock for anchoring. More...
 
 ClassDef (ObjectLine, 1)
 
- 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 unsigned int GetSize () 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...
 
virtual Int_t DistancetoPrimitive (int, int, AbstractObjectStock **)=0
 used for selection of object, for const need attention to the pointer More...
 
virtual void SetLineColorObject (Color_t)
 
 ClassDef (AbstractObjectStock, 1)
 

Protected Member Functions

void RecalcCoeff_origin (double x0, double x1)
 mathematical functions More...
 
virtual double GetXBorder (double y) const
 specific for extrapolation
return X value where border is crossed More...
 
virtual double ExtrapolateYPad (double) const
 extrapolate y fom line equation More...
 
- Protected Member Functions inherited from ObjectLine
void InitLine (double x0, double y0, double x1, double y1)
 
virtual std::vector< float > GetValues (int px, int py, time_t &date) const
 used by MakeStringForStatusBar only base in ObjectLine should be very simple More...
 

Protected Attributes

double coeff_d
 most general for drawing a line, y = ax + b and moving as well, rotate a, translate b ! a and b not fixed need to be recalculated everytime repaint ( if axis moves ) to check ! More...
 
double origin
 
double valueY0
 save initial values, y's overridden if Lines Y initial values , no overloaded by line->SetY, here stay constant associated to fbin_begin/fend More...
 
double valueY1
 
time_t ftbegin
 set up once fbegin/fend, for update/save may be used More...
 
time_t ftend
 
int fbin_begin
 memorize bin_x0, bin_x1, easier with slide More...
 
int fbin_end
 
- Protected Attributes inherited from ObjectLine
std::string name_line
 add a name, absent in AbstractObjectStock More...
 
ModeLine fModeLine
 kLine, kSegment, kHalfSegment0, kHalfSegment1 More...
 
TypeLine fTypeLine
 TypeLine, enum : kNone, kSupport, kTendance, kFibo. More...
 
TLine * fline
 use composition TLine*, valable for all derived class 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...
 

Additional Inherited Members

- Protected Types inherited from ObjectLine
enum  ModeLine { kLine = 0, kHalfLine1 = 1, kHalfLine2 = 2, kSegment = 3 }
 

Detailed Description

Used for free drawing of support/tendance Add a general line description with coeef_d and origin : y = coeff_d * x + origin.

Should be interactive and provide : -Anchor -Selection and movable

Definition at line 230 of file ObjectLine.h.

Constructor & Destructor Documentation

ObjectLineTendance::ObjectLineTendance ( )
inline

default constructor

Definition at line 258 of file ObjectLine.h.

ObjectLineTendance::ObjectLineTendance ( TypeLine tline,
double  valueX,
double  valueY 
)

Constructor from TPadStock, use the Factory now.

Definition at line 222 of file ObjectLine.cxx.

References ObjectLine::fModeLine, ObjectLine::fTypeLine, ObjectLine::InitLine(), and ObjectLine::kSegment.

Here is the call graph for this function:

virtual ObjectLineTendance::~ObjectLineTendance ( )
inlinevirtual

Definition at line 262 of file ObjectLine.h.

Member Function Documentation

ObjectLineTendance::ClassDef ( ObjectLineTendance  ,
 
)
virtual void ObjectLineTendance::ClearObjectStock ( )
inlinevirtual

general function called when drawing

Implements AbstractObjectStock.

Definition at line 296 of file ObjectLine.h.

void ObjectLineTendance::ExecuteEvent ( Int_t  event,
Int_t  px,
Int_t  py 
)
virtual
double ObjectLineTendance::ExtrapolateYPad ( double  x) const
protectedvirtual

extrapolate y fom line equation

Definition at line 303 of file ObjectLine.cxx.

References coeff_d, and origin.

Referenced by FinaliseDrawableLine(), MakeStringForStatusBar(), and SetObjectStock().

Here is the caller graph for this function:

void ObjectLineTendance::FinaliseDrawableLine ( CommonXAxis fcommon_xaxis_th)

set up all data member after drawing.


only X/Y values needed for calling this function

Parameters
fcommon_xaxis_th

Definition at line 315 of file ObjectLine.cxx.

References ExtrapolateYPad(), AbstractObjectStock::fParentTHStock, THStock::GetDateFromBin(), ObjectLine::GetX0(), ObjectLine::GetX1(), CommonXAxis::GetXAxis(), ObjectLine::GetY0(), ObjectLine::GetY1(), InitCoeff_origin(), SetBins(), SetInitValuesY(), SetTimes(), ObjectLine::SetX0(), ObjectLine::SetX1(), ObjectLine::SetY0(), ObjectLine::SetY1(), valueY0, and valueY1.

Here is the call graph for this function:

Int_t ObjectLineTendance::GetBinBegin ( ) const
inline

Definition at line 278 of file ObjectLine.h.

References fbin_begin.

Referenced by SetObjectStock().

Here is the caller graph for this function:

Int_t ObjectLineTendance::GetBinEnd ( ) const
inline

Definition at line 279 of file ObjectLine.h.

References fbin_end.

Referenced by SetObjectStock().

Here is the caller graph for this function:

double ObjectLineTendance::GetCoeffD ( ) const
inline

member functions specific

Definition at line 270 of file ObjectLine.h.

References coeff_d.

Referenced by MoveObjectLine().

Here is the caller graph for this function:

double ObjectLineTendance::GetOrigin ( ) const
inline

Definition at line 272 of file ObjectLine.h.

References origin.

time_t ObjectLineTendance::GetTimeBegin ( ) const
inline

Definition at line 276 of file ObjectLine.h.

References ftbegin.

time_t ObjectLineTendance::GetTimeEnd ( ) const
inline

Definition at line 277 of file ObjectLine.h.

References ftend.

double ObjectLineTendance::GetXBorder ( double  y) const
protectedvirtual

specific for extrapolation
return X value where border is crossed

Definition at line 291 of file ObjectLine.cxx.

References coeff_d, and origin.

Referenced by SetObjectStock().

Here is the caller graph for this function:

void ObjectLineTendance::InitCoeff_origin ( double  x0,
double  x1,
double  y0,
double  y1 
)

Definition at line 272 of file ObjectLine.cxx.

References coeff_d, and origin.

Referenced by FinaliseDrawableLine().

Here is the caller graph for this function:

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

create the string for the StatusBar

Implements AbstractObjectStock.

Definition at line 377 of file ObjectLine.cxx.

References ExtrapolateYPad(), ObjectLine::GetValues(), ObjectLine::GetY0(), ObjectLine::IsSupport(), Utils::Time_tToString(), Utils::toString(), and values.

Here is the call graph for this function:

void ObjectLineTendance::MoveObjectLine ( bool  kdir)
virtual

pass the direction ( positive, negative ) to extend

Definition at line 836 of file ObjectLine.cxx.

References GetCoeffD(), EditorObjStock::GetRotate(), EditorObjStock::GetTranslate(), ObjectLine::GetY0(), ObjectLine::GetY1(), SetCoeffD(), SetInitValuesY(), ObjectLine::SetY0(), ObjectLine::SetY1(), valueY0, and valueY1.

Referenced by ExecuteEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Paint the objet, to overide.

Reimplemented from ObjectLine.

Definition at line 563 of file ObjectLine.cxx.

References ObjectLine::fline.

void ObjectLineTendance::RecalcCoeff_origin ( double  x0,
double  x1 
)
protected

mathematical functions

Definition at line 245 of file ObjectLine.cxx.

References coeff_d, origin, valueY0, and valueY1.

Referenced by SetObjectStock().

Here is the caller graph for this function:

void ObjectLineTendance::SetBinBegin ( Int_t  bin_x0)
inline

Definition at line 284 of file ObjectLine.h.

References fbin_begin.

void ObjectLineTendance::SetBinEnd ( Int_t  bin_x1)
inline

Definition at line 285 of file ObjectLine.h.

References fbin_end.

void ObjectLineTendance::SetBins ( Int_t  bin_x0,
Int_t  bin_x1 
)
inline

Definition at line 286 of file ObjectLine.h.

References fbin_begin, and fbin_end.

Referenced by FinaliseDrawableLine().

Here is the caller graph for this function:

void ObjectLineTendance::SetCoeffD ( double &  new_coeff)
inline

Definition at line 271 of file ObjectLine.h.

References coeff_d.

Referenced by MoveObjectLine().

Here is the caller graph for this function:

void ObjectLineTendance::SetInitValuesY ( )
inline

Definition at line 287 of file ObjectLine.h.

References ObjectLine::fline, valueY0, and valueY1.

Referenced by ExecuteEvent(), FinaliseDrawableLine(), and MoveObjectLine().

Here is the caller graph for this function:

void ObjectLineTendance::SetObjectStock ( ListDataStockBase ,
CommonXAxis ,
Hparam_stock_t  
)
virtual
void ObjectLineTendance::SetOrigin ( double &  x,
double &  y 
)

Definition at line 366 of file ObjectLine.cxx.

References coeff_d, and origin.

virtual void ObjectLineTendance::SetTimes ( time_t  begin,
time_t  end 
)
inlinevirtual

Definition at line 283 of file ObjectLine.h.

References ftbegin, and ftend.

Referenced by FinaliseDrawableLine().

Here is the caller graph for this function:

void ObjectLineTendance::SetTimeT0 ( time_t  begin)
inline

Definition at line 281 of file ObjectLine.h.

References ftbegin.

void ObjectLineTendance::SetTimeT1 ( time_t  end)
inline

Definition at line 282 of file ObjectLine.h.

References ftend.

Field Documentation

double ObjectLineTendance::coeff_d
protected

most general for drawing a line, y = ax + b and moving as well, rotate a, translate b ! a and b not fixed need to be recalculated everytime repaint ( if axis moves ) to check !

Definition at line 236 of file ObjectLine.h.

Referenced by ExtrapolateYPad(), GetCoeffD(), GetXBorder(), InitCoeff_origin(), RecalcCoeff_origin(), SetCoeffD(), and SetOrigin().

int ObjectLineTendance::fbin_begin
protected

memorize bin_x0, bin_x1, easier with slide

Definition at line 246 of file ObjectLine.h.

Referenced by GetBinBegin(), SetBinBegin(), and SetBins().

int ObjectLineTendance::fbin_end
protected

Definition at line 246 of file ObjectLine.h.

Referenced by GetBinEnd(), SetBinEnd(), and SetBins().

time_t ObjectLineTendance::ftbegin
protected

set up once fbegin/fend, for update/save may be used

Definition at line 244 of file ObjectLine.h.

Referenced by GetTimeBegin(), SetTimes(), and SetTimeT0().

time_t ObjectLineTendance::ftend
protected

Definition at line 244 of file ObjectLine.h.

Referenced by GetTimeEnd(), SetTimes(), and SetTimeT1().

double ObjectLineTendance::origin
protected
double ObjectLineTendance::valueY0
protected

save initial values, y's overridden if Lines Y initial values , no overloaded by line->SetY, here stay constant associated to fbin_begin/fend

Definition at line 241 of file ObjectLine.h.

Referenced by FinaliseDrawableLine(), MoveObjectLine(), RecalcCoeff_origin(), and SetInitValuesY().

double ObjectLineTendance::valueY1
protected

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