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");
64 CGFloat* lengths =
new CGFloat[
n];
65 for (
int i = 0; i <
n; i++)
67 CGContextSetLineDash(ctx, 0, lengths,
n);
70 CGContextSetLineDash(ctx, 0, NULL, 0);
78 assert(ctx != 0 &&
"SetLineStyle, ctx parameter is null");
80 static Int_t dashed[2] = {3, 3};
81 static Int_t dotted[2] = {1, 2};
82 static Int_t dasheddotted[4] = {3, 4, 1, 4};
86 }
else if (lstyle == 2) {
88 }
else if (lstyle == 3) {
90 }
else if (lstyle == 4) {
97 std::vector<Int_t> linestyle(nt);
98 for (
Int_t j = 0; j<nt; j++) {
100 sscanf(((
TObjString*)tokens->
At(j))->GetName(),
"%d", &it);
101 linestyle[j] = (
Int_t)(it/4);
114 assert(ctx != 0 &&
"SetLineWidth, ctx parameter is null");
120 CGContextSetLineWidth(ctx, width ? width : 1);
126 assert(ctx != 0 &&
"DrawLine, ctx parameter is null");
128 CGContextBeginPath(ctx);
129 CGContextMoveToPoint(ctx, x1, y1);
130 CGContextAddLineToPoint(ctx, x2, y2);
131 CGContextStrokePath(ctx);
142 assert(ctx != 0 &&
"DrawPolyLine, ctx parameter is null");
143 assert(xy != 0 &&
"DrawPolyLine, xy parameter is null");
145 CGContextBeginPath(ctx);
146 CGContextMoveToPoint(ctx, xy[0].fX, xy[0].fY);
147 for (
Int_t i = 1; i <
n; ++i)
148 CGContextAddLineToPoint(ctx, xy[i].fX, xy[i].fY);
150 if (xy[
n - 1].fX == xy[0].fX && xy[
n - 1].fY == xy[0].fY)
151 CGContextClosePath(ctx);
153 CGContextStrokePath(ctx);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Color_t
Color number (short).
float Float_t
Float 4 bytes (float).
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
Collectable string class.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
void DrawPolyLine(CGContextRef ctx, Int_t n, TPoint *xy)
Bool_t SetLineColor(CGContextRef ctx, Color_t colorIndex)
void SetLineType(CGContextRef ctx, Int_t n, Int_t *dash)
void DrawLine(CGContextRef ctx, Int_t x1, Int_t y1, Int_t x2, Int_t y2)
void SetLineWidth(CGContextRef ctx, Int_t width)
void SetLineStyle(CGContextRef ctx, Int_t lstyle)