1 /** \file
2  * \brief Plot component for Iup.
3  *
4  * See Copyright Notice in "iup.h"
5  */
6 
7 module iup.iup_mglplot;
8 
9 import iup.iup : Ihandle;
10 
11 version(DigitalMars) version(Windows) { pragma(lib, "iup_mglplot.lib"); } // libiup_mglplot.so depends on libiupgl.so, libiup.so, ...
12 
13 extern(C) @nogc nothrow :
14 
15 /* Initialize IupMglPlot widget class */
16 void IupMglPlotOpen(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/ctrl/iup_mglplot.html
17 
18 /* Create an IupMglPlot widget instance */
19 Ihandle* IupMglPlot();
20 
21 /***********************************************/
22 /*           Additional API                    */
23 
24 /* Linear Data Only */
25 void IupMglPlotBegin(Ihandle* ih, int dim);
26 void IupMglPlotAdd1D(Ihandle* ih, const(char)* name, double y);
27 void IupMglPlotAdd2D(Ihandle* ih, double x, double y);
28 void IupMglPlotAdd3D(Ihandle* ih, double x, double y, double z);
29 int  IupMglPlotEnd(Ihandle* ih);
30 
31 /* Linear (dim=1,2,3), Planar (dim=1), Volumetric (dim=1) */
32 int IupMglPlotNewDataSet(Ihandle *ih, int dim);
33 
34 /* Linear Data Only */
35 void IupMglPlotInsert1D(Ihandle* ih, int ds_index, int sample_index, const(char)** names, const(double)* y, int count);
36 void IupMglPlotInsert2D(Ihandle* ih, int ds_index, int sample_index, const(double)* x, const(double)* y, int count);
37 void IupMglPlotInsert3D(Ihandle* ih, int ds_index, int sample_index, const(double)* x, const(double)* y, const(double)* z, int count);
38 
39 /* Linear Data Only */
40 void IupMglPlotSet1D(Ihandle* ih, int ds_index, const(char)** names, const(double)* y, int count);
41 void IupMglPlotSet2D(Ihandle* ih, int ds_index, const(double)* x, const(double)* y, int count);
42 void IupMglPlotSet3D(Ihandle* ih, int ds_index, const(double)* x, const(double)* y, const(double)* z, int count);
43 void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const(char)* formulaX, const(char)* formulaY, const(char)* formulaZ, int count);
44 
45 /* Linear (dim=1), Planar (dim=1), Volumetric (dim=1) */
46 void IupMglPlotSetData(Ihandle* ih, int ds_index, const(double)* data, int count_x, int count_y, int count_z);
47 void IupMglPlotLoadData(Ihandle* ih, int ds_index, const(char)* filename, int count_x, int count_y, int count_z);
48 void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const(char)* formula, int count_x, int count_y, int count_z);
49 
50 /* Only inside callbacks */
51 void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int* ix, int* iy);
52 void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double* x, double* y, double* z);
53 
54 /* Only inside callbacks */
55 void IupMglPlotDrawMark(Ihandle* ih, double x, double y, double z);
56 void IupMglPlotDrawLine(Ihandle* ih, double x1, double y1, double z1, double x2, double y2, double z2);
57 void IupMglPlotDrawText(Ihandle* ih, const(char)* text, double x, double y, double z);
58 
59 void IupMglPlotPaintTo(Ihandle* ih, const(char)* format, int w, int h, double dpi, void* data);
60 
61 /***********************************************/
62 
63 /* Utility label for showing TeX labels */
64 Ihandle* IupMglLabel(const(char)* title); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/ctrl/iup_mgllabel.html