1 module kaleidic.api.mathgl.highlevel;
2 import kaleidic.api.mathgl.lowlevel;
3 //import mathgl.data;
4 //import mathgl.datac;
5 /**
6 This is a work in progress and does not yet compile
7 */
8 
9 /+
10 enum OpenGL = 0;
11 /// Wrapper class for all graphics
12 class MglGraph
13 {
14     private HMGL gr;
15     this(in MglGraph t) // copying is not allowed
16     {
17     }
18 
19     this(HMGL graph)
20     {
21         gr = graph;
22         mgl_use_graph(gr, 1);
23     }
24 
25     ~this()
26     {
27         if (mgl_use_graph(gr, -1) < 1)
28             mgl_delete_graph(gr);
29     }
30 
31     this(int kind = 0, int width = 600, int height = 400)
32     {
33         if (kind ==  - 1)
34             gr = null;
35 
36         version (OpenGL)
37         {
38             if (kind ==  - 1)
39                 gr = null;
40             else if (kind == 1)
41                 gr = mgl_create_graph_gl();
42         }
43         else
44         {
45             if (kind ==  - 1)
46                 gr = null;
47             else if (kind == 1)
48             {
49                 gr = mgl_create_graph(width, height);
50                 SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL.");
51             }
52     	    else
53         	    gr = mgl_create_graph(width, height);
54         }
55     }
56 
57     /// Get pointer to internal HMGL object
58     HMGL getHGML()
59     {
60         return gr;
61     }
62 
63     /// Set default parameters for plotting
64     void DefaultPlotParam()
65     {
66         mgl_set_def_param(gr);
67     }
68 
69     /// Set name of plot for saving filename
70     void SetPlotId(string id)
71     {
72         mgl_set_plotid(gr, id);
73     }
74 
75     /// Get name of plot for saving filename
76     const(char*) GetPlotId()
77     {
78         return mgl_get_plotid(gr);
79     }
80 
81     /// Ask to stop drawing
82     void Stop(bool stop = true)
83     {
84         mgl_ask_stop(gr, stop);
85     }
86 
87     /// Check if plot termination is asked
88     bool NeedStop()
89     {
90         return mgl_need_stop(gr);
91     }
92 
93     /// Set callback function for event processing
94     void SetEventFunc(void function(void*), void * par = null)
95     {
96         mgl_set_event_func(gr, func, par);
97     }
98 
99     /// Set the transparency on/off.
100     void Alpha(bool enable)
101     {
102         mgl_set_alpha(gr, enable);
103     }
104 
105     /// Set default value of alpha-channel
106     void SetAlphaDef(double alpha)
107     {
108         mgl_set_alpha_default(gr, alpha);
109     }
110 
111     /// Set the transparency type (0 - usual, 1 - glass, 2 - lamp)
112     void SetTranspType(int type)
113     {
114         mgl_set_transp_type(gr, type);
115     }
116 
117     /// Set the using of light on/off.
118     void Light(bool enable)
119     {
120         mgl_set_light(gr, enable);
121     }
122 
123     /// Switch on/off the specified light source.
124     void Light(int n, bool enable)
125     {
126         mgl_set_light_n(gr, n, enable);
127     }
128 
129     /// Use diffusive light (only for local light sources) -- OBSOLETE
130     void SetDifLight(bool dif)
131     {
132         mgl_set_light_dif(gr, dif);
133     }
134 
135     /// Add a light source.
136     void AddLight(int n, mglPoint p, char col = 'w', double bright = 0.5, double ap = 0)
137     {
138         mgl_add_light_ext(gr, n, p.x, p.y, p.z, col, bright, ap);
139     }
140 
141     void AddLight(int n, mglPoint r, mglPoint p, char col = 'w', double bright = 0.5,
142         double ap = 0)
143     {
144         mgl_add_light_loc(gr, n, r.x, r.y, r.z, p.x, p.y, p.z, col, bright, ap);
145     }
146 
147     /// Set ambient light brightness
148     void SetAmbient(double i)
149     {
150         mgl_set_ambbr(gr, i);
151     }
152 
153     /// Set diffusive light brightness
154     void SetDiffuse(double i)
155     {
156         mgl_set_difbr(gr, i);
157     }
158 
159     /// Set the fog distance or switch it off (if d=0).
160     void Fog(double d, double dz = 0.25)
161     {
162         mgl_set_fog(gr, d, dz);
163     }
164 
165     /// Set relative width of rectangles in Bars, Barh, BoxPlot
166     void SetBarWidth(double width)
167     {
168         mgl_set_bar_width(gr, width);
169     }
170 
171     /// Set default size of marks (locally you can use "size" option)
172     void SetMarkSize(double size)
173     {
174         mgl_set_mark_size(gr, size);
175     }
176 
177     /// Set default size of arrows (locally you can use "size" option)
178     void SetArrowSize(double size)
179     {
180         mgl_set_arrow_size(gr, size);
181     }
182 
183     /// Set number of mesh lines (use 0 to draw all of them)
184     void SetMeshNum(int num)
185     {
186         mgl_set_meshnum(gr, num);
187     }
188 
189     /// Set number of visible faces (use 0 to draw all of them)
190     void SetFaceNum(int num)
191     {
192         mgl_set_facenum(gr, num);
193     }
194 
195     /// Set cutting for points outside of bounding box
196     void SetCut(bool cut)
197     {
198         mgl_set_cut(gr, cut);
199     }
200 
201     /// Set additional cutting box
202     void SetCutBox(mglPoint p1, mglPoint p2)
203     {
204         mgl_set_cut_box(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z);
205     }
206 
207     /// Set the cutting off condition (formula)
208     void CutOff(string EqC)
209     {
210         mgl_set_cutoff(gr, EqC);
211     }
212 
213     /// Set default font size
214     void SetFontSize(double size)
215     {
216         mgl_set_font_size(gr, size);
217     }
218 
219     /// Set default font style and color
220     void SetFontDef(string fnt)
221     {
222         mgl_set_font_def(gr, fnt);
223     }
224 
225     /// Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72)
226      void SetFontSizePT(double pt, int dpi = 72)
227     {
228         SetFontSize(pt * 27.0 / dpi);
229     }
230 
231     /// Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt)
232     void SetFontSizeCM(double cm, int dpi = 72)
233     {
234         SetFontSizePT(cm * 28.45, dpi);
235     }
236 
237     /// Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt)
238     void SetFontSizeIN(double inp, int dpi = 72)
239     {
240         SetFontSizePT(inp  * 72.27, dpi);
241     }
242     /// Load font from file
243     void LoadFont(string name, string path = null)
244     {
245         mgl_load_font(gr, name, path);
246     }
247 
248     /// Copy font from another mglGraph instance
249     void CopyFont(const(mglGraph*) GR)
250     {
251         mgl_copy_font(gr, GR.gr);
252     }
253 
254     /// Restore font (load default font for new HMGL objects)
255     void RestoreFont()
256     {
257         mgl_restore_font(gr);
258     }
259 
260     /// Set to use or not text rotation
261     void SetRotatedText(bool rotated)
262     {
263         mgl_set_rotated_text(gr, rotated);
264     }
265 
266     /// Set default font for all new HMGL and mglGraph objects
267     static void SetDefFont(string name, string path = null)
268     {
269         mgl_def_font(name, path);
270     }
271 
272     /// Set default palette
273     void SetPalette(string colors)
274     {
275         mgl_set_palette(gr, colors);
276     }
277 
278     /// Set default color scheme
279     void SetDefScheme(string sch)
280     {
281         mgl_set_def_sch(gr, sch);
282     }
283 
284     /// Sets RGB values for color with given id
285     static void SetColor(char id, double r, double g, double b)
286     {
287         mgl_set_color(id, r, g, b);
288     }
289 
290     /// Set mask for face coloring as array of type 'ubyte[8]'
291     static void SetMask(char id, string mask)
292     {
293         mgl_set_mask(id, mask);
294     }
295 
296     /// Set mask for face coloring as uint64_t number
297     static void SetMask(char id, uint64_t mask)
298     {
299         mgl_set_mask_val(id, mask);
300     }
301 
302     /// Set default mask rotation angle
303     void SetMaskAngle(int angle)
304     {
305         mgl_set_mask_angle(gr, angle);
306     }
307 
308     /// Get last warning code
309     int GetWarn()
310     {
311         return mgl_get_warn(gr);
312     }
313 
314     /// Set warning code ant fill message
315     void SetWarn(int code, string info)
316     {
317         mgl_set_warn(gr, code, info);
318     }
319 
320     /// Get text of warning message(s)
321     const(char*) Message()
322     {
323         return mgl_get_mess(gr);
324     }
325 
326     /// Set global warning message
327     static void SetGlobalWarn(string text)
328     {
329         mgl_set_global_warn(text);
330     }
331 
332     /// Get text of global warning message(s)
333     static const(char*) GlobalWarn()
334     {
335         return mgl_get_global_warn();
336     }
337 
338     /// Suppress printing warnings to stderr
339     static void SuppressWarn(bool on)
340     {
341         mgl_suppress_warn(on);
342     }
343 
344     /// Check if MathGL version is valid (return false) or not (return true)
345     static bool CheckVersion(string ver)
346     {
347         return mgl_check_version(ver);
348     }
349 
350     /// Set axis range scaling -- simplified way to shift/zoom axis range -- need to replot whole image!
351     void ZoomAxis(mglPoint p1 = mglPoint(0, 0, 0, 0), mglPoint p2 = mglPoint(1, 1,
352         1, 1))
353     {
354         mgl_zoom_axis(gr, p1.x, p1.y, p1.z, p1.c, p2.x, p2.y, p2.z, p2.c);
355     }
356 
357     /// Add [v1, v2] to the current range in direction dir
358     void AddRange(char dir, double v1, double v2)
359     {
360         mgl_add_range_val(gr, dir, v1, v2);
361     }
362 
363     /// Set range in direction dir as [v1, v2]
364     void SetRange(char dir, double v1, double v2)
365     {
366         mgl_set_range_val(gr, dir, v1, v2);
367     }
368 
369     /// Set range in direction dir as minimal and maximal values of data a
370     void SetRange(char dir, const(mglDataA*) dat, bool add = false)
371     {
372         mgl_set_range_dat(gr, dir, dat, add);
373     }
374 
375     /// Set values of axis range as minimal and maximal values of datas
376     void SetRanges(const(mglDataA*) xx, const(mglDataA*) yy,
377         const(mglDataA*) zz, const(mglDataA*) cc)
378     {
379         mgl_set_range_dat(gr, 'x', xx, 0);
380         mgl_set_range_dat(gr, 'y', yy, 0);
381         mgl_set_range_dat(gr, 'z', zz, 0);
382         mgl_set_range_dat(gr, 'c', cc, 0);
383     }
384 
385     /// Set values of axis range as minimal and maximal values of datas
386     void SetRanges(const(mglDataA*) xx, const(mglDataA*) yy, const(mglDataA*) zz)
387     {
388         mgl_set_range_dat(gr, 'x', xx, 0);
389         mgl_set_range_dat(gr, 'y', yy, 0);
390         mgl_set_range_dat(gr, 'z', zz, 0);
391         mgl_set_range_dat(gr, 'c', zz, 0);
392     }
393 
394     /// Set values of axis range as minimal and maximal values of datas
395     void SetRanges(const(mglDataA*) xx, const(mglDataA*) yy)
396     {
397         mgl_set_range_dat(gr, 'x', xx, 0);
398         mgl_set_range_dat(gr, 'y', yy, 0);
399     }
400 
401     /// Set values of axis ranges
402     void SetRanges(double x1, double x2, double y1, double y2, double z1 = 0, double z2 = 0)
403     {
404         mgl_set_ranges(gr, x1, x2, y1, y2, z1, z2);
405     }
406 
407     /// Set values of axis ranges
408     void SetRanges(mglPoint p1, mglPoint p2)
409     {
410         mgl_set_ranges(gr, p1.x, p2.x, p1.y, p2.y, p1.z, p2.z);
411     }
412 
413     /// Set ranges for automatic variables
414     void SetAutoRanges(double x1, double x2, double y1 = 0, double y2 = 0,
415         double z1 = 0, double z2 = 0, double c1 = 0, double c2 = 0)
416     {
417         mgl_set_auto_ranges(gr, x1, x2, y1, y2, z1, z2, c1, c2);
418     }
419 
420     /// Set ranges for automatic variables
421     void SetAutoRanges(mglPoint p1, mglPoint p2)
422     {
423         mgl_set_auto_ranges(gr, p1.x, p2.x, p1.y, p2.y, p1.z, p2.z, p1.c, p2.c);
424     }
425 
426     /// Set axis origin
427     void SetOrigin(mglPoint p)
428     {
429         mgl_set_origin(gr, p.x, p.y, p.z);
430     }
431 
432     void SetOrigin(double x0, double y0, double z0 = mglNaN)
433     {
434         mgl_set_origin(gr, x0, y0, z0);
435     }
436 
437     /// Set the transformation formulas for coordinate
438     void SetFunc(string EqX, string EqY, string EqZ = null, string EqA = null)
439     {
440         mgl_set_func(gr, EqX, EqY, EqZ, EqA);
441     }
442 
443     /// Set one of predefined transformation rule
444     void SetCoor(int how)
445     {
446         mgl_set_coor(gr, how);
447     }
448 
449     /// Set to draw Ternary axis (triangle like axis, grid and so on)
450     void Ternary(int val)
451     {
452         mgl_set_ternary(gr, val);
453     }
454 
455     /// Set to use or not tick labels rotation
456     void SetTickRotate(bool val)
457     {
458         mgl_set_tick_rotate(gr, val);
459     }
460 
461     /// Set to use or not tick labels skipping
462     void SetTickSkip(bool val)
463     {
464         mgl_set_tick_skip(gr, val);
465     }
466 
467     /// Set tick length
468     void SetTickLen(double len, double stt = 1)
469     {
470         mgl_set_tick_len(gr, len, stt);
471     }
472 
473     /// Set axis and ticks style
474     void SetAxisStl(string stl = "k", string tck = 0, string sub = 0)
475     {
476         mgl_set_axis_stl(gr, toStringz(stl), tck, sub);
477     }
478 
479     /// Set time templates for ticks
480     void SetTicksTime(char dir, double d = 0, string t = "")
481     {
482         mgl_set_ticks_time(gr, dir, d, t);
483     }
484 
485     /// Set ticks text (\n separated). Use "" to disable this feature.
486     void SetTicksVal(char dir, string lbl, bool add = false)
487     {
488         mgl_set_ticks_str(gr, dir, lbl, add);
489     }
490 
491     void SetTicksVal(char dir, const wchar_t* lbl, bool add = false)
492     {
493         mgl_set_ticks_wcs(gr, dir, lbl, add);
494     }
495 
496     /// Set ticks position and text (\n separated). Use "" to disable this feature.
497     void SetTicksVal(char dir, const(mglDataA*) v, string lbl, bool add = false)
498     {
499         mgl_set_ticks_val(gr, dir, v, lbl, add);
500     }
501 
502     void SetTicksVal(char dir, const(mglDataA*) v, const wchar_t* lbl, bool add = false)
503     {
504         mgl_set_ticks_valw(gr, dir, v, lbl, add);
505     }
506 
507     /// Add manual tick at given position. Use "" to disable this feature.
508     void AddTick(char dir, double val, string lbl)
509     {
510         mgl_add_tick(gr, dir, val, lbl);
511     }
512 
513     void AddTick(char dir, double val, const wchar_t* lbl)
514     {
515         mgl_add_tickw(gr, dir, val, lbl);
516     }
517 
518     /// Set the ticks parameters and string for its factor
519     void SetTicks(char dir, double d = 0, int ns = 0, double org = mglNaN, string factor = "")
520     {
521         mgl_set_ticks_fact(gr, dir, d, ns, org, factor);
522     }
523 
524     void SetTicks(char dir, double d, int ns, double org, const wchar_t* factor)
525     {
526         mgl_set_ticks_factw(gr, dir, d, ns, org, factor);
527     }
528 
529     /// Auto adjust ticks
530     void Adjust(string dir = "xyzc")
531     {
532         mgl_adjust_ticks(gr, dir);
533     }
534 
535     /// Set templates for ticks
536     void SetTickTempl(char dir, string t)
537     {
538         mgl_set_tick_templ(gr, dir, t);
539     }
540 
541     void SetTickTempl(char dir, const wchar_t* t)
542     {
543         mgl_set_tick_templw(gr, dir, t);
544     }
545 
546     /// Tune ticks
547     void SetTuneTicks(int tune, double fact_pos = 1.15)
548     {
549         mgl_tune_ticks(gr, tune, fact_pos);
550     }
551 
552     /// Set additional shift of tick labels
553     void SetTickShift(mglPoint p)
554     {
555         mgl_set_tick_shift(gr, p.x, p.y, p.z, p.c);
556     }
557 
558     /// Set to use UTC time instead of local time
559     void SetTimeUTC(bool enable)
560     {
561         mgl_set_flag(gr, enable, MGL_USE_GMTIME);
562     }
563 
564     /// Set to draw tick labels at axis origin
565     void SetOriginTick(bool enable = true)
566     {
567         mgl_set_flag(gr, !enable, MGL_NO_ORIGIN);
568     }
569 
570     /// Put further plotting in some region of whole frame.
571     void SubPlot(int nx, int ny, int m, const(char*) style = "<>_^", double dx = 0,
572         double dy = 0)
573     {
574         mgl_subplot_d(gr, nx, ny, m, style, dx, dy);
575     }
576 
577     /// Like SubPlot() but "join" several cells
578     void MultiPlot(int nx, int ny, int m, int dx, int dy, string style = "<>_^")
579     {
580         mgl_multiplot(gr, nx, ny, m, dx, dy, style);
581     }
582 
583     /// Put further plotting in a region of whole frame.
584     void InPlot(double x1, double x2, double y1, double y2, bool rel = true)
585     {
586         if (rel)
587             mgl_relplot(gr, x1, x2, y1, y2);
588         else
589             mgl_inplot(gr, x1, x2, y1, y2);
590     }
591 
592     /// Put further plotting in column cell of previous subplot
593     void ColumnPlot(int num, int ind, double d = 0)
594     {
595         mgl_columnplot(gr, num, ind, d);
596     }
597 
598     /// Put further plotting in matrix cell of previous subplot
599     void GridPlot(int nx, int ny, int ind, double d = 0)
600     {
601         mgl_gridplot(gr, nx, ny, ind, d);
602     }
603 
604     /// Put further plotting in cell of stick rotated on angles tet, phi
605     void StickPlot(int num, int i, double tet, double phi)
606     {
607         mgl_stickplot(gr, num, i, tet, phi);
608     }
609 
610     /// Set factor of plot size
611     void SetPlotFactor(double val)
612     {
613         mgl_set_plotfactor(gr, val);
614     }
615 
616     /// Push transformation matrix into stack
617     void Push()
618     {
619         mgl_mat_push(gr);
620     }
621 
622     /// Pop transformation matrix from stack
623     void Pop()
624     {
625         mgl_mat_pop(gr);
626     }
627 
628     /// Add title for current subplot/inplot
629     void Title(string title, const(char*) stl = "", double size = -2)
630     {
631         mgl_title(gr, title, stl, size);
632     }
633 
634     void Title(const wchar_t* title, const(char*) stl = "", double size = -2)
635     {
636         mgl_titlew(gr, title, stl, size);
637     }
638 
639     /// Set aspect ratio for further plotting.
640     void Aspect(double Ax, double Ay, double Az = 1)
641     {
642         mgl_aspect(gr, Ax, Ay, Az);
643     }
644 
645     /// Rotate a further plotting.
646     void Rotate(double TetX, double TetZ = 0, double TetY = 0)
647     {
648         mgl_rotate(gr, TetX, TetZ, TetY);
649     }
650 
651     /// Rotate a further plotting around vector {x,y,z}.
652     void RotateN(double Tet, double x, double y, double z)
653     {
654         mgl_rotate_vector(gr, Tet, x, y, z);
655     }
656 
657     /// Set perspective (in range [0,1)) for plot. Set to zero for switching off.
658     void Perspective(double val)
659     {
660         mgl_perspective(gr, val);
661     }
662 
663     /// Set angle of view independently from Rotate().
664     void View(double TetX, double TetZ = 0, double TetY = 0)
665     {
666         mgl_view(gr, TetX, TetZ, TetY);
667     }
668 
669     /// Set angle of view independently from Rotate().
670     void ViewAsRotate(double TetZ, double TetX, double TetY = 0)
671     {
672         mgl_view(gr, -TetX, -TetZ, -TetY);
673     }
674 
675     /// Zoom in/out a part of picture (use Zoom(0, 0, 1, 1) for restore default)
676     void Zoom(double x1, double y1, double x2, double y2)
677     {
678         mgl_zoom(gr, x1, y1, x2, y2);
679     }
680 
681     /// Set size of frame in pixels. Normally this function is called internally.
682     void SetSize(int width, int height)
683     {
684         mgl_set_size(gr, width, height);
685     }
686 
687     /// Set plot quality
688     void SetQuality(int qual = MGL_DRAW_NORM)
689     {
690         mgl_set_quality(gr, qual);
691     }
692 
693     /// Get plot quality
694     int GetQuality()
695     {
696         return mgl_get_quality(gr);
697     }
698 
699     /// Set drawing region for Quality&4
700     void SetDrawReg(long nx = 1, long ny = 1, long m = 0)
701     {
702         mgl_set_draw_reg(gr, nx, ny, m);
703     }
704 
705     /// Start group of objects
706     void StartGroup(string name)
707     {
708         mgl_start_group(gr, toStringz(name));
709     }
710 
711     /// End group of objects
712     void EndGroup()
713     {
714         mgl_end_group(gr);
715     }
716 
717     /// Highlight objects with given id
718     void Highlight(int id)
719     {
720         mgl_highlight(gr, id);
721     }
722 
723     /// Show current image
724     void ShowImage(string viewer, bool keep = 0)
725     {
726         mgl_show_image(gr, viewer, keep);
727     }
728 
729     /// Write the frame in file (depending extension, write current frame if fname is empty)
730     void WriteFrame(string fname = 0, const(char*) descr = "")
731     {
732         mgl_write_frame(gr, fname, descr);
733     }
734 
735     /// Write the frame in file using JPEG format
736     void WriteJPEG(string fname, const(char*) descr = "")
737     {
738         mgl_write_jpg(gr, fname, descr);
739     }
740 
741     /// Write the frame in file using PNG format with transparency
742     void WritePNG(string fname, const(char*) descr = "", bool alpha = true)
743     {
744         if (alpha)
745             mgl_write_png(gr, fname, descr);
746         else
747             mgl_write_png_solid(gr, fname, descr);
748     }
749 
750     /// Write the frame in file using BMP format
751     void WriteBMP(string fname, const(char*) descr = "")
752     {
753         mgl_write_bmp(gr, fname, descr);
754     }
755 
756     /// Write the frame in file using BMP format
757     void WriteTGA(string fname, const(char*) descr = "")
758     {
759         mgl_write_tga(gr, fname, descr);
760     }
761 
762     /// Write the frame in file using PostScript format
763     void WriteEPS(string fname, const(char*) descr = "")
764     {
765         mgl_write_eps(gr, fname, descr);
766     }
767 
768     /// Write the frame in file using LaTeX format
769     void WriteTEX(string fname, const(char*) descr = "")
770     {
771         mgl_write_tex(gr, fname, descr);
772     }
773 
774     /// Write the frame in file using PostScript format as bitmap
775     void WriteBPS(string fname, const(char*) descr = "")
776     {
777         mgl_write_bps(gr, fname, descr);
778     }
779 
780     /// Write the frame in file using SVG format
781     void WriteSVG(string fname, const(char*) descr = "")
782     {
783         mgl_write_svg(gr, fname, descr);
784     }
785 
786     /// Write the frame in file using GIF format (only for current frame!)
787     void WriteGIF(string fname, const(char*) descr = "")
788     {
789         mgl_write_gif(gr, fname, descr);
790     }
791 
792     /// Write the frame in file using OBJ format
793     void WriteOBJ(string fname, const(char*) descr = "", bool use_png = true)
794     {
795         mgl_write_obj(gr, fname, descr, use_png);
796     }
797 
798     /// Write the frame in file using OBJ format - Balakin way
799     void WriteOBJold(string fname, const(char*) descr = "", bool use_png = true)
800     {
801         mgl_write_obj_old(gr, fname, descr, use_png);
802     }
803 
804     /// Write the frame in file using XYZ format
805     void WriteXYZ(string fname, const(char*) descr = "")
806     {
807         mgl_write_xyz(gr, fname, descr);
808     }
809 
810     /// Write the frame in file using STL format (faces only)
811     void WriteSTL(string fname, const(char*) descr = "")
812     {
813         mgl_write_stl(gr, fname, descr);
814     }
815 
816     /// Write the frame in file using OFF format
817     void WriteOFF(string fname, const(char*) descr = "", bool colored = false)
818     {
819         mgl_write_off(gr, fname, descr, colored);
820     }
821 
822     //	/// Write the frame in file using X3D format
823     //	void WriteX3D(string fname,const (char*) descr="")
824     //	{	mgl_write_x3d(gr, fname, descr);	}
825     /// Write the frame in file using PRC format
826     void WritePRC(string fname, const(char*) descr = "", bool make_pdf = true)
827     {
828         mgl_write_prc(gr, fname, descr, make_pdf);
829     }
830 
831     /// Export in JSON format suitable for later drawing by JavaScript
832     void WriteJSON(string fname, const(char*) descr = "", bool force_z = false)
833     {
834         if (force_z)
835             mgl_write_json_z(gr, fname, descr);
836         else
837             mgl_write_json(gr, fname, descr);
838     }
839 
840     /// Return string of JSON data suitable for later drawing by JavaScript
841     const(char*) GetJSON()
842     {
843         return mgl_get_json(gr);
844     }
845 
846     /// Force preparing the image. It can be useful for OpenGL mode mostly.
847     void Finish()
848     {
849         mgl_finish(gr);
850     }
851 
852     /// Create new frame.
853     void NewFrame()
854     {
855         mgl_new_frame(gr);
856     }
857 
858     /// Finish frame drawing
859     void EndFrame()
860     {
861         mgl_end_frame(gr);
862     }
863 
864     /// Get the number of created frames
865     int GetNumFrame()
866     {
867         return mgl_get_num_frame(gr);
868     }
869 
870     /// Reset frames counter (start it from zero)
871     void ResetFrames()
872     {
873         mgl_reset_frames(gr);
874     }
875 
876     /// Delete primitives for i-th frame (work if MGL_VECT_FRAME is set on)
877     void DelFrame(int i)
878     {
879         mgl_del_frame(gr, i);
880     }
881 
882     /// Get drawing data for i-th frame (work if MGL_VECT_FRAME is set on)
883     void GetFrame(int i)
884     {
885         mgl_get_frame(gr, i);
886     }
887 
888     /// Set drawing data for i-th frame (work if MGL_VECT_FRAME is set on). Work as EndFrame() but don't add frame to GIF image.
889     void SetFrame(int i)
890     {
891         mgl_set_frame(gr, i);
892     }
893 
894     /// Append drawing data from i-th frame (work if MGL_VECT_FRAME is set on)
895     void ShowFrame(int i)
896     {
897         mgl_show_frame(gr, i);
898     }
899 
900     /// Clear list of primitives for current drawing
901     void ClearFrame()
902     {
903         mgl_clear_frame(gr);
904     }
905 
906     /// Start write frames to cinema using GIF format
907     void StartGIF(string fname, int ms = 100)
908     {
909         mgl_start_gif(gr, fname, ms);
910     }
911 
912     /// Stop writing cinema using GIF format
913     void CloseGIF()
914     {
915         mgl_close_gif(gr);
916     }
917 
918     /// Export points and primitives in file using MGLD format
919     void ExportMGLD(string fname, string descr = 0)
920     {
921         mgl_export_mgld(gr, fname, descr);
922     }
923 
924     /// Import points and primitives from file using MGLD format
925     void ImportMGLD(string fname, bool add = false)
926     {
927         mgl_import_mgld(gr, fname, add);
928     }
929 
930     /// Copy RGB values into array which is allocated by user
931     bool GetRGB(char* imgdata, int imglen)
932     {
933         long w = mgl_get_width(gr), h = mgl_get_height(gr);
934         if (imglen >= 3 * w * h)
935             memcpy(imgdata, mgl_get_rgb(gr), 3 * w * h);
936         return (imglen >= 3 * w * h);
937     }
938 
939     const(ubyte*) GetRGB()
940     {
941         return mgl_get_rgb(gr);
942     }
943 
944     /// Copy RGBA values into array which is allocated by user
945     bool GetRGBA(char* imgdata, int imglen)
946     {
947         long w = mgl_get_width(gr), h = mgl_get_height(gr);
948         if (imglen >= 4 * w * h)
949             memcpy(imgdata, mgl_get_rgba(gr), 4 * w * h);
950         return (imglen >= 4 * w * h);
951     }
952 
953     const(ubyte*) GetRGBA()
954     {
955         return mgl_get_rgba(gr);
956     }
957 
958     /// Copy BGRN values into array which is allocated by user
959     bool GetBGRN(ubyte* imgdata, int imglen)
960     {
961         long w = mgl_get_width(gr), h = mgl_get_height(gr), i;
962         const(ubyte*) buf = mgl_get_rgb(gr);
963         if (imglen >= 4 * w * h)
964             for (i = 0; i < w * h; i++)
965             {
966                 imgdata[4 * i] = buf[3 * i + 2];
967                 imgdata[4 * i + 1] = buf[3 * i + 1];
968                 imgdata[4 * i + 2] = buf[3 * i];
969                 imgdata[4 * i + 3] = 255;
970             }
971         return (imglen >= 4 * w * h);
972     }
973 
974     /// Copy RGBA values of background image into array which is allocated by user
975     bool GetBackground(char* imgdata, int imglen)
976     {
977         long w = mgl_get_width(gr), h = mgl_get_height(gr);
978         if (imglen >= 4 * w * h)
979             memcpy(imgdata, mgl_get_background(gr), 4 * w * h);
980         return imglen >= 4 * w * h;
981     }
982 
983     const(ubyte*) GetBackground()
984     {
985         return mgl_get_background(gr);
986     }
987 
988     /// Get width of the image
989     int GetWidth()
990     {
991         return mgl_get_width(gr);
992     }
993 
994     /// Get height of the image
995     int GetHeight()
996     {
997         return mgl_get_height(gr);
998     }
999 
1000     /// Calculate 3D coordinate {x,y,z} for screen point {xs,ys}
1001     mglPoint CalcXYZ(int xs, int ys)
1002     {
1003         mreal x, y, z;
1004         mgl_calc_xyz(gr, xs, ys, x, y, z);
1005         return mglPoint(x, y, z);
1006     }
1007 
1008     /// Calculate screen point {xs,ys} for 3D coordinate {x,y,z}
1009     mglPoint CalcScr(mglPoint p)
1010     {
1011         int xs, ys;
1012         mgl_calc_scr(gr, p.x, p.y, p.z, xs, ys);
1013         return mglPoint(xs, ys);
1014     }
1015 
1016     /// Set object/subplot id
1017     void SetObjId(int id)
1018     {
1019         mgl_set_obj_id(gr, id);
1020     }
1021 
1022     /// Get object id
1023     int GetObjId(long x, long y)
1024     {
1025         return mgl_get_obj_id(gr, x, y);
1026     }
1027 
1028     /// Get subplot id
1029     int GetSplId(long x, long y)
1030     {
1031         return mgl_get_spl_id(gr, x, y);
1032     }
1033 
1034     /// Check if {\a xs,\a ys} is close to active point with accuracy d, and return its position or -1
1035     long IsActive(int xs, int ys, int d = 1)
1036     {
1037         return mgl_is_active(gr, xs, ys, d);
1038     }
1039 
1040     /// Combine plots from 2 canvases. Result will be saved into this
1041     void Combine(const(mglGraph*) g)
1042     {
1043         mgl_combine_gr(gr, g.gr);
1044     }
1045 
1046     /// Clear up the frame
1047     void Clf(double r, double g, double b)
1048     {
1049         mgl_clf_rgb(gr, r, g, b);
1050     }
1051 
1052     void Clf(string col)
1053     {
1054         mgl_clf_str(gr, col);
1055     }
1056 
1057     void Clf(char col)
1058     {
1059         mgl_clf_chr(gr, col);
1060     }
1061 
1062     void Clf()
1063     {
1064         mgl_clf(gr);
1065     }
1066 
1067     /// Clear unused points and primitives. Useful only in combination with SetFaceNum().
1068     void ClearUnused()
1069     {
1070         mgl_clear_unused(gr);
1071     }
1072 
1073     /// Load background image
1074     void LoadBackground(string fname, double alpha = 1)
1075     {
1076         mgl_load_background(gr, fname, alpha);
1077     }
1078 
1079     /// Force drawing the image and use it as background one
1080     void Rasterize()
1081     {
1082         mgl_rasterize(gr);
1083     }
1084 
1085     /// Draws the point (ball) at position {x,y,z} with color c
1086     void Ball(mglPoint p, char c = 'r')
1087     {
1088         char s[3] = {'.', c, 0};
1089         mgl_mark(gr, p.x, p.y, p.z, s);
1090     }
1091 
1092     /// Draws the mark at position p
1093     void Mark(mglPoint p, string mark)
1094     {
1095         mgl_mark(gr, p.x, p.y, p.z, mark);
1096     }
1097 
1098     /// Draws the line between points by specified pen
1099     void Line(mglPoint p1, mglPoint p2, string pen = "B", int n = 2)
1100     {
1101         mgl_line(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, pen, n);
1102     }
1103 
1104     /// Draws the spline curve between points by specified pen
1105     void Curve(mglPoint p1, mglPoint d1, mglPoint p2, mglPoint d2, string pen = "B",
1106         int n = 100)
1107     {
1108         mgl_curve(gr, p1.x, p1.y, p1.z, d1.x, d1.y, d1.z, p2.x, p2.y, p2.z,
1109             d2.x, d2.y, d2.z, pen, n);
1110     }
1111 
1112     /// Draws the 3d error box e for point p
1113     void Error(mglPoint p, mglPoint e, string pen = "k")
1114     {
1115         mgl_error_box(gr, p.x, p.y, p.z, e.x, e.y, e.z, pen);
1116     }
1117 
1118     /// Draws the face between points with color stl (include interpolation up to 4 colors).
1119     void Face(mglPoint p1, mglPoint p2, mglPoint p3, mglPoint p4, string stl = "r")
1120     {
1121         mgl_face(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, p3.x, p3.y, p3.z, p4.x, p4.y,
1122             p4.z, stl);
1123     }
1124 
1125     /// Draws the face in y-z plane at point p with color stl (include interpolation up to 4 colors).
1126     void FaceX(mglPoint p, double wy, double wz, string stl = "w", double dx = 0, double dy = 0)
1127     {
1128         mgl_facex(gr, p.x, p.y, p.z, wy, wz, toStringz(stl), dx, dy);
1129     }
1130 
1131     /// Draws the face in x-z plane at point p with color stl (include interpolation up to 4 colors).
1132     void FaceY(mglPoint p, double wx, double wz, string stl = "w", double dx = 0, double dy = 0)
1133     {
1134         mgl_facey(gr, p.x, p.y, p.z, wx, wz, toStringz(stl), dx, dy);
1135     }
1136 
1137     /// Draws the face in x-y plane at point p with color stl (include interpolation up to 4 colors).
1138     void FaceZ(mglPoint p, double wx, double wy, string stl = "w", double dx = 0, double dy = 0)
1139     {
1140         mgl_facez(gr, p.x, p.y, p.z, wx, wy, toStringz(stl), dx, dy);
1141     }
1142 
1143     /// Draws the drop at point p in direction d with color col and radius r
1144     void Drop(mglPoint p, mglPoint d, double r, string col = "r", double shift = 1,
1145         double ap = 1)
1146     {
1147         mgl_drop(gr, p.x, p.y, p.z, d.x, d.y, d.z, r, col, shift, ap);
1148     }
1149 
1150     /// Draws the sphere at point p with color col and radius r
1151     void Sphere(mglPoint p, double r, string col = "r")
1152     {
1153         mgl_sphere(gr, p.x, p.y, p.z, r, col);
1154     }
1155 
1156     /// Draws the cone between points p1,p2 with radius r1,r2 and with style stl
1157     void Cone(mglPoint p1, mglPoint p2, double r1, double r2 = -1, string stl = "r@")
1158     {
1159         mgl_cone(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, r1, r2, stl);
1160     }
1161 
1162     /// Draws the ellipse between points p1,p2 with color stl and width r
1163     void Ellipse(mglPoint p1, mglPoint p2, double r, string stl = "r")
1164     {
1165         mgl_ellipse(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, r, stl);
1166     }
1167 
1168     /// Draws the circle at point p with color stl and radius r
1169     void Circle(mglPoint p, double r, string stl = "r")
1170     {
1171         mgl_ellipse(gr, p.x, p.y, p.z, p.x, p.y, p.z, r, stl);
1172     }
1173 
1174     /// Draws the rhomb between points p1,p2 with color stl and width r
1175     void Rhomb(mglPoint p1, mglPoint p2, double r, string stl = "r")
1176     {
1177         mgl_rhomb(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, r, stl);
1178     }
1179 
1180     /// Draws the polygon based on points p1,p2 with color stl
1181     void Polygon(mglPoint p1, mglPoint p2, int n, string stl = "r")
1182     {
1183         mgl_polygon(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, n, stl);
1184     }
1185 
1186     /// Draws the arc around axis pr with center at p0 and starting from p1, by color stl and angle a (in degrees)
1187     void Arc(mglPoint p0, mglPoint pr, mglPoint p1, double a, string stl = "r")
1188     {
1189         mgl_arc_ext(gr, p0.x, p0.y, p0.z, pr.x, pr.y, pr.z, p1.x, p1.y, p1.z, a, stl);
1190     }
1191 
1192     /// Draws the arc around axis 'z' with center at p0 and starting from p1, by color stl and angle a (in degrees)
1193     void Arc(mglPoint p0, mglPoint p1, double a, string stl = "r")
1194     {
1195         mgl_arc_ext(gr, p0.x, p0.y, p0.z, 0, 0, 1, p1.x, p1.y, p0.z, a, stl);
1196     }
1197 
1198     /// Draws bitmap (logo) which is stretched along whole axis range
1199     void Logo(long w, long h, const(ubyte*) rgba, bool smooth = false, string opt = "")
1200     {
1201         mgl_logo(gr, w, h, rgba, smooth, toStringz(opt));
1202     }
1203 
1204     void Logo(string fname, bool smooth = false, string opt = "")
1205     {
1206         mgl_logo_file(gr, fname, smooth, toStringz(opt));
1207     }
1208 
1209     /// Print text in position p with specified font
1210     void Putsw(mglPoint p, const wchar_t* text, const(char*) font = ":C", double size = -1)
1211     {
1212         mgl_putsw(gr, p.x, p.y, p.z, text, font, size);
1213     }
1214 
1215     void Puts(mglPoint p, const(char*) text, const(char*) font = ":C", double size = -1)
1216     {
1217         mgl_puts(gr, p.x, p.y, p.z, text, font, size);
1218     }
1219 
1220     void Putsw(double x, double y, const wchar_t* text, const(char*) font = ":AC",
1221         double size = -1)
1222     {
1223         mgl_putsw(gr, x, y, 0, text, font, size);
1224     }
1225 
1226     void Puts(double x, double y, const(char*) text, const(char*) font = ":AC", double size = -1)
1227     {
1228         mgl_puts(gr, x, y, 0, text, font, size);
1229     }
1230 
1231     /// Print text in position p along direction d with specified font
1232     void Putsw(mglPoint p, mglPoint d, const wchar_t* text, string font = ":L", double size = -1)
1233     {
1234         mgl_putsw_dir(gr, p.x, p.y, p.z, d.x, d.y, d.z, text, font, size);
1235     }
1236 
1237     void Puts(mglPoint p, mglPoint d, string text, string font = ":L", double size = -1)
1238     {
1239         mgl_puts_dir(gr, p.x, p.y, p.z, d.x, d.y, d.z, text, font, size);
1240     }
1241 
1242     /// Print text along the curve
1243     void Text(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1244         string text, string font = "", string opt = "")
1245     {
1246         mgl_text_xyz(gr, x, y, z, text, font, toStringz(opt));
1247     }
1248 
1249     void Text(const(mglDataA*) x, const(mglDataA*) y, string text, string font = "",
1250         string opt = "")
1251     {
1252         mgl_text_xy(gr, x, y, text, font, toStringz(opt));
1253     }
1254 
1255     void Text(const(mglDataA*) y, string text, string font = "", string opt = "")
1256     {
1257         mgl_text_y(gr, y, text, font, toStringz(opt));
1258     }
1259 
1260     void Text(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1261         const wchar_t* text, string font = "", string opt = "")
1262     {
1263         mgl_textw_xyz(gr, x, y, z, text, font, toStringz(opt));
1264     }
1265 
1266     void Text(const(mglDataA*) x, const(mglDataA*) y, const wchar_t* text,
1267         string font = "", string opt = "")
1268     {
1269         mgl_textw_xy(gr, x, y, text, font, toStringz(opt));
1270     }
1271 
1272     void Text(const(mglDataA*) y, const wchar_t* text, string font = "", string opt = "")
1273     {
1274         mgl_textw_y(gr, y, text, font, toStringz(opt));
1275     }
1276 
1277     /// Draws bounding box outside the plotting volume with color c.
1278     void Box(string col = "", bool ticks = true)
1279     {
1280         mgl_box_str(gr, col, ticks);
1281     }
1282 
1283     /// Draw axises with ticks in direction(s) dir.
1284     void Axis(string dir = "xyzt", string stl = "", string opt = "")
1285     {
1286         mgl_axis(gr, dir, stl, opt);
1287     }
1288 
1289     /// Draw grid lines perpendicular to direction(s) dir.
1290     void Grid(string dir = "xyzt", const(char*) pen = "B", string opt = "")
1291     {
1292         mgl_axis_grid(gr, dir, pen, toStringz(opt));
1293     }
1294 
1295     /// Print the label text for axis dir.
1296     void Label(char dir, string text, double pos = +1, string opt = "")
1297     {
1298         mgl_label(gr, dir, text, pos, toStringz(opt));
1299     }
1300 
1301     void Label(char dir, const wchar_t* text, double pos = +1, string opt = "")
1302     {
1303         mgl_labelw(gr, dir, text, pos, toStringz(opt));
1304     }
1305 
1306     /// Draw colorbar at edge of axis
1307     void Colorbar(string sch = "")
1308     {
1309         mgl_colorbar(gr, sch);
1310     }
1311 
1312     void Colorbar(string sch, double x, double y, double w = 1, double h = 1)
1313     {
1314         mgl_colorbar_ext(gr, toStringz(sch), x, y, w, h);
1315     }
1316 
1317     /// Draw colorbar with manual colors at edge of axis
1318     void Colorbar(const(mglDataA*) val, string sch = "")
1319     {
1320         mgl_colorbar_val(gr, val, sch);
1321     }
1322 
1323     void Colorbar(const(mglDataA*) val, string sch, double x, double y, double w = 1,
1324         double h = 1)
1325     {
1326         mgl_colorbar_val_ext(gr, val, toStringz(sch), x, y, w, h);
1327     }
1328 
1329     /// Add string to legend
1330     void AddLegend(string text, const(char*) style)
1331     {
1332         mgl_add_legend(gr, text, style);
1333     }
1334 
1335     void AddLegend(const wchar_t* text, const(char*) style)
1336     {
1337         mgl_add_legendw(gr, text, style);
1338     }
1339 
1340     /// Clear saved legend string
1341     void ClearLegend()
1342     {
1343         mgl_clear_legend(gr);
1344     }
1345 
1346     /// Draw legend of accumulated strings at position {x,y}
1347     void Legend(double x, double y, string font = "#", string opt = "")
1348     {
1349         mgl_legend_pos(gr, x, y, font, toStringz(opt));
1350     }
1351 
1352     /// Draw legend of accumulated strings
1353     void Legend(int where = 3, string font = "#", string opt = "")
1354     {
1355         mgl_legend(gr, where, font, toStringz(opt));
1356     }
1357 
1358     /// Set number of marks in legend sample
1359     void SetLegendMarks(int num)
1360     {
1361         mgl_set_legend_marks(gr, num);
1362     }
1363 
1364     /// Draw usual curve {x,y,z}
1365     void Plot(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1366         string pen = "", string opt = "")
1367     {
1368         mgl_plot_xyz(gr, x, y, z, pen, toStringz(opt));
1369     }
1370 
1371     void Plot(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1372     {
1373         mgl_plot_xy(gr, x, y, pen, opt);
1374     }
1375 
1376     void Plot(const(mglDataA*) y, string pen = "", string opt = "")
1377     {
1378         mgl_plot(gr, y, pen, opt);
1379     }
1380 
1381     /// Draw tape(s) which rotates as (bi-)normales of curve {x,y,z}
1382     void Tape(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1383         string pen = "", string opt = "")
1384     {
1385         mgl_tape_xyz(gr, x, y, z, pen, toStringz(opt));
1386     }
1387 
1388     void Tape(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1389     {
1390         mgl_tape_xy(gr, x, y, pen, opt);
1391     }
1392 
1393     void Tape(const(mglDataA*) y, string pen = "", string opt = "")
1394     {
1395         mgl_tape(gr, y, pen, opt);
1396     }
1397 
1398     /// Draw radar chart (plot in curved coordinates)
1399     void Radar(const(mglDataA*) a, string pen = "", string opt = "")
1400     {
1401         mgl_radar(gr, a, pen, toStringz(opt));
1402     }
1403 
1404     /// Draw stairs for points in arrays {x,y,z}
1405     void Step(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1406         string pen = "", string opt = "")
1407     {
1408         mgl_step_xyz(gr, x, y, z, pen, toStringz(opt));
1409     }
1410 
1411     void Step(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1412     {
1413         mgl_step_xy(gr, x, y, pen, toStringz(opt));
1414     }
1415 
1416     void Step(const(mglDataA*) y, string pen = "", string opt = "")
1417     {
1418         mgl_step(gr, y, pen, toStringz(opt));
1419     }
1420 
1421     /// Draw curve {x,y,z} which is colored by c (like tension plot)
1422     void Tens(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1423         const(mglDataA*) c, string pen = "", string opt = "")
1424     {
1425         mgl_tens_xyz(gr, x, y, z, c, pen, toStringz(opt));
1426     }
1427 
1428     void Tens(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) c,
1429         string pen = "", string opt = "")
1430     {
1431         mgl_tens_xy(gr, x, y, c, pen, toStringz(opt));
1432     }
1433 
1434     void Tens(const(mglDataA*) y, const(mglDataA*) c, string pen = "", string opt = "")
1435     {
1436         mgl_tens(gr, y, c, pen, toStringz(opt));
1437     }
1438 
1439     /// Fill area between curve {x,y,z} and axis plane
1440     void Area(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1441         string pen = "", string opt = "")
1442     {
1443         mgl_area_xyz(gr, x, y, z, pen, toStringz(opt));
1444     }
1445 
1446     void Area(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1447     {
1448         mgl_area_xy(gr, x, y, pen, toStringz(opt));
1449     }
1450 
1451     void Area(const(mglDataA*) y, string pen = "", string opt = "")
1452     {
1453         mgl_area(gr, y, pen, toStringz(opt));
1454     }
1455 
1456     /// Fill area between curves y1 and y2 specified parametrically
1457     void Region(const(mglDataA*) y1, const(mglDataA*) y2, string pen = "", string opt = "")
1458     {
1459         mgl_region(gr, y1, y2, pen, toStringz(opt));
1460     }
1461 
1462     void Region(const(mglDataA*) x, const(mglDataA*) y1, const(mglDataA*) y2,
1463         string pen = "", string opt = "")
1464     {
1465         mgl_region_xy(gr, x, y1, y2, pen, toStringz(opt));
1466     }
1467 
1468     /// Fill area (draw ribbon) between curves {x1,y1,z1} and {x2,y2,z2}
1469     void Region(const(mglDataA*) x1, const(mglDataA*) y1, const(mglDataA*) z1,
1470         const(mglDataA*) x2, const(mglDataA*) y2, const(mglDataA*) z2,
1471         string pen = "", string opt = "")
1472     {
1473         mgl_region_3d(gr, x1, y1, z1, x2, y2, z2, pen, toStringz(opt));
1474     }
1475 
1476     void Region(const(mglDataA*) x1, const(mglDataA*) y1, const(mglDataA*) x2,
1477         const(mglDataA*) y2, string pen = "", string opt = "")
1478     {
1479         mgl_region_3d(gr, x1, y1, null, x2, y2, null, pen, toStringz(opt));
1480     }
1481 
1482     /// Draw vertical lines from points {x,y,z} to axis plane
1483     void Stem(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1484         string pen = "", string opt = "")
1485     {
1486         mgl_stem_xyz(gr, x, y, z, pen, toStringz(opt));
1487     }
1488 
1489     void Stem(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1490     {
1491         mgl_stem_xy(gr, x, y, pen, toStringz(opt));
1492     }
1493 
1494     void Stem(const(mglDataA*) y, string pen = "", string opt = "")
1495     {
1496         mgl_stem(gr, y, pen, toStringz(opt));
1497     }
1498 
1499     /// Draw vertical bars from points {x,y,z} to axis plane
1500     void Bars(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1501         string pen = "", string opt = "")
1502     {
1503         mgl_bars_xyz(gr, x, y, z, pen, toStringz(opt));
1504     }
1505 
1506     void Bars(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1507     {
1508         mgl_bars_xy(gr, x, y, pen, toStringz(opt));
1509     }
1510 
1511     void Bars(const(mglDataA*) y, string pen = "", string opt = "")
1512     {
1513         mgl_bars(gr, y, pen, toStringz(opt));
1514     }
1515 
1516     /// Draw horizontal bars from points {x,y} to axis plane
1517     void Barh(const(mglDataA*) y, const(mglDataA*) v, string pen = "", string opt = "")
1518     {
1519         mgl_barh_yx(gr, y, v, pen, toStringz(opt));
1520     }
1521 
1522     void Barh(const(mglDataA*) v, string pen = "", string opt = "")
1523     {
1524         mgl_barh(gr, v, pen, toStringz(opt));
1525     }
1526 
1527     /// Draw chart for data a
1528     void Chart(const(mglDataA*) a, string colors = "", string opt = "")
1529     {
1530         mgl_chart(gr, a, colors, opt);
1531     }
1532 
1533     /// Draw Open-High-Low-Close (OHLC) diagram
1534     void OHLC(const(mglDataA*) x, const(mglDataA*) open, const(mglDataA*) high,
1535         const(mglDataA*) low, const(mglDataA*) close, string pen = "", string opt = "")
1536     {
1537         mgl_ohlc_x(gr, x, open, high, low, close, pen, opt);
1538     }
1539 
1540     void OHLC(const(mglDataA*) open, const(mglDataA*) high,
1541         const(mglDataA*) low, const(mglDataA*) close, string pen = "", string opt = "")
1542     {
1543         mgl_ohlc(gr, open, high, low, close, pen, opt);
1544     }
1545 
1546     /// Draw box-plot (special 5-value plot used in statistic)
1547     void BoxPlot(const(mglDataA*) x, const(mglDataA*) y, string pen = "", string opt = "")
1548     {
1549         mgl_boxplot_xy(gr, x, y, pen, opt);
1550     }
1551 
1552     void BoxPlot(const(mglDataA*) y, string pen = "", string opt = "")
1553     {
1554         mgl_boxplot(gr, y, pen, opt);
1555     }
1556 
1557     /// Draw candle plot
1558     void Candle(const(mglDataA*) x, const(mglDataA*) v1, const(mglDataA*) v2,
1559         const(mglDataA*) y1, const(mglDataA*) y2, string pen = "", string opt = "")
1560     {
1561         mgl_candle_xyv(gr, xv1v2, y1, y2, pen, toStringz(opt));
1562     }
1563 
1564     void Candle(const(mglDataA*) v1, const(mglDataA*) v2, const(mglDataA*) y1,
1565         const(mglDataA*) y2, string pen = "", string opt = "")
1566     {
1567         mgl_candle_yv(grv1v2, y1, y2, pen, toStringz(opt));
1568     }
1569 
1570     void Candle(const(mglDataA*) v1, const(mglDataA*) v2, string pen = "", string opt = "")
1571     {
1572         mgl_candle_yv(grv1v2, null, null, pen, toStringz(opt));
1573     }
1574 
1575     void Candle(const(mglDataA*) y, const(mglDataA*) y1, const(mglDataA*) y2,
1576         string pen = "", string opt = "")
1577     {
1578         mgl_candle(gr, y, y1, y2, pen, toStringz(opt));
1579     }
1580 
1581     void Candle(const(mglDataA*) y, string pen = "", string opt = "")
1582     {
1583         mgl_candle(gr, y, null, null, pen, toStringz(opt));
1584     }
1585 
1586     /// Draw cones from points {x,y,z} to axis plane
1587     void Cones(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1588         string pen = "@", string opt = "")
1589     {
1590         mgl_cones_xyz(gr, x, y, z, pen, toStringz(opt));
1591     }
1592 
1593     void Cones(const(mglDataA*) x, const(mglDataA*) z, string pen = "@", string opt = "")
1594     {
1595         mgl_cones_xz(gr, x, z, pen, toStringz(opt));
1596     }
1597 
1598     void Cones(const(mglDataA*) z, string pen = "@", string opt = "")
1599     {
1600         mgl_cones(gr, z, pen, toStringz(opt));
1601     }
1602 
1603     /// Draw error boxes {ex,ey} at points {x,y}
1604     void Error(const(mglDataA*) y, const(mglDataA*) ey, string pen = "", string opt = "")
1605     {
1606         mgl_error(gr, y, ey, pen, toStringz(opt));
1607     }
1608 
1609     void Error(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ey,
1610         string pen = "", string opt = "")
1611     {
1612         mgl_error_xy(gr, x, y, ey, pen, toStringz(opt));
1613     }
1614 
1615     void Error(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ex,
1616         const(mglDataA*) ey, string pen = "", string opt = "")
1617     {
1618         mgl_error_exy(gr, x, y, ex, ey, pen, toStringz(opt));
1619     }
1620 
1621     /// Draw marks with size r at points {x,y,z}
1622     void Mark(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1623         const(mglDataA*) r, string pen, string opt = "")
1624     {
1625         mgl_mark_xyz(gr, x, y, z, r, pen, toStringz(opt));
1626     }
1627 
1628     void Mark(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) r,
1629         string pen, string opt = "")
1630     {
1631         mgl_mark_xy(gr, x, y, r, pen, toStringz(opt));
1632     }
1633 
1634     void Mark(const(mglDataA*) y, const(mglDataA*) r, string pen, string opt = "")
1635     {
1636         mgl_mark_y(gr, y, r, pen, toStringz(opt));
1637     }
1638 
1639     /// Draw textual marks with size r at points {x,y,z}
1640     void TextMark(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1641         const(mglDataA*) r, string text, string fnt = "", string opt = "")
1642     {
1643         mgl_textmark_xyzr(gr, x, y, z, r, text, fnt, toStringz(opt));
1644     }
1645 
1646     void TextMark(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) r,
1647         string text, string fnt = "", string opt = "")
1648     {
1649         mgl_textmark_xyr(gr, x, y, r, text, fnt, toStringz(opt));
1650     }
1651 
1652     void TextMark(const(mglDataA*) y, const(mglDataA*) r, string text,
1653         string fnt = "", string opt = "")
1654     {
1655         mgl_textmark_yr(gr, y, r, text, fnt, toStringz(opt));
1656     }
1657 
1658     void TextMark(const(mglDataA*) y, string text, string fnt = "", string opt = "")
1659     {
1660         mgl_textmark(gr, y, text, fnt, toStringz(opt));
1661     }
1662 
1663     void TextMark(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1664         const(mglDataA*) r, const wchar_t* text, string fnt = "", string opt = "")
1665     {
1666         mgl_textmarkw_xyzr(gr, x, y, z, r, text, fnt, toStringz(opt));
1667     }
1668 
1669     void TextMark(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) r,
1670         const wchar_t* text, string fnt = "", string opt = "")
1671     {
1672         mgl_textmarkw_xyr(gr, x, y, r, text, fnt, toStringz(opt));
1673     }
1674 
1675     void TextMark(const(mglDataA*) y, const(mglDataA*) r, const wchar_t* text,
1676         string fnt = "", string opt = "")
1677     {
1678         mgl_textmarkw_yr(gr, y, r, text, fnt, toStringz(opt));
1679     }
1680 
1681     void TextMark(const(mglDataA*) y, const wchar_t* text, string fnt = "", string opt = "")
1682     {
1683         mgl_textmarkw(gr, y, text, fnt, toStringz(opt));
1684     }
1685 
1686     /// Draw labels for points coordinate(s) at points {x,y,z}
1687     void Label(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1688         string text, string fnt = "", string opt = "")
1689     {
1690         mgl_label_xyz(gr, x, y, z, text, fnt, toStringz(opt));
1691     }
1692 
1693     void Label(const(mglDataA*) x, const(mglDataA*) y, string text, string fnt = "",
1694         string opt = "")
1695     {
1696         mgl_label_xy(gr, x, y, text, fnt, toStringz(opt));
1697     }
1698 
1699     void Label(const(mglDataA*) y, string text, string fnt = "", string opt = "")
1700     {
1701         mgl_label_y(gr, y, text, fnt, toStringz(opt));
1702     }
1703 
1704     void Label(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1705         const wchar_t* text, string fnt = "", string opt = "")
1706     {
1707         mgl_labelw_xyz(gr, x, y, z, text, fnt, toStringz(opt));
1708     }
1709 
1710     void Label(const(mglDataA*) x, const(mglDataA*) y, const wchar_t* text,
1711         string fnt = "", string opt = "")
1712     {
1713         mgl_labelw_xy(gr, x, y, text, fnt, toStringz(opt));
1714     }
1715 
1716     void Label(const(mglDataA*) y, const wchar_t* text, string fnt = "", string opt = "")
1717     {
1718         mgl_labelw_y(gr, y, text, fnt, toStringz(opt));
1719     }
1720 
1721     /// Draw table for values val along given direction with row labels text
1722     void Table(const(mglDataA*) val, string text, string fnt = "#|", string opt = "")
1723     {
1724         mgl_table(gr, 0, 0, val, text, fnt, toStringz(opt));
1725     }
1726 
1727     void Table(const(mglDataA*) val, const wchar_t* text, string fnt = "#|", string opt = "")
1728     {
1729         mgl_tablew(gr, 0, 0, val, text, fnt, toStringz(opt));
1730     }
1731 
1732     /// Draw table for values val along given direction with row labels text at given position
1733     void Table(double x, double y, const(mglDataA*) val, string text,
1734         string fnt = "#|", string opt = "")
1735     {
1736         mgl_table(gr, x, y, val, text, fnt, toStringz(opt));
1737     }
1738 
1739     void Table(double x, double y, const(mglDataA*) val, const wchar_t* text,
1740         string fnt = "#|", string opt = "")
1741     {
1742         mgl_tablew(gr, x, y, val, text, fnt, toStringz(opt));
1743     }
1744 
1745     /// Draw tube with radius r around curve {x,y,z}
1746     void Tube(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1747         const(mglDataA*) r, string pen = "", string opt = "")
1748     {
1749         mgl_tube_xyzr(gr, x, y, z, r, pen, toStringz(opt));
1750     }
1751 
1752     void Tube(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1753         double r, string pen = "", string opt = "")
1754     {
1755         mgl_tube_xyz(gr, x, y, z, r, pen, toStringz(opt));
1756     }
1757 
1758     void Tube(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) r,
1759         string pen = "", string opt = "")
1760     {
1761         mgl_tube_xyr(gr, x, y, r, pen, toStringz(opt));
1762     }
1763 
1764     void Tube(const(mglDataA*) x, const(mglDataA*) y, double r, string pen = "", string opt = "")
1765     {
1766         mgl_tube_xy(gr, x, y, r, pen, toStringz(opt));
1767     }
1768 
1769     void Tube(const(mglDataA*) y, const(mglDataA*) r, string pen = "", string opt = "")
1770     {
1771         mgl_tube_r(gr, y, r, pen, toStringz(opt));
1772     }
1773 
1774     void Tube(const(mglDataA*) y, double r, string pen = "", string opt = "")
1775     {
1776         mgl_tube(gr, y, r, pen, toStringz(opt));
1777     }
1778 
1779     /// Draw surface of curve {r,z} rotatation around axis
1780     void Torus(const(mglDataA*) r, const(mglDataA*) z, string pen = "", string opt = "")
1781     {
1782         mgl_torus(gr, r, z, pen, opt);
1783     }
1784 
1785     /// Draw mesh lines for 2d data specified parametrically
1786     void Mesh(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1787         string stl = "", string opt = "")
1788     {
1789         mgl_mesh_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1790     }
1791 
1792     void Mesh(const(mglDataA*) z, string stl = "", string opt = "")
1793     {
1794         mgl_mesh(gr, z, toStringz(stl), toStringz(opt));
1795     }
1796 
1797     /// Draw mesh lines for 2d data specified parametrically
1798     void Fall(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1799         string stl = "", string opt = "")
1800     {
1801         mgl_fall_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1802     }
1803 
1804     void Fall(const(mglDataA*) z, string stl = "", string opt = "")
1805     {
1806         mgl_fall(gr, z, toStringz(stl), toStringz(opt));
1807     }
1808 
1809     /// Draw belts for 2d data specified parametrically
1810     void Belt(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1811         string stl = "", string opt = "")
1812     {
1813         mgl_belt_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1814     }
1815 
1816     void Belt(const(mglDataA*) z, string stl = "", string opt = "")
1817     {
1818         mgl_belt(gr, z, toStringz(stl), toStringz(opt));
1819     }
1820 
1821     /// Draw surface for 2d data specified parametrically with color proportional to z
1822     void Surf(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1823         string stl = "", string opt = "")
1824     {
1825         mgl_surf_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1826     }
1827 
1828     void Surf(const(mglDataA*) z, string stl = "", string opt = "")
1829     {
1830         mgl_surf(gr, z, toStringz(stl), toStringz(opt));
1831     }
1832 
1833     /// Draw grid lines for density plot of 2d data specified parametrically
1834     void Grid(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1835         string stl = "", string opt = "")
1836     {
1837         mgl_grid_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1838     }
1839 
1840     void Grid(const(mglDataA*) z, string stl = "", string opt = "")
1841     {
1842         mgl_grid(gr, z, toStringz(stl), toStringz(opt));
1843     }
1844 
1845     /// Draw vertical tiles for 2d data specified parametrically
1846     void Tile(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1847         string stl = "", string opt = "")
1848     {
1849         mgl_tile_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1850     }
1851 
1852     void Tile(const(mglDataA*) z, string stl = "", string opt = "")
1853     {
1854         mgl_tile(gr, z, toStringz(stl), toStringz(opt));
1855     }
1856 
1857     /// Draw density plot for 2d data specified parametrically
1858     void Dens(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1859         string stl = "", string opt = "")
1860     {
1861         mgl_dens_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1862     }
1863 
1864     void Dens(const(mglDataA*) z, string stl = "", string opt = "")
1865     {
1866         mgl_dens(gr, z, toStringz(stl), toStringz(opt));
1867     }
1868 
1869     /// Draw vertical boxes for 2d data specified parametrically
1870     void Boxs(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1871         string stl = "", string opt = "")
1872     {
1873         mgl_boxs_xy(gr, x, y, z, toStringz(stl), toStringz(opt));
1874     }
1875 
1876     void Boxs(const(mglDataA*) z, string stl = "", string opt = "")
1877     {
1878         mgl_boxs(gr, z, toStringz(stl), toStringz(opt));
1879     }
1880 
1881     /// Draw contour lines for 2d data specified parametrically
1882     void Cont(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
1883         const(mglDataA*) z, string sch = "", string opt = "")
1884     {
1885         mgl_cont_xy_val(grv, x, y, z, toStringz(sch), toStringz(opt));
1886     }
1887 
1888     void Cont(const(mglDataA*) v, const(mglDataA*) z, string sch = "", string opt = "")
1889     {
1890         mgl_cont_val(gr, v, z, toStringz(sch), toStringz(opt));
1891     }
1892 
1893     void Cont(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1894         string sch = "", string opt = "")
1895     {
1896         mgl_cont_xy(gr, x, y, z, toStringz(sch), toStringz(opt));
1897     }
1898 
1899     void Cont(const(mglDataA*) z, string sch = "", string opt = "")
1900     {
1901         mgl_cont(gr, z, toStringz(sch), toStringz(opt));
1902     }
1903 
1904     /// Draw solid contours for 2d data specified parametrically
1905     void ContF(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
1906         const(mglDataA*) z, string sch = "", string opt = "")
1907     {
1908         mgl_contf_xy_val(grv, x, y, z, toStringz(sch), toStringz(opt));
1909     }
1910 
1911     void ContF(const(mglDataA*) v, const(mglDataA*) z, string sch = "", string opt = "")
1912     {
1913         mgl_contf_val(gr, v, z, toStringz(sch), toStringz(opt));
1914     }
1915 
1916     void ContF(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1917         string sch = "", string opt = "")
1918     {
1919         mgl_contf_xy(gr, x, y, z, toStringz(sch), toStringz(opt));
1920     }
1921 
1922     void ContF(const(mglDataA*) z, string sch = "", string opt = "")
1923     {
1924         mgl_contf(gr, z, toStringz(sch), toStringz(opt));
1925     }
1926 
1927     /// Draw solid contours for 2d data specified parametrically with manual colors
1928     void ContD(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
1929         const(mglDataA*) z, string sch = "", string opt = "")
1930     {
1931         mgl_contd_xy_val(grv, x, y, z, toStringz(sch), toStringz(opt));
1932     }
1933 
1934     void ContD(const(mglDataA*) v, const(mglDataA*) z, string sch = "", string opt = "")
1935     {
1936         mgl_contd_val(gr, v, z, toStringz(sch), toStringz(opt));
1937     }
1938 
1939     void ContD(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1940         string sch = "", string opt = "")
1941     {
1942         mgl_contd_xy(gr, x, y, z, toStringz(sch), toStringz(opt));
1943     }
1944 
1945     void ContD(const(mglDataA*) z, string sch = "", string opt = "")
1946     {
1947         mgl_contd(gr, z, toStringz(sch), toStringz(opt));
1948     }
1949 
1950     /// Draw contour tubes for 2d data specified parametrically
1951     void ContV(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
1952         const(mglDataA*) z, string sch = "", string opt = "")
1953     {
1954         mgl_contv_xy_val(grv, x, y, z, toStringz(sch), toStringz(opt));
1955     }
1956 
1957     void ContV(const(mglDataA*) v, const(mglDataA*) z, string sch = "", string opt = "")
1958     {
1959         mgl_contv_val(gr, v, z, toStringz(sch), toStringz(opt));
1960     }
1961 
1962     void ContV(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1963         string sch = "", string opt = "")
1964     {
1965         mgl_contv_xy(gr, x, y, z, toStringz(sch), toStringz(opt));
1966     }
1967 
1968     void ContV(const(mglDataA*) z, string sch = "", string opt = "")
1969     {
1970         mgl_contv(gr, z, toStringz(sch), toStringz(opt));
1971     }
1972 
1973     /// Draw axial-symmetric isosurfaces for 2d data specified parametrically
1974     void Axial(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
1975         const(mglDataA*) z, string sch = "", string opt = "")
1976     {
1977         mgl_axial_xy_val(grv, x, y, z, toStringz(sch), opt);
1978     }
1979 
1980     void Axial(const(mglDataA*) v, const(mglDataA*) z, string sch = "", string opt = "")
1981     {
1982         mgl_axial_val(gr, v, z, toStringz(sch), toStringz(opt));
1983     }
1984 
1985     void Axial(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1986         string sch = "", string opt = "")
1987     {
1988         mgl_axial_xy(gr, x, y, z, toStringz(sch), toStringz(opt));
1989     }
1990 
1991     void Axial(const(mglDataA*) z, string sch = "", string opt = "")
1992     {
1993         mgl_axial(gr, z, toStringz(sch), toStringz(opt));
1994     }
1995 
1996     /// Draw grid lines for density plot at slice for 3d data specified parametrically
1997     void Grid3(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
1998         const(mglDataA*) a, string stl = "", double sVal = -1, string opt = "")
1999     {
2000         mgl_grid3_xyz(gr, x, y, z, a, toStringz(stl), sVal, toStringz(opt));
2001     }
2002 
2003     void Grid3(const(mglDataA*) a, string stl = "", double sVal = -1, string opt = "")
2004     {
2005         mgl_grid3(gr, a, toStringz(stl), sVal, toStringz(opt));
2006     }
2007 
2008     /// Draw density plot at slice for 3d data specified parametrically
2009     void Dens3(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2010         const(mglDataA*) a, string stl = "", double sVal = -1, string opt = "")
2011     {
2012         mgl_dens3_xyz(gr, x, y, z, a, toStringz(stl), sVal, toStringz(opt));
2013     }
2014 
2015     void Dens3(const(mglDataA*) a, string stl = "", double sVal = -1, string opt = "")
2016     {
2017         mgl_dens3(gr, a, toStringz(stl), sVal, toStringz(opt));
2018     }
2019 
2020     /// Draw isosurface(s) for 3d data specified parametrically
2021     void Surf3(double Val, const(mglDataA*) x, const(mglDataA*) y,
2022         const(mglDataA*) z, const(mglDataA*) a, string stl = "", string opt = "")
2023     {
2024         mgl_surf3_xyz_val(gr, Val, x, y, z, a, toStringz(stl), toStringz(opt));
2025     }
2026 
2027     void Surf3(double Val, const(mglDataA*) a, string stl = "", string opt = "")
2028     {
2029         mgl_surf3_val(gr, Val, a, toStringz(stl), toStringz(opt));
2030     }
2031 
2032     void Surf3(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2033         const(mglDataA*) a, string stl = "", string opt = "")
2034     {
2035         mgl_surf3_xyz(gr, x, y, z, a, toStringz(stl), toStringz(opt));
2036     }
2037 
2038     void Surf3(const(mglDataA*) a, string stl = "", string opt = "")
2039     {
2040         mgl_surf3(gr, a, toStringz(stl), toStringz(opt));
2041     }
2042 
2043     /// Draw a semi-transparent cloud for 3d data
2044     void Cloud(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2045         const(mglDataA*) a, string stl = "", string opt = "")
2046     {
2047         mgl_cloud_xyz(gr, x, y, z, a, toStringz(stl), toStringz(opt));
2048     }
2049 
2050     void Cloud(const(mglDataA*) a, string stl = "", string opt = "")
2051     {
2052         mgl_cloud(gr, a, toStringz(stl), toStringz(opt));
2053     }
2054 
2055     /// Draw contour lines at slice for 3d data specified parametrically
2056     void Cont3(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
2057         const(mglDataA*) z, const(mglDataA*) a, string sch = "", double sVal = -1,
2058         string opt = "")
2059     {
2060         mgl_cont3_xyz_val(grv, x, y, z, a, toStringz(sch), sVal, toStringz(opt));
2061     }
2062 
2063     void Cont3(const(mglDataA*) v, const(mglDataA*) a, string sch = "",
2064         double sVal = -1, string opt = "")
2065     {
2066         mgl_cont3_val(gr, v, a, toStringz(sch), sVal, toStringz(opt));
2067     }
2068 
2069     void Cont3(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2070         const(mglDataA*) a, string sch = "", double sVal = -1, string opt = "")
2071     {
2072         mgl_cont3_xyz(gr, x, y, z, a, toStringz(sch), sVal, toStringz(opt));
2073     }
2074 
2075     void Cont3(const(mglDataA*) a, string sch = "", double sVal = -1, string opt = "")
2076     {
2077         mgl_cont3(gr, a, toStringz(sch), sVal, toStringz(opt));
2078     }
2079 
2080     /// Draw solid contours at slice for 3d data specified parametrically
2081     void ContF3(const(mglDataA*) v, const(mglDataA*) x, const(mglDataA*) y,
2082         const(mglDataA*) z, const(mglDataA*) a, string sch = "", double sVal = -1,
2083         string opt = "")
2084     {
2085         mgl_contf3_xyz_val(grv, x, y, z, a, toStringz(sch), sVal, toStringz(opt));
2086     }
2087 
2088     void ContF3(const(mglDataA*) v, const(mglDataA*) a, string sch = "",
2089         double sVal = -1, string opt = "")
2090     {
2091         mgl_contf3_val(gr, v, a, toStringz(sch), sVal, toStringz(opt));
2092     }
2093 
2094     void ContF3(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2095         const(mglDataA*) a, string sch = "", double sVal = -1, string opt = "")
2096     {
2097         mgl_contf3_xyz(gr, x, y, z, a, toStringz(sch), sVal, toStringz(opt));
2098     }
2099 
2100     void ContF3(const(mglDataA*) a, string sch = "", double sVal = -1, string opt = "")
2101     {
2102         mgl_contf3(gr, a, toStringz(sch), sVal, toStringz(opt));
2103     }
2104 
2105     /// Draw several isosurfaces for 3d beam in curvilinear coordinates
2106     void Beam(const(mglDataA*) tr, const(mglDataA*) g1, const(mglDataA*) g2,
2107         const(mglDataA*) a, double r, string stl = 0, int flag = 0, int num = 3)
2108     {
2109         mgl_beam(gr, tr, g1, g2, a, r, stl, flag, num);
2110     }
2111 
2112     void Beam(double val, const(mglDataA*) tr, const(mglDataA*) g1,
2113         const(mglDataA*) g2, const(mglDataA*) a, double r, string stl = null, int flag = 0)
2114     {
2115         mgl_beam_val(gr, val, tr, g1, g2, a, r, stl, flag);
2116     }
2117 
2118     /// Draw vertical tiles with variable size r for 2d data specified parametrically
2119     void TileS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2120         const(mglDataA*) r, string stl = "", string opt = "")
2121     {
2122         mgl_tiles_xy(gr, x, y, z, r, toStringz(stl), toStringz(opt));
2123     }
2124 
2125     void TileS(const(mglDataA*) z, const(mglDataA*) r, string stl = "", string opt = "")
2126     {
2127         mgl_tiles(gr, z, r, toStringz(stl), toStringz(opt));
2128     }
2129 
2130     /// Draw surface for 2d data specified parametrically with color proportional to c
2131     void SurfC(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2132         const(mglDataA*) c, string sch = "", string opt = "")
2133     {
2134         mgl_surfc_xy(gr, x, y, z, c, toStringz(sch), opt);
2135     }
2136 
2137     void SurfC(const(mglDataA*) z, const(mglDataA*) c, string sch = "", string opt = "")
2138     {
2139         mgl_surfc(gr, z, c, toStringz(sch), opt);
2140     }
2141 
2142     /// Draw surface for 2d data specified parametrically with alpha proportional to c
2143     void SurfA(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2144         const(mglDataA*) c, string sch = "", string opt = "")
2145     {
2146         mgl_surfa_xy(gr, x, y, z, c, toStringz(sch), opt);
2147     }
2148 
2149     void SurfA(const(mglDataA*) z, const(mglDataA*) c, string sch = "", string opt = "")
2150     {
2151         mgl_surfa(gr, z, c, toStringz(sch), opt);
2152     }
2153 
2154     /// Color map of matrix a to matrix b, both matrix can parametrically depend on coordinates
2155     void Map(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) a,
2156         const(mglDataA*) b, string sch = "", string opt = "")
2157     {
2158         mgl_map_xy(gr, x, y, a, b, toStringz(sch), toStringz(opt));
2159     }
2160 
2161     void Map(const(mglDataA*) a, const(mglDataA*) b, string sch = "", string opt = "")
2162     {
2163         mgl_map(gr, a, b, toStringz(sch), toStringz(opt));
2164     }
2165 
2166     /// Draw density plot for spectra-gramm specified parametrically
2167     void STFA(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) re,
2168         const(mglDataA*) im, int dn, string sch = "", string opt = "")
2169     {
2170         mgl_stfa_xy(gr, x, y, re, im, dn, toStringz(sch), toStringz(opt));
2171     }
2172 
2173     void STFA(const(mglDataA*) re, const(mglDataA*) im, int dn, string sch = "", string opt = "")
2174     {
2175         mgl_stfa(gr, re, im, dn, toStringz(sch), toStringz(opt));
2176     }
2177 
2178     /// Draw isosurface(s) for 3d data specified parametrically with alpha proportional to b
2179     void Surf3A(double Val, const(mglDataA*) x, const(mglDataA*) y,
2180         const(mglDataA*) z, const(mglDataA*) a, const(mglDataA*) b, string stl = "",
2181         string opt = "")
2182     {
2183         mgl_surf3a_xyz_val(gr, Val, x, y, z, a, b, toStringz(stl), toStringz(opt));
2184     }
2185 
2186     void Surf3A(double Val, const(mglDataA*) a, const(mglDataA*) b, string stl = "",
2187         string opt = "")
2188     {
2189         mgl_surf3a_val(gr, Val, a, b, toStringz(stl), toStringz(opt));
2190     }
2191 
2192     void Surf3A(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2193         const(mglDataA*) a, const(mglDataA*) b, string stl = "", string opt = "")
2194     {
2195         mgl_surf3a_xyz(gr, x, y, z, a, b, toStringz(stl), toStringz(opt));
2196     }
2197 
2198     void Surf3A(const(mglDataA*) a, const(mglDataA*) b, string stl = "", string opt = "")
2199     {
2200         mgl_surf3a(gr, a, b, toStringz(stl), toStringz(opt));
2201     }
2202 
2203     /// Draw isosurface(s) for 3d data specified parametrically with color proportional to b
2204     void Surf3C(double Val, const(mglDataA*) x, const(mglDataA*) y,
2205         const(mglDataA*) z, const(mglDataA*) a, const(mglDataA*) b, string stl = "",
2206         string opt = "")
2207     {
2208         mgl_surf3c_xyz_val(gr, Val, x, y, z, a, b, toStringz(stl), opt);
2209     }
2210 
2211     void Surf3C(double Val, const(mglDataA*) a, const(mglDataA*) b, string stl = "",
2212         string opt = "")
2213     {
2214         mgl_surf3c_val(gr, Val, a, b, toStringz(stl), toStringz(opt));
2215     }
2216 
2217     void Surf3C(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2218         const(mglDataA*) a, const(mglDataA*) b, string stl = "", string opt = "")
2219     {
2220         mgl_surf3c_xyz(gr, x, y, z, a, b, toStringz(stl), toStringz(opt));
2221     }
2222 
2223     void Surf3C(const(mglDataA*) a, const(mglDataA*) b, string stl = "", string opt = "")
2224     {
2225         mgl_surf3c(gr, a, b, toStringz(stl), toStringz(opt));
2226     }
2227 
2228     /// Plot dew drops for vector field {ax,ay} parametrically depended on coordinate {x,y}
2229     void Dew(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ax,
2230         const(mglDataA*) ay, string sch = "", string opt = "")
2231     {
2232         mgl_dew_xy(gr, x, y, ax, ay, toStringz(sch), toStringz(opt));
2233     }
2234 
2235     void Dew(const(mglDataA*) ax, const(mglDataA*) ay, string sch = "", string opt = "")
2236     {
2237         mgl_dew_2d(gr, ax, ay, toStringz(sch), toStringz(opt));
2238     }
2239 
2240     /// Plot vectors at position {x,y,z} along {ax,ay,az} with length/color proportional to |a|
2241     void Traj(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ax,
2242         const(mglDataA*) ay, string sch = "", string opt = "")
2243     {
2244         mgl_traj_xy(gr, x, y, ax, ay, toStringz(sch), toStringz(opt));
2245     }
2246 
2247     void Traj(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2248         const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2249         string sch = "", string opt = "")
2250     {
2251         mgl_traj_xyz(gr, x, y, z, ax, ay, az, toStringz(sch), toStringz(opt));
2252     }
2253 
2254     /// Plot vector field {ax,ay,az} parametrically depended on coordinate {x,y,z} with length/color proportional to |a|
2255     void Vect(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ax,
2256         const(mglDataA*) ay, string sch = "", string opt = "")
2257     {
2258         mgl_vect_xy(gr, x, y, ax, ay, toStringz(sch), toStringz(opt));
2259     }
2260 
2261     void Vect(const(mglDataA*) ax, const(mglDataA*) ay, string sch = "", string opt = "")
2262     {
2263         mgl_vect_2d(gr, ax, ay, toStringz(sch), toStringz(opt));
2264     }
2265 
2266     void Vect(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2267         const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2268         string sch = "", string opt = "")
2269     {
2270         mgl_vect_xyz(gr, x, y, z, ax, ay, az, toStringz(sch), toStringz(opt));
2271     }
2272 
2273     void Vect(const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2274         string sch = "", string opt = "")
2275     {
2276         mgl_vect_3d(gr, ax, ay, az, toStringz(sch), toStringz(opt));
2277     }
2278 
2279     /// Draw vector plot at slice for 3d data specified parametrically
2280     void Vect3(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2281         const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2282         string stl = "", double sVal = -1, string opt = "")
2283     {
2284         mgl_vect3_xyz(gr, x, y, z, ax, ay, az, toStringz(stl), sVal, toStringz(opt));
2285     }
2286 
2287     void Vect3(const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2288         string stl = "", double sVal = -1, string opt = "")
2289     {
2290         mgl_vect3(gr, ax, ay, az, toStringz(stl), sVal, toStringz(opt));
2291     }
2292 
2293     /// Plot flows for vector field {ax,ay,az} parametrically depended on coordinate {x,y,z} with color proportional to |a|
2294     void Flow(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ax,
2295         const(mglDataA*) ay, string sch = "", string opt = "")
2296     {
2297         mgl_flow_xy(gr, x, y, ax, ay, toStringz(sch), toStringz(opt));
2298     }
2299 
2300     void Flow(const(mglDataA*) ax, const(mglDataA*) ay, string sch = "", string opt = "")
2301     {
2302         mgl_flow_2d(gr, ax, ay, toStringz(sch), toStringz(opt));
2303     }
2304 
2305     void Flow(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2306         const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2307         string sch = "", string opt = "")
2308     {
2309         mgl_flow_xyz(gr, x, y, z, ax, ay, az, toStringz(sch), toStringz(opt));
2310     }
2311 
2312     void Flow(const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2313         string sch = "", string opt = "")
2314     {
2315         mgl_flow_3d(gr, ax, ay, az, toStringz(sch), toStringz(opt));
2316     }
2317 
2318     /// Plot flow from point p for vector field {ax,ay,az} parametrically depended on coordinate {x,y,z} with color proportional to |a|
2319     void FlowP(mglPoint p, const(mglDataA*) x, const(mglDataA*) y,
2320         const(mglDataA*) ax, const(mglDataA*) ay, string sch = "", string opt = "")
2321     {
2322         mgl_flowp_xy(gr, p.x, p.y, p.z, x, y, ax, ay, toStringz(sch), toStringz(opt));
2323     }
2324 
2325     void FlowP(mglPoint p, const(mglDataA*) ax, const(mglDataA*) ay, string sch = "",
2326         string opt = "")
2327     {
2328         mgl_flowp_2d(gr, p.x, p.y, p.z, ax, ay, toStringz(sch), toStringz(opt));
2329     }
2330 
2331     void FlowP(mglPoint p, const(mglDataA*) x, const(mglDataA*) y,
2332         const(mglDataA*) z, const(mglDataA*) ax, const(mglDataA*) ay,
2333         const(mglDataA*) az, string sch = "", string opt = "")
2334     {
2335         mgl_flowp_xyz(gr, p.x, p.y, p.z, x, y, z, ax, ay, az, toStringz(sch), toStringz(opt));
2336     }
2337 
2338     void FlowP(mglPoint p, const(mglDataA*) ax, const(mglDataA*) ay,
2339         const(mglDataA*) az, string sch = "", string opt = "")
2340     {
2341         mgl_flowp_3d(gr, p.x, p.y, p.z, ax, ay, az, toStringz(sch), toStringz(opt));
2342     }
2343 
2344     /// Plot flows for gradient of scalar field phi parametrically depended on coordinate {x,y,z}
2345     void Grad(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2346         const(mglDataA*) phi, string sch = "", string opt = "")
2347     {
2348         mgl_grad_xyz(gr, x, y, z, phi, sch, opt);
2349     }
2350 
2351     void Grad(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) phi,
2352         string sch = "", string opt = "")
2353     {
2354         mgl_grad_xy(gr, x, y, phi, sch, opt);
2355     }
2356 
2357     void Grad(const(mglDataA*) phi, string sch = "", string opt = "")
2358     {
2359         mgl_grad(gr, phi, sch, opt);
2360     }
2361 
2362     /// Plot flow pipes for vector field {ax,ay,az} parametrically depended on coordinate {x,y,z} with color and radius proportional to |a|
2363     void Pipe(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) ax,
2364         const(mglDataA*) ay, string sch = "", double r0 = 0.05, string opt = "")
2365     {
2366         mgl_pipe_xy(gr, x, y, ax, ay, toStringz(sch), r0, toStringz(opt));
2367     }
2368 
2369     void Pipe(const(mglDataA*) ax, const(mglDataA*) ay, string sch = "",
2370         double r0 = 0.05, string opt = "")
2371     {
2372         mgl_pipe_2d(gr, ax, ay, toStringz(sch), r0, toStringz(opt));
2373     }
2374 
2375     void Pipe(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2376         const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2377         string sch = "", double r0 = 0.05, string opt = "")
2378     {
2379         mgl_pipe_xyz(gr, x, y, z, ax, ay, az, toStringz(sch), r0, toStringz(opt));
2380     }
2381 
2382     void Pipe(const(mglDataA*) ax, const(mglDataA*) ay, const(mglDataA*) az,
2383         string sch = "", double r0 = 0.05, string opt = "")
2384     {
2385         mgl_pipe_3d(gr, ax, ay, az, toStringz(sch), r0, toStringz(opt));
2386     }
2387 
2388     /// Draw density plot for data at x = sVal
2389     void DensX(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2390     {
2391         mgl_dens_x(gr, a, toStringz(stl), sVal, toStringz(opt));
2392     }
2393 
2394     /// Draw density plot for data at y = sVal
2395     void DensY(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2396     {
2397         mgl_dens_y(gr, a, toStringz(stl), sVal, toStringz(opt));
2398     }
2399 
2400     /// Draw density plot for data at z = sVal
2401     void DensZ(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2402     {
2403         mgl_dens_z(gr, a, toStringz(stl), sVal, toStringz(opt));
2404     }
2405 
2406     /// Draw contour lines for data at x = sVal
2407     void ContX(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2408     {
2409         mgl_cont_x(gr, a, toStringz(stl), sVal, toStringz(opt));
2410     }
2411 
2412     void ContX(const(mglDataA*) v, const(mglDataA*) a, string stl = "",
2413         double sVal = mglNaN, string opt = "")
2414     {
2415         mgl_cont_x_val(gr, v, a, toStringz(stl), sVal, toStringz(opt));
2416     }
2417 
2418     /// Draw contour lines for data at y = sVal
2419     void ContY(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2420     {
2421         mgl_cont_y(gr, a, toStringz(stl), sVal, toStringz(opt));
2422     }
2423 
2424     void ContY(const(mglDataA*) v, const(mglDataA*) a, string stl = "",
2425         double sVal = mglNaN, string opt = "")
2426     {
2427         mgl_cont_y_val(gr, v, a, toStringz(stl), sVal, toStringz(opt));
2428     }
2429 
2430     /// Draw contour lines for data at z = sVal
2431     void ContZ(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2432     {
2433         mgl_cont_z(gr, a, toStringz(stl), sVal, toStringz(opt));
2434     }
2435 
2436     void ContZ(const(mglDataA*) v, const(mglDataA*) a, string stl = "",
2437         double sVal = mglNaN, string opt = "")
2438     {
2439         mgl_cont_z_val(gr, v, a, toStringz(stl), sVal, toStringz(opt));
2440     }
2441 
2442     /// Draw solid contours for data at x = sVal
2443     void ContFX(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2444     {
2445         mgl_contf_x(gr, a, toStringz(stl), sVal, toStringz(opt));
2446     }
2447 
2448     void ContFX(const(mglDataA*) v, const(mglDataA*) a, string stl = "",
2449         double sVal = mglNaN, string opt = "")
2450     {
2451         mgl_contf_x_val(gr, v, a, toStringz(stl), sVal, toStringz(opt));
2452     }
2453 
2454     /// Draw solid contours for data at y = sVal
2455     void ContFY(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2456     {
2457         mgl_contf_y(gr, a, toStringz(stl), sVal, toStringz(opt));
2458     }
2459 
2460     void ContFY(const(mglDataA*) v, const(mglDataA*) a, string stl = "",
2461         double sVal = mglNaN, string opt = "")
2462     {
2463         mgl_contf_y_val(gr, v, a, toStringz(stl), sVal, toStringz(opt));
2464     }
2465 
2466     /// Draw solid contours for data at z = sVal
2467     void ContFZ(const(mglDataA*) a, string stl = "", double sVal = mglNaN, string opt = "")
2468     {
2469         mgl_contf_z(gr, a, toStringz(stl), sVal, toStringz(opt));
2470     }
2471 
2472     void ContFZ(const(mglDataA*) v, const(mglDataA*) a, string stl = "",
2473         double sVal = mglNaN, string opt = "")
2474     {
2475         mgl_contf_z_val(gr, v, a, toStringz(stl), sVal, toStringz(opt));
2476     }
2477 
2478     /// Draw curve for formula with x in x-axis range
2479     void FPlot(string fy, string stl = "", string opt = "")
2480     {
2481         mgl_fplot(gr, toStringz(fy), toStringz(stl), toStringz(opt));
2482     }
2483 
2484     /// Draw curve for formulas parametrically depended on t in range [0,1]
2485     void FPlot(string fx, string fy, string fz, string stl, string opt = "")
2486     {
2487         mgl_fplot_xyz(gr, toStringz(fx), toStringz(fy), toStringz(fz),
2488             toStringz(stl), toStringz(opt));
2489     }
2490 
2491     /// Draw surface by formula with x,y in axis range
2492     void FSurf(string fz, string stl = "", string opt = "")
2493     {
2494         mgl_fsurf(gr, toStringz(fz), toStringz(stl), toStringz(opt));
2495     }
2496 
2497     /// Draw surface by formulas parametrically depended on u,v in range [0,1]
2498     void FSurf(string fx, string fy, string fz, string stl, string opt = "")
2499     {
2500         mgl_fsurf_xyz(gr, toStringz(fx), toStringz(fy), toStringz(fz),
2501             toStringz(stl), toStringz(opt));
2502     }
2503 
2504     /// Draw triangle mesh for points in arrays {x,y,z} with specified color c.
2505     void TriPlot(const(mglDataA*) nums, const(mglDataA*) x, const(mglDataA*) y,
2506         const(mglDataA*) z, const(mglDataA*) c, string sch = "", string opt = "")
2507     {
2508         mgl_triplot_xyzc(gr, nums, x, y, z, c, toStringz(sch), toStringz(opt));
2509     }
2510 
2511     void TriPlot(const(mglDataA*) nums, const(mglDataA*) x, const(mglDataA*) y,
2512         const(mglDataA*) z, string sch = "", string opt = "")
2513     {
2514         mgl_triplot_xyz(gr, nums, x, y, z, toStringz(sch), toStringz(opt));
2515     }
2516 
2517     void TriPlot(const(mglDataA*) nums, const(mglDataA*) x, const(mglDataA*) y,
2518         string sch = "", string opt = "")
2519     {
2520         mgl_triplot_xy(gr, nums, x, y, toStringz(sch), toStringz(opt));
2521     }
2522 
2523     /// Draw quad mesh for points in arrays {x,y,z} with specified color c.
2524     void QuadPlot(const(mglDataA*) nums, const(mglDataA*) x,
2525         const(mglDataA*) y, const(mglDataA*) z, const(mglDataA*) c, string sch = "",
2526         string opt = "")
2527     {
2528         mgl_quadplot_xyzc(gr, nums, x, y, z, c, toStringz(sch), toStringz(opt));
2529     }
2530 
2531     void QuadPlot(const(mglDataA*) nums, const(mglDataA*) x,
2532         const(mglDataA*) y, const(mglDataA*) z, string sch = "", string opt = "")
2533     {
2534         mgl_quadplot_xyz(gr, nums, x, y, z, toStringz(sch), toStringz(opt));
2535     }
2536 
2537     void QuadPlot(const(mglDataA*) nums, const(mglDataA*) x,
2538         const(mglDataA*) y, string sch = "", string opt = "")
2539     {
2540         mgl_quadplot_xy(gr, nums, x, y, toStringz(sch), toStringz(opt));
2541     }
2542 
2543     /// Draw contour lines for triangle mesh for points in arrays {x,y,z} with specified color c.
2544     void TriCont(const(mglDataA*) nums, const(mglDataA*) x, const(mglDataA*) y,
2545         const(mglDataA*) z, string sch = "", string opt = "")
2546     {
2547         mgl_tricont_xyc(gr, nums, x, y, z, toStringz(sch), toStringz(opt));
2548     }
2549 
2550     void TriContV(const(mglDataA*) v, const(mglDataA*) nums,
2551         const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z, string sch = "",
2552         string opt = "")
2553     {
2554         mgl_tricont_xycv(gr, v, nums, x, y, z, toStringz(sch), toStringz(opt));
2555     }
2556 
2557     void TriCont(const(mglDataA*) nums, const(mglDataA*) x, const(mglDataA*) y,
2558         const(mglDataA*) z, const(mglDataA*) a, string sch = "", string opt = "")
2559     {
2560         mgl_tricont_xyzc(gr, nums, x, y, z, a, toStringz(sch), toStringz(opt));
2561     }
2562 
2563     void TriContV(const(mglDataA*) v, const(mglDataA*) nums,
2564         const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2565         const(mglDataA*) a, string sch = "", string opt = "")
2566     {
2567         mgl_tricont_xyzcv(gr, v, nums, x, y, z, a, toStringz(sch), toStringz(opt));
2568     }
2569 
2570     void TriCont(const(mglDataA*) v, const(mglDataA*) nums, const(mglDataA*) x,
2571         const(mglDataA*) y, const(mglDataA*) z, const(mglDataA*) a, string sch = "",
2572         string opt = "")
2573     {
2574         mgl_tricont_xyzcv(gr, v, nums, x, y, z, a, toStringz(sch), toStringz(opt));
2575     }
2576 
2577     /// Draw contour tubes for triangle mesh for points in arrays {x,y,z} with specified color c.
2578     void TriContVt(const(mglDataA*) nums, const(mglDataA*) x,
2579         const(mglDataA*) y, const(mglDataA*) z, string sch = "", string opt = "")
2580     {
2581         mgl_tricontv_xyc(gr, nums, x, y, z, toStringz(sch), toStringz(opt));
2582     }
2583 
2584     void TriContVt(const(mglDataA*) nums, const(mglDataA*) x,
2585         const(mglDataA*) y, const(mglDataA*) z, const(mglDataA*) a, string sch = "",
2586         string opt = "")
2587     {
2588         mgl_tricontv_xyzc(gr, nums, x, y, z, a, toStringz(sch), toStringz(opt));
2589     }
2590 
2591     void TriContVt(const(mglDataA*) v, const(mglDataA*) nums,
2592         const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2593         const(mglDataA*) a, string sch = "", string opt = "")
2594     {
2595         mgl_tricontv_xyzcv(gr, v, nums, x, y, z, a, toStringz(sch), toStringz(opt));
2596     }
2597 
2598     /// Draw dots in points {x,y,z}.
2599     void Dots(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2600         string sch = "", string opt = "")
2601     {
2602         mgl_dots(gr, x, y, z, toStringz(sch), toStringz(opt));
2603     }
2604 
2605     /// Draw semitransparent dots in points {x,y,z} with specified alpha a.
2606     void Dots(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2607         const(mglDataA*) a, string sch = "", string opt = "")
2608     {
2609         mgl_dots_a(gr, x, y, z, a, toStringz(sch), toStringz(opt));
2610     }
2611 
2612     /// Draw semitransparent dots in points {x,y,z} with specified color c and alpha a.
2613     void Dots(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2614         const(mglDataA*) c, const(mglDataA*) a, string sch = "", string opt = "")
2615     {
2616         mgl_dots_ca(gr, x, y, z, c, a, toStringz(sch), toStringz(opt));
2617     }
2618 
2619     /// Draw surface reconstructed for points in arrays {x,y,z}.
2620     void Crust(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2621         string sch = "", string opt = "")
2622     {
2623         mgl_crust(gr, x, y, z, toStringz(sch), toStringz(opt));
2624     }
2625 
2626     /// Fit data along x-direction for each data row. Return array with values for found formula.
2627     mglData Fit(const(mglDataA*) y, string eq, string vars, string opt = "")
2628     {
2629         return mglData(-1, mgl_fit_1(gr, y, eq, vars, 0, toStringz(opt)));
2630     }
2631 
2632     mglData Fit(const(mglDataA*) y, string eq, string vars, mglData* ini, string opt = "")
2633     {
2634         return mglData(-1, mgl_fit_1(gr, y, toStringz(eq), toStringz(vars), ini, toStringz(opt)));
2635     }
2636 
2637     /// Fit data along x-, y-directions for each data slice. Return array with values for found formula.
2638     mglData Fit2(const(mglDataA*) z, string eq, string vars, string opt = "")
2639     {
2640         return mglData(-1, mgl_fit_2(gr, z, toStringz(eq), vars, 0, toStringz(opt)));
2641     }
2642 
2643     mglData Fit2(const(mglDataA*) z, string eq, string vars, mglData* ini, string opt = "")
2644     {
2645         return mglData(-1, mgl_fit_2(gr, z, toStringz(eq), toStringz(vars), ini, toStringz(opt)));
2646     }
2647 
2648     /// Fit data along along all directions. Return array with values for found formula.
2649     mglData Fit3(const(mglDataA*) a, string eq, string vars, string opt = "")
2650     {
2651         return mglData(-1, mgl_fit_3(gr, a, toStringz(eq), vars, 0, toStringz(opt)));
2652     }
2653 
2654     mglData Fit3(const(mglDataA*) a, string eq, string vars, mglData* ini, string opt = "")
2655     {
2656         return mglData(-1, mgl_fit_3(gr, a, toStringz(eq), toStringz(vars), ini, toStringz(opt)));
2657     }
2658 
2659     /// Fit data along x-direction for each data row. Return array with values for found formula.
2660     mglData Fit(const(mglDataA*) x, const(mglDataA*) y, string eq, string vars, string opt = "")
2661     {
2662         return mglData(-1, mgl_fit_xy(gr, x, y, toStringz(eq), vars, 0, toStringz(opt)));
2663     }
2664 
2665     mglData Fit(const(mglDataA*) x, const(mglDataA*) y, string eq, string vars,
2666         mglData* ini, string opt = "")
2667     {
2668         return mglData(-1, mgl_fit_xy(gr, x, y, toStringz(eq),
2669             toStringz(vars), ini, toStringz(opt)));
2670     }
2671 
2672     /// Fit data along x-, y-directions for each data slice. Return array with values for found formula.
2673     mglData Fit(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2674         string eq, string vars, string opt = "")
2675     {
2676         return mglData(-1, mgl_fit_xyz(gr, x, y, z, toStringz(eq), vars, 0, toStringz(opt)));
2677     }
2678 
2679     mglData Fit(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2680         string eq, string vars, mglData* ini, string opt = "")
2681     {
2682         return mglData(-1, mgl_fit_xyz(gr, x, y, z, toStringz(eq),
2683             toStringz(vars), ini, toStringz(opt)));
2684     }
2685 
2686     /// Fit data along along all directions. Return array with values for found formula.
2687     mglData Fit(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2688         const(mglDataA*) a, string eq, string vars, string opt = "")
2689     {
2690         return mglData(-1, mgl_fit_xyza(gr, x, y, z, a, toStringz(eq), vars, 0, toStringz(opt)));
2691     }
2692 
2693     mglData Fit(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2694         const(mglDataA*) a, string eq, string vars, mglData* ini, string opt = "")
2695     {
2696         return mglData(-1, mgl_fit_xyza(gr, x, y, z, a, eq, vars, ini, toStringz(opt)));
2697     }
2698 
2699     /// Fit data with dispersion s along x-direction for each data row. Return array with values for found formula.
2700     mglData FitS(const(mglDataA*) y, const(mglDataA*) s, string eq, string vars, string opt = "")
2701     {
2702         return mglData(-1, mgl_fit_ys(gr, y, s, toStringz(eq), vars, 0, toStringz(opt)));
2703     }
2704 
2705     mglData FitS(const(mglDataA*) y, const(mglDataA*) s, string eq, string vars,
2706         mglData* ini, string opt = "")
2707     {
2708         return mglData(-1, mgl_fit_ys(gr, y, s, toStringz(eq),
2709             toStringz(vars), ini, toStringz(opt)));
2710     }
2711 
2712     mglData FitS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) s,
2713         string eq, string vars, string opt = "")
2714     {
2715         return mglData(-1, mgl_fit_xys(gr, x, y, s, toStringz(eq), vars, 0, toStringz(opt)));
2716     }
2717 
2718     mglData FitS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) s,
2719         string eq, string vars, mglData* ini, string opt = "")
2720     {
2721         return mglData(-1, mgl_fit_xys(gr, x, y, s, toStringz(eq),
2722             toStringz(vars), ini, toStringz(opt)));
2723     }
2724 
2725     /// Fit data with dispersion s along x-, y-directions for each data slice. Return array with values for found formula.
2726     mglData FitS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2727         const(mglDataA*) s, string eq, string vars, string opt = "")
2728     {
2729         return mglData(-1, mgl_fit_xyzs(gr, x, y, z, s, toStringz(eq), vars, 0, toStringz(opt)));
2730     }
2731 
2732     mglData FitS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2733         const(mglDataA*) s, string eq, string vars, mglData* ini, string opt = "")
2734     {
2735         return mglData(-1, mgl_fit_xyzs(gr, x, y, z, s, toStringz(eq),
2736             toStringz(vars), ini, toStringz(opt)));
2737     }
2738 
2739     /// Fit data with dispersion s along all directions. Return array with values for found formula.
2740     mglData FitS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2741         const(mglDataA*) a, const(mglDataA*) s, string eq, string vars, string opt = "")
2742     {
2743         return mglData(-1, mgl_fit_xyzas(gr, x, y, z, a, s, toStringz(eq),
2744             vars, 0, toStringz(opt)));
2745     }
2746 
2747     mglData FitS(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2748         const(mglDataA*) a, const(mglDataA*) s, string eq, string vars,
2749         mglData* ini, string opt = "")
2750     {
2751         return mglData(-1, mgl_fit_xyzas(gr, x, y, z, a, s, toStringz(eq),
2752             toStringz(vars), ini, toStringz(opt)));
2753     }
2754 
2755     /// Print fitted last formula (with coefficients)
2756     void PutsFit(mglPoint p, string prefix = 0, string font = "", double size = -1)
2757     {
2758         mgl_puts_fit(gr, p.x, p.y, p.z, prefix, font, size);
2759     }
2760 
2761     /// Get last fitted formula
2762     const(char*) GetFit() const
2763     {
2764         return mgl_get_fit(gr);
2765     }
2766 
2767     /// Get chi for last fitted formula
2768     static mreal GetFitChi()
2769     {
2770         return mgl_get_fit_chi();
2771     }
2772 
2773     /// Solve PDE with x,y,z in range [Min, Max]
2774     mglData PDE(string ham, const(mglDataA*) ini_re, const(mglDataA*) ini_im,
2775         double dz = 0.1, double k0 = 100, string opt = "")
2776     {
2777         return mglData(-1, mgl_pde_solve(gr, ham, ini_re, ini_im, dz, k0, toStringz(opt)));
2778     }
2779 
2780     /// Fill data by formula with x,y,z in range [Min, Max]
2781     void Fill(mglData* u, string eq, string opt = "")
2782     {
2783         mgl_data_fill_eq(gr, u, toStringz(eq), 0, 0, toStringz(opt));
2784     }
2785 
2786     void Fill(mglData* u, string eq, const(mglDataA*) v, string opt = "")
2787     {
2788         mgl_data_fill_eq(gr, u, toStringz(eq), v, 0, toStringz(opt));
2789     }
2790 
2791     void Fill(mglData* u, string eq, const(mglDataA*) v, const(mglDataA*) w, string opt = "")
2792     {
2793         mgl_data_fill_eq(gr, u, toStringz(eq), v, w, toStringz(opt));
2794     }
2795 
2796     /// Fill data by formula with x,y,z in range [Min, Max]
2797     void Fill(mglDataC* u, string eq, string opt = "")
2798     {
2799         mgl_datac_fill_eq(gr, u, toStringz(eq), 0, 0, toStringz(opt));
2800     }
2801 
2802     void Fill(mglDataC* u, string eq, const(mglDataA*) v, string opt = "")
2803     {
2804         mgl_datac_fill_eq(gr, u, toStringz(eq), v, 0, toStringz(opt));
2805     }
2806 
2807     void Fill(mglDataC* u, string eq, const(mglDataA*) v, const(mglDataA*) w, string opt = "")
2808     {
2809         mgl_datac_fill_eq(gr, u, toStringz(eq), v, w, toStringz(opt));
2810     }
2811 
2812     /// Fill dat by interpolated values of vdat parametrically depended on xdat,ydat,zdat for x,y,z in axis range
2813     void Refill(mglData* dat, const(mglDataA*) xdat, const(mglDataA*) vdat,
2814         long sl = -1, string opt = "")
2815     {
2816         mgl_data_refill_gr(gr, dat, xdat, 0, 0, vdat, sl, opt);
2817     }
2818 
2819     void Refill(mglData* dat, const(mglDataA*) xdat, const(mglDataA*) ydat,
2820         const(mglDataA*) vdat, long sl = -1, string opt = "")
2821     {
2822         mgl_data_refill_gr(gr, dat, xdat, ydat, 0, vdat, sl, opt);
2823     }
2824 
2825     void Refill(mglData* dat, const(mglDataA*) xdat, const(mglDataA*) ydat,
2826         const(mglDataA*) zdat, const(mglDataA*) vdat, string opt = "")
2827     {
2828         mgl_data_refill_gr(gr, dat, xdat, ydat, zdat, vdat, -1, opt);
2829     }
2830 
2831     /// Set the data by triangulated surface values assuming x,y,z in range [Min, Max]
2832     void DataGrid(mglData* d, const(mglDataA*) x, const(mglDataA*) y,
2833         const(mglDataA*) z, string opt = "")
2834     {
2835         mgl_data_grid(gr, d, x, y, z, toStringz(opt));
2836     }
2837 
2838     /// Make histogram (distribution) of data. This function do not plot data.
2839     mglData Hist(const(mglDataA*) x, const(mglDataA*) a, string opt = "")
2840     {
2841         return mglData(-1, mgl_hist_x(gr, x, a, toStringz(opt)));
2842     }
2843 
2844     mglData Hist(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) a, string opt = "")
2845     {
2846         return mglData(-1, mgl_hist_xy(gr, x, y, a, toStringz(opt)));
2847     }
2848 
2849     mglData Hist(const(mglDataA*) x, const(mglDataA*) y, const(mglDataA*) z,
2850         const(mglDataA*) a, string opt = "")
2851     {
2852         return mglData(-1, mgl_hist_xyz(gr, x, y, z, a, toStringz(opt)));
2853     }
2854 
2855     void Compression(bool)
2856     {
2857     }
2858  // NOTE: Add later -- IDTF
2859     /// Set the preference for vertex color on/off (for formats that support it, now only PRC does).
2860     void VertexColor(bool enable)
2861     {
2862         mgl_set_flag(gr, enable ? -1 : 0, MGL_PREFERVC);
2863     }
2864 
2865     /// Render only front side of surfaces for dubugging purposes (for formats that support it, now only PRC does).
2866     void DoubleSided(bool enable)
2867     {
2868         mgl_set_flag(gr, (!enable) ? -1 : 0, MGL_ONESIDED);
2869     }
2870     //	void TextureColor(bool){}	// NOTE: Add later -- IDTF
2871 };
2872 //-----------------------------------------------------------------------------
2873 /// Wrapper class for MGL parsing
2874 class mglParse
2875 {
2876     HMPR pr;
2877     this(HMPR p)
2878     {
2879         pr = p;
2880         mgl_use_parser(pr, 1);
2881     }
2882     this(mglParse* p)
2883     {
2884         pr = p.pr;
2885         mgl_use_parser(pr, 1);
2886     }
2887     this(bool setsize = false)
2888     {
2889         pr = mgl_create_parser();
2890         mgl_parser_allow_setsize(pr, setsize);
2891     }
2892     ~this()
2893     {
2894         //#pragma omp critical
2895         if (mgl_use_parser(pr,  - 1) < 1)
2896             mgl_delete_parser(pr);
2897     }
2898     /// Get pointer to internal mglParser object
2899     HMPR Self()
2900     {
2901         return pr;
2902     }
2903 
2904     /// Parse and draw single line of the MGL script
2905     int Parse(mglGraph* gr, string str, int pos)
2906     {
2907         return mgl_parse_line(gr.Self(), pr, toStringz(str), pos);
2908     }
2909 
2910     //int Parse(mglGraph *gr, const wchar_t *str, int pos)
2911     //{	return mgl_parse_linew(gr.Self(), pr, str, pos);	}
2912     /// Execute MGL script text with '\n' separated lines
2913     void Execute(mglGraph* gr, string str)
2914     {
2915         mgl_parse_text(gr.Self(), pr, toStringz(str));
2916     }
2917 
2918     //void Execute(mglGraph *gr, const wchar_t *str)
2919     //{	mgl_parse_textw(gr.Self(), pr, str);	}
2920     /// Execute and draw script from the file
2921     void Execute(mglGraph* gr, FILE* fp, bool print = false)
2922     {
2923         mgl_parse_file(gr.Self(), pr, fp, print ? -1 : 0);
2924     }
2925 
2926     /// Return type of command: 0 - not found, 1 - other data plot, 2 - func plot,
2927     ///		3 - setup, 4 - data handle, 5 - data create, 6 - subplot, 7 - program
2928     ///		8 - 1d plot, 9 - 2d plot, 10 - 3d plot, 11 - dd plot, 12 - vector plot
2929     ///		13 - axis, 14 - primitives, 15 - axis setup, 16 - text/legend, 17 - data transform
2930     int CmdType(string name)
2931     {
2932         return mgl_parser_cmd_type(pr, toStringz(name));
2933     }
2934 
2935     /// Return string of command format (command name and its argument[s])
2936     string CmdFormat(string name)
2937     {
2938         return ZtoString(mgl_parser_cmd_frmt(pr, toStringz(name)));
2939     }
2940 
2941     /// Return description of MGL command
2942     string CmdDesc(string name)
2943     {
2944         return ZtoString(mgl_parser_cmd_desc(pr, toStringz(name)));
2945     }
2946 
2947     /// Get name of command with nmber n
2948     string GetCmdName(long n)
2949     {
2950         return ZtoString(mgl_parser_cmd_name(pr, n));
2951     }
2952 
2953     /// Get number of defined commands
2954     long GetCmdNum()
2955     {
2956         return mgl_parser_cmd_num(pr);
2957     }
2958 
2959     /// Load new commands from external dynamic Library (must have "const mglCommand *mgl_cmd_extra" variable)
2960     void LoadDLL(string fname)
2961     {
2962         mgl_parser_load(pr, toStringz(fname));
2963     }
2964 
2965     /// Set value for parameter $N
2966     void AddParam(int id, string str)
2967     {
2968         mgl_parser_add_param(pr, id, toStringz(str));
2969     }
2970 
2971     //void AddParam(int id, const wchar_t *str)
2972     //{	mgl_parser_add_paramw(pr, id, str);	}
2973     /// Restore once flag
2974     void RestoreOnce()
2975     {
2976         mgl_parser_restore_once(pr);
2977     }
2978 
2979     /// Allow changing size of the picture
2980     void AllowSetSize(bool allow)
2981     {
2982         mgl_parser_allow_setsize(pr, allow ?  - 1 : 0);
2983     }
2984 
2985     /// Allow reading/saving files
2986     void AllowFileIO(bool allow)
2987     {
2988         mgl_parser_allow_file_io(pr, allow ? -1 : 0);
2989     }
2990 
2991     /// Allow loading commands from external libraries
2992     void AllowDllCall(bool allow)
2993     {
2994         mgl_parser_allow_dll_call(pr, allow);
2995     }
2996 
2997     /// Set flag to stop script parsing
2998     void Stop()
2999     {
3000         mgl_parser_stop(pr);
3001     }
3002 
3003     /// Return result of formula evaluation
3004     mglData Calc(string formula)
3005     {
3006         return mglData(-1, mgl_parser_calc(pr, toStringz(formula)));
3007     }
3008 
3009     //mglData Calc(const wchar_t *formula)
3010     //{	return mglData(-1,mgl_parser_calcw(pr,formula));	}
3011 
3012     /// Find variable with given name or add a new one
3013     /// NOTE !!! You must not delete obtained data arrays !!!
3014     mglData* AddVar(string name)
3015     {
3016         return mgl_parser_add_var(pr, toStringz(name));
3017     }
3018 
3019     //mglData *AddVar(const wchar_t *name)
3020     //{	return mgl_parser_add_varw(pr, toStringz(name));	}
3021     /// Find variable with given name or return null if no one
3022     /// NOTE !!! You must not delete obtained data arrays !!!
3023     mglDataA* FindVar(string name)
3024     {
3025         return mgl_parser_find_var(pr, toStringz(name));
3026     }
3027 
3028     //mglDataA *FindVar(const wchar_t *name)
3029     //{	return mgl_parser_find_varw(pr, toStringz(name));	}
3030     /// Get variable with given id. Can be null for temporary ones.
3031     /// NOTE !!! You must not delete obtained data arrays !!!
3032     mglDataA* GetVar(ulong id)
3033     {
3034         return mgl_parser_get_var(pr, id);
3035     }
3036 
3037     /// Get number of variables
3038     long GetNumVar()
3039     {
3040         return mgl_parser_num_var(pr);
3041     }
3042 
3043     /// Delete variable with name
3044 
3045     void DeleteVar(string name)
3046     {
3047         mgl_parser_del_var(pr, toStringz(name));
3048     }
3049 
3050     //void DeleteVar(const wchar_t *name)	{	mgl_parser_del_varw(pr, toStringz(name));		}
3051 
3052     /// Delete all data variables
3053     void DeleteAll()
3054     {
3055         mgl_parser_del_all(pr);
3056 
3057     }
3058 }
3059 +/
3060 
3061 /***************************************************************************
3062  * mgl.h is part of Math Graphic Library
3063  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
3064  *                                                                         *
3065  *   This program is free software; you can redistribute it and/or modify  *
3066  *   it under the terms of the GNU General Public License as published by  *
3067  *   the Free Software Foundation; either version 2 of the License, or     *
3068  *   (at your option) any later version.                                   *
3069  *                                                                         *
3070  *   This program is distributed in the hope that it will be useful,       *
3071  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
3072  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
3073  *   GNU General Public License for more details.                          *
3074  *                                                                         *
3075  *   You should have received a copy of the GNU General Public License     *
3076  *   along with this program; if not, write to the                         *
3077  *   Free Software Foundation, Inc.,                                       *
3078  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
3079  ***************************************************************************/