#include <ctime>
#include <cstdio>
TString stime(time_t* t,
bool utc =
false,
bool display_time_zone =
true) {
char buf[256];
if (display_time_zone) strftime(buf,
sizeof(buf),
"%Y-%m-%d %H:%M:%S %Z",
tt);
else strftime(buf,
sizeof(buf),
"%Y-%m-%d %H:%M:%S",
tt);
}
time_t
offset[] = {0, 0, 1325376000, 1341100800};
time_t t[] = {1331150400, 1336417200, 0, 36000};
c->SetTopMargin(0);
c->SetBottomMargin(0);
c->SetLeftMargin(0);
c->SetRightMargin(0);
for(int i = 0; i < 4; ++i){
for(int gmt = 0; gmt < 2; ++gmt){
const char* opt = (gmt ? "gmt" : "local");
p->SetTopMargin(0);
p->SetBottomMargin(0);
p->SetLeftMargin(0);
p->SetRightMargin(0);
TGaxis* ga =
new TGaxis (.4, .25, 5., .25, t[i], t[i] + 1, 1,
"t");
const char* offsettimeformat =
a.GetTimeFormat();
char buf[256];
sprintf(buf, "#splitline{%s, %s}{offset: %ld, option %s}",
stime(t+i).Data(), stime(t+i,
true).Data(),
offset[i], opt);
} else {
int m = (t[i] - 3600 *
h) / 60 ;
int s = (t[i] -
h * 3600 -
m * 60);
sprintf(buf, "#splitline{%d h %d m %d s}{offset: %s, option %s}",
h,
m, s, stime(
offset + i, gmt).Data(), opt);
}
sprintf(buf, "Expecting: #color[2]{%s}", stime(&t_, gmt, false).Data());
}
}
}
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Class to manage histogram axis.
void SetTimeFormat(const char *tformat)
Change the format used for time plotting.
void SetLabelFont(Int_t labelfont)
void SetLabelOffset(Float_t labeloffset)
void SetTimeOffset(Double_t toffset, Option_t *option="local")
Change the time offset. If option = "gmt", set display mode to GMT.
void SetLabelColor(Int_t labelcolor)
void SetLabelSize(Float_t labelsize)
To draw Mathematical Formula.
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters And copy object attributes.
Use the TLine constructor to create a simple line.
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
TVirtualPad is an abstract base class for the Pad and Canvas classes.