Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4Marker Class Reference

Extended graphical marker class for go4 condition editor and viewpanel. More...

#include <TGo4Marker.h>

List of all members.

Public Member Functions

 TGo4Marker ()
 TGo4Marker (Double_t x, Double_t y, Int_t style)
virtual ~TGo4Marker ()
virtual void Print (Option_t *opt="") const
 Implement standard root print.
void PrintMarker (Option_t *opt="")
 If option is "go4log", print to TGo4Log::Message.
virtual void Paint (Option_t *opt="")
 Display marker with plain root canvas and in go4 viewpanel.
virtual void Draw (Option_t *opt="")
 Draw this marker on current pad.
virtual void UnDraw (Option_t *opt="")
 Erase view of this marker from the pad.
virtual void Pop ()
 Re-implement TObject method to pop all our views to front.
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Reimplemented to pop our labels to front when selected.
virtual TGo4MarkerPainterCreatePainter ()
 Factory method to generate (optional subclass) implementation for painter.
void SetVisible (Bool_t on)
Bool_t IsVisible ()
virtual void SetName (const char *name)
void SetToBin (Int_t xbin, Int_t ybin=0)
 Set marker to position according to work histogram axis.
void SetLabelDraw (Bool_t on)
Bool_t HasLabel ()
void SetLineDraw (Bool_t on)
Bool_t HasConnector ()
void SetXDraw (Bool_t on)
Bool_t IsXDraw ()
void SetYDraw (Bool_t on)
Bool_t IsYDraw ()
void SetXbinDraw (Bool_t on)
Bool_t IsXbinDraw ()
void SetYbinDraw (Bool_t on)
Bool_t IsYbinDraw ()
void SetContDraw (Bool_t on)
Bool_t IsContDraw ()
void SaveLabelStyle ()
 This will save draw flags into static default setup.
void ResetLabel ()
 Will reset label position to defaults.
void InitLabelStyle ()
 Initialize label setup from static default variables.
void SetHistogram (TH1 *histo)
TH1 * GetHistogram () const
virtual const char * GetName () const
 TMarker is not TNamed, so we implement name ourself.
Int_t GetXbin ()
 Deliver x axis bin number of work histogram at marker position.
Int_t GetYbin ()
 Deliver y axis bin number of work histogram at marker position.
Int_t GetCont ()
 Deliver bin content of work histogram at marker position.
Double_t GetLabelX ()
 Calculate initial label coordinate from marker position.
Double_t GetLabelY ()
 Calculate initial label coordinate from marker position.
TVirtualPad * GetDrawPad ()
Bool_t CheckDrawPad ()
 True if current draw pad is still exisiting.
Bool_t CheckHistogram ()
 True if current histogram is still exisiting.
void DeletePainter ()

Static Public Member Functions

static Int_t GetInstances ()

Static Public Attributes

static Bool_t fgbHASLABEL = kTRUE
 default setting for all markers of label on/off flag.
static Bool_t fgbHASCONNECTOR = kTRUE
 default setting for all markers of connector line flag.
static Bool_t fgbXDRAW = kTRUE
 default setting for all markers of xdraw flag.
static Bool_t fgbYDRAW = kTRUE
 default setting for all markers of ydraw flag.
static Bool_t fgbXBINDRAW = kFALSE
 default setting for all markers of xbindraw flag.
static Bool_t fgbYBINDRAW = kFALSE
 default setting for all markers of ybindraw flag.
static Bool_t fgbCONTDRAW = kTRUE
 default setting for all markers of bin content flag.

Protected Member Functions

void SetPainted (Bool_t on)
Bool_t IsPainted ()
void SetDrawPad (TVirtualPad *pad)

Protected Attributes

TGo4MarkerPainterfxPainter
 Painter instance to display the condition in root pad.

Private Attributes

TString fxName
 since TMarker is not TNamed, we provide identifier string here:
Bool_t fbIsPainted
 Flag to prevent Paint() method to redraw marker views after UnDraw.
Bool_t fbVisible
 Visibility of this marker on pad.
Bool_t fbHasLabel
 Switch marker label on or off.
Bool_t fbHasConnector
 Switch connectionline between marker and label on or off.
Bool_t fbXDraw
 If true, draw corresponding value as label on working pad.
Bool_t fbYDraw
 If true, draw corresponding value as label on working pad.
Bool_t fbXbinDraw
 If true, draw corresponding value as label on working pad.
Bool_t fbYbinDraw
 If true, draw corresponding value as label on working pad.
Bool_t fbContDraw
 If true, draw corresponding value as label on working pad.
TH1 * fxHisto
 Reference to currently used histogram (for bin contents).
TVirtualPad * fxDrawPad
 Remember last pad used for Draw.

Static Private Attributes

static UInt_t fguInstanceCounter = 0
 use this counter for automatic naming and coloring


Detailed Description

Extended graphical marker class for go4 condition editor and viewpanel.

Offers coordinate label updated from pad. Scans work histogram for bin numbers and contents.

Author:
Joern Adamczewski
Since:
06/2004

Definition at line 33 of file TGo4Marker.h.


Constructor & Destructor Documentation

TGo4Marker::TGo4Marker  ) 
 

Definition at line 51 of file TGo4Marker.cxx.

References InitLabelStyle().

TGo4Marker::TGo4Marker Double_t  x,
Double_t  y,
Int_t  style
 

Definition at line 39 of file TGo4Marker.cxx.

References fguInstanceCounter, fxName, and InitLabelStyle().

TGo4Marker::~TGo4Marker  )  [virtual]
 

Definition at line 62 of file TGo4Marker.cxx.

References fxPainter, and UnDraw().


Member Function Documentation

void TGo4Marker::Print Option_t *  opt = ""  )  const [virtual]
 

Implement standard root print.

If option is "go4log", print to TGo4Log::Message. Otherwise use cout

Definition at line 217 of file TGo4Marker.cxx.

References PrintMarker().

void TGo4Marker::PrintMarker Option_t *  opt = ""  ) 
 

If option is "go4log", print to TGo4Log::Message.

Otherwise use cout

Definition at line 228 of file TGo4Marker.cxx.

References GetCont(), GetHistogram(), GetName(), GetXbin(), GetYbin(), and TGo4Log::Message().

Referenced by Print().

void TGo4Marker::Paint Option_t *  opt = ""  )  [virtual]
 

Display marker with plain root canvas and in go4 viewpanel.

Definition at line 90 of file TGo4Marker.cxx.

References CheckDrawPad(), CreatePainter(), fxPainter, GetDrawPad(), IsPainted(), IsVisible(), TGo4MarkerPainter::PaintLabel(), SetDrawPad(), and SetPainted().

void TGo4Marker::Draw Option_t *  opt = ""  )  [virtual]
 

Draw this marker on current pad.

Definition at line 106 of file TGo4Marker.cxx.

References IsVisible(), SetDrawPad(), SetPainted(), and UnDraw().

void TGo4Marker::UnDraw Option_t *  opt = ""  )  [virtual]
 

Erase view of this marker from the pad.

Definition at line 120 of file TGo4Marker.cxx.

References CreatePainter(), fxPainter, SetDrawPad(), SetPainted(), and TGo4MarkerPainter::UnPaintLabel().

Referenced by Draw(), and ~TGo4Marker().

void TGo4Marker::Pop  )  [virtual]
 

Re-implement TObject method to pop all our views to front.

Definition at line 130 of file TGo4Marker.cxx.

References TGo4MarkerPainter::DisplayToFront(), and fxPainter.

void TGo4Marker::ExecuteEvent Int_t  event,
Int_t  px,
Int_t  py
[virtual]
 

Reimplemented to pop our labels to front when selected.

Definition at line 136 of file TGo4Marker.cxx.

References TGo4MarkerPainter::DisplayToFront(), and fxPainter.

TGo4MarkerPainter * TGo4Marker::CreatePainter  )  [virtual]
 

Factory method to generate (optional subclass) implementation for painter.

Definition at line 147 of file TGo4Marker.cxx.

References GetName(), and TGo4MarkerPainter::SetMarker().

Referenced by Paint(), and UnDraw().

void TGo4Marker::SetVisible Bool_t  on  )  [inline]
 

Definition at line 68 of file TGo4Marker.h.

References fbVisible.

Bool_t TGo4Marker::IsVisible  )  [inline]
 

Definition at line 69 of file TGo4Marker.h.

References fbVisible.

Referenced by Draw(), and Paint().

virtual void TGo4Marker::SetName const char *  name  )  [inline, virtual]
 

Definition at line 70 of file TGo4Marker.h.

References fxName.

void TGo4Marker::SetToBin Int_t  xbin,
Int_t  ybin = 0
 

Set marker to position according to work histogram axis.

Definition at line 154 of file TGo4Marker.cxx.

References CheckHistogram(), and fxHisto.

void TGo4Marker::SetLabelDraw Bool_t  on  )  [inline]
 

Definition at line 75 of file TGo4Marker.h.

References fbHasLabel.

Bool_t TGo4Marker::HasLabel  )  [inline]
 

Definition at line 76 of file TGo4Marker.h.

References fbHasLabel.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::SetLineDraw Bool_t  on  )  [inline]
 

Definition at line 77 of file TGo4Marker.h.

References fbHasConnector.

Bool_t TGo4Marker::HasConnector  )  [inline]
 

Definition at line 78 of file TGo4Marker.h.

References fbHasConnector.

Referenced by TGo4MarkerPainter::PaintConnector().

void TGo4Marker::SetXDraw Bool_t  on  )  [inline]
 

Definition at line 79 of file TGo4Marker.h.

References fbXDraw.

Bool_t TGo4Marker::IsXDraw  )  [inline]
 

Definition at line 80 of file TGo4Marker.h.

References fbXDraw.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::SetYDraw Bool_t  on  )  [inline]
 

Definition at line 81 of file TGo4Marker.h.

References fbYDraw.

Bool_t TGo4Marker::IsYDraw  )  [inline]
 

Definition at line 82 of file TGo4Marker.h.

References fbYDraw.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::SetXbinDraw Bool_t  on  )  [inline]
 

Definition at line 83 of file TGo4Marker.h.

References fbXbinDraw.

Bool_t TGo4Marker::IsXbinDraw  )  [inline]
 

Definition at line 84 of file TGo4Marker.h.

References fbXbinDraw.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::SetYbinDraw Bool_t  on  )  [inline]
 

Definition at line 85 of file TGo4Marker.h.

References fbYbinDraw.

Bool_t TGo4Marker::IsYbinDraw  )  [inline]
 

Definition at line 86 of file TGo4Marker.h.

References fbYbinDraw.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::SetContDraw Bool_t  on  )  [inline]
 

Definition at line 87 of file TGo4Marker.h.

References fbContDraw.

Bool_t TGo4Marker::IsContDraw  )  [inline]
 

Definition at line 88 of file TGo4Marker.h.

References fbContDraw.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::SaveLabelStyle  ) 
 

This will save draw flags into static default setup.

Definition at line 260 of file TGo4Marker.cxx.

References fbContDraw, fbHasConnector, fbHasLabel, fbXbinDraw, fbXDraw, fbYbinDraw, fbYDraw, fgbCONTDRAW, fgbHASCONNECTOR, fgbHASLABEL, fgbXBINDRAW, fgbXDRAW, fgbYBINDRAW, and fgbYDRAW.

void TGo4Marker::ResetLabel  ) 
 

Will reset label position to defaults.

Definition at line 282 of file TGo4Marker.cxx.

References fxPainter, TGo4MarkerPainter::PaintLabel(), and TGo4MarkerPainter::UnPaintLabel().

void TGo4Marker::InitLabelStyle  ) 
 

Initialize label setup from static default variables.

Definition at line 271 of file TGo4Marker.cxx.

References fbContDraw, fbHasConnector, fbHasLabel, fbXbinDraw, fbXDraw, fbYbinDraw, fbYDraw, fgbCONTDRAW, fgbHASCONNECTOR, fgbHASLABEL, fgbXBINDRAW, fgbXDRAW, fgbYBINDRAW, and fgbYDRAW.

Referenced by TGo4Marker().

void TGo4Marker::SetHistogram TH1 *  histo  ) 
 

Definition at line 79 of file TGo4Marker.cxx.

References fxHisto.

TH1* TGo4Marker::GetHistogram  )  const [inline]
 

Definition at line 100 of file TGo4Marker.h.

References fxHisto.

Referenced by TGo4MarkerPainter::PaintLabel(), and PrintMarker().

virtual const char* TGo4Marker::GetName  )  const [inline, virtual]
 

TMarker is not TNamed, so we implement name ourself.

Definition at line 103 of file TGo4Marker.h.

References fxName.

Referenced by CreatePainter(), TGo4MarkerPainter::PaintLabel(), and PrintMarker().

Int_t TGo4Marker::GetXbin  ) 
 

Deliver x axis bin number of work histogram at marker position.

Definition at line 174 of file TGo4Marker.cxx.

References CheckDrawPad(), CheckHistogram(), fxDrawPad, and fxHisto.

Referenced by GetCont(), TGo4MarkerPainter::PaintLabel(), and PrintMarker().

Int_t TGo4Marker::GetYbin  ) 
 

Deliver y axis bin number of work histogram at marker position.

Definition at line 181 of file TGo4Marker.cxx.

References CheckDrawPad(), CheckHistogram(), fxDrawPad, and fxHisto.

Referenced by GetCont(), TGo4MarkerPainter::PaintLabel(), and PrintMarker().

Int_t TGo4Marker::GetCont  ) 
 

Deliver bin content of work histogram at marker position.

Definition at line 189 of file TGo4Marker.cxx.

References CheckDrawPad(), CheckHistogram(), fxHisto, GetXbin(), and GetYbin().

Referenced by TGo4MarkerPainter::PaintLabel(), and PrintMarker().

Double_t TGo4Marker::GetLabelX  ) 
 

Calculate initial label coordinate from marker position.

Definition at line 197 of file TGo4Marker.cxx.

References CheckDrawPad(), and fxDrawPad.

Referenced by TGo4MarkerPainter::PaintLabel().

Double_t TGo4Marker::GetLabelY  ) 
 

Calculate initial label coordinate from marker position.

Definition at line 205 of file TGo4Marker.cxx.

References CheckDrawPad(), and fxDrawPad.

Referenced by TGo4MarkerPainter::PaintLabel().

static Int_t TGo4Marker::GetInstances  )  [inline, static]
 

Definition at line 116 of file TGo4Marker.h.

References fguInstanceCounter.

TVirtualPad* TGo4Marker::GetDrawPad  )  [inline]
 

Definition at line 118 of file TGo4Marker.h.

References fxDrawPad.

Referenced by Paint().

Bool_t TGo4Marker::CheckDrawPad  ) 
 

True if current draw pad is still exisiting.

Definition at line 74 of file TGo4Marker.cxx.

References fxDrawPad.

Referenced by GetCont(), GetLabelX(), GetLabelY(), GetXbin(), GetYbin(), and Paint().

Bool_t TGo4Marker::CheckHistogram  ) 
 

True if current histogram is still exisiting.

Definition at line 84 of file TGo4Marker.cxx.

References fxHisto.

Referenced by GetCont(), GetXbin(), GetYbin(), and SetToBin().

void TGo4Marker::DeletePainter  ) 
 

Definition at line 290 of file TGo4Marker.cxx.

References fxPainter.

void TGo4Marker::SetPainted Bool_t  on  )  [inline, protected]
 

Definition at line 155 of file TGo4Marker.h.

References fbIsPainted.

Referenced by Draw(), Paint(), and UnDraw().

Bool_t TGo4Marker::IsPainted  )  [inline, protected]
 

Definition at line 156 of file TGo4Marker.h.

References fbIsPainted.

Referenced by Paint().

void TGo4Marker::SetDrawPad TVirtualPad *  pad  )  [protected]
 

Definition at line 69 of file TGo4Marker.cxx.

References fxDrawPad.

Referenced by Draw(), Paint(), and UnDraw().


Member Data Documentation

Bool_t TGo4Marker::fgbHASLABEL = kTRUE [static]
 

default setting for all markers of label on/off flag.

Definition at line 30 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

Bool_t TGo4Marker::fgbHASCONNECTOR = kTRUE [static]
 

default setting for all markers of connector line flag.

Definition at line 31 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

Bool_t TGo4Marker::fgbXDRAW = kTRUE [static]
 

default setting for all markers of xdraw flag.

Definition at line 32 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

Bool_t TGo4Marker::fgbYDRAW = kTRUE [static]
 

default setting for all markers of ydraw flag.

Definition at line 33 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

Bool_t TGo4Marker::fgbXBINDRAW = kFALSE [static]
 

default setting for all markers of xbindraw flag.

Definition at line 34 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

Bool_t TGo4Marker::fgbYBINDRAW = kFALSE [static]
 

default setting for all markers of ybindraw flag.

Definition at line 35 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

Bool_t TGo4Marker::fgbCONTDRAW = kTRUE [static]
 

default setting for all markers of bin content flag.

Definition at line 36 of file TGo4Marker.cxx.

Referenced by TGo4QSettings::getBasicSettings(), InitLabelStyle(), SaveLabelStyle(), and TGo4QSettings::setBasicSettings().

TGo4MarkerPainter* TGo4Marker::fxPainter [protected]
 

Painter instance to display the condition in root pad.

To be used in Paint() which is called on TPad::Update automatically for all TObjects appended to the pad.

Definition at line 153 of file TGo4Marker.h.

Referenced by DeletePainter(), ExecuteEvent(), Paint(), Pop(), ResetLabel(), UnDraw(), and ~TGo4Marker().

TString TGo4Marker::fxName [private]
 

since TMarker is not TNamed, we provide identifier string here:

Definition at line 164 of file TGo4Marker.h.

Referenced by GetName(), SetName(), and TGo4Marker().

Bool_t TGo4Marker::fbIsPainted [private]
 

Flag to prevent Paint() method to redraw marker views after UnDraw.

Problem with Paint() called from ROOT event loop.

Definition at line 168 of file TGo4Marker.h.

Referenced by IsPainted(), and SetPainted().

Bool_t TGo4Marker::fbVisible [private]
 

Visibility of this marker on pad.

For marker array in editor

Definition at line 171 of file TGo4Marker.h.

Referenced by IsVisible(), and SetVisible().

Bool_t TGo4Marker::fbHasLabel [private]
 

Switch marker label on or off.

Definition at line 174 of file TGo4Marker.h.

Referenced by HasLabel(), InitLabelStyle(), SaveLabelStyle(), and SetLabelDraw().

Bool_t TGo4Marker::fbHasConnector [private]
 

Switch connectionline between marker and label on or off.

Definition at line 177 of file TGo4Marker.h.

Referenced by HasConnector(), InitLabelStyle(), SaveLabelStyle(), and SetLineDraw().

Bool_t TGo4Marker::fbXDraw [private]
 

If true, draw corresponding value as label on working pad.

Definition at line 180 of file TGo4Marker.h.

Referenced by InitLabelStyle(), IsXDraw(), SaveLabelStyle(), and SetXDraw().

Bool_t TGo4Marker::fbYDraw [private]
 

If true, draw corresponding value as label on working pad.

Definition at line 183 of file TGo4Marker.h.

Referenced by InitLabelStyle(), IsYDraw(), SaveLabelStyle(), and SetYDraw().

Bool_t TGo4Marker::fbXbinDraw [private]
 

If true, draw corresponding value as label on working pad.

Definition at line 186 of file TGo4Marker.h.

Referenced by InitLabelStyle(), IsXbinDraw(), SaveLabelStyle(), and SetXbinDraw().

Bool_t TGo4Marker::fbYbinDraw [private]
 

If true, draw corresponding value as label on working pad.

Definition at line 189 of file TGo4Marker.h.

Referenced by InitLabelStyle(), IsYbinDraw(), SaveLabelStyle(), and SetYbinDraw().

Bool_t TGo4Marker::fbContDraw [private]
 

If true, draw corresponding value as label on working pad.

Definition at line 192 of file TGo4Marker.h.

Referenced by InitLabelStyle(), IsContDraw(), SaveLabelStyle(), and SetContDraw().

TH1* TGo4Marker::fxHisto [private]
 

Reference to currently used histogram (for bin contents).

Definition at line 195 of file TGo4Marker.h.

Referenced by CheckHistogram(), GetCont(), GetHistogram(), GetXbin(), GetYbin(), SetHistogram(), and SetToBin().

TVirtualPad* TGo4Marker::fxDrawPad [private]
 

Remember last pad used for Draw.

Needed for condition editor to prevent displaying marker on pad other than the working pad.

Definition at line 199 of file TGo4Marker.h.

Referenced by CheckDrawPad(), GetDrawPad(), GetLabelX(), GetLabelY(), GetXbin(), GetYbin(), and SetDrawPad().

UInt_t TGo4Marker::fguInstanceCounter = 0 [static, private]
 

use this counter for automatic naming and coloring

Definition at line 28 of file TGo4Marker.cxx.

Referenced by GetInstances(), and TGo4Marker().


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 13:01:04 2008 for Go4-v3.04-1 by  doxygen 1.4.2