1 /** \file 2 * \brief Plot component for Iup. 3 * 4 * See Copyright Notice in "iup.h" 5 */ 6 7 module iup.iup_plot; 8 9 import iup.iup : Ihandle; 10 11 version(DigitalMars) version(Windows) { pragma(lib, "iup_plot.lib"); } // libiup_plot.so depends on libcd.so, libcdgl.so, libcdcontextplus.so, libiupgl, libiup.so, GL-library, ... 12 13 extern(C) @nogc nothrow : 14 15 /* Initialize IupPlot widget class */ 16 void IupPlotOpen(); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/ctrl/iup_plot.html 17 18 /* Create an IupPlot widget instance */ 19 Ihandle* IupPlot(); 20 21 /***********************************************/ 22 /* Additional API */ 23 24 void IupPlotBegin(Ihandle* ih, int strXdata); 25 void IupPlotAdd(Ihandle* ih, double x, double y); 26 void IupPlotAddStr(Ihandle* ih, const(char)* x, double y); 27 void IupPlotAddSegment(Ihandle* ih, double x, double y); 28 int IupPlotEnd(Ihandle* ih); 29 30 int IupPlotLoadData(Ihandle* ih, const(char)* filename, int strXdata); 31 32 /* available only when linking with "iupluaplot" */ 33 //int IupPlotSetFormula(Ihandle* ih, int sample_count, const(char)* formula, const(char)* init); 34 35 void IupPlotInsert(Ihandle* ih, int ds_index, int sample_index, double x, double y); 36 void IupPlotInsertStr(Ihandle* ih, int ds_index, int sample_index, const(char)* x, double y); 37 void IupPlotInsertSegment(Ihandle* ih, int ds_index, int sample_index, double x, double y); 38 39 void IupPlotInsertStrSamples(Ihandle* ih, int ds_index, int sample_index, const(char)** x, double* y, int count); 40 void IupPlotInsertSamples(Ihandle* ih, int ds_index, int sample_index, double* x, double* y, int count); 41 42 void IupPlotAddSamples(Ihandle* ih, int ds_index, double* x, double* y, int count); 43 void IupPlotAddStrSamples(Ihandle* ih, int ds_index, const(char)** x, double* y, int count); 44 45 void IupPlotGetSample(Ihandle* ih, int ds_index, int sample_index, double* x, double* y); 46 void IupPlotGetSampleStr(Ihandle* ih, int ds_index, int sample_index, const(char)** x, double* y); 47 int IupPlotGetSampleSelection(Ihandle* ih, int ds_index, int sample_index); 48 double IupPlotGetSampleExtra(Ihandle* ih, int ds_index, int sample_index); 49 void IupPlotSetSample(Ihandle* ih, int ds_index, int sample_index, double x, double y); 50 void IupPlotSetSampleStr(Ihandle* ih, int ds_index, int sample_index, const(char)* x, double y); 51 void IupPlotSetSampleSelection(Ihandle* ih, int ds_index, int sample_index, int selected); 52 void IupPlotSetSampleExtra(Ihandle* ih, int ds_index, int sample_index, double extra); 53 54 void IupPlotTransform(Ihandle* ih, double x, double y, double* cnv_x, double* cnv_y); 55 void IupPlotTransformTo(Ihandle* ih, double cnv_x, double cnv_y, double* x, double* y); 56 57 int IupPlotFindSample(Ihandle* ih, double cnv_x, double cnv_y, int* ds_index, int* sample_index); 58 int IupPlotFindSegment(Ihandle* ih, double cnv_x, double cnv_y, int* ds_index, int* sample_index1, int* sample_index2); 59 60 version(CD) 61 { 62 import cd.cd : _cdCanvas; 63 void IupPlotPaintTo(Ihandle* ih, _cdCanvas* cnv); /// See_Also: https://webserver2.tecgraf.puc-rio.br/iup/en/ctrl/iup_plot.html 64 } 65 66 /***********************************************/