GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
Extended graphical marker class for go4 condition editor and viewpanel. More...
#include <TGo4Marker.h>
Public Member Functions | |
TGo4Marker () | |
TGo4Marker (Double_t x, Double_t y, Int_t style) | |
virtual | ~TGo4Marker () |
Bool_t | CheckDrawPad () const |
True if current draw pad is still existing. | |
Bool_t | CheckHistogram () const |
True if current histogram is still existing. | |
virtual TGo4MarkerPainter * | CreatePainter () |
Factory method to generate (optional subclass) implementation for painter. | |
void | DeletePainter () |
void | Draw (Option_t *opt="") override |
Draw this marker on current pad. | |
void | ExecuteEvent (Int_t event, Int_t px, Int_t py) override |
Reimplemented to pop our labels to front when selected. | |
Int_t | GetCont () const |
Deliver bin content of work histogram at marker position. | |
TVirtualPad * | GetDrawPad () const |
TH1 * | GetHistogram () const |
Double_t | GetLabelX () const |
Calculate initial label coordinate from marker position. | |
Double_t | GetLabelY () const |
Calculate initial label coordinate from marker position. | |
const char * | GetName () const override |
TMarker is not TNamed, so we implement name ourself. | |
const char * | GetNumFormat () const |
Int_t | GetXbin () const |
Deliver x axis bin number of work histogram at marker position. | |
Int_t | GetYbin () const |
Deliver y axis bin number of work histogram at marker position. | |
Bool_t | HasConnector () const |
Bool_t | HasLabel () const |
void | InitLabelStyle () |
Initialize label setup from static default variables. | |
Bool_t | IsContDraw () const |
Bool_t | IsVisible () const |
Bool_t | IsXbinDraw () const |
Bool_t | IsXDraw () const |
Bool_t | IsYbinDraw () const |
Bool_t | IsYDraw () const |
void | Paint (Option_t *opt="") override |
Display marker with plain root canvas and in go4 viewpanel. | |
void | Pop () override |
Re-implement TObject method to pop all our views to front. | |
void | Print (Option_t *opt="") const override |
Implement standard root print. | |
void | ResetLabel () |
Will reset label position to defaults. | |
void | SaveLabelStyle () |
This will save draw flags into static default setup. | |
void | SetContDraw (Bool_t on) |
void | SetHistogram (TH1 *histo) |
void | SetLabelDraw (Bool_t on) |
void | SetLineDraw (Bool_t on) |
virtual void | SetName (const char *name) |
void | SetNumFormat (const char *fmt="%.4E") |
void | SetToBin (Int_t xbin, Int_t ybin=0) |
Set marker to position according to work histogram axis. | |
void | SetVisible (Bool_t on) |
void | SetXbinDraw (Bool_t on) |
void | SetXDraw (Bool_t on) |
void | SetXY (Double_t x, Double_t y) |
void | SetYbinDraw (Bool_t on) |
void | SetYDraw (Bool_t on) |
virtual void | UnDraw (Option_t *opt="") |
Erase view of this marker from the pad. | |
Static Public Member Functions | |
static void | GetGlobalStyle (Bool_t &HASLABEL, Bool_t &HASCONNECTOR, Bool_t &XDRAW, Bool_t &YDRAW, Bool_t &XBINDRAW, Bool_t &YBINDRAW, Bool_t &CONTDRAW, TString &NUMFORMAT) |
static Int_t | GetInstances () |
static void | SetGlobalStyle (Bool_t HASLABEL, Bool_t HASCONNECTOR, Bool_t XDRAW, Bool_t YDRAW, Bool_t XBINDRAW, Bool_t YBINDRAW, Bool_t CONTDRAW, const char *NUMFORMAT) |
Static Public Attributes | |
static Bool_t | fgbCONTDRAW = kTRUE |
default setting for all markers of bin content flag. | |
static Bool_t | fgbHASCONNECTOR = kTRUE |
default setting for all markers of connector line flag. | |
static Bool_t | fgbHASLABEL = kTRUE |
default setting for all markers of label on/off flag. | |
static Bool_t | fgbXBINDRAW = kFALSE |
default setting for all markers of xbindraw flag. | |
static Bool_t | fgbXDRAW = kTRUE |
default setting for all markers of xdraw flag. | |
static Bool_t | fgbYBINDRAW = kFALSE |
default setting for all markers of ybindraw flag. | |
static Bool_t | fgbYDRAW = kTRUE |
default setting for all markers of ydraw flag. | |
static TString | fgxNUMFORMAT = "%.4E" |
default setting for all conditions with format string for numbers. | |
Protected Member Functions | |
Bool_t | IsPainted () const |
void | SetDrawPad (TVirtualPad *pad) |
void | SetPainted (Bool_t on) |
Protected Attributes | |
TGo4MarkerPainter * | fxPainter {nullptr} |
Painter instance to display the condition in root pad. | |
Private Attributes | |
Bool_t | fbContDraw {kTRUE} |
If true, draw corresponding value as label on working pad. | |
Bool_t | fbHasConnector {kTRUE} |
Switch connection line between marker and label on or off. | |
Bool_t | fbHasLabel {kTRUE} |
Switch marker label on or off. | |
Bool_t | fbIsPainted {kFALSE} |
Flag to prevent Paint() method to redraw marker views after UnDraw. | |
Bool_t | fbVisible {kTRUE} |
Visibility of this marker on pad. | |
Bool_t | fbXbinDraw {kTRUE} |
If true, draw corresponding value as label on working pad. | |
Bool_t | fbXDraw {kTRUE} |
If true, draw corresponding value as label on working pad. | |
Bool_t | fbYbinDraw {kTRUE} |
If true, draw corresponding value as label on working pad. | |
Bool_t | fbYDraw {kTRUE} |
If true, draw corresponding value as label on working pad. | |
TVirtualPad * | fxDrawPad {nullptr} |
Remember last pad used for Draw. | |
TH1 * | fxHisto {nullptr} |
Reference to currently used histogram (for bin contents). | |
TString | fxName |
since TMarker is not TNamed, we provide identifier string here: | |
TString | fxNumFormat |
format string for all label numbers. | |
Static Private Attributes | |
static UInt_t | fguInstanceCounter = 0 |
use this counter for automatic naming and coloring | |
Extended graphical marker class for go4 condition editor and viewpanel.
Offers coordinate label updated from pad. Scans work histogram for bin numbers and contents.
Definition at line 32 of file TGo4Marker.h.
TGo4Marker::TGo4Marker | ( | ) |
Definition at line 50 of file TGo4Marker.cxx.
References InitLabelStyle().
TGo4Marker::TGo4Marker | ( | Double_t | x, |
Double_t | y, | ||
Int_t | style ) |
Definition at line 42 of file TGo4Marker.cxx.
References fguInstanceCounter, fxName, and InitLabelStyle().
|
virtual |
Definition at line 57 of file TGo4Marker.cxx.
Bool_t TGo4Marker::CheckDrawPad | ( | ) | const |
True if current draw pad is still existing.
Definition at line 69 of file TGo4Marker.cxx.
References fxDrawPad.
Referenced by GetCont(), GetLabelX(), GetLabelY(), GetXbin(), GetYbin(), and Paint().
Bool_t TGo4Marker::CheckHistogram | ( | ) | const |
True if current histogram is still existing.
Definition at line 79 of file TGo4Marker.cxx.
References fxHisto.
Referenced by GetCont(), GetXbin(), GetYbin(), and SetToBin().
|
virtual |
Factory method to generate (optional subclass) implementation for painter.
Definition at line 142 of file TGo4Marker.cxx.
References GetName().
Referenced by Paint().
void TGo4Marker::DeletePainter | ( | ) |
Definition at line 293 of file TGo4Marker.cxx.
References fxPainter.
Referenced by TGo4ViewPanel::MakePictureForPad().
|
override |
Draw this marker on current pad.
Definition at line 101 of file TGo4Marker.cxx.
References IsVisible(), SetDrawPad(), SetPainted(), and UnDraw().
Referenced by TGo4ViewPanel::PadClickedSlot().
|
override |
Reimplemented to pop our labels to front when selected.
Definition at line 131 of file TGo4Marker.cxx.
References fxPainter.
Int_t TGo4Marker::GetCont | ( | ) | const |
Deliver bin content of work histogram at marker position.
Definition at line 180 of file TGo4Marker.cxx.
References CheckDrawPad(), CheckHistogram(), fxHisto, GetXbin(), and GetYbin().
Referenced by Print().
|
inline |
|
static |
Definition at line 271 of file TGo4Marker.cxx.
References fgbCONTDRAW, fgbHASCONNECTOR, fgbHASLABEL, fgbXBINDRAW, fgbXDRAW, fgbYBINDRAW, fgbYDRAW, and fgxNUMFORMAT.
Referenced by TGo4MarkerSettings::TGo4MarkerSettings(), and TGo4QSettings::setBasicSettings().
|
inline |
Definition at line 98 of file TGo4Marker.h.
References fxHisto.
Referenced by TGo4ViewPanel::CheckObjectsAssigments(), and Print().
|
static |
Definition at line 36 of file TGo4Marker.cxx.
References fguInstanceCounter.
Referenced by TGo4ViewPanel::PadClickedSlot().
Double_t TGo4Marker::GetLabelX | ( | ) | const |
Calculate initial label coordinate from marker position.
Definition at line 188 of file TGo4Marker.cxx.
References CheckDrawPad(), and fxDrawPad.
Double_t TGo4Marker::GetLabelY | ( | ) | const |
Calculate initial label coordinate from marker position.
Definition at line 197 of file TGo4Marker.cxx.
References CheckDrawPad(), and fxDrawPad.
|
inlineoverride |
TMarker is not TNamed, so we implement name ourself.
Definition at line 101 of file TGo4Marker.h.
References fxName.
Referenced by CreatePainter(), Print(), and TGo4ViewPanel::ProcessCanvasAdopt().
|
inline |
Definition at line 85 of file TGo4Marker.h.
References fxNumFormat.
Int_t TGo4Marker::GetXbin | ( | ) | const |
Deliver x axis bin number of work histogram at marker position.
Definition at line 166 of file TGo4Marker.cxx.
References CheckDrawPad(), CheckHistogram(), fxDrawPad, and fxHisto.
Int_t TGo4Marker::GetYbin | ( | ) | const |
Deliver y axis bin number of work histogram at marker position.
Definition at line 173 of file TGo4Marker.cxx.
References CheckDrawPad(), CheckHistogram(), fxDrawPad, and fxHisto.
|
inline |
Definition at line 73 of file TGo4Marker.h.
References fbHasConnector.
|
inline |
Definition at line 71 of file TGo4Marker.h.
References fbHasLabel.
void TGo4Marker::InitLabelStyle | ( | ) |
Initialize label setup from static default variables.
Definition at line 245 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(), and TGo4Marker().
|
inline |
Definition at line 83 of file TGo4Marker.h.
References fbContDraw.
|
inlineprotected |
|
inline |
Definition at line 64 of file TGo4Marker.h.
References fbVisible.
|
inline |
Definition at line 79 of file TGo4Marker.h.
References fbXbinDraw.
|
inline |
Definition at line 75 of file TGo4Marker.h.
References fbXDraw.
|
inline |
Definition at line 81 of file TGo4Marker.h.
References fbYbinDraw.
|
inline |
Definition at line 77 of file TGo4Marker.h.
References fbYDraw.
|
override |
Display marker with plain root canvas and in go4 viewpanel.
Definition at line 85 of file TGo4Marker.cxx.
References CheckDrawPad(), CreatePainter(), fxPainter, GetDrawPad(), IsPainted(), IsVisible(), SetDrawPad(), and SetPainted().
|
override |
Re-implement TObject method to pop all our views to front.
Definition at line 125 of file TGo4Marker.cxx.
References fxPainter.
|
override |
Implement standard root print.
If option is "go4log", print to TGo4Log::Message. Otherwise use cout
Definition at line 210 of file TGo4Marker.cxx.
References GetCont(), GetHistogram(), GetName(), GetXbin(), GetYbin(), TGo4Log::Message(), and TGo4Status::PrintLine().
void TGo4Marker::ResetLabel | ( | ) |
Will reset label position to defaults.
Definition at line 285 of file TGo4Marker.cxx.
References fxPainter.
void TGo4Marker::SaveLabelStyle | ( | ) |
This will save draw flags into static default setup.
Definition at line 233 of file TGo4Marker.cxx.
References fbContDraw, fbHasConnector, fbHasLabel, fbXbinDraw, fbXDraw, fbYbinDraw, fbYDraw, fgbCONTDRAW, fgbHASCONNECTOR, fgbHASLABEL, fgbXBINDRAW, fgbXDRAW, fgbYBINDRAW, fgbYDRAW, fgxNUMFORMAT, and fxNumFormat.
|
inline |
Definition at line 82 of file TGo4Marker.h.
References fbContDraw.
|
protected |
|
static |
Definition at line 257 of file TGo4Marker.cxx.
References fgbCONTDRAW, fgbHASCONNECTOR, fgbHASLABEL, fgbXBINDRAW, fgbXDRAW, fgbYBINDRAW, fgbYDRAW, and fgxNUMFORMAT.
Referenced by TGo4QSettings::getBasicSettings(), and TGo4MarkerSettings::setFlags().
void TGo4Marker::SetHistogram | ( | TH1 * | histo | ) |
Definition at line 74 of file TGo4Marker.cxx.
References fxHisto.
Referenced by TGo4ViewPanel::CheckObjectsAssigments(), TGo4ViewPanel::PadClickedSlot(), and TGo4ViewPanel::ProcessCanvasAdopt().
|
inline |
Definition at line 70 of file TGo4Marker.h.
References fbHasLabel.
|
inline |
Definition at line 72 of file TGo4Marker.h.
References fbHasConnector.
|
inlinevirtual |
Definition at line 65 of file TGo4Marker.h.
References fxName.
|
inline |
Definition at line 86 of file TGo4Marker.h.
References fxNumFormat.
|
inlineprotected |
Definition at line 166 of file TGo4Marker.h.
References fbIsPainted.
void TGo4Marker::SetToBin | ( | Int_t | xbin, |
Int_t | ybin = 0 ) |
Set marker to position according to work histogram axis.
Definition at line 149 of file TGo4Marker.cxx.
References CheckHistogram(), and fxHisto.
|
inline |
Definition at line 63 of file TGo4Marker.h.
References fbVisible.
|
inline |
Definition at line 78 of file TGo4Marker.h.
References fbXbinDraw.
|
inline |
Definition at line 74 of file TGo4Marker.h.
References fbXDraw.
|
inline |
Definition at line 103 of file TGo4Marker.h.
|
inline |
Definition at line 80 of file TGo4Marker.h.
References fbYbinDraw.
|
inline |
Definition at line 76 of file TGo4Marker.h.
References fbYDraw.
|
virtual |
Erase view of this marker from the pad.
Definition at line 115 of file TGo4Marker.cxx.
References fxPainter, SetDrawPad(), and SetPainted().
Referenced by ~TGo4Marker(), and Draw().
|
private |
If true, draw corresponding value as label on working pad.
Definition at line 202 of file TGo4Marker.h.
Referenced by InitLabelStyle(), IsContDraw(), SaveLabelStyle(), and SetContDraw().
|
private |
Switch connection line between marker and label on or off.
Definition at line 187 of file TGo4Marker.h.
Referenced by HasConnector(), InitLabelStyle(), SaveLabelStyle(), and SetLineDraw().
|
private |
Switch marker label on or off.
Definition at line 184 of file TGo4Marker.h.
Referenced by HasLabel(), InitLabelStyle(), SaveLabelStyle(), and SetLabelDraw().
|
private |
Flag to prevent Paint() method to redraw marker views after UnDraw.
Problem with Paint() called from ROOT event loop.
Definition at line 178 of file TGo4Marker.h.
Referenced by IsPainted(), and SetPainted().
|
private |
Visibility of this marker on pad.
For marker array in editor
Definition at line 181 of file TGo4Marker.h.
Referenced by IsVisible(), and SetVisible().
|
private |
If true, draw corresponding value as label on working pad.
Definition at line 196 of file TGo4Marker.h.
Referenced by InitLabelStyle(), IsXbinDraw(), SaveLabelStyle(), and SetXbinDraw().
|
private |
If true, draw corresponding value as label on working pad.
Definition at line 190 of file TGo4Marker.h.
Referenced by InitLabelStyle(), IsXDraw(), SaveLabelStyle(), and SetXDraw().
|
private |
If true, draw corresponding value as label on working pad.
Definition at line 199 of file TGo4Marker.h.
Referenced by InitLabelStyle(), IsYbinDraw(), SaveLabelStyle(), and SetYbinDraw().
|
private |
If true, draw corresponding value as label on working pad.
Definition at line 193 of file TGo4Marker.h.
Referenced by InitLabelStyle(), IsYDraw(), SaveLabelStyle(), and SetYDraw().
|
static |
default setting for all markers of bin content flag.
Definition at line 148 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
static |
default setting for all markers of connector line flag.
Definition at line 133 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
static |
default setting for all markers of label on/off flag.
Definition at line 130 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
static |
default setting for all markers of xbindraw flag.
Definition at line 142 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
static |
default setting for all markers of xdraw flag.
Definition at line 136 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
static |
default setting for all markers of ybindraw flag.
Definition at line 145 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
static |
default setting for all markers of ydraw flag.
Definition at line 139 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
staticprivate |
use this counter for automatic naming and coloring
Definition at line 215 of file TGo4Marker.h.
Referenced by TGo4Marker(), and GetInstances().
|
static |
default setting for all conditions with format string for numbers.
Definition at line 151 of file TGo4Marker.h.
Referenced by GetGlobalStyle(), InitLabelStyle(), SaveLabelStyle(), and SetGlobalStyle().
|
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 212 of file TGo4Marker.h.
Referenced by CheckDrawPad(), GetDrawPad(), GetLabelX(), GetLabelY(), GetXbin(), GetYbin(), and SetDrawPad().
|
private |
Reference to currently used histogram (for bin contents).
Definition at line 208 of file TGo4Marker.h.
Referenced by CheckHistogram(), GetCont(), GetHistogram(), GetXbin(), GetYbin(), SetHistogram(), and SetToBin().
|
private |
since TMarker is not TNamed, we provide identifier string here:
Definition at line 174 of file TGo4Marker.h.
Referenced by TGo4Marker(), GetName(), and SetName().
|
private |
format string for all label numbers.
Definition at line 205 of file TGo4Marker.h.
Referenced by GetNumFormat(), InitLabelStyle(), SaveLabelStyle(), and SetNumFormat().
|
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 164 of file TGo4Marker.h.
Referenced by ~TGo4Marker(), DeletePainter(), ExecuteEvent(), Paint(), Pop(), ResetLabel(), and UnDraw().