Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes

TGo4Marker Class Reference

#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
void PrintMarker (Option_t *opt="")
virtual void Paint (Option_t *opt="")
virtual void Draw (Option_t *opt="")
virtual void UnDraw (Option_t *opt="")
virtual void Pop ()
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
virtual TGo4MarkerPainterCreatePainter ()
void SetVisible (Bool_t on)
Bool_t IsVisible ()
virtual void SetName (const char *name)
void SetToBin (Int_t xbin, Int_t ybin=0)
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 ()
const char * GetNumFormat ()
void SetNumFormat (const char *fmt="%.4E")
void SaveLabelStyle ()
void ResetLabel ()
void InitLabelStyle ()
void SetHistogram (TH1 *histo)
TH1 * GetHistogram () const
virtual const char * GetName () const
Int_t GetXbin ()
Int_t GetYbin ()
Int_t GetCont ()
Double_t GetLabelX ()
Double_t GetLabelY ()
TVirtualPad * GetDrawPad ()
Bool_t CheckDrawPad ()
Bool_t CheckHistogram ()
void DeletePainter ()

Static Public Member Functions

static Int_t GetInstances ()

Static Public Attributes

static Bool_t fgbHASLABEL = kTRUE
static Bool_t fgbHASCONNECTOR = kTRUE
static Bool_t fgbXDRAW = kTRUE
static Bool_t fgbYDRAW = kTRUE
static Bool_t fgbXBINDRAW = kFALSE
static Bool_t fgbYBINDRAW = kFALSE
static Bool_t fgbCONTDRAW = kTRUE
static TString fgxNUMFORMAT = "%.4E"

Protected Member Functions

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

Protected Attributes

TGo4MarkerPainterfxPainter

Private Attributes

TString fxName
Bool_t fbIsPainted
Bool_t fbVisible
Bool_t fbHasLabel
Bool_t fbHasConnector
Bool_t fbXDraw
Bool_t fbYDraw
Bool_t fbXbinDraw
Bool_t fbYbinDraw
Bool_t fbContDraw
TString fxNumFormat
TH1 * fxHisto
TVirtualPad * fxDrawPad

Static Private Attributes

static UInt_t fguInstanceCounter = 0

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 31 of file TGo4Marker.h.


Constructor & Destructor Documentation

TGo4Marker::TGo4Marker (  ) 

Definition at line 49 of file TGo4Marker.cxx.

References InitLabelStyle().

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

Definition at line 37 of file TGo4Marker.cxx.

References fguInstanceCounter, fxName, and InitLabelStyle().

TGo4Marker::~TGo4Marker (  )  [virtual]

Definition at line 60 of file TGo4Marker.cxx.

References fxPainter, and UnDraw().


Member Function Documentation

Bool_t TGo4Marker::CheckDrawPad (  ) 

True if current draw pad is still exisiting

Definition at line 72 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 82 of file TGo4Marker.cxx.

References fxHisto.

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

TGo4MarkerPainter * TGo4Marker::CreatePainter (  )  [virtual]

Factory method to generate (optional subclass) implementation for painter

Definition at line 145 of file TGo4Marker.cxx.

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

Referenced by Paint(), and UnDraw().

void TGo4Marker::DeletePainter (  ) 

Definition at line 280 of file TGo4Marker.cxx.

References fxPainter.

Referenced by TGo4ViewPanel::MakePictureForPad().

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

Draw this marker on current pad

Definition at line 104 of file TGo4Marker.cxx.

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

Referenced by TGo4ViewPanel::PadClickedSlot().

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 134 of file TGo4Marker.cxx.

References TGo4MarkerPainter::DisplayToFront(), and fxPainter.

Int_t TGo4Marker::GetCont (  ) 

Deliver bin content of work histogram at marker position

Definition at line 187 of file TGo4Marker.cxx.

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

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

TVirtualPad* TGo4Marker::GetDrawPad (  )  [inline]

Definition at line 131 of file TGo4Marker.h.

Referenced by Paint().

TH1* TGo4Marker::GetHistogram (  )  const [inline]
static Int_t TGo4Marker::GetInstances (  )  [inline, static]

Definition at line 129 of file TGo4Marker.h.

Referenced by TGo4ViewPanel::PadClickedSlot().

Double_t TGo4Marker::GetLabelX (  ) 

Calculate initial label coordinate from marker position

Definition at line 195 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 203 of file TGo4Marker.cxx.

References CheckDrawPad(), and fxDrawPad.

Referenced by TGo4MarkerPainter::PaintLabel().

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

TMarker is not TNamed, so we implement name ourself

Definition at line 116 of file TGo4Marker.h.

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

const char* TGo4Marker::GetNumFormat (  )  [inline]

Definition at line 98 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

Int_t TGo4Marker::GetXbin (  ) 

Deliver x axis bin number of work histogram at marker position

Definition at line 172 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 179 of file TGo4Marker.cxx.

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

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

Bool_t TGo4Marker::HasConnector (  )  [inline]

Definition at line 86 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintConnector().

Bool_t TGo4Marker::HasLabel (  )  [inline]

Definition at line 84 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

void TGo4Marker::InitLabelStyle (  ) 

Initialize label setup from static default variables

Definition at line 260 of file TGo4Marker.cxx.

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

Referenced by TGo4Marker().

Bool_t TGo4Marker::IsContDraw (  )  [inline]

Definition at line 96 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

Bool_t TGo4Marker::IsPainted (  )  [inline, protected]

Definition at line 172 of file TGo4Marker.h.

Referenced by Paint().

Bool_t TGo4Marker::IsVisible (  )  [inline]

Definition at line 77 of file TGo4Marker.h.

Referenced by Draw(), and Paint().

Bool_t TGo4Marker::IsXbinDraw (  )  [inline]

Definition at line 92 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

Bool_t TGo4Marker::IsXDraw (  )  [inline]

Definition at line 88 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

Bool_t TGo4Marker::IsYbinDraw (  )  [inline]

Definition at line 94 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

Bool_t TGo4Marker::IsYDraw (  )  [inline]

Definition at line 90 of file TGo4Marker.h.

Referenced by TGo4MarkerPainter::PaintLabel().

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

Display marker with plain root canvas and in go4 viewpanel

Definition at line 88 of file TGo4Marker.cxx.

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

void TGo4Marker::Pop (  )  [virtual]

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

Definition at line 128 of file TGo4Marker.cxx.

References TGo4MarkerPainter::DisplayToFront(), and fxPainter.

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 215 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 226 of file TGo4Marker.cxx.

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

Referenced by Print().

void TGo4Marker::ResetLabel (  ) 

Will reset label position to defaults

Definition at line 272 of file TGo4Marker.cxx.

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

void TGo4Marker::SaveLabelStyle (  ) 

This will save draw flags into static default setup

Definition at line 248 of file TGo4Marker.cxx.

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

void TGo4Marker::SetContDraw ( Bool_t  on  )  [inline]

Definition at line 95 of file TGo4Marker.h.

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

Definition at line 67 of file TGo4Marker.cxx.

References fxDrawPad.

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

void TGo4Marker::SetHistogram ( TH1 *  histo  ) 
void TGo4Marker::SetLabelDraw ( Bool_t  on  )  [inline]

Definition at line 83 of file TGo4Marker.h.

void TGo4Marker::SetLineDraw ( Bool_t  on  )  [inline]

Definition at line 85 of file TGo4Marker.h.

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

Definition at line 78 of file TGo4Marker.h.

void TGo4Marker::SetNumFormat ( const char *  fmt = "%.4E"  )  [inline]

Definition at line 99 of file TGo4Marker.h.

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

Definition at line 171 of file TGo4Marker.h.

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

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

Set marker to position according to work histogram axis.

Definition at line 152 of file TGo4Marker.cxx.

References CheckHistogram(), and fxHisto.

void TGo4Marker::SetVisible ( Bool_t  on  )  [inline]

Definition at line 76 of file TGo4Marker.h.

void TGo4Marker::SetXbinDraw ( Bool_t  on  )  [inline]

Definition at line 91 of file TGo4Marker.h.

void TGo4Marker::SetXDraw ( Bool_t  on  )  [inline]

Definition at line 87 of file TGo4Marker.h.

void TGo4Marker::SetYbinDraw ( Bool_t  on  )  [inline]

Definition at line 93 of file TGo4Marker.h.

void TGo4Marker::SetYDraw ( Bool_t  on  )  [inline]

Definition at line 89 of file TGo4Marker.h.

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

Erase view of this marker from the pad

Definition at line 118 of file TGo4Marker.cxx.

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

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


Member Data Documentation

Bool_t TGo4Marker::fbContDraw [private]

If true, draw corresponding value as label on working pad

Definition at line 208 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

Bool_t TGo4Marker::fbHasConnector [private]

Switch connectionline between marker and label on or off.

Definition at line 193 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

Bool_t TGo4Marker::fbHasLabel [private]

Switch marker label on or off.

Definition at line 190 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

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 184 of file TGo4Marker.h.

Bool_t TGo4Marker::fbVisible [private]

Visibility of this marker on pad. For marker array in editor

Definition at line 187 of file TGo4Marker.h.

Bool_t TGo4Marker::fbXbinDraw [private]

If true, draw corresponding value as label on working pad

Definition at line 202 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

Bool_t TGo4Marker::fbXDraw [private]

If true, draw corresponding value as label on working pad

Definition at line 196 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

Bool_t TGo4Marker::fbYbinDraw [private]

If true, draw corresponding value as label on working pad

Definition at line 205 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

Bool_t TGo4Marker::fbYDraw [private]

If true, draw corresponding value as label on working pad

Definition at line 199 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

Bool_t TGo4Marker::fgbCONTDRAW = kTRUE [static]
Bool_t TGo4Marker::fgbHASCONNECTOR = kTRUE [static]
Bool_t TGo4Marker::fgbHASLABEL = kTRUE [static]
Bool_t TGo4Marker::fgbXBINDRAW = kFALSE [static]
Bool_t TGo4Marker::fgbXDRAW = kTRUE [static]
Bool_t TGo4Marker::fgbYBINDRAW = kFALSE [static]
Bool_t TGo4Marker::fgbYDRAW = kTRUE [static]
UInt_t TGo4Marker::fguInstanceCounter = 0 [static, private]

use this counter for automatic naming and coloring

Definition at line 221 of file TGo4Marker.h.

Referenced by TGo4Marker().

TString TGo4Marker::fgxNUMFORMAT = "%.4E" [static]

default setting for all conditions with format string for numbers.

Definition at line 162 of file TGo4Marker.h.

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

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 218 of file TGo4Marker.h.

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

TH1* TGo4Marker::fxHisto [private]

Reference to currently used histogram (for bin contents).

Definition at line 214 of file TGo4Marker.h.

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

TString TGo4Marker::fxName [private]

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

Definition at line 180 of file TGo4Marker.h.

Referenced by TGo4Marker().

TString TGo4Marker::fxNumFormat [private]

format string for all label numbers.

Definition at line 211 of file TGo4Marker.h.

Referenced by InitLabelStyle(), and SaveLabelStyle().

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 169 of file TGo4Marker.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines