31 assert(ctx != 0 &&
"SetLineColor, ctx parameter is null");
41 const CGFloat alpha = color->
GetAlpha();
43 color->
GetRGB(rgb[0], rgb[1], rgb[2]);
44 CGContextSetRGBStrokeColor(ctx, rgb[0], rgb[1], rgb[2], alpha);
61 assert(ctx != 0 &&
"SetLineType, ctx parameter is null");
65 for (
int i = 0; i <
n; i++)
67 CGContextSetLineDash(ctx, 0, lengths, n);
69 CGContextSetLineDash(ctx, 0,
NULL, 0);
77 assert(ctx != 0 &&
"SetLineStyle, ctx parameter is null");
79 static Int_t dashed[2] = {3, 3};
80 static Int_t dotted[2] = {1, 2};
81 static Int_t dasheddotted[4] = {3, 4, 1, 4};
85 }
else if (lstyle == 2) {
87 }
else if (lstyle == 3) {
89 }
else if (lstyle == 4) {
96 std::vector<Int_t> linestyle(nt);
97 for (
Int_t j = 0; j<nt; j++) {
99 sscanf(((
TObjString*)tokens->
At(j))->GetName(),
"%d", &it);
100 linestyle[j] = (
Int_t)(it/4);
113 assert(ctx != 0 &&
"SetLineWidth, ctx parameter is null");
119 CGContextSetLineWidth(ctx, width ? width : 1);
125 assert(ctx != 0 &&
"DrawLine, ctx parameter is null");
127 CGContextBeginPath(ctx);
128 CGContextMoveToPoint(ctx, x1, y1);
129 CGContextAddLineToPoint(ctx, x2, y2);
130 CGContextStrokePath(ctx);
141 assert(ctx != 0 &&
"DrawPolyLine, ctx parameter is null");
142 assert(xy != 0 &&
"DrawPolyLine, xy parameter is null");
144 CGContextBeginPath(ctx);
145 CGContextMoveToPoint(ctx, xy[0].fX, xy[0].fY);
146 for (
Int_t i = 1; i <
n; ++i)
147 CGContextAddLineToPoint(ctx, xy[i].fX, xy[i].fY);
149 if (xy[n - 1].fX == xy[0].fX && xy[n - 1].fY == xy[0].fY)
150 CGContextClosePath(ctx);
152 CGContextStrokePath(ctx);
const char * GetLineStyleString(Int_t i=1) const
Return line style string (used by PostScript).
Namespace for new ROOT classes and functions.
Collectable string class.
R__EXTERN TStyle * gStyle
static const double x2[5]
void SetLineType(CGContextRef ctx, Int_t n, Int_t *dash)
void DrawPolyLine(CGContextRef ctx, Int_t n, TPoint *xy)
void SetLineWidth(CGContextRef ctx, Int_t width)
virtual void GetRGB(Float_t &r, Float_t &g, Float_t &b) const
Bool_t SetLineColor(CGContextRef ctx, Color_t colorIndex)
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
void SetLineStyle(CGContextRef ctx, Int_t lstyle)
static const double x1[5]
void DrawLine(CGContextRef ctx, Int_t x1, Int_t y1, Int_t x2, Int_t y2)
The color creation and management class.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const