1 module iup.mglplot;
2 
3 import iup.iup: Ihandle;
4 
5 extern(C) {
6 
7 /* Initialize IupMglPlot widget class */
8 void IupMglPlotOpen();
9 
10 /* Create an IupMglPlot widget instance */
11 Ihandle* IupMglPlot();
12 
13 /***********************************************/
14 /*           Additional API                    */
15 
16 /* Linear Data Only */
17 void IupMglPlotBegin(Ihandle *ih, int dim);
18 void IupMglPlotAdd1D(Ihandle *ih, const(char) * name, double y);
19 void IupMglPlotAdd2D(Ihandle *ih, double x, double y);
20 void IupMglPlotAdd3D(Ihandle *ih, double x, double y, double z);
21 int  IupMglPlotEnd(Ihandle *ih);
22 
23 /* Linear (dim=1,2,3), Planar (dim=1), Volumetric (dim=1) */
24 int IupMglPlotNewDataSet(Ihandle *ih, int dim);
25 
26 /* Linear Data Only */
27 void IupMglPlotInsert1D(Ihandle* ih, int ds_index, int sample_index, const(char) ** names, const double* y, int count);
28 void IupMglPlotInsert2D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, int count);
29 void IupMglPlotInsert3D(Ihandle* ih, int ds_index, int sample_index, const double* x, const double* y, const double* z, int count);
30 
31 /* Linear Data Only */
32 void IupMglPlotSet1D(Ihandle* ih, int ds_index, const(char) ** names, const double* y, int count);
33 void IupMglPlotSet2D(Ihandle* ih, int ds_index, const double* x, const double* y, int count);
34 void IupMglPlotSet3D(Ihandle* ih, int ds_index, const double* x, const double* y, const double* z, int count);
35 void IupMglPlotSetFormula(Ihandle* ih, int ds_index, const(char) * formulaX, const(char) * formulaY, const(char) * formulaZ, int count);
36 
37 /* Linear (dim=1), Planar (dim=1), Volumetric (dim=1) */
38 void IupMglPlotSetData(Ihandle* ih, int ds_index, const double* data, int count_x, int count_y, int count_z);
39 void IupMglPlotLoadData(Ihandle* ih, int ds_index, const(char) * filename, int count_x, int count_y, int count_z);
40 void IupMglPlotSetFromFormula(Ihandle* ih, int ds_index, const(char) * formula, int count_x, int count_y, int count_z);
41 
42 /* Only inside callbacks */
43 void IupMglPlotTransform(Ihandle* ih, double x, double y, double z, int *ix, int *iy);
44 void IupMglPlotTransformTo(Ihandle* ih, int ix, int iy, double *x, double *y, double *z);
45 
46 /* Only inside callbacks */
47 void IupMglPlotDrawMark(Ihandle* ih, double x, double y, double z);
48 void IupMglPlotDrawLine(Ihandle* ih, double x1, double y1, double z1, double x2, double y2, double z2);
49 void IupMglPlotDrawText(Ihandle* ih, const(char) * text, double x, double y, double z);
50 
51 void IupMglPlotPaintTo(Ihandle *ih, const(char) * format, int w, int h, double dpi, void *data);
52 
53 /***********************************************/
54 
55 /* Utility label for showing TeX labels */
56 Ihandle* IupMglLabel(const(char) * title);
57 
58 }