From: Dimitrios Eftaxiopoulos
Date: Fri, 9 Mar 2012 22:03:34 +0000 (+0200)
Subject: Imported Upstream version 2~rc2+svn359
X-Git-Tag: archive/raspbian/2.5-2+rpi1^2~26^2~41
X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3d58a760c06ad3374cc91fe97b28cde2466edfc1;p=mathgl.git
Imported Upstream version 2~rc2+svn359
---
diff --git a/examples/fltk_example.cpp b/examples/fltk_example.cpp
index 985b74b..23da92a 100644
--- a/examples/fltk_example.cpp
+++ b/examples/fltk_example.cpp
@@ -62,7 +62,7 @@ int main(int argc,char **argv)
case '1': gr = new mglWindow(0,sample_1,"1D plots"); break;
case '2': gr = new mglWindow(0,sample_2,"2D plots"); break;
case '3': gr = new mglWindow(0,sample_3,"3D plots"); break;
- case 'd': gr = new mglWindow(0,sample_d,"Dual plots"); break;
+ case 'd': gr = new mglWindow(0,sample_d,"Dual plots");break;
case 't': gr = new mglWindow(0,test_wnd,"Testing"); break;
default: gr = new mglWindow(0,sample,"Drop and waves"); break;
}
diff --git a/examples/full_test.cpp b/examples/full_test.cpp
index 06eabbb..1419ad7 100644
--- a/examples/full_test.cpp
+++ b/examples/full_test.cpp
@@ -49,10 +49,27 @@ void smgl_combined(mglGraph *gr);
void save(mglGraph *gr,const char *name,const char *suf);
void test(mglGraph *gr)
{
- gr->DefaultPlotParam(); gr->Clf();
- smgl_colorbar(gr); save(gr, "colorbar", "");
- gr->DefaultPlotParam(); gr->Clf();
- smgl_combined(gr); save(gr, "combined", "");
+ mglData a(256,2); a.Fill(-1,1);
+ gr->SubPlot(2,10,0,NULL,0.2); gr->Dens(a,"kw"); gr->Puts(0.07, 0.92, "kw", "A");
+ gr->SubPlot(2,10,1,NULL,0.2); gr->Dens(a,"wk"); gr->Puts(0.57, 0.92, "wk", "A");
+ gr->SubPlot(2,10,2,NULL,0.2); gr->Dens(a,"kHCcw"); gr->Puts(0.07, 0.82, "kHCcw", "A");
+ gr->SubPlot(2,10,3,NULL,0.2); gr->Dens(a,"kBbcw"); gr->Puts(0.57, 0.82, "kBbcw", "A");
+ gr->SubPlot(2,10,4,NULL,0.2); gr->Dens(a,"kRryw"); gr->Puts(0.07, 0.72, "kRryw", "A");
+ gr->SubPlot(2,10,5,NULL,0.2); gr->Dens(a,"kGgew"); gr->Puts(0.57, 0.72, "kGgew", "A");
+ gr->SubPlot(2,10,6,NULL,0.2); gr->Dens(a,"BbwrR"); gr->Puts(0.07, 0.62, "BbwrR", "A");
+ gr->SubPlot(2,10,7,NULL,0.2); gr->Dens(a,"BbwgG"); gr->Puts(0.57, 0.62, "BbwgG", "A");
+ gr->SubPlot(2,10,8,NULL,0.2); gr->Dens(a,"GgwmM"); gr->Puts(0.07, 0.52, "GgwmM", "A");
+ gr->SubPlot(2,10,9,NULL,0.2); gr->Dens(a,"UuwqR"); gr->Puts(0.57, 0.52, "UuwqR", "A");
+ gr->SubPlot(2,10,10,NULL,0.2); gr->Dens(a,"QqwcC"); gr->Puts(0.07, 0.42, "QqwcC", "A");
+ gr->SubPlot(2,10,11,NULL,0.2); gr->Dens(a,"CcwyY"); gr->Puts(0.57, 0.42, "CcwyY", "A");
+ gr->SubPlot(2,10,12,NULL,0.2); gr->Dens(a,"bcwyr"); gr->Puts(0.07, 0.32, "bcwyr", "A");
+ gr->SubPlot(2,10,13,NULL,0.2); gr->Dens(a,"bwr"); gr->Puts(0.57, 0.32, "bwr", "A");
+ gr->SubPlot(2,10,14,NULL,0.2); gr->Dens(a,"BbcyrR"); gr->Puts(0.07, 0.22, "BbcyrR", "A");
+ gr->SubPlot(2,10,15,NULL,0.2); gr->Dens(a,"UbcyqR"); gr->Puts(0.57, 0.22, "UbcyqR", "A");
+ gr->SubPlot(2,10,16,NULL,0.2); gr->Dens(a,"BbcwyrR"); gr->Puts(0.07, 0.12, "BbcwyrR", "A");
+ gr->SubPlot(2,10,17,NULL,0.2); gr->Dens(a,"bcyr"); gr->Puts(0.57, 0.12, "bcyr", "A");
+ gr->SubPlot(2,10,18,NULL,0.2); gr->Dens(a,"BbcyrR|"); gr->Puts(0.07, 0.02, "BbcyrR|", "A");
+ gr->SubPlot(2,10,19,NULL,0.2); gr->Dens(a,"bgr"); gr->Puts(0.57, 0.02, "bgr", "A");
return;
mglParse par;
@@ -123,26 +140,26 @@ const char *mmgl_schemes="call 'sch' 0 'kw'\ncall 'sch' 1 'wk'\ncall 'sch' 2 'kH
void smgl_schemes(mglGraph *gr) // Color table
{
mglData a(256,2); a.Fill(-1,1);
- gr->SubPlot(2,10,0,0.2); gr->Dens(a,"kw"); gr->Puts(0.07, 0.92, "kw", "A");
- gr->SubPlot(2,10,1,0.2); gr->Dens(a,"wk"); gr->Puts(0.57, 0.92, "wk", "A");
- gr->SubPlot(2,10,2,0.2); gr->Dens(a,"kHCcw"); gr->Puts(0.07, 0.82, "kHCcw", "A");
- gr->SubPlot(2,10,3,0.2); gr->Dens(a,"kBbcw"); gr->Puts(0.57, 0.82, "kBbcw", "A");
- gr->SubPlot(2,10,4,0.2); gr->Dens(a,"kRryw"); gr->Puts(0.07, 0.72, "kRryw", "A");
- gr->SubPlot(2,10,5,0.2); gr->Dens(a,"kGgew"); gr->Puts(0.57, 0.72, "kGgew", "A");
- gr->SubPlot(2,10,6,0.2); gr->Dens(a,"BbwrR"); gr->Puts(0.07, 0.62, "BbwrR", "A");
- gr->SubPlot(2,10,7,0.2); gr->Dens(a,"BbwgG"); gr->Puts(0.57, 0.62, "BbwgG", "A");
- gr->SubPlot(2,10,8,0.2); gr->Dens(a,"GgwmM"); gr->Puts(0.07, 0.52, "GgwmM", "A");
- gr->SubPlot(2,10,9,0.2); gr->Dens(a,"UuwqR"); gr->Puts(0.57, 0.52, "UuwqR", "A");
- gr->SubPlot(2,10,10,0.2); gr->Dens(a,"QqwcC"); gr->Puts(0.07, 0.42, "QqwcC", "A");
- gr->SubPlot(2,10,11,0.2); gr->Dens(a,"CcwyY"); gr->Puts(0.57, 0.42, "CcwyY", "A");
- gr->SubPlot(2,10,12,0.2); gr->Dens(a,"bcwyr"); gr->Puts(0.07, 0.32, "bcwyr", "A");
- gr->SubPlot(2,10,13,0.2); gr->Dens(a,"bwr"); gr->Puts(0.57, 0.32, "bwr", "A");
- gr->SubPlot(2,10,14,0.2); gr->Dens(a,"BbcyrR"); gr->Puts(0.07, 0.22, "BbcyrR", "A");
- gr->SubPlot(2,10,15,0.2); gr->Dens(a,"UbcyqR"); gr->Puts(0.57, 0.22, "UbcyqR", "A");
- gr->SubPlot(2,10,16,0.2); gr->Dens(a,"BbcwyrR"); gr->Puts(0.07, 0.12, "BbcwyrR", "A");
- gr->SubPlot(2,10,17,0.2); gr->Dens(a,"bcyr"); gr->Puts(0.57, 0.12, "bcyr", "A");
- gr->SubPlot(2,10,18,0.2); gr->Dens(a,"BbcyrR|"); gr->Puts(0.07, 0.02, "BbcyrR|", "A");
- gr->SubPlot(2,10,19,0.2); gr->Dens(a,"bgr"); gr->Puts(0.57, 0.02, "bgr", "A");
+ gr->SubPlot(2,10,0,NULL,0.2); gr->Dens(a,"kw"); gr->Puts(0.07, 0.92, "kw", "A");
+ gr->SubPlot(2,10,1,NULL,0.2); gr->Dens(a,"wk"); gr->Puts(0.57, 0.92, "wk", "A");
+ gr->SubPlot(2,10,2,NULL,0.2); gr->Dens(a,"kHCcw"); gr->Puts(0.07, 0.82, "kHCcw", "A");
+ gr->SubPlot(2,10,3,NULL,0.2); gr->Dens(a,"kBbcw"); gr->Puts(0.57, 0.82, "kBbcw", "A");
+ gr->SubPlot(2,10,4,NULL,0.2); gr->Dens(a,"kRryw"); gr->Puts(0.07, 0.72, "kRryw", "A");
+ gr->SubPlot(2,10,5,NULL,0.2); gr->Dens(a,"kGgew"); gr->Puts(0.57, 0.72, "kGgew", "A");
+ gr->SubPlot(2,10,6,NULL,0.2); gr->Dens(a,"BbwrR"); gr->Puts(0.07, 0.62, "BbwrR", "A");
+ gr->SubPlot(2,10,7,NULL,0.2); gr->Dens(a,"BbwgG"); gr->Puts(0.57, 0.62, "BbwgG", "A");
+ gr->SubPlot(2,10,8,NULL,0.2); gr->Dens(a,"GgwmM"); gr->Puts(0.07, 0.52, "GgwmM", "A");
+ gr->SubPlot(2,10,9,NULL,0.2); gr->Dens(a,"UuwqR"); gr->Puts(0.57, 0.52, "UuwqR", "A");
+ gr->SubPlot(2,10,10,NULL,0.2); gr->Dens(a,"QqwcC"); gr->Puts(0.07, 0.42, "QqwcC", "A");
+ gr->SubPlot(2,10,11,NULL,0.2); gr->Dens(a,"CcwyY"); gr->Puts(0.57, 0.42, "CcwyY", "A");
+ gr->SubPlot(2,10,12,NULL,0.2); gr->Dens(a,"bcwyr"); gr->Puts(0.07, 0.32, "bcwyr", "A");
+ gr->SubPlot(2,10,13,NULL,0.2); gr->Dens(a,"bwr"); gr->Puts(0.57, 0.32, "bwr", "A");
+ gr->SubPlot(2,10,14,NULL,0.2); gr->Dens(a,"BbcyrR"); gr->Puts(0.07, 0.22, "BbcyrR", "A");
+ gr->SubPlot(2,10,15,NULL,0.2); gr->Dens(a,"UbcyqR"); gr->Puts(0.57, 0.22, "UbcyqR", "A");
+ gr->SubPlot(2,10,16,NULL,0.2); gr->Dens(a,"BbcwyrR"); gr->Puts(0.07, 0.12, "BbcwyrR", "A");
+ gr->SubPlot(2,10,17,NULL,0.2); gr->Dens(a,"bcyr"); gr->Puts(0.57, 0.12, "bcyr", "A");
+ gr->SubPlot(2,10,18,NULL,0.2); gr->Dens(a,"BbcyrR|"); gr->Puts(0.07, 0.02, "BbcyrR|", "A");
+ gr->SubPlot(2,10,19,NULL,0.2); gr->Dens(a,"bgr"); gr->Puts(0.57, 0.02, "bgr", "A");
}
//-----------------------------------------------------------------------------
const char *mmgl_curvcor="origin -1 1 -1\nsubplot 2 2 0:title 'Cartesian':rotate 50 60:fplot '2*t-1' '0.5' '0':axis:grid\n"
@@ -1979,6 +1996,7 @@ mglSample samp[] = {
{"contv", smgl_contv},
// {"crust", smgl_crust}, // TODO: open after triangulation
{"curvcoor", smgl_curvcoor},
+ {"cut", smgl_cut},
{"dat_diff", smgl_dat_diff},
{"dat_exta", smgl_dat_exta},
{"dens", smgl_dens},
diff --git a/include/mgl/canvas.h b/include/mgl/canvas.h
index 165064b..b96cab6 100644
--- a/include/mgl/canvas.h
+++ b/include/mgl/canvas.h
@@ -175,9 +175,9 @@ using mglBase::Light;
/// Combine plots from 2 canvases. Result will be saved into this.
void Combine(const mglCanvas *gr);
/// Send graphical information to node id using MPI
- void MPI_Send(int /*id*/) {} // TODO: add later
+ void MPI_Send(int id);
/// Receive graphical information from node id using MPI
- void MPI_Recv(int /*id*/) {} // TODO: add later
+ void MPI_Recv(int id);
inline float GetDelay() { return Delay; }
inline void SetDelay(float d) { Delay=d; }
diff --git a/include/mgl/canvas_cf.h b/include/mgl/canvas_cf.h
index 3e807f3..50e3159 100644
--- a/include/mgl/canvas_cf.h
+++ b/include/mgl/canvas_cf.h
@@ -120,9 +120,8 @@ void mgl_mat_push(HMGL gr);
void mgl_clf(HMGL graph);
void mgl_clf_rgb(HMGL gr, float r, float g, float b);
-void mgl_subplot(HMGL gr, int nx,int ny,int m);
-void mgl_subplot_d(HMGL gr, int nx,int ny,int m, float dx, float dy);
-void mgl_subplot_s(HMGL gr, int nx,int ny,int m,const char *style);
+void mgl_subplot_d(HMGL gr, int nx,int ny,int m,const char *style, float dx, float dy);
+void mgl_subplot(HMGL gr, int nx,int ny,int m,const char *style);
void mgl_multiplot(HMGL gr, int nx,int ny,int m,int dx,int dy,const char *style);
void mgl_inplot(HMGL gr, float x1,float x2,float y1,float y2);
void mgl_relplot(HMGL gr, float x1,float x2,float y1,float y2);
@@ -139,6 +138,7 @@ void mgl_zoom(HMGL gr, float x1, float y1, float x2, float y2);
void mgl_rotate_vector(HMGL gr, float Tet,float x,float y,float z);
void mgl_perspective(HMGL gr, float val);
+void mgl_draw_thr(void *);
/*****************************************************************************/
uintptr_t mgl_create_graph_(int *width, int *height);
void mgl_delete_graph_(uintptr_t *graph);
@@ -255,13 +255,13 @@ void mgl_perspective_(uintptr_t *graph, float val);
int mgl_fortran_func(HMGL gr, void *);
HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void *par);
HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, void *par);
-void mgl_fltk_run();
-void mgl_qt_run();
+int mgl_fltk_run();
+int mgl_qt_run();
/*****************************************************************************/
uintptr_t mgl_create_graph_qt_(const char *title, int);
uintptr_t mgl_create_graph_fltk_(const char *title, int);
-void mgl_fltk_run_();
-void mgl_qt_run_();
+int mgl_fltk_run_();
+int mgl_qt_run_();
/*****************************************************************************/
void mgl_wnd_set_delay(HMGL gr, float dt);
void mgl_setup_window(HMGL gr, int autoclf, int showpos, int clf_upd);
diff --git a/include/mgl/data.h b/include/mgl/data.h
index 8ab4dc0..242fdcb 100644
--- a/include/mgl/data.h
+++ b/include/mgl/data.h
@@ -641,6 +641,8 @@ public:
inline void operator+=(mreal d) { mgl_data_add_num(this,d); }
/// Substract the number
inline void operator-=(mreal d) { mgl_data_sub_num(this,d); }
+ /// Direct access to the data cell
+ inline mreal &operator[](long i) { return a[i]; }
// NOTE see 13.10 for operator(), operator[] -- m.b. I should add it ???
protected:
/// Get the value in given cell of the data without border checking
diff --git a/include/mgl/define.h b/include/mgl/define.h
index dff47c7..1d7552c 100644
--- a/include/mgl/define.h
+++ b/include/mgl/define.h
@@ -58,7 +58,7 @@ extern mglData s;const unsigned long mgl_nan[2] = {0xffffffff, 0x7fffffff};
#define mglprintf swprintf
#endif
//#define FLT_EPS 1.1920928955078125e-07
-#define MGL_FLT_EPS (1.+1e-06)
+#define MGL_FLT_EPS (1.+1e-05)
//-----------------------------------------------------------------------------
#ifndef isnan
#define isnan(a) ((a)!=(a))
@@ -193,25 +193,12 @@ struct mglThreadD
void mglStartThread(void *(*func)(void *), void (*post)(mglThreadD *,mreal *), long n,
mreal *a=0, const mreal *b=0, const mreal *c=0, const long *p=0,
void *v=0, const mreal *d=0, const mreal *e=0, char *s=0);
-void mglSetNumThr(int n=0); ///< Set number of thread for plotting and data handling
extern int mglNumThr; ///< Number of thread for plotting and data handling
//-----------------------------------------------------------------------------
-class mglGraph;
-class mglBase;
-/// Class for drawing in windows (like, mglCanvasFL, mglCanvasQT and so on)
-/// Make inherited class and redefine Draw() function if you don't want to use function pointers.
-struct mglDraw
-{
- virtual int Draw(mglGraph *)=0;
- virtual void Reload(){}
-};
-int mgl_draw_class(mglBase *gr, void *p);
-void mgl_reload_class(void *p);
-typedef int (*draw_func)(mglGraph *gr);
-int mgl_draw_graph(mglBase *gr, void *p);
-//-----------------------------------------------------------------------------
extern "C" {
#endif
+/** Set number of thread for plotting and data handling*/
+void mgl_set_num_thr(int n);
void mgl_test_txt(const char *str, ...);
void mgl_set_test_mode(int enable);
/** Duplicate string (returned pointer must be free() after usage) */
diff --git a/include/mgl/glut.h b/include/mgl/glut.h
index 5adb631..558bfeb 100644
--- a/include/mgl/glut.h
+++ b/include/mgl/glut.h
@@ -22,7 +22,7 @@
#define _MGL_GLUT_H_
#ifdef __cplusplus
#include "mgl/opengl.h"
-#include "mgl/mgl.h"
+#include "mgl/window.h"
//-----------------------------------------------------------------------------
extern "C" {
#endif
diff --git a/include/mgl/mgl.h b/include/mgl/mgl.h
index ef33e21..e013ae2 100644
--- a/include/mgl/mgl.h
+++ b/include/mgl/mgl.h
@@ -203,11 +203,8 @@ public:
{ mgl_tune_ticks(gr, tune, fact_pos); }
/// Put further plotting in some region of whole frame surface.
- inline void SubPlot(int nx,int ny,int m, float dx=0, float dy=0)
- { mgl_subplot_d(gr, nx, ny, m, dx, dy); }
- /// Put further plotting in some region of whole frame surface (adjust size according reservations).
- inline void SubPlot(int nx,int ny,int m, const char *style)
- { mgl_subplot_s(gr, nx, ny, m, style); }
+ inline void SubPlot(int nx,int ny,int m,const char *style="<>_^", float dx=0, float dy=0)
+ { mgl_subplot_d(gr, nx, ny, m, style, dx, dy); }
/// Like SubPlot bot "join" several cells
inline void MultiPlot(int nx,int ny,int m, int dx, int dy, const char *style="<>_^")
{ mgl_multiplot(gr, nx, ny, m, dx, dy, style); }
@@ -231,7 +228,7 @@ public:
inline void Title(const wchar_t *title,const char *stl="",float size=-2)
{ mgl_titlew(gr,title,stl,size); }
/// Set aspect ratio for further plotting.
- inline void Aspect(float Ax,float Ay,float Az)
+ inline void Aspect(float Ax,float Ay,float Az=1)
{ mgl_aspect(gr, Ax, Ay, Az); }
/// Rotate a further plotting.
inline void Rotate(float TetX,float TetZ=0,float TetY=0)
@@ -331,10 +328,10 @@ public:
/// Stop writing cinema using GIF format
inline void CloseGIF() { mgl_close_gif(gr); }
/// Export points and primitives in file using MGLD format
- inline bool ExportMGLD(const char *fname, const char *descr=0)
+ inline void ExportMGLD(const char *fname, const char *descr=0)
{ mgl_export_mgld(gr, fname, descr); }
/// Import points and primitives from file using MGLD format
- inline bool ImportMGLD(const char *fname, bool add=false)
+ inline void ImportMGLD(const char *fname, bool add=false)
{ mgl_import_mgld(gr, fname, add); }
/// Copy RGB values into array which is allocated by user
diff --git a/include/mgl/window.h b/include/mgl/window.h
index c084ae3..cd86191 100644
--- a/include/mgl/window.h
+++ b/include/mgl/window.h
@@ -23,6 +23,26 @@
/*****************************************************************************/
#include "mgl/mgl.h"
//-----------------------------------------------------------------------------
+/// Class for drawing in windows (like, mglCanvasFL, mglCanvasQT and so on)
+/// Make inherited class and redefine Draw() function if you don't want to use function pointers.
+struct mglDraw
+{
+#ifdef HAVE_PTHREAD
+ pthread_t thr;
+ bool running;
+ mglDraw() { running=false; }
+ virtual void Calc() {} ///< Function for calculations
+ inline void Run() ///< Run calculations in other thread
+ { mgl_draw_thr(this); }
+#endif
+ virtual int Draw(mglGraph *)=0; ///< Function for drawing
+ virtual void Reload() {} ///< Function for reloading data
+};
+int mgl_draw_class(mglBase *gr, void *p);
+void mgl_reload_class(void *p);
+typedef int (*draw_func)(mglGraph *gr);
+int mgl_draw_graph(mglBase *gr, void *p);
+//-----------------------------------------------------------------------------
class mglWindow : public mglGraph
{
protected:
@@ -46,8 +66,8 @@ public:
if(wnd==1) gr = mgl_create_graph_qt(mgl_draw_class,title,dr);
else gr = mgl_create_graph_fltk(mgl_draw_class,title,dr);
}
- inline void Run() ///< Run main loop for event handling
- { if(wnd==1) mgl_qt_run(); else mgl_fltk_run(); }
+ inline int Run() ///< Run main loop for event handling
+ { return (wnd==1)? mgl_qt_run() : mgl_fltk_run(); }
inline void ToggleAlpha() ///< Switch on/off transparency (do not overwrite user settings)
{ mgl_wnd_toggle_alpha(gr); }
diff --git a/src/axis.cpp b/src/axis.cpp
index 0e31b9c..b0247fb 100644
--- a/src/axis.cpp
+++ b/src/axis.cpp
@@ -282,6 +282,7 @@ void mglCanvas::SetTickTime(char dir, float d, const char *t)
//-----------------------------------------------------------------------------
void mglCanvas::AdjustTicks(const char *dir, bool force)
{
+ if(force) SetTuneTicks(true);
UpdateAxis(); //TuneTicks = true;
if(strchr(dir,'x'))
{ if(force) ax.d=0; AdjustTicks(ax,fx); }
diff --git a/src/base.cpp b/src/base.cpp
index 3d79ec8..d863eb6 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -752,7 +752,7 @@ float mglBase::GetA(float a)
{
if(fa) a = fa->Calc(0,0,0,a);
a = (a-FMin.c)/(FMax.c-FMin.c);
- a = a<1?(a>0?a:0):1/MGL_FLT_EPS; // for texture a must be <1 always!!!
+ a = (a<1?(a>0?a:0):1)/MGL_FLT_EPS; // for texture a must be <1 always!!!
return a;
}
//-----------------------------------------------------------------------------
@@ -856,9 +856,6 @@ float mglBase::SaveState(const char *opt)
else if(!strcmp(a,"light")) Light(ff!=0);
else if(!strcmp(a,"ambient")) SetAmbient(ff);
else if(!strcmp(a,"diffuse")) SetDifLight(ff);
- else if(!strcmp(a,"marksize")) SetMarkSize(ff);
- else if(!strcmp(a,"fontsize")) SetFontSize(ff);
- else if(!strcmp(a,"arrowsize")) SetArrowSize(ff);
else if(!strcmp(a,"size"))
{ SetMarkSize(ff); SetFontSize(ff); SetArrowSize(ff); }
else if(!strcmp(a,"num") || !strcmp(a,"number") || !strcmp(a,"value")) return ff;
diff --git a/src/canvas_cf.cpp b/src/canvas_cf.cpp
index 5e83da2..90b9a19 100644
--- a/src/canvas_cf.cpp
+++ b/src/canvas_cf.cpp
@@ -58,10 +58,7 @@ void mgl_mat_pop(HMGL gr) { _Gr_->Pop(); }
void mgl_clf(HMGL gr) { _Gr_->Clf(); }
void mgl_clf_rgb(HMGL gr, float r, float g, float b){ _Gr_->Clf(mglColor(r,g,b)); }
//-----------------------------------------------------------------------------
-void mgl_subplot(HMGL gr, int nx,int ny,int m)
-{ mgl_subplot_d(gr,nx,ny,m,0,0); }
-//-----------------------------------------------------------------------------
-void mgl_subplot_d(HMGL gr, int nx,int ny,int m,float dx,float dy)
+void mgl_subplot_d(HMGL gr, int nx,int ny,int m,const char *style,float dx,float dy)
{
float x1,x2,y1,y2;
int mx = m%nx, my = m/nx;
@@ -69,18 +66,12 @@ void mgl_subplot_d(HMGL gr, int nx,int ny,int m,float dx,float dy)
else { dx /= 2; dy /= 2; }
x1 = (mx+dx)/nx; x2 = (mx+1+dx)/nx;
y2 = 1.f-(my+dy)/ny; y1 = 1.f-(my+1+dy)/ny;
- _Gr_->InPlot(x1,x2,y1,y2,false);
-}
-//-----------------------------------------------------------------------------
-void mgl_subplot_s(HMGL gr, int nx,int ny,int m,const char *style)
-{
- float x1,x2,y1,y2;
- int mx = m%nx, my = m/nx;
- x1 = float(mx)/nx; x2 = float(mx+1)/nx;
- y2 = 1.f-float(my)/ny; y1 = 1.f-float(my+1)/ny;
_Gr_->InPlot(x1,x2,y1,y2,style);
}
//-----------------------------------------------------------------------------
+void mgl_subplot(HMGL gr, int nx,int ny,int m,const char *style)
+{ mgl_subplot_d(gr,nx,ny,m,style,0,0); }
+//-----------------------------------------------------------------------------
void mgl_multiplot(HMGL gr, int nx,int ny,int m,int dx,int dy,const char *style)
{
float x1,x2,y1,y2;
@@ -155,13 +146,12 @@ void mgl_clf_(uintptr_t *gr)
void mgl_clf_rgb_(uintptr_t *gr, float *r, float *g, float *b)
{ _GR_->Clf(mglColor(*r,*g,*b)); }
//-----------------------------------------------------------------------------
-void mgl_subplot_(uintptr_t *gr, int *nx,int *ny,int *m)
-{ mgl_subplot_d(_GR_,*nx,*ny,*m,0,0); }
-void mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,float *dx,float *dy)
-{ mgl_subplot_d(_GR_,*nx,*ny,*m,*dx,*dy); }
-void mgl_subplot_s_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st,int l)
+void mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st,float *dx,float *dy,int l)
+{ char *s=new char[l+1]; memcpy(s,st,l); s[l]=0;
+ mgl_subplot_d(_GR_,*nx,*ny,*m,s,*dx,*dy); delete []s; }
+void mgl_subplot_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st,int l)
{ char *s=new char[l+1]; memcpy(s,st,l); s[l]=0;
- mgl_subplot_s(_GR_,*nx,*ny,*m,s); delete []s; }
+ mgl_subplot(_GR_,*nx,*ny,*m,s); delete []s; }
void mgl_multiplot_(uintptr_t *gr, int *nx,int *ny,int *m,int *dx,int *dy,const char *st,int l)
{ char *s=new char[l+1]; memcpy(s,st,l); s[l]=0;
mgl_multiplot(_GR_,*nx,*ny,*m,*dx,*dy,s); delete []s; }
@@ -222,7 +212,7 @@ void mgl_set_axis_stl(HMGL gr, const char *stl, const char *tck, const char *sub
void mgl_tune_ticks(HMGL gr, int tune, float pos)
{ _Gr_->SetTuneTicks(tune,pos); }
void mgl_adjust_ticks(HMGL gr, const char *dir)
-{ _Gr_->AdjustTicks(dir); }
+{ _Gr_->AdjustTicks(dir,true); }
void mgl_set_ticks(HMGL gr, char dir, float d, int ns, float org)
{ _Gr_->SetTicks(dir,d,ns,org); }
void mgl_set_ticks_str(HMGL gr, char dir, const char *lbl, int add)
@@ -376,8 +366,8 @@ void mgl_set_plotid_(uintptr_t *gr, const char *id,int l)
//-----------------------------------------------------------------------------
void mgl_mpi_send(HMGL gr, int id) { _Gr_->MPI_Send(id); }
void mgl_mpi_recv(HMGL gr, int id) { _Gr_->MPI_Recv(id); }
-void mgl_mpi_send_(uintptr_t *gr, int *id) { _GR_->MPI_Send(*id); }
-void mgl_mpi_recv_(uintptr_t *gr, int *id) { _GR_->MPI_Recv(*id); }
+void mgl_mpi_send_(uintptr_t *gr, int *id) { mgl_mpi_send(_GR_, *id); }
+void mgl_mpi_recv_(uintptr_t *gr, int *id) { mgl_mpi_recv(_GR_, *id); }
//-----------------------------------------------------------------------------
void mgl_wnd_set_delay_(uintptr_t *gr, mreal *dt) { _GR_->SetDelay(*dt); }
void mgl_wnd_set_delay(HMGL gr, mreal dt) { _Gr_->SetDelay(dt); }
diff --git a/src/data.cpp b/src/data.cpp
index b485f82..fa1dd40 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -38,7 +38,7 @@ void mglFillP5(long x, const mreal *a,long nx,mreal _p[6]);
#elif defined(unix) || defined(__unix) || defined(__unix__)
#include
#endif
-void mglSetNumThr(int n)
+void mgl_set_num_thr(int n)
{
#ifdef WIN32
SYSTEM_INFO systemInfo;
@@ -54,7 +54,7 @@ void mglSetNumThr(int n)
#endif
}
#else
-void mglSetNumThr(int) { mglNumThr = 1; }
+void mgl_set_num_thr(int) { mglNumThr = 1; }
#endif
//-----------------------------------------------------------------------------
void mglStartThread(void *(*func)(void *), void (*post)(mglThreadD *,mreal *), long n, mreal *a,
@@ -62,7 +62,7 @@ void mglStartThread(void *(*func)(void *), void (*post)(mglThreadD *,mreal *), l
{
if(!func) return;
#ifdef HAVE_PTHREAD
- if(mglNumThr<1) mglSetNumThr(0);
+ if(mglNumThr<1) mgl_set_num_thr(0);
if(mglNumThr>1)
{
pthread_t *tmp=new pthread_t[mglNumThr];
diff --git a/src/exec.cpp b/src/exec.cpp
index c7ea4ca..737a0c0 100644
--- a/src/exec.cpp
+++ b/src/exec.cpp
@@ -2024,19 +2024,15 @@ void mglc_surf3a(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt
//-----------------------------------------------------------------------------
int mgls_subplot(mglGraph *gr, long , mglArg *a, int k[10], const char *)
{
- if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2)
- gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), a[3].s.c_str());
- else if(k[0]==3 && k[1]==3 && k[2]==3)
- gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==3?a[3].v:0, k[4]==3?a[4].v:0);
+ if(k[0]==3 && k[1]==3 && k[2]==3)
+ gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==2?a[3].s.c_str():"<>_^", k[4]==3?a[3].v:0, k[5]==3?a[4].v:0);
else return 1;
return 0;
}
void mglc_subplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *)
{
- if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2)
- mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, \"%s\");", iint(a[0].v), iint(a[1].v), iint(a[2].v), a[3].s.c_str());
- else if(k[0]==3 && k[1]==3 && k[2]==3)
- mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, %g, %g);", iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==3?a[3].v:0, k[4]==3?a[4].v:0);
+ if(k[0]==3 && k[1]==3 && k[2]==3)
+ mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, \"%s\", %g, %g);", iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==2?a[3].s.c_str():"<>_^", k[4]==3?a[3].v:0, k[5]==3?a[4].v:0);
}
//-----------------------------------------------------------------------------
int mgls_multiplot(mglGraph *gr, long , mglArg *a, int k[10], const char *)
@@ -2054,7 +2050,7 @@ void mglc_multiplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *
//-----------------------------------------------------------------------------
int mgls_title(mglGraph *gr, long , mglArg *a, int k[10], const char *)
{
- if(k[0]==2) gr->Title(a[0].w.c_str(), k[1]==2?a[1].s.c_str():"#", k[2]==2?a[2].v:-2);
+ if(k[0]==2) gr->Title(a[0].w.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==2?a[2].v:-2);
else return 1;
return 0;
}
@@ -3685,7 +3681,7 @@ mglCommand mgls_base_cmd[] = {
{"stickplot","Set position of plot inside cell of stick", "stickplot num ind tet phi", mgls_stickplot, mglc_stickplot,5},
{"stop","Stop execution","stop", 0, 0, 6},
{"subdata","Extract sub-array","subdata Res Dat nx [ny nz]", mgls_subdata, mglc_subdata,4},
- {"subplot","Set position of plot","subplot m n pos [dx dy]|m n pos 'style'", mgls_subplot, mglc_subplot,5},
+ {"subplot","Set position of plot","subplot m n pos ['style' dx dy]", mgls_subplot, mglc_subplot,5},
{"subto","Subtract data or number","subto Var Dat|Var num", mgls_subto, mglc_subto,3},
{"sum","Find summation over direction","sum Res Dat 'dir'", mgls_sum, mglc_sum,4},
{"surf","Draw solid surface","surf Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_surf, mglc_surf,0},
@@ -3701,7 +3697,7 @@ mglCommand mgls_base_cmd[] = {
{"text","Draw text at some position or along curve","text x y 'txt' ['fmt' size]|x y z 'txt' ['fmt' size]|x y dx dy 'txt' ['fmt' size]|x y z dx dy dz 'txt' ['fmt' size]|Ydat 'txt' ['font' sise]|Xdat Ydat 'txt' ['font' sise]", mgls_text, mglc_text,0},
{"textmark","Draw TeX mark at point position","textmark Ydat Rdat 'text' ['fmt']|Xdat Ydat Rdat 'text' ['fmt']|Xdat Ydat Zdat Rdat 'text' ['fmt']", mgls_textmark, mglc_textmark,0},
{"ticklen","Set tick length","ticklen val [stt]", mgls_ticklen, mglc_ticklen,2},
- {"ticktime","Set ticks in time format","timetick 'dir' [dv 'tmpl']", mgls_ticktime, mglc_ticktime,2},
+ {"ticktime","Set ticks in time format","ticktime 'dir' [dv 'tmpl']", mgls_ticktime, mglc_ticktime,2},
{"tile","Draw horizontal tiles","tile Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_tile, mglc_tile,0},
{"tiles","Draw horizontal tiles with variable size","tiles Zdat Rdat ['fmt']|Xdat Ydat Zdat Rdat ['fmt']", mgls_tiles, mglc_tiles,0},
{"title","Add title for current subplot/inplot","title 'txt' ['fmt' size]", mgls_title, mglc_title,0},
@@ -3732,15 +3728,3 @@ mglCommand mgls_base_cmd[] = {
{"ztick","Set ticks for z-axis","ztick dz [sz tz] | 'tmpl' | Zdat 'lbl' [add] | v1 'lbl1' ...", mgls_ztick, mglc_ztick,2},
{"","","",NULL,NULL,0}};
//-----------------------------------------------------------------------------
-int mgl_draw_class(mglBase *gr, void *p)
-{ mglGraph g(gr); return p ? ((mglDraw *)p)->Draw(&g) : 0; }
-void mgl_reload_class(void *p)
-{ if(p) ((mglDraw *)p)->Reload(); }
-//-----------------------------------------------------------------------------
-int mgl_draw_graph(mglBase *gr, void *p)
-{
- mglGraph g(gr);
- draw_func func = (draw_func)(p);
- return func ? func(&g) : 0;
-}
-//-----------------------------------------------------------------------------
diff --git a/src/pixel.cpp b/src/pixel.cpp
index 8bc59e9..f5dc55e 100644
--- a/src/pixel.cpp
+++ b/src/pixel.cpp
@@ -243,7 +243,7 @@ void mglStartThread(void (mglCanvas::*func)(unsigned long i, unsigned long n, co
{
if(!func || !gr) return;
#ifdef HAVE_PTHREAD
- if(mglNumThr<1) mglSetNumThr(0);
+ if(mglNumThr<1) mgl_set_num_thr(0);
if(mglNumThr>1)
{
pthread_t *tmp=new pthread_t[mglNumThr];
@@ -410,6 +410,11 @@ void mglCanvas::Combine(const mglCanvas *gr)
mglStartThread(&mglCanvas::pxl_other,this,Width*Height,gr);
}
//-----------------------------------------------------------------------------
+#ifndef HAVE_MPI
+void mglCanvas::MPI_Send(int id) {} // TODO: add later
+void mglCanvas::MPI_Recv(int id) {} // TODO: add later
+#endif
+//-----------------------------------------------------------------------------
void mglCanvas::pnt_plot(long x,long y,float z,const unsigned char ci[4])
{
long i0=x+Width*(Height-1-y);
diff --git a/texinfo/CMakeLists.txt b/texinfo/CMakeLists.txt
index dd3f86f..97c370a 100644
--- a/texinfo/CMakeLists.txt
+++ b/texinfo/CMakeLists.txt
@@ -12,8 +12,8 @@ if(use_doc)
# set_source_files_properties(${CMAKE_BINARY_DIR}/examples/mgl_example PROPERTIES GENERATED 1)
# ADD_CUSTOM_TARGET(gen_all_png DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png)
# ADD_DEPENDENCIES(gen_all_png mgl_example)
- set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi parse_en.texi core_en.texi widget_en.texi data_en.texi other_en.texi samples_en.texi appendix_en.texi fdl.texi)
- set(list_texi_files_ru mathgl_ru.texi mgl_ru.texi overview_ru.texi example_ru.texi ex_mgl_ru.texi parse_ru.texi core_ru.texi widget_ru.texi data_ru.texi other_ru.texi samples_ru.texi appendix_ru.texi fdl.texi)
+ set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi parse_en.texi core_en.texi concept_en.texi widget_en.texi data_en.texi other_en.texi samples_en.texi appendix_en.texi fdl.texi)
+ set(list_texi_files_ru mathgl_ru.texi mgl_ru.texi overview_ru.texi example_ru.texi ex_mgl_ru.texi parse_ru.texi core_ru.texi concept_ru.texi widget_ru.texi data_ru.texi other_ru.texi samples_ru.texi appendix_ru.texi fdl.texi)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info
COMMAND ${findth} --split=section mathgl_en.texi -o mathgl_en
diff --git a/texinfo/concept_en.texi b/texinfo/concept_en.texi
index ba123d1..79b184f 100644
--- a/texinfo/concept_en.texi
+++ b/texinfo/concept_en.texi
@@ -1,4 +1,4 @@
-@chapter Overview
+@chapter General concepts
The set of MathGL features is rather rich -- just the number of basic graphics types
is larger than 50. Also there are functions for data handling, plot setup and so on. In spite of it I tried to keep a similar style in function names and in the order of arguments. Mostly it is
@@ -24,6 +24,7 @@ In addition to the general concepts I want to comment on some non-trivial or les
@menu
* Coordinate axes::
+* Color styles::
* Line styles::
* Color scheme::
* Font styles::
@@ -33,87 +34,78 @@ In addition to the general concepts I want to comment on some non-trivial or les
@end menu
@c ------------------------------------------------------------------
-@node Coordinate axes, Line styles, , General concepts
-@subsection Coordinate axes
+@node Coordinate axes, Color styles, , General concepts
+@section Coordinate axes
-Two axis representations are used in MathGL. The first one consists of normalizing the data point coordinates in a box @var{Min}x@var{Max} (@pxref{Axis settings}). If @var{Cut} is @code{true} then the outlier points are omitted, otherwise they are projected to the bounding box (@pxref{Cutting}). Also, the point will be omitted if it lies inside the box defined by @var{CutMin} x @var{CutMax} or if the value of formula @code{CutOff}() is nonzero for its coordinates. After that, transformation formulas are applied to the data point. Finally, the data point is plotted by one of the functions.
+Two axis representations are used in MathGL. The first one consists of normalizing coordinates of data points in a box @var{Min} x @var{Max} (see @ref{Axis settings}). If @code{SetCut()} is @code{true} then the outlier points are omitted, otherwise they are projected to the bounding box (see @ref{Cutting}). Also, the point will be omitted if it lies inside the box defined by @code{SetCutBox()} or if the value of formula @code{CutOff()} is nonzero for its coordinates. After that, transformation formulas defined by @code{SetFunc()} or @code{SetCoor()} are applied to the data point (see @ref{Curved coordinates}). Finally, the data point is plotted by one of the functions.
-There is a possibility to set members @var{Max}, @var{Min} directly, but one should call @code{RecalcBorder()} function to setup plotting routines. A safer way is to set these values by calling the @code{Axis()} function, which calls @code{RecalcBorder()} automatically. Another way to specify the scaling of the axis is to set it as a minimal or maximal value of the data array. Functions @code{XRange(), YRange(), ZRange()} do it. The second (optional) argument is used to replace the axis range or to join with the existed range.
+The range of @emph{x, y, z}-axis can be specified by @code{SetRange()} or @code{SetRanges()} functions. Its origin is specified by @code{SetOrigin()} function. At this you can you can use @code{NAN} values for selecting axis origin automatically.
-The axis origin is defined by the variable @var{Org} and is applied to all consequent calls of axes or grid drawing. By default, if this point lies outside the bounding box then it is projected onto the one (variable @var{AutoOrg} controls it). If one of the values of @var{Org} is equal to NAN then the corresponding value will be selected automatically.
+There is 4-th axis @emph{c} (color axis or colorbar) in addition to the usual axes @emph{x, y, z}. It sets the range of values for the surface coloring. Its borders are automatically set to values of Min.z, Max.z during the call of @code{SetRanges()} function. Also, one can directly set it by call @code{SetRange('c', ...)}. Use @code{Colorbar()} function for drawing the colorbar.
-There is 4-th axis @emph{c} (color axis or colorbar) in addition to the usual axes @emph{x, y, z}. It sets the range of values for the surface coloring. Its borders are automatically set to values of Min.z, Max.z during the call of @code{Axis()} function. Also, one can directly change the color range by setting variables @var{Cmax}, @var{Cmax}, or calling functions @code{CAxis()} or @code{CRange()}. Use @code{Colorbar()} function for showing the colorbar.
+The form (appearence) of tick labels is controlled by @code{SetTicks()} function (@pxref{Ticks}). Function @var{SetTuneTicks} switches on/off tick enhancing by factoring out acommon multiplier (for small coordinate values, like 0.001 to 0.002, or large, like from 1000 to 2000) or common component (for narrow range, like from 0.999 to 1.000). Finally, you may use functions @code{SetTickTempl()} for setting templates for tick labels (it supports TeX symbols). Also, there is a possibility to print arbitrary text as tick labels the by help of @code{SetTicksVal()} function.
-The form (appearence) of tick labels is controlled by @code{SetTicks()} function (@pxref{Axis settings}). It has 3 arguments: first one @var{d} sets the tick step (if positive) or tick number (if negative) or switches logarithmic ticks on (if zero); the second one, @var{ns}, sets the number of subticks; the last one is the starting point for ticks (default is axis origin). Function @var{SetTuneTicks} switches on/off tick enhancing by factoring out acommon multiplier (for small coordinate values, like 0.001 to 0.002, or large, like from 1000 to 2000) or common component (for narrow range, like from 0.999 to 1.000). Finally, you may use functions @code{SetXTT(), SetYTT(), SetZTT(), SetCTT()} for setting templates for tick labels (it supports TeX symbols). Also, there is a possibility to print arbitrary text as tick labels the by help of @code{SetTicksVal()} function.
-@node Line styles, Color scheme, Coordinate axes, General concepts
-@subsection Line styles
+@node Color styles, Line styles, Coordinate axes, General concepts
+@section Color styles
-@cindex Line style
-@cindex Mark style
-@cindex Arrows
-
-The line style is defined by the string which may contain specifications for color (@samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}), dashing style (@samp{-|;:ji} or space), width (@samp{0123456789}) and marks (@samp{o+xsd.^v} and @samp{#} modifier). If one of the type of information is omitted then default values used with the previous color or one from palette (for @pxref{1D plotting}) are adopted.
+Base colors are defined by one of symbol @samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}.
@ifhtml
@html
-By default palette contain following colors: dark gray ‘H’, blue ‘b’, green ‘g’, red ‘r’, cyan ‘c’, magenta ‘m’, yellow ‘y’, gray ‘h’, green-blue ‘l’, sky-blue ‘n’, orange ‘q’, green-yellow ‘e’, blue-violet ‘u’, purple ‘p’.
-
-The color types are: ‘k’ -- black, ‘r’ -- red, ‘R’ -- dark red, ‘g’ -- green, ‘G’ -- dark green, ‘b’ -- blue, ‘B’ -- dark blue, ‘c’ -- cyan, ‘C’ -- dark cyan, ‘m’ -- magenta, ‘M’ -- dark magenta, ‘y’ -- yellow, ‘Y’ -- dark yellow (gold), ‘h’ -- gray, ‘H’ -- dark gray, ‘w’ -- white, ‘W’ -- bright gray, ‘l’ -- green-blue, ‘L’ -- dark green-blue, ‘e’ -- green-yellow, ‘E’ -- dark green-yellow, ‘n’ -- sky-blue, ‘N’ -- dark sky-blue, ‘u’ -- blue-violet, ‘U’ -- dark blue-violet, ‘p’ -- purple, ‘P’ -- dark purple, ‘q’ -- orange, ‘Q’ -- dark orange (brown).
+The color types are: ‘k’ -- black, ‘r’ -- red, ‘R’ -- dark red, ‘g’ -- green, ‘G’ -- dark green, ‘b’ -- blue, ‘B’ -- dark blue, ‘c’ -- cyan, ‘C’ -- dark cyan, ‘m’ -- magenta, ‘M’ -- dark magenta, ‘y’ -- yellow, ‘Y’ -- dark yellow (gold), ‘h’ -- gray, ‘H’ -- dark gray, ‘w’ -- white, ‘W’ -- bright gray, ‘l’ -- green-blue, ‘L’ -- dark green-blue, ‘e’ -- green-yellow, ‘E’ -- dark green-yellow, ‘n’ -- sky-blue, ‘N’ -- dark sky-blue, ‘u’ -- blue-violet, ‘U’ -- dark blue-violet, ‘p’ -- purple, ‘P’ -- dark purple, ‘q’ -- orange, ‘Q’ -- dark orange (brown).
@end html
@end ifhtml
+@ifnothtml
+The color types are: @samp{k} -- black, @samp{r} -- red, @samp{R} -- dark red, @samp{g} -- green, @samp{G} -- dark green, @samp{b} -- blue, @samp{B} -- dark blue, @samp{c} -- cyan, @samp{C} -- dark cyan, @samp{m} -- magenta, @samp{M} -- dark magenta, @samp{y} -- yellow, @samp{Y} -- dark yellow (gold), @samp{h} -- gray, @samp{H} -- dark gray, @samp{w} -- white, @samp{W} -- bright gray, @samp{l} -- green-blue, @samp{L} -- dark green-blue, @samp{e} -- green-yellow, @samp{E} -- dark green-yellow, @samp{n} -- sky-blue, @samp{N} -- dark sky-blue, @samp{u} -- blue-violet, @samp{U} -- dark blue-violet, @samp{p} -- purple, @samp{P} -- dark purple, @samp{q} -- orange, @samp{Q} -- dark orange (brown).
+@end ifnothtml
+You can also use ``bright'' colors. The ``bright'' color contain 2 symbols in brackets @samp{@{cN@}}: first one is the usual symbol for color id, the second one is a digit for its brightness. The digit can be in range @samp{1}...@samp{9}. Number @samp{5} corresponds to a normal color, @samp{1} is a very dark version of the color (practically black), and @samp{9} is a very bright version of the color (practically white). For example, the colors can be @samp{@{b2@}} @samp{@{b7@}} @samp{@{r7@}} and so on.
-You can also use ``lighted'' colors. The ``lighted'' color contain 2 symbols in brackets @samp{@{cN@}}: first one is the usual symbol for color specification, the second one is a digit for its brightness. The digit can be in range @samp{1}...@samp{9}.
-Number @samp{5} corresponds to a normal color, @samp{1} is a very dark version of the color (practically black), and @samp{9} is a very bright version of the color (practically white). For example, the colors can be @samp{@{b2@}} @samp{@{b7@}} @samp{@{r7@}} and so on.
-
-@float
-@image{../png/colors, 7cm}
-@caption{Colors and its ids.}
-@end float
+@node Line styles, Color scheme, Color styles, General concepts
+@section Line styles
+@cindex Line style
+@cindex Mark style
+@cindex Arrows
+The line style is defined by the string which may contain specifications for color (@samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}), dashing style (@samp{-|;:ji=} or space), width (@samp{123456789}) and marks (@samp{*o+xsd.^v<>} and @samp{#} modifier). If one of the type of information is omitted then default values used with next color from palette (see @ref{Palette and colors}).
@ifhtml
@html
-Dashing style has the following meaning: space -- no line (usable for plotting only marks), ‘-’ -- solid line (■■■■■■■■■■■■■■■■), ‘|’ -- long dashed line (■■■■■■■■□□□□□□□□), ‘;’ -- dashed line (■■■■□□□□■■■■□□□□), ‘=’ -- small dashed line (■■□□■■□□■■□□■■□□), ‘:’ -- dotted line (■□□□■□□□■□□□■□□□), ‘j’ -- dash-dotted line (■■■■■■■□□□□■□□□□), ‘i’ -- small dash-dotted line (■■■□□■□□■■■□□■□□).
+By default palette contain following colors: dark gray ‘H’, blue ‘b’, green ‘g’, red ‘r’, cyan ‘c’, magenta ‘m’, yellow ‘y’, gray ‘h’, green-blue ‘l’, sky-blue ‘n’, orange ‘q’, green-yellow ‘e’, blue-violet ‘u’, purple ‘p’.
+
+Dashing style has the following meaning: space -- no line (usable for plotting only marks), ‘-’ -- solid line (■■■■■■■■■■■■■■■■), ‘|’ -- long dashed line (■■■■■■■■□□□□□□□□), ‘;’ -- dashed line (■■■■□□□□■■■■□□□□), ‘=’ -- small dashed line (■■□□■■□□■■□□■■□□), ‘:’ -- dotted line (■□□□■□□□■□□□■□□□), ‘j’ -- dash-dotted line (■■■■■■■□□□□■□□□□), ‘i’ -- small dash-dotted line (■■■□□■□□■■■□□■□□).
@end html
@end ifhtml
@ifnothtml
The line style is defined by the string which may contain specifications for color (@samp{wkrgbcymhRGBCYMHWlenupqLENUPQ}), dashing style (@samp{-|;:ji} or space), width (@samp{0123456789}) and marks (@samp{o+xsd.^v} and @samp{#} modifier). If one of the type of information is omitted then default values used with the previous color or one from palette (for @pxref{1D plotting}) are adopted. By default palette contain following colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}.
-The color types are: @samp{k} -- black, @samp{r} -- red, @samp{R} -- dark red, @samp{g} -- green, @samp{G} -- dark green, @samp{b} -- blue, @samp{B} -- dark blue, @samp{c} -- cyan, @samp{C} -- dark cyan, @samp{m} -- magenta, @samp{M} -- dark magenta, @samp{y} -- yellow, @samp{Y} -- dark yellow (gold), @samp{h} -- gray, @samp{H} -- dark gray, @samp{w} -- white, @samp{W} -- bright gray, @samp{l} -- green-blue, @samp{L} -- dark green-blue, @samp{e} -- green-yellow, @samp{E} -- dark green-yellow, @samp{n} -- sky-blue, @samp{N} -- dark sky-blue, @samp{u} -- blue-violet, @samp{U} -- dark blue-violet, @samp{p} -- purple, @samp{P} -- dark purple, @samp{q} -- orange, @samp{Q} -- dark orange (brown).
-
Dashing style has the following meaning: space -- no line (usable for plotting only marks), @samp{-} -- solid line (################), @samp{|} -- long dashed line (########________), @samp{;} -- dashed line (####____####____), @samp{=} -- small dashed line (##__##__##__##__), @samp{:} -- dotted line (#___#___#___#___), @samp{j} -- dash-dotted line (#######____#____), @samp{i} -- small dash-dotted line (###__#__###__#__).
@end ifnothtml
Marker types are: @samp{o} -- circle, @samp{+} -- cross, @samp{x} -- skew cross, @samp{s} - square, @samp{d} - rhomb (or diamond), @samp{.} -- dot (point), @samp{^} -- triangle up, @samp{v} -- triangle down, @samp{<} -- triangle left, @samp{>} -- triangle right, @samp{#*} -- Y sign, @samp{#+} -- squared cross, @samp{#x} -- squared skew cross, @samp{#.} -- circled dot. If string contain symbol @samp{#} then the solid versions of markers are used.
-@float
-@image{../png/sample5, 7cm}
-@caption{Styles of lines and marks.}
-@end float
-
One may specify to draw a special symbol (an arrow) at the beginning and at the end of line. This is done if the specification string contains one of the following symbols: @samp{A} -- outer arrow, @samp{V} -- inner arrow, @samp{I} -- transverse hatches, @samp{K} -- arrow with hatches, @samp{T} -- triangle, @samp{S} -- square, @samp{D} -- rhombus, @samp{O} -- circle, @samp{_} -- nothing (the default). The following rule applies: the first symbol specifies the arrow at the end of line, the second specifies the arrow at the beginning of the line. For example, @samp{r-A} defines a red solid line with usual arrow at the end, @samp{b|AI} defines a blue dash line with an arrow at the end and with hatches at the beginning, @samp{_O} defines a line with the current style and with a circle at the beginning. These styles are applicable during the graphics plotting as well (for example, @ref{1D plotting}).
@float
-@image{../png/sampled, 7cm}
-@caption{Arrow styles.}
+@image{../png/style, 11cm}
+@caption{Color and line styles.}
@end float
@c ------------------------------------------------------------------
@node Color scheme, Font styles, Line styles, General concepts
-@subsection Color scheme
+@section Color scheme
@cindex Color scheme
-The color scheme is used for determining the color of surfaces, isolines, isosurfaces and so on. The color scheme is defined by the string, which may contain several characters that are color id (@pxref{Line styles}) or characters @samp{d#:|}. Symbol @samp{d} denotes the interpolation by 3d position instead of the coloring by amplitude. Symbol @samp{#} switches to mesh drawing or to a wire plot. Symbol @samp{|} disables color interpolation in color scheme, which can be useful, for example, for sharp colors during matrix plotting. Symbol @samp{:} finishes the color scheme parsing. Following it, the user may put styles for the text, rotation axis for curves/isocontours, and so on. Color scheme may contain up to 32 color values.
+The color scheme is used for determining the color of surfaces, isolines, isosurfaces and so on. The color scheme is defined by the string, which may contain several characters that are color id (@pxref{Line styles}) or characters @samp{#:|}. Symbol @samp{#} switches to mesh drawing or to a wire plot. Symbol @samp{|} disables color interpolation in color scheme, which can be useful, for example, for sharp colors during matrix plotting. Symbol @samp{:} terminate the color scheme parsing. Following it, the user may put styles for the text, rotation axis for curves/isocontours, and so on. Color scheme may contain up to 32 color values.
-For coloring by @emph{amplitude} (most common) the final color is a linear interpolation of color array. The color array is constructed from the string ids. The argument is the amplitude normalized between @var{Cmin} -- @var{Cmax} (@pxref{Axis settings}). For example, string containing 4 characters @samp{bcyr} corresponds to a colorbar from blue (lowest value) through cyan (next value) through yellow (next value) to the red (highest value). String @samp{kw} corresponds to a colorbar from black (lowest value) to white (highest value). String @samp{m} corresponds to a simple magenta color.
+The final color is a linear interpolation of color array. The color array is constructed from the string ids (including ``bright'' colors, see @ref{Color styles}). The argument is the amplitude normalized between @var{Cmin} -- @var{Cmax} (see @ref{Axis settings}). For example, string containing 4 characters @samp{bcyr} corresponds to a colorbar from blue (lowest value) through cyan (next value) through yellow (next value) to the red (highest value). String @samp{kw} corresponds to a colorbar from black (lowest value) to white (highest value). String @samp{m} corresponds to a simple magenta color.
There are several useful combinations. String @samp{kw} corresponds to the simplest gray color scheme where higher values are brighter. String @samp{wk} presents the inverse gray color scheme where higher value is darker. Strings @samp{kRryw}, @samp{kGgw}, @samp{kBbcw} present the well-known @emph{hot}, @emph{summer} and @emph{winter} color schemes. Strings @samp{BbwrR} and @samp{bBkRr} allow to view bi-color figure on white or black background, where negative values are blue and positive values are red. String @samp{BbcyrR} gives a color scheme similar to the well-known @emph{jet} color scheme.
@float
-@image{../png/color_schemes, 7cm}
+@image{../png/schemes, 11cm}
@caption{Most popular color schemes.}
@end float
@@ -122,16 +114,15 @@ When coloring by @emph{coordinate} (used in @ref{map}), the final color is deter
@c ------------------------------------------------------------------
@node Font styles, Textual formulas, Color scheme, General concepts
-@subsection Font styles
+@section Font styles
@cindex Font styles
-Text style is specified by the string which may contain several characters of font (@samp{ribwou}) and/or alignment (@samp{LRC}) specifications. The string also may contain the color id characters @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) after the symbol @samp{:}. For example, @samp{r:iCb} sets the bold italic font text aligned at the center and with red color.
+Text style is specified by the string which may contain: color id characters @samp{wkrgbcymhRGBCYMHW} (see @ref{Color styles}), and font style (@samp{ribwou}) and/or alignment (@samp{LRC}) specifications. At this, font style and alignment begin after the separator @samp{:}. For example, @samp{r:iCb} sets the bold (@samp{b}) italic (@samp{i}) font text aligned at the center (@samp{C}) and with red color (@samp{r}).
-The font types are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style. By default roman roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. Additional font effects are: @samp{w} -- wired, @samp{o} -- over-lined, @samp{u} -- underlined.
-@c Also a parsing of the LaTeX-like syntax is provided (for detail, @pxref{mglFont class} and @ref{Font settings}).
+The font styles are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style. By default roman roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. Additional font effects are: @samp{w} -- wired, @samp{o} -- over-lined, @samp{u} -- underlined.
-Also a parsing of the LaTeX-like syntax is provided. There are commands for the font style changing inside the string (for example, use \b for bold font): \a or \overline -- over-lined, \b or \textbf -- bold, \i or \textit -- italic, \r or \textrm -- roman (disable bold and italic attributes), \u or \underline -- underlined, \w or \wire -- wired, \big -- bigger size, @@ -- smaller size. The lower and upper indexes are specified by @samp{_} and @samp{^} symbols. At this the changed font style is applied only on next symbol or symbols in braces @{@}. The text in braces @{@} are treated as single symbol that allow one to print the index of index. For example, compare the strings @samp{sin (x^@{2^3@})} and @samp{sin (x^2^3)}. You may also change text color inside string by command #? or by \color? where @samp{?} is symbolic id of the color (@pxref{Line styles}). For example, words @samp{Blue} and @samp{red} will be colored in the string @samp{#b@{Blue@} and \colorr@{red@} text}. The most of functions understand the newline symbol @samp{\n} and allows to print multi-line text. Finally, you can use arbitrary UTF codes by command @code{\utf0x????}. For example, @code{\utf0x3b1} will produce
+Also a parsing of the LaTeX-like syntax is provided. There are commands for the font style changing inside the string (for example, use \b for bold font): \a or \overline -- over-lined, \b or \textbf -- bold, \i or \textit -- italic, \r or \textrm -- roman (disable bold and italic attributes), \u or \underline -- underlined, \w or \wire -- wired, \big -- bigger size, @@ -- smaller size. The lower and upper indexes are specified by @samp{_} and @samp{^} symbols. At this the changed font style is applied only on next symbol or symbols in braces @{@}. The text in braces @{@} are treated as single symbol that allow one to print the index of index. For example, compare the strings @samp{sin (x^@{2^3@})} and @samp{sin (x^2^3)}. You may also change text color inside string by command #? or by \color? where @samp{?} is symbolic id of the color (@pxref{Color styles}). For example, words @samp{blue} and @samp{red} will be colored in the string @samp{#b@{blue@} and \colorr@{red@} text}. The most of functions understand the newline symbol @samp{\n} and allows to print multi-line text. Finally, you can use arbitrary (if it was defined in font-face) UTF codes by command @code{\utf0x????}. For example, @code{\utf0x3b1} will produce
@ifhtml
@html
α symbol.
@@ -148,26 +139,26 @@ The most of commands for special TeX or AMSTeX symbols, the commands for font st
In particular, the Greek letters are recognizable special symbols: α – \alpha, β – \beta, γ – \gamma, δ – \delta, ε – \epsilon, η – \eta, ι – \iota, χ – \chi, κ – \kappa, λ – \lambda, μ – \mu, ν – \nu, o – \o, ω – \omega, ϕ – \phi, π – \pi, ψ – \psi, ρ – \rho, σ – \sigma, θ – \theta, τ – \tau, υ – \upsilon, ξ – \xi, ζ – \zeta, ς – \varsigma, ɛ – \varepsilon, ϑ – \vartheta, φ – \varphi, ϰ – \varkappa; A – \Alpha, B – \Beta, Γ – \Gamma, Δ – \Delta, E – \Epsilon, H – \Eta, I – \Iota, C – \Chi, K – \Kappa, Λ – \Lambda, M – \Mu, N – \Nu, O – \O, Ω – \Omega, Φ – \Phi, Π – \Pi, Ψ – \Psi, R – \Rho, Σ – \Sigma, Θ – \Theta, T – \Tau, Υ – \Upsilon, Ξ – \Xi, Z – \Zeta.
The small part of most common special TeX symbols are: ∠ – \angle, ⋅ – \cdot, ♣ – \clubsuit, ✓ – \checkmark, ∪ – \cup, ∩ – \cap, ♢ – \diamondsuit, ◇ – \diamond, ÷
- – \div,
+ – \div,
↓ – \downarrow, † – \dag, ‡ – \ddag, ≡ – \equiv, ∃ – \exists, ⌢ – \frown, ♭ – \flat, ≥ – \ge, ≥ – \geq, ≧ – \geqq, ← – \gets, ♡ – \heartsuit, ∞ – \infty, ∫ – \int, \Int, ℑ – \Im, ♢ – \lozenge, ⟨ – \langle, ≤ – \le, ≤ – \leq, ≦ – \leqq, ← – \leftarrow, ∓ – \mp, ∇ – \nabla, ≠ – \ne, ≠ – \neq, ♮ – \natural, ∮ – \oint, ⊙ – \odot, ⊕ – \oplus, ∂ – \partial, ∥ – \parallel, ⊥ –\perp, ± – \pm, ∝ – \propto, ∏ – \prod, ℜ – \Re, → – \rightarrow, ⟩ – \rangle, ♠ – \spadesuit, ~ – \sim, ⌣ – \smile, ⊂ – \subset, ⊃ – \supset, √ – \sqrt or \surd, § – \S, ♯ – \sharp, ∑ – \sum, × – \times, → – \to, ∴ – \therefore, ↑ – \uparrow, ℘ – \wp.
@end html
@end ifhtml
@ifnothtml
In particular, the Greek letters are recognizable special symbols: @math{\alpha} -- \alpha, @math{\beta} -- \beta, @math{\gamma} -- \gamma, @math{\delta} -- \delta, @math{\epsilon} -- \epsilon, @math{\eta} -- \eta, @math{\iota} -- \iota, @math{\chi} -- \chi, @math{\kappa} -- \kappa, @math{\lambda} -- \lambda, @math{\mu} -- \mu, @math{\nu} -- \nu, @math{o} -- \o, @math{\omega} -- \omega, @math{\phi} -- \phi, @math{\pi} -- \pi, @math{\psi} -- \psi, @math{\rho} -- \rho, @math{\sigma} -- \sigma, @math{\theta} -- \theta, @math{\tau} -- \tau, @math{\upsilon} -- \upsilon, @math{\xi} -- \xi, @math{\zeta} -- \zeta, @math{\varsigma} -- \varsigma, @math{\varepsilon} -- \varepsilon, @math{\vartheta} -- \vartheta, @math{\varphi} -- \varphi, A -- \Alpha, B -- \Beta, @math{\Gamma} -- \Gamma, @math{\Delta} -- \Delta, E -- \Epsilon, H -- \Eta, I -- \Iota, C -- \Chi, K -- \Kappa, @math{\Lambda} -- \Lambda, M -- \Mu, N -- \Nu, O -- \O, @math{\Omega} -- \Omega, @math{\Phi} -- \Phi, @math{\Pi} -- \Pi, @math{\Psi} -- \Psi, R -- \Rho, @math{\Sigma} -- \Sigma, @math{\Theta} -- \Theta, T -- \Tau, @math{\Upsilon} -- \Upsilon, @math{\Xi} -- \Xi, Z -- \Zeta.
-The small part of most common special TeX symbols are: @math{\angle} -- \angle, @math{\aleph} -- \aleph, @math{\cdot} -- \cdot, @math{\clubsuit} -- \clubsuit, @math{\cup} -- \cup, @math{\cap} -- \cap, @math{\diamondsuit} -- \diamondsuit, @math{\diamond} -- \diamond, @math{\div} -- \div, @math{\downarrow} -- \downarrow, @math{\dag} -- \dag, @math{\ddag} -- \ddag, @math{\equiv} -- \equiv, @math{\exists} -- \exists, @math{\frown} -- \frown, @math{\flat} -- \flat, @math{\ge} -- \ge, @math{\geq} -- \geq, @math{\gets} -- \gets, @math{\heartsuit} -- \heartsuit, @math{\infty} -- \infty, @math{\in} -- \in, @math{\int} -- \int, @math{\Im} -- \Im, @math{\langle} -- \langle, @math{\le} -- \le, @math{\leq} -- \leq, @math{\leftarrow} -- \leftarrow, @math{\mp} -- \mp, @math{\nabla} -- \nabla, @math{\ne} -- \ne, @math{\neq} -- \neq, @math{\natural} -- \natural, @math{\oint} -- \oint, @math{\odot} -- \odot, @math{\oplus} -- \oplus, @math{\partial} -- \partial, @math{\parallel} -- \parallel, @math{\perp} -- \perp, @math{\pm} -- \pm, @math{\propto} -- \propto, @math{\prod} -- \prod, @math{\Re} -- \Re, @math{\rightarrow} -- \rightarrow, @math{\rangle} -- \rangle, @math{\spadesuit} -- \spadesuit, @math{\sim} -- \sim, @math{\smile} -- \smile, @math{\subset} -- \subset, @math{\supset} -- \supset, @math{\surd} -- \sqrt or \surd, @math{\S} -- \S, @math{\sharp} -- \sharp, @math{\sum} -- \sum, @math{\times} -- \times, @math{\to} -- \to, @math{\uparrow} -- \uparrow, @math{\wp} -- \wp and so on.
+The small part of most common special TeX symbols are: @math{\angle} -- \angle, @math{\aleph} -- \aleph, @math{\cdot} -- \cdot, @math{\clubsuit} -- \clubsuit, @math{\cup} -- \cup, @math{\cap} -- \cap, @math{\diamondsuit} -- \diamondsuit, @math{\diamond} -- \diamond, @math{\div} -- \div, @math{\downarrow} -- \downarrow, @math{\dag} -- \dag, @math{\ddag} -- \ddag, @math{\equiv} -- \equiv, @math{\exists} -- \exists, @math{\frown} -- \frown, @math{\flat} -- \flat, @math{\ge} -- \ge, @math{\geq} -- \geq, @math{\gets} -- \gets, @math{\heartsuit} -- \heartsuit, @math{\infty} -- \infty, @math{\in} -- \in, @math{\int} -- \int, @math{\Im} -- \Im, @math{\langle} -- \langle, @math{\le} -- \le, @math{\leq} -- \leq, @math{\leftarrow} -- \leftarrow, @math{\mp} -- \mp, @math{\nabla} -- \nabla, @math{\ne} -- \ne, @math{\neq} -- \neq, @math{\natural} -- \natural, @math{\oint} -- \oint, @math{\odot} -- \odot, @math{\oplus} -- \oplus, @math{\partial} -- \partial, @math{\parallel} -- \parallel, @math{\perp} -- \perp, @math{\pm} -- \pm, @math{\propto} -- \propto, @math{\prod} -- \prod, @math{\Re} -- \Re, @math{\rightarrow} -- \rightarrow, @math{\rangle} -- \rangle, @math{\spadesuit} -- \spadesuit, @math{\sim} -- \sim, @math{\smile} -- \smile, @math{\subset} -- \subset, @math{\supset} -- \supset, @math{\surd} -- \sqrt or \surd, @math{\S} -- \S, @math{\sharp} -- \sharp, @math{\sum} -- \sum, @math{\times} -- \times, @math{\to} -- \to, @math{\uparrow} -- \uparrow, @math{\wp} -- \wp and so on.
@end ifnothtml
-The font size can be defined explicitly (if @var{size}>0) or relative to a base font size as |@var{size}|*@var{FontSize} (if @var{size}<0). The value @var{size}=0 specifies that the string will not be printed. The base font size is measured in internal ``MathGL'' units. Special functions @code{SetFontSizePT(), SetFontSizeCM(), SetFontSizeIN()} allow one to set it in more ``common'' variables for a given dpi value of the picture.
+The font size can be defined explicitly (if @var{size}>0) or relatively to a base font size as |@var{size}|*@var{FontSize} (if @var{size}<0). The value @var{size}=0 specifies that the string will not be printed. The base font size is measured in internal ``MathGL'' units. Special functions @code{SetFontSizePT(), SetFontSizeCM(), SetFontSizeIN()} (see @ref{Font settings}) allow one to set it in more ``common'' variables for a given dpi value of the picture.
@c ------------------------------------------------------------------
@node Textual formulas, Command options, Font styles, General concepts
-@subsection Textual formulas
+@section Textual formulas
@cindex Textual formulas
-MathGL have the fast variant of textual formula evaluation
+MathGL have the fast variant of textual formula evaluation
@ifclear UDAV
(@pxref{mglFormula class})
@end ifclear
@@ -209,7 +200,7 @@ Elliptic integrals are: @samp{ee(k)} -- complete elliptic integral is denoted by
Jacobi elliptic functions are: @samp{sn(u,m)}, @samp{cn(u,m)}, @samp{dn(u,m)}, @samp{sc(u,m)}, @samp{sd(u,m)}, @samp{ns(u,m)}, @samp{cs(u,m)}, @samp{cd(u,m)}, @samp{nc(u,m)}, @samp{ds(u,m)}, @samp{dc(u,m)}, @samp{nd(u,m)}.
-Note, some of these functions are unavailable if NO_GSL is defined during compilation of MathGL library.
+Note, some of these functions are unavailable if MathGL was compiled without GSL support.
There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN.
@@ -218,7 +209,7 @@ There is no difference between lower or upper case in formulas. If argument valu
@node Command options, Interfaces, Textual formulas, General concepts
@section Command options
-Command options allow the easy setup of the plot by changing of global settings only for this plot. Each option is separated from the previous text by symbol @samp{;}. Options work so that them remember the current settings, change settings as it being set in the option, execute command and return the original settings back. So, the options usage for data handling commands or for graphics setup commands is useless.
+Command options allow the easy setup of the selected plot by changing global settings only for this plot. Each option start from symbol @samp{;}. Options work so that MathGL remember the current settings, change settings as it being set in the option, execute function and return the original settings back. So, the options are most usable for plotting functions.
The most useful options are @code{xrange, yrange, zrange}. They sets the boundaries for data change. This boundaries are used for automatically filled variables. So, these options allow one to change the position of some plots. For example, in command @code{Plot(y,"","xrange 0.1 0.9");} or @code{plot y; xrange 0.1 0.9} the x coordinate will be equidistantly distributed in range 0.1 ... 0.9.
@@ -226,13 +217,17 @@ The full list of options are:
@cindex alpha
@cindex alphadef
@deffn {MGL option} alpha @code{val}
-@deffnx {MGL option} alphadef @code{val}
Sets alpha value (transparency) of the plot. The value should be in range [0, 1]. See also @ref{alphadef}.
@end deffn
@cindex ambient
@deffn {MGL option} ambient @code{val}
Sets brightness of ambient light for the plot. The value should be in range [0, 1]. See also @ref{ambient}.
@end deffn
+@cindex diffuse
+@deffn {MGL option} diffuse @code{val}
+Sets brightness of diffuse light for the plot. The value should be in range [0, 1]. See also @ref{diffuse}.
+@end deffn
+
@cindex xrange
@deffn {MGL option} xrange @code{val1 val2}
Sets boundaries of x coordinate change for the plot. See also @ref{xrange}.
@@ -245,22 +240,20 @@ Sets boundaries of y coordinate change for the plot. See also @ref{yrange}.
@deffn {MGL option} zrange @code{val1 val2}
Sets boundaries of z coordinate change for the plot. See also @ref{zrange}.
@end deffn
+
@cindex cut
@deffn {MGL option} cut @code{val}
Sets whether to cut or to project the plot points lying outside the bounding box. See also @ref{cut}.
@end deffn
@cindex fontsize
-@deffn {MGL option} fontsize @code{val}
-Sets the size of text. See also @ref{font}.
-@end deffn
-@cindex marksize
-@deffn {MGL option} marksize @code{val}
-Sets the size of marks. See also @ref{marksize}.
+@deffn {MGL option} size @code{val}
+Sets the size of text, marks and arrows. See also @ref{font}, @ref{marksize}, @ref{arrowsize}.
@end deffn
@cindex meshnum
@deffn {MGL option} meshnum @code{val}
Work like @ref{meshnum} command.
@end deffn
+
@cindex legend
@deffn {MGL option} legend 'txt'
Adds string 'txt' to internal legend accumulator. The style of described line and mark is taken from arguments of the last @ref{1D plotting} command. See also @ref{legend}.
@@ -276,10 +269,10 @@ Set the value to be used as additional numeric parameter in plotting command.
@section Interfaces
The MathGL library has interfaces for a set of languages. Most of them are based on the C interface via SWIG tool. There are Python, Java, Octave, Lisp, C#, Guile, Lua, Modula 3, Ocaml, Perl, PHP, Pike, R, Ruby, and Tcl interfaces. Also there is a Fortran interface which has a similar set of functions, but slightly different types of arguments (integers instead of pointers). These functions are marked as [C function].
-@c ++++++++++
-Some of the languages listed above support classes (like C++ or Python). For them, a special wrapper was written.
-@c ++++++++++
-Finally, a special command language MGL was written for a faster access to plotting functions. Corresponding scripts can be executed separately (by UDAV, mgl2png, mgl2eps and so on)
+
+Some of the languages listed above support classes (like C++ or Python). The name of functions for them is the same as in C++ (see @ref{MathGL core} and @ref{Data processing}) and marked like [Method on mglGraph].
+
+Finally, a special command language MGL (see @ref{MGL scripts}) was written for a faster access to plotting functions. Corresponding scripts can be executed separately (by UDAV, mglconv, mglview and so on)
@ifclear UDAV
or from the C/C++/Python/... code (@pxref{mglParse class}).
@end ifclear
@@ -287,11 +280,11 @@ Finally, a special command language MGL was written for a faster access to plott
@ifclear UDAV
@menu
* C interface::
-* Python interface::
-* MGL interface::
+* C++ interface::
@end menu
+@end ifclear
-@node C interface, Python interface, , Interfaces
+@node C interface, C++ interface, , Interfaces
@subsection C/Fortran interface
The C interface is a base for many other interfaces. It contains the pure C functions for most of the methods of MathGL classes. In distinction to C++ classes, C functions must have an argument HMGL (for graphics) and/or HMDT (for data arrays), which specifies the object for drawing or manipulating (changing). So, firstly, the user has to create this object by the function @code{mgl_create_*()} and has to delete it after the use by function @code{mgl_delete_*()}.
@@ -309,18 +302,19 @@ These variables contain identifiers for graphics drawing objects and for the dat
Fortran functions/subroutines have the same names as C functions. However, there is a difference. Variable of type @code{HMGL, HMDT} must be an integer with sufficient size (@code{integer*4} in the 32-bit operating system or @code{integer*8} in the 64-bit operating system). All C functions are subroutines in Fortran, which are called by operator @code{call}. The exceptions are functions, which return variables of types @code{HMGL} or @code{HMDT}. These functions should be declared as integer in Fortran code. Also, one should keep in mind that strings in Fortran are denoted by @code{'} symbol, not the @code{"} symbol.
-@node Python interface, MGL interface, C interface, Interfaces
+@node C++ interface, , C interface, Interfaces
@subsection C++/Python interface
MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is named in this chapter's title. Exactly the same classes are used for high-level C++ API. Its feature is using only inline member-functions what make high-level API to be independent on compiler even for binary build.
-There are 2 classes in:
+There are 3 classes in:
@itemize
@item @code{mglGraph}
--- provide most plotting functions (@pxref{MathGL core}).
+-- provide most plotting functions (see @ref{MathGL core}).
@item @code{mglData}
--- provide base data processing (@pxref{Data processing}). It have an additional feature to access data values. You can use a construct like this: @code{dat[i]=sth;} or @code{sth=dat[i]} where flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1). You can also import NumPy arrays as input arguments in Python: @code{mgl_dat = mglData(numpy_dat);}.
-@c @item @code{mglParse} -- practically the same as C++ class @code{MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is denoted in the chapter title.
+-- provide base data processing (see @ref{Data processing}). It have an additional feature to access data values. You can use a construct like this: @code{dat[i]=sth;} or @code{sth=dat[i]} where flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1). You can also import NumPy arrays as input arguments in Python: @code{mgl_dat = mglData(numpy_dat);}.
+@item @code{mglParse}
+-- provide functions for parsing MGL scripts (see @ref{MGL scripts}).
@end itemize
@@ -339,147 +333,3 @@ a.Box()
a.WritePNG("test.png")
@end verbatim
This becomes useful if you create many @code{mglData} objects, for example.
-
-
-@node MGL interface, , Python interface, Interfaces
-@end ifclear
-@subsection MGL interface
-
-MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mglconv, mglview programs and others, @pxref{Utilities}) or in the frame of the library using.
-
-MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is sufficient, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets.
-
-If string contain references to external parameters (substrings @samp{$0}, @samp{$1} ... @samp{$9}) or definitions (substrings @samp{$a}, @samp{$b} ... @samp{$z}) then before execution the values of parameter/definition will be substituted instead of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on).
-
-Argument can be a string, a variable name or a number.
-@itemize @bullet
-@item
-The string is any symbols between ordinary marks @samp{'}.
-
-@item
-Usually variable have a name which is arbitrary combination of symbols (except spaces and @samp{'}) started from a letter and with length less than 64. A temporary array can be used as variable:
-@itemize @bullet
-@item
-sub-arrays (like in @ref{subdata} command) as command argument. For example, @code{a(1)} or @code{a(1,:)} or @code{a(1,:,:)} is second row, @code{a(:,2)} or @code{a(:,2,:)} is third column, @code{a(:,:,0)} is first slice and so on. Also you can extract a part of array from m-th to n-th element by code @code{a(m:n,:,:)} or just @code{a(m:n)}.
-
-@item
-any column combinations defined by formulas, like @code{a('n*w^2/exp(t)')} if names for data columns was specified (by @ref{idset} command or in the file at string started with @code{##}).
-
-@item
-any expression (without spaces) of existed variables produce temporary variable. For example, @samp{sqrt(dat(:,5)+1)} will produce temporary variable with data values equal to @code{tmp[i,j] = sqrt(dat[i,5,j]+1)}.
-
-@item
-temporary variable of higher dimensions by help of []. For example, @samp{[1,2,3]} will produce a temporary vector of 3 elements @{1, 2, 3@}; @samp{[[11,12],[21,22]]} will produce matrix 2*2 and so on. Here you can join even an arrays of the same dimensions by construction like @samp{[v1,v2,...,vn]}.
-
-@item
-result of code for making new data (@pxref{Make another data}) inside @{@}. For example, @samp{@{sum dat 'x'@}} produce temporary variable which contain result of summation of @var{dat} along direction 'x'. This is the same array @var{tmp} as produced by command @samp{sum tmp dat 'x'}. You can use nested constructions, like @samp{@{sum @{max dat 'z'@} 'x'@}}.
-@end itemize
-Temporary variables can not be used as 1st argument for commands which create (return) the data (like @samp{new}, @samp{read}, @samp{hist} and so on).
-
-@item
-Special names @code{nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1} are treated as number if they were not redefined by user. Variables with suffixes are treated as numbers (@pxref{Data information}). Names defined by @ref{define} command are treated as number. Also results of formulas with sizes 1x1x1 are treated as number (for example, @samp{pi/dat.nx}).
-@end itemize
-Before the first using all variables must be defined with the help of commands, like, @ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} and so on (see sections @ref{Data constructor}, @ref{Data filling} and @ref{Make another data}).
-
-Command may have several set of possible arguments (for example, @code{plot ydat} and @code{plot xdat ydat}). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like @code{plot ydat ['stl'='' zval=nan]}. At this, the record @code{[arg1 arg2 arg3 ...]} means @code{[arg1 [arg2 [arg3 ...]]]}, i.e. you can omit only tailing arguments if you agree with its default values. For example, @code{plot ydat '' 1} or @code{plot ydat ''} is correct, but @code{plot ydat 1} is incorrect (argument @code{'stl'} is missed).
-
-Below I show commands to control program flow, like, conditions, cycles, define script arguments and so on. Other commands can be found in chapters @ref{MathGL core} and @ref{Data processing}.
-
-@cindex chdir
-@anchor{chdir}
-@deftypefn {MGL command} {} chdir 'path'
-Changes the current directory to @var{path}.
-@end deftypefn
-
-@cindex define
-@anchor{define}
-@deftypefn {MGL command} {} define $N smth
-Sets @var{N}-th script argument to @var{smth}. Note, that @var{smth} is used as is (with @samp{'} symbols if present). Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@deftypefn {MGL command} {} define name smth
-Create scalar variable @code{name} which have the numeric value of @code{smth}. Later you can use this variable as usual number. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex defchr
-@anchor{defchr}
-@deftypefn {MGL command} {} defchr $N smth
-Sets @var{N}-th script argument to character with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex defnum
-@anchor{defnum}
-@deftypefn {MGL command} {} defnum $N smth
-Sets @var{N}-th script argument to number with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex defpal
-@anchor{defpal}
-@deftypefn {MGL command} {} defpal $N smth
-Sets @var{N}-th script argument to palette character at position evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-
-@cindex call
-@anchor{call}
-@deftypefn {MGL command} {} call 'fname' [ARG1 ARG2 ... ARG9]
-Executes function @var{fname} (or script if function is not found). Optional arguments will be passed to functions. See also @ref{func}.
-@end deftypefn
-@cindex func
-@anchor{func}
-@deftypefn {MGL command} {} func 'fname' [narg=0]
-Define the function @var{fname} and number of required arguments. The arguments will be placed in script parameters $1, $2, ... $9. Note, you should stop script execution before function definition(s) by command @ref{stop}. See also @ref{return}.
-@end deftypefn
-@cindex return
-@anchor{return}
-@deftypefn {MGL command} {} return
-Return from the function. See also @ref{func}.
-@end deftypefn
-
-
-@cindex if
-@anchor{if}
-@deftypefn {MGL command} {} if dat 'cond'
-Starts block which will be executed if @var{dat} satisfy to @var{cond}.
-@end deftypefn
-@deftypefn {MGL command} {} if @code{val}
-Starts block which will be executed if @code{val} is nonzero.
-@end deftypefn
-@cindex elseif
-@anchor{elseif}
-@deftypefn {MGL command} {} elseif dat 'cond'
-Starts block which will be executed if previous @code{if} or @code{elseif} is false and @var{dat} satisfy to @var{cond}.
-@end deftypefn
-@deftypefn {MGL command} {} elseif @code{val}
-Starts block which will be executed if previous @code{if} or @code{elseif} is false and @code{val} is nonzero.
-@end deftypefn
-@cindex else
-@anchor{else}
-@deftypefn {MGL command} {} else
-Starts block which will be executed if previous @code{if} or @code{elseif} is false.
-@end deftypefn
-@cindex endif
-@anchor{endif}
-@deftypefn {MGL command} {} endif
-Finishes @code{if/elseif/else} block.
-@end deftypefn
-
-@cindex for
-@anchor{for}
-@deftypefn {MGL command} {} for $N @code{v1 v2 [dv=1]}
-Starts cycle with $@var{N}-th argument changing from @var{v1} to @var{v2} with the step @var{dv}. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@deftypefn {MGL command} {} for $N dat
-Starts cycle with $@var{N}-th argument changing for @var{dat} values. Here @var{N} is digit (0...9) or alpha (a...z).
-@end deftypefn
-@cindex next
-@anchor{next}
-@deftypefn {MGL command} {} next
-Finishes @code{for} cycle.
-@end deftypefn
-
-@cindex once
-@anchor{once}
-@deftypefn {MGL command} {} once @code{val}
-The code between @code{once on} and @code{once off} will be executed only once. Useful for large data manipulation in programs like UDAV.
-@end deftypefn
-@cindex stop
-@anchor{stop}
-@deftypefn {MGL command} {} stop
-Terminate execution.
-@end deftypefn
diff --git a/texinfo/core_en.texi b/texinfo/core_en.texi
index c9fe7ea..75bca66 100644
--- a/texinfo/core_en.texi
+++ b/texinfo/core_en.texi
@@ -3,7 +3,7 @@
@cindex mglGraph
@ifclear UDAV
-The core of MathGL is @strong{mglGraph} class defined in @code{#include }. It contains a lot of plotting functions for 1D, 2D and 3D plots. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation may be used for each axis. All plotting functions use data encapsulated in mglData class (@pxref{Data processing}) that allows to check sizes of used arrays easily. Also it have many functions for data handling: modify it by formulas, find momentums and distribution (histogram), apply operator (differentiate, integrate, transpose, Fourier and so on), change data sizes (interpolate, squeeze, crop and so on). Additional information about colors, fonts, formula parsing can be found in @ref{Other classes}.
+The core of MathGL is @strong{mglGraph} class defined in @code{#include }. It contains a lot of plotting functions for 1D, 2D and 3D data. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation can be used for each axis. All plotting functions use data encapsulated in mglData class (see @ref{Data processing}) that allows to check sizes of used arrays easily. Also it have many functions for data handling: modify it by formulas, find momentums and distribution (histogram), apply operator (differentiate, integrate, transpose, Fourier and so on), change data sizes (interpolate, squeeze, crop and so on). Additional information about colors, fonts, formula parsing can be found in @ref{General concepts} and @ref{Other classes}.
@end ifclear
@menu
@@ -68,7 +68,8 @@ Restore initial values for all of parameters.
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{void} SetPlotId (@code{const char *}id)
-Sets name of plot for saving filename (in GLUT window for example).
+@deftypefnx {C function} @code{void} mgl_set_plotid (@code{HMGL} gr, @code{const char *}id)
+Sets name of plot for saving filename (in FLTK window for example).
@end deftypefn
@end ifclear
@@ -152,15 +153,26 @@ Sets the using of light on/off for overall plot. Function returns previous value
Switch on/off @var{n}-th light source separately.
@end deftypefn
-@deftypefn {MGL command} {} light @code{num xpos ypos zpos} ['col'='w' @code{br=0.5}]
+@deftypefn {MGL command} {} light @code{num xdir ydir zdir} ['col'='w' @code{br=0.5}]
+@deftypefnx {MGL command} {} light @code{num xdir ydir zdir xpos ypos zpos} ['col'='w' @code{br=0.5}]
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} AddLight (@code{int} n, @code{mglPoint} p, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}, @code{float} ap=@code{0})
-@deftypefnx {C function} @code{void} mgl_add_light (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c)
-@deftypefnx {C function} @code{void} mgl_add_light_ext (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c, @code{float} bright, @code{int} infty, @code{float} ap)
+@deftypefnx {Method on @code{mglGraph}} @code{void} AddLight (@code{int} n, @code{mglPoint} d, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{float} ap=@code{0})
+@deftypefnx {Method on @code{mglGraph}} @code{void} AddLight (@code{int} n, @code{mglPoint} r, @code{mglPoint} d, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{float} ap=@code{0})
+@deftypefnx {C function} @code{void} mgl_add_light (@code{HMGL} gr, @code{int} n, @code{float} dx, @code{float} dy, @code{float} dz)
+@deftypefnx {C function} @code{void} mgl_add_light_ext (@code{HMGL} gr, @code{int} n, @code{float} dx, @code{float} dy, @code{float} dz, @code{char} c, @code{float} bright, @code{float} ap)
+@deftypefnx {C function} @code{void} mgl_add_light_loc (@code{HMGL} gr, @code{int} n, @code{float} rx, @code{float} ry, @code{float} rz, @code{float} dx, @code{float} dy, @code{float} dz, @code{char} c, @code{float} bright, @code{float} ap)
@end ifclear
-The function adds a light source with identification @var{n} at position @var{p} with color @var{c} and with brightness @var{bright} (which must be in range [0,1]). Flag @var{infty}=@code{true} puts the source to infinite distance (for the faster drawing).
+The function adds a light source with identification @var{n} in direction @var{d} with color @var{c} and with brightness @var{bright} (which must be in range [0,1]). If position @var{r} is specified and isn't NAN then light source is supposed to be local otherwise light source is supposed to be placed at infinity.
@end deftypefn
+@anchor{diffuse}
+@ifclear UDAV
+@deftypefn {ÐеÑод клаÑÑа @code{mglGraph}} @code{void} SetDifLight (@code{bool} enable)
+@deftypefnx {ФÑнкÑÐ¸Ñ Ð¡} @code{void} mgl_set_light_dif (@code{HMGL} gr, @code{int} enable)
+Set on/off to use diffusive light (only for local light sources).
+@end deftypefn
+@end ifclear
+
@anchor{ambient}
@deftypefn {MGL command} {} ambient @code{val}
@ifclear UDAV
@@ -225,7 +237,7 @@ Sets size of marks for @ref{1D plotting}. Default value is @code{0.02}.
@deftypefnx {Method on @code{mglGraph}} @code{void} SetArrowSize (@code{float} val)
@deftypefnx {C function} @code{void} mgl_set_arrow_size (@code{HMGL} gr, @code{float} val)
@end ifclear
-Sets size of arrows for @ref{1D plotting}, lines and curves (@pxref{Primitives drawing}). Default value is @code{0.03}.
+Sets size of arrows for @ref{1D plotting}, lines and curves (see @ref{Primitives drawing}). Default value is @code{0.03}.
@end deftypefn
@anchor{meshnum}
@@ -248,7 +260,7 @@ Sets approximate number of lines in @ref{mesh}, @ref{fall}, @ref{grid} and also
@end ifclear
@cindex Cut
-These variables and functions set the condition when the points are excluded (cutted) from the drawing. Note, that a point with NAN value(s) of coordinate or amplitude will be automatically excluded from the drawing.
+These variables and functions set the condition when the points are excluded (cutted) from the drawing. Note, that a point with NAN value(s) of coordinate or amplitude will be automatically excluded from the drawing. @sref{Cut sample}
@anchor{cut}
@deftypefn {MGL command} {} cut @code{val}
@@ -259,17 +271,12 @@ These variables and functions set the condition when the points are excluded (cu
Flag which determines how points outside bounding box are drawn. If it is @code{true} then points are excluded from plot (it is default) otherwise the points are projected to edges of bounding box.
@end deftypefn
-@float
-@image{cut, 7cm}
-@caption{Left figure is drawn with parameter @code{Cut=false}. Right one is drawn with parameter @code{Cut=true}.}
-@end float
-
@deftypefn {MGL command} {} cut @code{x1 y1 z1 x2 y2 z2}
@ifclear UDAV
@deftypefnx {Method on @code{mglGraph}} @code{void} SetCutBox (@code{mglPoint} p1, @code{mglPoint} p1)
@deftypefnx {C function} @code{void} mgl_set_cut_box (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2)
@end ifclear
-Lower and upper edge of the box in which never points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty. @sref{Cut sample}
+Lower and upper edge of the box in which never points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty.
@end deftypefn
@deftypefn {MGL command} {} cut 'cond'
@@ -277,7 +284,7 @@ Lower and upper edge of the box in which never points are drawn. If both edges a
@deftypefnx {Method on @code{mglGraph}} @code{void} CutOff (@code{const char *}cond)
@deftypefnx {C function} @code{void} mgl_set_cutoff (@code{HMGL} gr, @code{const char *}cond)
@end ifclear
-Sets the cutting off condition by formula @var{cond}. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as @code{""} to disable cutting off condition. @sref{Cut sample}
+Sets the cutting off condition by formula @var{cond}. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as @code{""} to disable cutting off condition.
@end deftypefn
@c ==================================================================
@@ -299,7 +306,7 @@ Sets the cutting off condition by formula @var{cond}. This condition determine w
@anchor{font}
@deftypefn {MGL command} {} font 'fnt' [@code{val=6}]
-Font style for text and labels (see text). Initial style is 'fnt'=':rC' give Roman font with centering. Parameter @code{val} sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail, @pxref{Font styles}.
+Font style for text and labels (see text). Initial style is 'fnt'=':rC' give Roman font with centering. Parameter @code{val} sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail, see @ref{Font styles}.
@end deftypefn
@anchor{rotatetext}
@@ -312,7 +319,7 @@ Sets to use or not text rotation.
@ifclear UDAV
@deftypefn {Method on @code{mglGraph}} @code{void} SetFontDef (@code{const char *}fnt)
@deftypefnx {C function} @code{void} mgl_set_font_def (@code{HMGL} gr, @code{const char *} val)
-Sets the font specification (@pxref{Text printing}). Default is @samp{rC} -- Roman font centering.
+Sets the font specification (see @ref{Text printing}). Default is @samp{rC} -- Roman font centering.
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{void} SetFontSize (@code{float} val)
@@ -348,7 +355,7 @@ Restore font data to default typeface.
@c ==================================================================
@node Palette and colors, Error handling, Font settings, Graphics setup
-@subsection Pallete and colors
+@subsection Palette and colors
@ifclear UDAV
@cindex SetPalette
@end ifclear
@@ -360,7 +367,7 @@ Restore font data to default typeface.
@deftypefnx {Method on @code{mglGraph}} @code{void} SetPalette (@code{const char *}@var{colors})
@deftypefnx {C function} @code{void} mgl_set_palette (@code{HMGL} gr, @code{const char *}@var{colors})
@end ifclear
-Sets the palette as selected colors. Default value is @code{"Hbgrcmyhlnqeup"} that corresponds to colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}. The palette is used mostly in 1D plots (@pxref{1D plotting}) for curves which styles are not specified.
+Sets the palette as selected colors. Default value is @code{"Hbgrcmyhlnqeup"} that corresponds to colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}. The palette is used mostly in 1D plots (see @ref{1D plotting}) for curves which styles are not specified.
@end deftypefn
@c ==================================================================
@@ -378,8 +385,8 @@ Normally user should set it to zero by @code{SetWarn(0);} before plotting and ch
Set warning code. Normally you should call this function only for clearing the warning state, i.e. call @code{SetWarn(0);}. Text @var{info} will be printed as is if @var{code}<0.
@end deftypefn
-@deftypefn {Method on @code{mglGraph}} @code{void} Message (@code{char *}buf)
-@deftypefnx {C function} @code{void} mgl_buf_warn (@code{HMGL} gr, @code{const char *}buf)
+@deftypefn {Method on @code{mglGraph}} @code{const char *}Message ()
+@deftypefnx {C function} @code{const char *}mgl_get_mess (@code{HMGL} gr)
Set buffer for writing messages about matters why some plot are not drawn. Set to NULL to disable messages. The buffer length must be at least 1024. If @var{buf}[0]==0 then there are no messages.
@end deftypefn
@@ -426,7 +433,7 @@ Format is not supported for that build
@node Axis settings, Transformation matrix, Graphics setup, MathGL core
@section Axis settings
-These large set of variables and functions control how the axis and ticks will be drawn. Note that there is 3-step transformation of data coordinates are performed. Firstly, coordinates are projected if @code{Cut=true} (@pxref{Cutting}), after it transformation formulas are applied, and finally the data was normalized in bounding box.
+These large set of variables and functions control how the axis and ticks will be drawn. Note that there is 3-step transformation of data coordinates are performed. Firstly, coordinates are projected if @code{Cut=true} (see @ref{Cutting}), after it transformation formulas are applied, and finally the data was normalized in bounding box.
@menu
* Ranges (bounding box)::
@@ -563,30 +570,13 @@ The function sets to draws Ternary or Quaternary plot. Ternary plot is special p
@cindex SetTickSkip
@end ifclear
-@anchor{ticklen}
-@deftypefn {MGL command} {} ticklen @code{val} [@code{stt=1}]
-@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickLen (@code{float} val, @code{float} stt=@code{1})
-@deftypefnx {C function} @code{void} mgl_set_tick_len (@code{HMGL} gr, @code{float} val, @code{float} stt)
-@end ifclear
-The relative length of axis ticks. Default value is @code{0.1}. Parameter @var{stt}>0 set relative length of subticks which is in @code{sqrt(1+stt)} times smaller.
-@end deftypefn
-
-@deftypefn {MGL command} {} axisstl 'stl' ['tck'='' 'sub'='']
-@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} SetAxisStl (@code{const char *}stl=@code{"k"}, @code{const char *}tck=@code{0}, @code{const char *}sub=@code{0})
-@deftypefnx {C function} @code{void} mgl_set_axis_stl (@code{HMGL} gr, @code{const char *}stl, @code{const char *}tck, @code{const char *}sub)
-@end ifclear
-The line style of axis, (@var{stl}) ticks (@var{tck}) and subticks (@var{sub}). If @var{stl} is empty then default style is used (@samp{k} or @samp{w} depending on transparency type). If @var{sub} or @var{sub} is empty then axis style is used (i.e. @var{stl}).
-@end deftypefn
-
@anchor{adjust}
@deftypefn {MGL command} {} adjust ['dir'='xyzc']
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Adjust (@code{const char *}dir=@code{"xyz"})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Adjust (@code{const char *}dir=@code{"xyzc"})
@deftypefnx {C function} @code{void} mgl_adjust_ticks (@code{HMGL} gr, @code{const char *}dir)
@end ifclear
-Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) @var{dir}. Also set @code{SetTuneTicks(true)}.
+Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) @var{dir}. Also set @code{SetTuneTicks(true)}. Usually you don't need to call this function except the case of returning to default settings.
@end deftypefn
@anchor{xtick}
@@ -618,7 +608,7 @@ Set the ticks step @var{d}, number of sub-ticks @var{ns} and initial ticks posit
@deftypefnx {C function} @code{void} mgl_set_ticks_val (@code{HMGL} gr, @code{char} dir, @code{HCDT} val, @code{const char *}lbl, @code{bool} add)
@deftypefnx {C function} @code{void} mgl_set_ticks_valw (@code{HMGL} gr, @code{char} dir, @code{HCDT} val, @code{const wchar_t *}lbl, @code{bool} add)
@end ifclear
-Set the manual positions @var{val} and its labels @var{lbl} for ticks along axis @var{dir}. If array @var{val} is absent then values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] are used. Labels are separated by @samp{\n} symbol. Use @code{SetTicks()} to restore automatic ticks. @sref{Manual ticks sample}
+Set the manual positions @var{val} and its labels @var{lbl} for ticks along axis @var{dir}. If array @var{val} is absent then values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] are used. Labels are separated by @samp{\n} symbol. Use @code{SetTicks()} to restore automatic ticks.
@end deftypefn
@deftypefn {MGL command} {} xtick 'templ'
@@ -634,15 +624,12 @@ Set the manual positions @var{val} and its labels @var{lbl} for ticks along axis
Set template @var{templ} for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. If @var{templ}=@code{""} then default template is used (in simplest case it is @samp{%.2g}). Setting on template switch off automatic ticks tuning.
@end deftypefn
-@deftypefn {MGL command} {} xtick val 'templ'
-@deftypefnx {MGL command} {} ytick val 'templ'
-@deftypefnx {MGL command} {} ztick val 'templ'
-@deftypefnx {MGL command} {} ctick val 'templ'
+@deftypefn {MGL command} {} ticktime 'dir' [@code{dv} 'tmpl']
@ifclear UDAV
@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTime (@code{char} dir, @code{float} val, @code{const char *}templ)
@deftypefnx {C function} @code{void} mgl_set_tick_time (@code{HMGL} gr, @code{float} val, @code{const char *}templ)
@end ifclear
-Set time labels with step @var{val} and template @var{templ} for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also.
+Set time labels with step @var{val} and template @var{templ} for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. The format of template @var{templ} is the same as described in @url{http://www.manpagez.com/man/3/strftime/}. Most common variants are @samp{%X} for national representation of time, @samp{%x} for national representation of date, @samp{%Y} for year with century. If @var{val}=0 and/or @var{templ}="" then automatic tick step and/or template will be selected.
@end deftypefn
@deftypefn {MGL command} {} tuneticks @code{val} [@code{pos=1.15}]
@@ -663,6 +650,23 @@ Enable/disable ticks skipping if there are too many ticks or ticks labels are to
@end deftypefn
@end ifclear
+@anchor{ticklen}
+@deftypefn {MGL command} {} ticklen @code{val} [@code{stt=1}]
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickLen (@code{float} val, @code{float} stt=@code{1})
+@deftypefnx {C function} @code{void} mgl_set_tick_len (@code{HMGL} gr, @code{float} val, @code{float} stt)
+@end ifclear
+The relative length of axis ticks. Default value is @code{0.1}. Parameter @var{stt}>0 set relative length of subticks which is in @code{sqrt(1+stt)} times smaller.
+@end deftypefn
+
+@deftypefn {MGL command} {} axisstl 'stl' ['tck'='' 'sub'='']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} SetAxisStl (@code{const char *}stl=@code{"k"}, @code{const char *}tck=@code{0}, @code{const char *}sub=@code{0})
+@deftypefnx {C function} @code{void} mgl_set_axis_stl (@code{HMGL} gr, @code{const char *}stl, @code{const char *}tck, @code{const char *}sub)
+@end ifclear
+The line style of axis, (@var{stl}) ticks (@var{tck}) and subticks (@var{sub}). If @var{stl} is empty then default style is used (@samp{k} or @samp{w} depending on transparency type). If @var{sub} or @var{sub} is empty then axis style is used (i.e. @var{stl}).
+@end deftypefn
+
@c ##################################################################
@node Transformation matrix, Export picture, Axis settings, MathGL core
@section Transformation matrix
@@ -680,32 +684,25 @@ Enable/disable ticks skipping if there are too many ticks or ticks labels are to
@cindex Push
@cindex Pop
-These functions control how and where further plotting will be placed. There is a curtain order of calling of these functions for the better plot view. First one should be @ref{subplot} or @ref{inplot} for specifying the place. After it a @ref{rotate} and @ref{aspect}. And finally any other plotting functions may be called. Alternatively you can use @ref{columnplot} or @ref{stickplot} for position plots in the column (or stick) one by another without gap between plot axis (bounding boxes).
+These functions control how and where further plotting will be placed. There is a certain calling order of these functions for the better plot appearance. First one should be @ref{subplot}, @ref{multiplot} or @ref{inplot} for specifying the place. Second one can be @ref{title} for adding title for the subplot. After it a @ref{rotate} and @ref{aspect}. And finally any other plotting functions may be called. Alternatively you can use @ref{columnplot}, @ref{gridplot}, @ref{stickplot} or relative @ref{inplot} for positioning plots in the column (or grid, or stick) one by another without gap between plot axis (bounding boxes). @sref{InPlot sample}
@anchor{subplot}
-@deftypefn {MGL command} {} subplot @code{nx ny m [dx=0 dy=0]}
+@deftypefn {MGL command} {} subplot @code{nx ny m ['stl'='<>_^' dx=0 dy=0]}
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{float} dx=@code{0}, @code{float} dy=@code{0})
-@deftypefnx {C function} @code{void} mgl_subplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m)
-@deftypefnx {C function} @code{void} mgl_subplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{float} dx, @code{float} dy)
+@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{const char *}stl=@code{"<>_^"}, @code{float} dx=@code{0}, @code{float} dy=@code{0})
+@deftypefnx {C function} @code{void} mgl_subplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}stl)
+@deftypefnx {C function} @code{void} mgl_subplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}stl, @code{float} dx, @code{float} dy)
@end ifclear
-Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. From the aesthetical point of view it is not recommended to use this function with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size @var{dx}, @var{dy}.
-@end deftypefn
-
-@deftypefn {MGL command} {} subplot @code{nx ny m} 'style'
-@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style)
-@deftypefnx {C function} @code{void} mgl_subplot_s (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style)
-@end ifclear
-The same as previous but space reserved for axis/colorbar is saved only if @var{style} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side.
+Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. Extra space will be reserved for axis/colorbar if @var{stl} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side. From the aesthetical point of view it is not recommended to use this function with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size @var{dx}, @var{dy}.
@end deftypefn
+@anchor{multiplot}
@deftypefn {MGL command} {} multiplot @code{nx ny m dx dy} ['style'='<>_^']
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} MultiPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}style=@code{"<>_^"})
-@deftypefnx {C function} @code{void} mgl_multiplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}style)
+@deftypefnx {Method on @code{mglGraph}} @code{void} MultiPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}stl=@code{"<>_^"})
+@deftypefnx {C function} @code{void} mgl_multiplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}stl)
@end ifclear
-Puts further plotting in a rectangle of @var{dx}*@var{dy} cells starting from @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. Extra space will be reserved for axis/colorbar if @var{style} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side.
+Puts further plotting in a rectangle of @var{dx}*@var{dy} cells starting from @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating subplot. Extra space will be reserved for axis/colorbar if @var{stl} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side.
@end deftypefn
@anchor{inplot}
@@ -725,7 +722,17 @@ Puts further plotting in some region of the whole frame surface. This function a
@deftypefnx {C function} @code{void} mgl_columnplot (@code{HMGL} gr, @code{int} num, @code{int} ind)
@deftypefnx {C function} @code{void} mgl_columnplot_d (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} d)
@end ifclear
-Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}). Parameter @var{d} set extra gap between cells. @sref{ColumnPlot sample}
+Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}). Parameter @var{d} set extra gap between cells.
+@end deftypefn
+
+@anchor{gridplot}
+@deftypefn {MGL command} {} gridplot @code{nx ny ind [d=0]}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} GridPlot (@code{int} nx, @code{int} ny, @code{int} ind, @code{float} d=@code{0})
+@deftypefnx {C function} @code{void} mgl_gridplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} ind)
+@deftypefnx {C function} @code{void} mgl_gridplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} ind, @code{float} d)
+@end ifclear
+Puts further plotting in @var{ind}-th cell of @var{nx}*@var{ny} grid. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}). Parameter @var{d} set extra gap between cells. @sref{ColumnPlot sample}
@end deftypefn
@anchor{stickplot}
@@ -734,14 +741,14 @@ Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The p
@deftypefnx {Method on @code{mglGraph}} @code{void} StickPlot (@code{int} num, @code{int} ind, @code{float} tet, @code{float} phi)
@deftypefnx {C function} @code{void} mgl_stickplot (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} tet, @code{float} phi)
@end ifclear
-Puts further plotting in @var{ind}-th cell of stick with @var{num} cells. At this, stick is rotated on angles @var{tet}, @var{phi}. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}). @sref{StickPlot sample}
+Puts further plotting in @var{ind}-th cell of stick with @var{num} cells. At this, stick is rotated on angles @var{tet}, @var{phi}. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}).
@end deftypefn
@anchor{title}
-@deftypefn {MGL command} {} title 'title' ['stl'='#' @code{size=-2}]
+@deftypefn {MGL command} {} title 'title' ['stl'='' @code{size=-2}]
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const char *}txt, @code{const char *}stl=@code{"#"}, @code{float} size=@code{-2})
-@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const wchar_t *}txt, @code{const char *}stl=@code{"#"}, @code{float} size=@code{-2})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const char *}txt, @code{const char *}stl=@code{""}, @code{float} size=@code{-2})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const wchar_t *}txt, @code{const char *}stl=@code{""}, @code{float} size=@code{-2})
@deftypefnx {C function} @code{void} mgl_title (@code{HMGL} gr, @code{const char *}txt, @code{const char *}stl, @code{float} size)
@deftypefnx {C function} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}txt, @code{const char *}stl, @code{float} size)
@end ifclear
@@ -768,7 +775,7 @@ Rotates a further plotting around vector @{@var{x}, @var{y}, @var{z}@} on angle
@anchor{aspect}
@deftypefn {MGL command} {} aspect @code{ax ay [az=1]}
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Aspect (@code{float} Ax, @code{float} Ay, @code{float} Az)
+@deftypefnx {Method on @code{mglGraph}} @code{void} Aspect (@code{float} Ax, @code{float} Ay, @code{float} Az=@code{1})
@deftypefnx {C function} @code{void} mgl_aspect (@code{HMGL} gr, @code{float} Ax, @code{float} Ay, @code{float} Az)
@end ifclear
Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio @var{Ax:Ay:Az}. For the best effect it should be used after @ref{rotate} function.
@@ -784,10 +791,6 @@ Add (switch on) the perspective to plot. The parameter @math{a ~ 1/z_@{eff@} \in
@end deftypefn
@ifclear UDAV
-@deftypefn {Method on @code{mglGraph}} @code{void} View (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0})
-@deftypefnx {C function} @code{void} mgl_view (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY)
-Rotates a further plotting relative to each axis @{x, z, y@} consecutively on angles @var{TetX}, @var{TetZ}, @var{TetY}. Rotation is done independently on @ref{rotate}.
-@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{void} Push ()
@deftypefnx {C function} @code{void} mgl_mat_push (@code{HMGL} gr)
@@ -798,6 +801,19 @@ Push transformation matrix into stack. Later you can restore its current state b
@deftypefnx {C function} @code{void} mgl_mat_pop (@code{HMGL} gr)
Pop (restore last 'pushed') transformation matrix into stack.
@end deftypefn
+
+There are 2 functions @code{View()} and @code{Zoom()} which transform whole image. I.e. they act as secondary transformation matrix. They were introduced for rotating/zooming the whole plot by mouse.
+
+@deftypefn {Method on @code{mglGraph}} @code{void} View (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0})
+@deftypefnx {C function} @code{void} mgl_view (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY)
+Rotates a further plotting relative to each axis @{x, z, y@} consecutively on angles @var{TetX}, @var{TetZ}, @var{TetY}. Rotation is done independently on @ref{rotate}. Use @code{Zoom(0,0,1,1)} to return default view.
+@end deftypefn
+
+@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Zoom (@code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2)
+@deftypefnx {C function} @code{void} mgl_set_zoom (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2)
+The function changes the scale of graphics that correspond to zoom in/out of the picture. After function call the current plot will be cleared and further the picture will contain plotting from its part [x1,x2]*[y1,y2]. Here picture coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} changes from 0 to 1. Attention! this settings can not be overwritten by any other functions. Use @code{Zoom(0,0,1,1)} to return default view.
+@end deftypefn
+
@end ifclear
@c ##################################################################
@@ -826,6 +842,7 @@ Sets quality of the plot depending on value @var{val}: @code{MGL_DRAW_WIRE=0} --
@end deftypefn
@ifclear UDAV
+
@deftypefn {Method on @code{mglGraph}} @code{void} StartGroup (const char *name)
@deftypefnx {C function} @code{void} mgl_start_group (@code{HMGL} gr, @code{const char *}name)
Starts group definition. Groups contain objects and other groups, they are used to select a part of a model to zoom to or to make invizible or to make semitransparent and so on.
@@ -837,6 +854,7 @@ Ends group definition.
@end deftypefn
@end ifclear
+
@menu
* Export to file::
* Frames/Animation::
@@ -961,6 +979,17 @@ Exports current frame to IDTF file. Later this file can be converted to U3D form
Displays the current picture using external program @var{viewer} for viewing. The function save the picture to temporary file and call @var{viewer} to display it. If @var{nowait}=@code{true} then the function return immediately (it will not wait while window will be closed).
@end deftypefn
+
+@deftypefn {Method on @code{mglGraph}} @code{void} ExportMGLD (@code{const char *}fname, @code{const char *}descr=@code{""})
+@deftypefnx {C function} @code{void} mgl_export_mgld (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr)
+Exports points and primitives in file using MGLD format. Later this file can be used for faster loading and viewing by @code{mglview} utility (see @ref{Utilities}). Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name).
+@end deftypefn
+
+@deftypefn {Method on @code{mglGraph}} @code{void} ImportMGLD (@code{const char *}fname, @code{const char *}descr=@code{""})
+@deftypefnx {C function} @code{void} mgl_import_mgld (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr)
+Imports points and primitives in file using MGLD format. Later this file can be used for faster loading and viewing by @code{mglview} utility (see @ref{Utilities}). Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name).
+@end deftypefn
+
@end ifclear
@@ -969,7 +998,7 @@ Displays the current picture using external program @var{viewer} for viewing. Th
@subsection Frames/Animation
@ifset UDAV
-There are no commands for making animation in MGL. However you can use features of utilities (@pxref{Utilities}). For example, by busing special comments @samp{##a } or @samp{##c }.
+There are no commands for making animation in MGL. However you can use features of utilities (see @ref{Utilities}). For example, by busing special comments @samp{##a } or @samp{##c }.
@end ifset
@ifclear UDAV
@@ -980,7 +1009,7 @@ There are no commands for making animation in MGL. However you can use features
@cindex StartGIF
@cindex CloseGIF
-These functions provide ability to create several pictures simultaneously. For most of cases it is useless but for widget classes (@pxref{Widget classes}) they can provide a way to show animation. Also you can write several frames into animated GIF file.
+These functions provide ability to create several pictures simultaneously. For most of cases it is useless but for widget classes (see @ref{Widget classes}) they can provide a way to show animation. Also you can write several frames into animated GIF file.
@deftypefn {Method on @code{mglGraph}} @code{int} NewFrame ()
@deftypefnx {C function} @code{int} mgl_new_frame (@code{HMGL} gr)
@@ -1020,7 +1049,8 @@ Finish writing animated GIF and close connected pointers.
@ifclear UDAV
These functions return the created picture (bitmap), its width and height. You may display it by yourself in any graphical library (see also, @ref{Widget classes}) or save in file (see also, @ref{Export to file}).
-@deftypefn {Method on @code{mglGraph}} @code{void} GetRGB (@code{char *}buf, @code{int} size)
+@deftypefn {Method on @code{mglGraph}} @code{const unsigned char *} GetRGB ()
+@deftypefnx {Method on @code{mglGraph}} @code{void} GetRGB (@code{char *}buf, @code{int} size)
@deftypefnx {Method on @code{mglGraph}} @code{void} GetBGRN (@code{char *}buf, @code{int} size)
@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgb (@code{HMGL} gr)
Gets RGB bitmap of the current state of the image. Format of each element of bits is: @{red, green, blue@}. Number of elements is Width*Height. Position of element @{i,j@} is [3*i + 3*Width*j] (or is [4*i + 4*Width*j] for @code{GetBGRN()}). You have to provide the proper @var{size} of the buffer, @var{buf}, i.e. the code for Python should look like
@@ -1033,7 +1063,8 @@ gr.GetBGRN(bits, len(bits));
@end verbatim
@end deftypefn
-@deftypefn {Method on @code{mglGraph}} @code{void} GetRGBA (@code{char *}buf, @code{int} size)
+@deftypefn {Method on @code{mglGraph}} @code{const unsigned char *} GetRGBA ()
+@deftypefnx {Method on @code{mglGraph}} @code{void} GetRGBA (@code{char *}buf, @code{int} size)
@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgba (@code{HMGL} gr)
Gets RGBA bitmap of the current state of the image. Format of each element of bits is: @{red, green, blue, alpha@}. Number of elements is Width*Height. Position of element @{i,j@} is [4*i + 4*Width*j].
@end deftypefn
@@ -1048,12 +1079,12 @@ Gets width and height of the image.
@deftypefn {Method on @code{mglGraph}} @code{mglPoint} CalcXYZ (@code{int} xs, @code{int} ys)
@deftypefnx {C function} @code{void} mgl_calc_xyz (@code{HMGL} gr, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z)
-Calculate 3D coordinate @{x,y,z@} for screen point @{xs,ys@}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (@pxref{Transformation matrix}).
+Calculate 3D coordinate @{x,y,z@} for screen point @{xs,ys@}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (see @ref{Transformation matrix}).
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{mglPoint} CalcScr (@code{mglPoint} p)
@deftypefnx {C function} @code{void} mgl_calc_scr (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{int *}xs, @code{int *}ys)
-Calculate screen point @{xs,ys@} for 3D coordinate @{x,y,z@}. The calculation are done for the last used InPlot (@pxref{Transformation matrix}).
+Calculate screen point @{xs,ys@} for 3D coordinate @{x,y,z@}. The calculation are done for the last used InPlot (see @ref{Transformation matrix}).
@end deftypefn
@deftypefn {Method on @code{mglGraph}} @code{void} SetObjId (@code{int} id)
@@ -1071,6 +1102,11 @@ Get the numeric id for most upper object at pixel @{xs, ys@} of the picture.
Get the numeric id for most subplot/inplot at pixel @{xs, ys@} of the picture.
@end deftypefn
+@deftypefn {Method on @code{mglGraph}} @code{void} Highlight (@code{int} id)
+@deftypefnx {C function} @code{void} mgl_highlight (@code{HMGL} gr, @code{int} id)
+Highlight the object with given @var{id}.
+@end deftypefn
+
@end ifclear
@@ -1079,22 +1115,14 @@ Get the numeric id for most subplot/inplot at pixel @{xs, ys@} of the picture.
@subsection Parallelization
@ifclear UDAV
-@cindex SetDrawReg
-@cindex PutDrawReg
@cindex Combine
@cindex MPI_Send
@cindex MPI_Recv
-There are few functions which allow parallelization at user-level. First 2 limit the drawing region (for example, by subplot per thread) and copy data from that region in another @code{mglGraph} instance.
+Many of things MathGL do in parallel by default (if MathGL was built with pthread). However, there is function which set the number of threads to be used.
-@deftypefn {Method on @code{mglGraph}} @code{int} SetDrawReg (@code{int} nx, @code{int} ny, @code{int} m)
-@deftypefnx {C function} @code{int} mgl_set_draw_reg (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m)
-Set drawable region as a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area.
-@end deftypefn
-
-@deftypefn {Method on @code{mglGraph}} @code{int} PutDrawReg (@code{int} nx, @code{int} ny, @code{int} m, @code{const mglGraph *}g)
-@deftypefnx {C function} @code{int} mgl_put_draw_reg (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{HMGL} g)
-Put drawing from another instance @var{g} for a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. The width and height of both instances must be the same.
+@deftypefn {C function} @code{int} mgl_set_num_thr (@code{int} n)
+Set the number of threads to be used by MathGL. If @var{n}<1 then the number of threads is set as maximal number of processors (cores). If @var{n}=1 then single thread will be used (this is default if pthread was disabled).
@end deftypefn
Another option is combining bitmap image (taking into account Z-ordering) from different instances. This method is most appropriate for computer clusters when the data size is so large that it exceed the memory of single computer node.
@@ -1139,8 +1167,7 @@ Receive graphical information from node @var{id} using MPI. The width and height
@end ifclear
-These functions draw some simple objects like line, point, sphere, drop, cone and so on.
-@c TODO @sref{Primitives sample}
+These functions draw some simple objects like line, point, sphere, drop, cone and so on. @sref{Primitives sample}
@anchor{clf}
@deftypefn {MGL command} {} clf
@@ -1159,7 +1186,6 @@ Clear the picture and fill it by color specified color.
@ifclear UDAV
@deftypefnx {Method on @code{mglGraph}} @code{void} Ball (@code{mglPoint} p, @code{char} col=@code{'r'})
@deftypefnx {Method on @code{mglGraph}} @code{void} Mark (@code{mglPoint} p, @code{const char *}mark)
-@deftypefnx {C function} @code{void} mgl_ball (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z)
@deftypefnx {C function} @code{void} mgl_mark (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}mark)
@end ifclear
Draws a mark (point @samp{.} by default) at position @var{p}=@{@var{x}, @var{y}, @var{z}@} with color @var{col}.
@@ -1167,7 +1193,8 @@ Draws a mark (point @samp{.} by default) at position @var{p}=@{@var{x}, @var{y},
@ifclear UDAV
@deftypefn {Method on @code{mglGraph}} @code{void} Error (@code{mglPoint} p, @code{mglPoint} e, @code{char} *stl=@code{""})
-Draws a 3d error box at position @var{p} with sizes @var{e} and style @var{stl}.
+@deftypefnx {C function} @code{void} mgl_error_box (@code{HMGL} gr, @code{float} px, @code{float} py, @code{float} pz, @code{float} ex, @code{float} ey, @code{float} ez, @code{char *}stl)
+Draws a 3d error box at position @var{p} with sizes @var{e} and style @var{stl}. Use NAN for component of @var{e} to reduce number of drawn elements.
@end deftypefn
@end ifclear
@@ -1175,10 +1202,10 @@ Draws a 3d error box at position @var{p} with sizes @var{e} and style @var{stl}.
@deftypefn {MGL command} {} line @code{x1 y1 x2 y2} ['stl'='']
@deftypefnx {MGL command} {} line @code{x1 y1 z1 x2 y2 z2} ['stl'='']
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Line (@code{mglPoint} p1, @code{mglPoint} p2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2})
-@deftypefnx {C function} @code{void} mgl_line (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl, @code{int}num)
+@deftypefnx {Method on @code{mglGraph}} @code{void} Line (@code{mglPoint} p1, @code{mglPoint} p2, @code{char *}stl=@code{"B"}, @code{int} num=@code{2})
+@deftypefnx {C function} @code{void} mgl_line (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl, @code{int} num)
@end ifclear
-Draws a geodesic line (straight line in Cartesian coordinates) from point @var{p1} to @var{p2} using line style @var{stl}. Parameter @var{num} define the ``quality'' of the line. If @var{num}=@code{2} then the stright line will be drawn in all coordinate system (independently on transformation formulas (@pxref{Curved coordinates}). Contrary, for large values (for example, =@code{100}) the geodesic line will be drawn in corresponding coordinate system (straight line in Cartesian coordinates, circle in polar coordinates and so on). Line will be drawn even if it lies out of bounding box.
+Draws a geodesic line (straight line in Cartesian coordinates) from point @var{p1} to @var{p2} using line style @var{stl}. Parameter @var{num} define the ``quality'' of the line. If @var{num}=@code{2} then the stright line will be drawn in all coordinate system (independently on transformation formulas (see @ref{Curved coordinates}). Contrary, for large values (for example, =@code{100}) the geodesic line will be drawn in corresponding coordinate system (straight line in Cartesian coordinates, circle in polar coordinates and so on). Line will be drawn even if it lies out of bounding box.
@end deftypefn
@anchor{curve}
@@ -1188,12 +1215,12 @@ Draws a geodesic line (straight line in Cartesian coordinates) from point @var{p
@deftypefnx {Method on @code{mglGraph}} @code{void} Curve (@code{mglPoint} p1, @code{mglPoint} d1, @code{mglPoint} p2, @code{mglPoint} d2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100})
@deftypefnx {C function} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} dx1, @code{float} dy1, @code{float} dz1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} dx2, @code{float} dy2, @code{float} dz2, @code{const char *}stl, @code{int} num)
@end ifclear
-Draws Bezier-like curve from point @var{p1} to @var{p2} using line style @var{stl}. At this tangent is codirected with @var{d1}, @var{d2} and proportional to its amplitude. Parameter @var{num} define the ``quality'' of the curve. If @var{num}=@code{2} then the straight line will be drawn in all coordinate system (independently on transformation formulas @pxref{Curved coordinates}). Contrary, for large values (for example, =@code{100}) the spline like Bezier curve will be drawn in corresponding coordinate system. Curve will be drawn even if it lies out of bounding box.
+Draws Bezier-like curve from point @var{p1} to @var{p2} using line style @var{stl}. At this tangent is codirected with @var{d1}, @var{d2} and proportional to its amplitude. Parameter @var{num} define the ``quality'' of the curve. If @var{num}=@code{2} then the straight line will be drawn in all coordinate system (independently on transformation formulas, see @ref{Curved coordinates}). Contrary, for large values (for example, =@code{100}) the spline like Bezier curve will be drawn in corresponding coordinate system. Curve will be drawn even if it lies out of bounding box.
@end deftypefn
@ifclear UDAV
@deftypefn {Method on @code{mglGraph}} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"})
-@deftypefnx {C function} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} x3, @code{float} y3, @code{float} z3, @code{float} x4, @code{float} y4, @code{float} z4, @code{const char *}stl)
+@deftypefnx {C function} @code{void} mgl_face (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} x3, @code{float} y3, @code{float} z3, @code{float} x4, @code{float} y4, @code{float} z4, @code{const char *}stl)
Draws the solid quadrangle (face) with vertexes @var{p1}, @var{p2}, @var{p3}, @var{p4} and with color(s) @var{stl}. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box.
@end deftypefn
@end ifclear
@@ -1282,18 +1309,22 @@ Draw the rhombus with width @var{r} and edge points @var{p1}, @var{p2} by color
@cindex Label
@cindex fgets
-These functions draw the text. There are functions for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. MathGL can use arbitrary font-faces and parse many TeX commands (for detail @pxref{Font styles}). All these functions have 2 variant: for printing 8-bit text (@code{char *}) and for printing Unicode text (@code{wchar_t *}). In first case the conversion in current locale is used. So sometimes you need to specify it by @code{setlocale()} function. The size argument control the size of text: if positive it give the value, if negative it give the value relative to @var{FontSize}. The font type (STIX, arial, courier, times and so on) can be selected by function LoadFont(). @xref{Font settings}.
+These functions draw the text. There are functions for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. MathGL can use arbitrary font-faces and parse many TeX commands (for more details see @ref{Font styles}). All these functions have 2 variant: for printing 8-bit text (@code{char *}) and for printing Unicode text (@code{wchar_t *}). In first case the conversion in current locale is used. So sometimes you need to specify it by @code{setlocale()} function. The size argument control the size of text: if positive it give the value, if negative it give the value relative to @var{FontSize}. The font type (STIX, arial, courier, times and so on) can be selected by function LoadFont(). @xref{Font settings}.
-The font parameters are described by string. This string may set the text color @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}). Also, after delimiter symbol @samp{:}, it can contain characters of font type (@samp{rbiwou}) and/or align (@samp{LRC}) specification. The font types are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style, @samp{w} -- wired style, @samp{o} -- over-lined text, @samp{u} -- underlined text. By default roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. For example, string @samp{b:iC} correspond to italic font style for centered text which printed by blue color.
+The font parameters are described by string. This string may set the text color @samp{wkrgbcymhRGBCYMHW} (see @ref{Color styles}). Also, after delimiter symbol @samp{:}, it can contain characters of font type (@samp{rbiwou}) and/or align (@samp{LRC}) specification. The font types are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style, @samp{w} -- wired style, @samp{o} -- over-lined text, @samp{u} -- underlined text. By default roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. For example, string @samp{b:iC} correspond to italic font style for centered text which printed by blue color.
If string contains symbols @samp{aA} then text is printed at arbitrary position @{@var{x}, @var{y}@} (supposed to be in range [0,1]) of subplot (for @samp{a}) or picture (for @samp{A}). If string contains symbol @samp{@@} then box around text is drawn.
+@sref{Text sample}
+
@anchor{text}
@deftypefn {MGL command} {} text @code{x y} 'text' ['fnt'='' @code{size=-1}]
@deftypefnx {MGL command} {} text @code{x y z} 'text' ['fnt'='' @code{size=-1}]
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{float} size=@code{-1})
-@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{float} size=@code{-1})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{const char *}text, @code{const char *}fnt=@code{":C"}, @code{float} size=@code{-1})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}fnt=@code{":C"}, @code{float} size=@code{-1})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{float} x, @code{float} y, @code{const char *}text, @code{const char *}fnt=@code{":AC"}, @code{float} size=@code{-1})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}fnt=@code{":AC"}, @code{float} size=@code{-1})
@deftypefnx {C function} @code{void} mgl_puts (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}fnt, @code{float} size)
@deftypefnx {C function} @code{void} mgl_putsw (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text, @code{const char *}fnt, @code{float} size)
@end ifclear
@@ -1303,8 +1334,8 @@ The function plots the string @var{text} at position @var{p} with fonts specifyi
@deftypefn {MGL command} {} text @code{x y dx dy} 'text' ['fnt'=':L' @code{size=-1}]
@deftypefnx {MGL command} {} text @code{x y z dx dy dz} 'text' ['fnt'=':L' @code{size=-1}]
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{mglPoint} d, @code{const char *}text, @code{const char *}fnt=@code{':L'}, @code{float} size=@code{-1})
-@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{mglPoint} d, @code{const wchar_t *}text, @code{const char *}fnt=@code{':L'}, @code{float} size=@code{-1})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{mglPoint} d, @code{const char *}text, @code{const char *}fnt=@code{":L"}, @code{float} size=@code{-1})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{mglPoint} d, @code{const wchar_t *}text, @code{const char *}fnt=@code{":L"}, @code{float} size=@code{-1})
@deftypefnx {C function} @code{void} mgl_puts_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{const char *}fnt, @code{float} size)
@deftypefnx {C function} @code{void} mgl_putsw_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const wchar_t *}text, @code{const char *}fnt, @code{float} size)
@end ifclear
@@ -1346,7 +1377,7 @@ The function draws the string @var{text} at position @{@var{x}, @var{y}@} with f
@deftypefnx {C function} @code{void} mgl_text_xyz (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_textw_xyz (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt)
@end ifclear
-The function draws @var{text} along the curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} by font style @var{fnt}. The string @var{fnt} may contain symbols @samp{t} for printing the text under the curve (default), or @samp{T} for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays @code{x.nx=y.nx=z.nx}. If array @var{x} is not specified then its an automatic array is used with values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] (@pxref{Ranges (bounding box)}). If array @var{z} is not specified then @var{z}[i] = @var{Min}.z is used. String @var{opt} contain command options (@pxref{Command options}). @sref{Text sample}
+The function draws @var{text} along the curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} by font style @var{fnt}. The string @var{fnt} may contain symbols @samp{t} for printing the text under the curve (default), or @samp{T} for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays @code{x.nx=y.nx=z.nx}. If array @var{x} is not specified then its an automatic array is used with values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] (see @ref{Ranges (bounding box)}). If array @var{z} is not specified then @var{z}[i] = @var{Min}.z is used. String @var{opt} contain command options (see @ref{Command options}).
@end deftypefn
@c ##################################################################
@@ -1358,7 +1389,7 @@ The function draws @var{text} along the curve between points @{@var{x}[i], @var{
@cindex Colorbar
@cindex Label
-These functions draw the ``things for measuring'', like axis with ticks, colorbar with ticks, grid along axis, bounding box and labels for axis. For more information @pxref{Axis settings}.
+These functions draw the ``things for measuring'', like axis with ticks, colorbar with ticks, grid along axis, bounding box and labels for axis. For more information see @ref{Axis settings}.
@anchor{axis}
@deftypefn {MGL command} {} axis ['dir'='xyz' 'stl'='']
@@ -1366,7 +1397,7 @@ These functions draw the ``things for measuring'', like axis with ticks, colorba
@deftypefnx {Method on @code{mglGraph}} @code{void} Axis (@code{const char *}dir=@code{"xyz"}, @code{const char *}stl=@code{""})
@deftypefnx {C function} @code{void} mgl_axis (@code{HMGL} gr, @code{const char *}dir, @code{const char *}stl)
@end ifclear
-Draws axes with ticks (@pxref{Axis settings}) in directions determined by string parameter @var{dir}.If string contain the symbol @samp{_} then tick labels are not printed. Font for ticks labels is determined by @var{FontDef} (@pxref{Font settings}). Ticks will be adjusted if @var{stl} contain @samp{a} (by call of @code{AdjustTicks()}). You can specified an arrow at the end of axis (see @pxref{Line styles}). Styles of ticks and axis can be overrided by using @var{stl} string.
+Draws axes with ticks (see @ref{Axis settings}) in directions determined by string parameter @var{dir}.If string contain the symbol @samp{_} then tick labels are not printed. Font for ticks labels is determined by @var{FontDef} (see @ref{Font settings}). Ticks will be adjusted if @var{stl} contain @samp{a} (by call of @code{AdjustTicks()}). You can specified an arrow at the end of axis (see see @ref{Line styles}). Styles of ticks and axis can be overrided by using @var{stl} string.
@end deftypefn
@anchor{colorbar}
@@ -1375,7 +1406,7 @@ Draws axes with ticks (@pxref{Axis settings}) in directions determined by string
@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch=@code{""})
@deftypefnx {C function} @code{void} mgl_colorbar (@code{HMGL} gr, @code{const char *}sch)
@end ifclear
-Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=""}) at edge of plot. If string @var{sch} contains @samp{<>^_} then the parameter @var{pos} is defined as: @code{pos=0} for @samp{>} (right), @code{pos=1} for @samp{<} (left), @code{pos=2} for @samp{^} (top), @code{pos=3} for @samp{_} (bottom). If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Dens sample}
+Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=""}) at edge of plot. If string @var{sch} contains @samp{<>^_} then the colorbar is placed at left, at right, at top or at bottom correspondingly. If string have @samp{I} then colorbar will be located near bounding box otherwise at the edge of the subplot. If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Dens sample}
@end deftypefn
@deftypefn {MGL command} {} colorbar vdat ['sch'='']
@@ -1386,20 +1417,21 @@ Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=""}) at
The same as previous but with sharp colors @var{sch} (current palette if @code{sch=""}) for values @var{v}. @sref{ContD sample}
@end deftypefn
-@deftypefn {MGL command} {} colorbar 'sch' @code{pos x y w h}
+@deftypefn {MGL command} {} colorbar 'sch' @code{x y [w=1 h=1]}
@ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch, @code{float} x, @code{float} y, @code{float} w, @code{float} h)
+@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch, @code{float} x, @code{float} y, @code{float} w=@code{1}, @code{float} h=@code{1})
@deftypefnx {C function} @code{void} mgl_colorbar_ext (@code{HMGL} gr, @code{const char *}sch, @code{float} x, @code{float} y, @code{float} w, @code{float} h)
@end ifclear
The same as first one but at arbitrary position of subplot @{@var{x}, @var{y}@} (supposed to be in range [0,1]). Parameters @var{w}, @var{h} set the relative width and height of the colorbar.
@end deftypefn
+@deftypefn {MGL command} {} colorbar vdat 'sch' @code{x y [w=1 h=1]}
@ifclear UDAV
-@deftypefn {Method on @code{mglGraph}} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch, @code{float} x, @code{float} y, @code{float} w, @code{float} h)
+@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch, @code{float} x, @code{float} y, @code{float} w=@code{1}, @code{float} h=@code{1})
@deftypefnx {C function} @code{void} mgl_colorbar_val_ext (@code{HMGL} gr, @code{HCDT} v, @code{const char *}sch, @code{float} x, @code{float} y, @code{float} w, @code{float} h)
+@end ifclear
The same as previous but with sharp colors @var{sch} (current palette if @code{sch=""}) for values @var{v}. @sref{ContD sample}
@end deftypefn
-@end ifclear
@anchor{grid}
@deftypefn {MGL command} {} grid ['dir'='xyz' 'pen'='B']
@@ -1417,7 +1449,7 @@ Draws grid lines perpendicular to direction determined by string parameter @var{
@deftypefnx {C function} @code{void} mgl_box (@code{HMGL} gr, @code{int} ticks)
@deftypefnx {C function} @code{void} mgl_box_str (@code{HMGL} gr, @code{const char *}col, @code{int} ticks)
@end ifclear
-Draws bounding box outside the plotting volume with color @var{col}.
+Draws bounding box outside the plotting volume with color @var{col}. If @var{col} contain @samp{@@} then filled faces are drawn. At this first color is used for faces (default is light yellow), last one for edges. @sref{Box sample}
@end deftypefn
@anchor{xlabel}
@@ -1447,7 +1479,7 @@ Prints the label @var{text} for axis @var{dir}=@samp{x},@samp{y},@samp{z},@samp{
@cindex SetLegendBox
@cindex SetLegendMarks
-These functions draw legend to the graph (useful for @ref{1D plotting}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function @ref{addlegend}) and further plotting it. The position of the legend can be selected automatic or manually. Parameters @var{fnt} and @var{size} specify the font style and size (@pxref{Font settings}). Parameter @var{llen} set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. If string @var{fnt} contains symbol @samp{A} then legend coordinates set position in the picture (not in the current subplot). If string @var{fnt} contains symbol @samp{#} then box around legend is drawn. @sref{Legend sample}
+These functions draw legend to the graph (useful for @ref{1D plotting}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function @ref{addlegend}) and further plotting it. The position of the legend can be selected automatic or manually. Parameters @var{fnt} and @var{size} specify the font style and size (see @ref{Font settings}). Parameter @var{llen} set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. If string @var{fnt} contains symbol @samp{A} then legend coordinates set position in the picture (not in the current subplot). If string @var{fnt} contains symbol @samp{#} then box around legend is drawn. @sref{Legend sample}
@anchor{legend}
@deftypefn {MGL command} {} legend [@code{pos=3} 'fnt'='#' @code{size=-0.8 llen=0.1}]
@@ -1474,7 +1506,7 @@ Draws legend of accumulated legend entries by font @var{fnt} with @var{size}. Po
@deftypefnx {C function} @code{void} mgl_add_legend (@code{HMGL} gr, @code{const char *}text, @code{const char *}style)
@deftypefnx {C function} @code{void} mgl_add_legendw (@code{HMGL} gr, @code{const wchar_t *}text, @code{const char *}style)
@end ifclear
-Adds string @var{text} to internal legend accumulator. The style of described line and mark is specified in string @var{style} (@pxref{Line styles}).
+Adds string @var{text} to internal legend accumulator. The style of described line and mark is specified in string @var{style} (see @ref{Line styles}).
@end deftypefn
@anchor{clearlegend}
@@ -1518,7 +1550,7 @@ Set the number of marks in the legend. By default 1 mark is used.
These functions perform plotting of 1D data. 1D means that data depended from only 1 parameter like parametric curve @{x[i],y[i],z[i]@}, i=1...n. By default (if absent) values of @var{x}[i] are equidistantly distributed in axis range, and @var{z}[i]=@var{Min}.z. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx}.
-String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). String @var{opt} contain command options (@pxref{Command options}). @sref{1D plot sample}
+String @var{pen} specifies the color and style of line and marks (see @ref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (see @ref{Palette and colors}). String @var{opt} contain command options (see @ref{Command options}). @sref{1D plot sample}
@anchor{plot}
@deftypefn {MGL command} {} plot ydat ['stl'='']
@@ -1571,7 +1603,7 @@ These functions draw continuous stairs for points to axis plane. See also @ref{p
@deftypefnx {C function} @code{void} mgl_tens_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} c, @code{const char *}pen, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_tens_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}pen, @code{const char *}opt)
@end ifclear
-These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} with color defined by the special array @var{c}[i] (look like tension plot). String @var{pen} specifies the color scheme (@pxref{Color scheme}) and style and/or width of line (@pxref{Line styles}). By default (@code{pen=""}) solid line with current color scheme is used. See also @ref{plot}, @ref{mesh}, @ref{fall}. @sref{Tens sample}
+These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} with color defined by the special array @var{c}[i] (look like tension plot). String @var{pen} specifies the color scheme (see @ref{Color scheme}) and style and/or width of line (see @ref{Line styles}). By default (@code{pen=""}) solid line with current color scheme is used. See also @ref{plot}, @ref{mesh}, @ref{fall}. @sref{Tens sample}
@end deftypefn
@anchor{area}
@@ -1649,7 +1681,7 @@ These functions draw horizontal bars from points to axis plane. If string contai
@deftypefnx {Method on @code{mglGraph}} @code{void} Chart (@code{const mglData &}a, @code{const char *}col=@code{""}, @code{const char *}opt=@code{""})
@deftypefnx {C function} @code{void} mgl_chart (@code{HMGL} gr, @code{HCDT} a, @code{const char *}col, @code{const char *}opt)
@end ifclear
-The function draws colored stripes (boxes) for data in array @var{a}. The number of stripes is equal to the number of rows in @var{a} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette Pal (@pxref{Palette and colors}). Spaces in colors denote transparent ``color'' (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{Chart sample}
+The function draws colored stripes (boxes) for data in array @var{a}. The number of stripes is equal to the number of rows in @var{a} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette Pal (see @ref{Palette and colors}). Spaces in colors denote transparent ``color'' (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{Chart sample}
@end deftypefn
@anchor{boxplot}
@@ -1792,7 +1824,7 @@ These functions draw surface which is result of curve @{@var{r}, @var{z}@} rotat
@cindex Grid
-These functions perform plotting of 2D data. 2D means that data depend from 2 independent parameters like matrix @math{f(x_i,y_j), i=1...n, j=1...m}. By default (if absent) values of @var{x}, @var{y} are equidistantly distributed in axis range. The plots are drawn for each z slice of the data. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}). @sref{2D plot sample}
+These functions perform plotting of 2D data. 2D means that data depend from 2 independent parameters like matrix @math{f(x_i,y_j), i=1...n, j=1...m}. By default (if absent) values of @var{x}, @var{y} are equidistantly distributed in axis range. The plots are drawn for each z slice of the data. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}). @sref{2D plot sample}
@anchor{surf}
@deftypefn {MGL command} {} surf zdat ['sch'='']
@@ -2017,7 +2049,7 @@ The function draws grid lines for density plot of surface specified parametrical
@cindex Cloud
@cindex Beam
-These functions perform plotting of 3D data. 3D means that data depend from 3 independent parameters like matrix @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}.By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{a} should be equal @code{x.nx=a.nx && y.nx=a.ny && z.nz=a.nz} or @code{x.nx=y.nx=z.nx=a.nx && x.ny=y.ny=z.ny=a.ny && x.nz=y.nz=z.nz=a.nz}. Arrays @var{x}, @var{y} and @var{z} can be vectors (not matrices as @var{a}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}). @sref{3D plot sample}
+These functions perform plotting of 3D data. 3D means that data depend from 3 independent parameters like matrix @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}.By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{a} should be equal @code{x.nx=a.nx && y.nx=a.ny && z.nz=a.nz} or @code{x.nx=y.nx=z.nx=a.nx && x.ny=y.ny=z.ny=a.ny && x.nz=y.nz=z.nz=a.nz}. Arrays @var{x}, @var{y} and @var{z} can be vectors (not matrices as @var{a}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}). @sref{3D plot sample}
@anchor{surf3}
@deftypefn {MGL command} {} surf3 adat @code{val} ['sch'='']
@@ -2149,7 +2181,7 @@ Draws the isosurface for 3d array @var{a} at constant values of @var{a}=@var{val
@cindex Map
@cindex STFA
-These plotting functions draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{c} should be equal. Arrays @var{x}, @var{y} (and @var{z} for @code{Surf3C, Surf3A}) can be vectors (not matrices as @var{c}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}).
+These plotting functions draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{c} should be equal. Arrays @var{x}, @var{y} (and @var{z} for @code{Surf3C, Surf3A}) can be vectors (not matrices as @var{c}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}).
@anchor{surfc}
@deftypefn {MGL command} {} surfc zdat cdat ['sch'='']
@@ -2270,7 +2302,7 @@ Draws spectrogram of complex array @var{re}+i*@code{im} for Fourier size of @var
@cindex FlowP
@cindex Pipe
-These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{ax} should be equal. The size of @var{ax}, @var{ay} and @var{az} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not matrices as @var{ax}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}).
+These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{ax} should be equal. The size of @var{ax}, @var{ay} and @var{az} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not matrices as @var{ax}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (see @ref{Command options}).
@anchor{traj}
@deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'='']
@@ -2281,7 +2313,7 @@ These functions perform plotting of 2D and 3D vector fields. There are 5 general
@deftypefnx {C function} @code{void} mgl_traj_xyz (@code{HMGL} gr, @code{HCDT}x, @code{HCDT}y, @code{HCDT}z, @code{HCDT}ax, @code{HCDT}ay, @code{HCDT}az, @code{const char *}sch, @code{const char *}opt)
@deftypefnx {C function} @code{void} mgl_traj_xy (@code{HMGL} gr, @code{HCDT}x, @code{HCDT}y, @code{HCDT}ax, @code{HCDT}ay, @code{const char *}sch, @code{const char *}opt)
@end ifclear
-The function draws vectors @{@var{ax}, @var{ay}, @var{az}@} along a curve @{@var{x}, @var{y}, @var{z}@}. The length of arrows are proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. String @var{pen} specifies the color (@pxref{Line styles}). By default (@code{pen=""}) color from palette is used (@pxref{Palette and colors}). Parameter @var{len} set the vector length factor (if non-zero) or vector length to be proportional the distance between curve points (if @var{len}=0). The minor sizes of all arrays must be equal and large 2. The plots are drawn for each row if one of the data is the matrix. See also @ref{vect}. @sref{Traj sample}
+The function draws vectors @{@var{ax}, @var{ay}, @var{az}@} along a curve @{@var{x}, @var{y}, @var{z}@}. The length of arrows are proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. String @var{pen} specifies the color (see @ref{Line styles}). By default (@code{pen=""}) color from palette is used (see @ref{Palette and colors}). Parameter @var{len} set the vector length factor (if non-zero) or vector length to be proportional the distance between curve points (if @var{len}=0). The minor sizes of all arrays must be equal and large 2. The plots are drawn for each row if one of the data is the matrix. See also @ref{vect}. @sref{Traj sample}
@end deftypefn
@anchor{vect}
@@ -2616,7 +2648,7 @@ The function reconstruct and draws the surface for arbitrary placed points @{@va
@cindex Fit2
@cindex Fit3
-These functions fit data to formula. Fitting goal is to find formula parameters for the best fit the data points, i.e. to minimize the sum @math{\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2}. At this, approximation function @samp{f} can depend only on one argument @samp{x} (1D case), on two arguments @samp{x,y} (2D case) and on three arguments @samp{x,y,z} (3D case). The function @samp{f} also may depend on parameters. Normally the list of fitted parameters is specified by @var{var} string (like, @samp{abcd}). Usually user should supply initial values for fitted parameters by @var{ini} variable. But if he/she don't supply it then the zeros are used. Parameter @var{print}=@code{true} switch on printing the found coefficients to @var{Message} (@pxref{Error handling}).
+These functions fit data to formula. Fitting goal is to find formula parameters for the best fit the data points, i.e. to minimize the sum @math{\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2}. At this, approximation function @samp{f} can depend only on one argument @samp{x} (1D case), on two arguments @samp{x,y} (2D case) and on three arguments @samp{x,y,z} (3D case). The function @samp{f} also may depend on parameters. Normally the list of fitted parameters is specified by @var{var} string (like, @samp{abcd}). Usually user should supply initial values for fitted parameters by @var{ini} variable. But if he/she don't supply it then the zeros are used. Parameter @var{print}=@code{true} switch on printing the found coefficients to @var{Message} (see @ref{Error handling}).
Functions Fit() and FitS() do not draw the obtained data themselves. They fill the data @var{fit} by formula @samp{f} with found coefficients and return it. At this, the @samp{x,y,z} coordinates are equidistantly distributed in the axis range. Number of points in @var{fit} is selected as maximal value of @var{fit} size and the value of @var{mglFitPnts}. Note, that this functions use GSL library and do something only if MathGL was compiled with GSL support. @sref{Fitting sample}
diff --git a/texinfo/data_en.texi b/texinfo/data_en.texi
index da53c54..f1a0496 100644
--- a/texinfo/data_en.texi
+++ b/texinfo/data_en.texi
@@ -1,7 +1,7 @@
@c ------------------------------------------------------------------
@chapter Data processing
-Class for working with data array. This class is defined in @code{#include }. The class has functions for easy and safe allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables -- x,y,z). The internal representation of numbers is float. Float type was chosen because it has smaller size in memory and usually it has enough precision in plotting purposes. You can change it by selecting option @code{--enable-double} at the library configuring (@pxref{Installation and usage}). Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands.
+Class for working with data array. This class is defined in @code{#include }. The class has functions for easy and safe allocation, resizing, loading and saving, modifying of data arrays. Also it can numerically differentiate and integrate data, interpolate, fill data by formula and so on. Class supports data with dimensions up to 3 (like function of 3 variables -- x,y,z). The internal representation of numbers is float. Float type was chosen because it has smaller size in memory and usually it has enough precision in plotting purposes. You can change it by selecting option @code{--enable-double} at the library configuring (see @ref{Installation}). Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands.
@menu
* Public variables::
diff --git a/texinfo/example_en.texi b/texinfo/example_en.texi
index 6d1b062..8875abe 100644
--- a/texinfo/example_en.texi
+++ b/texinfo/example_en.texi
@@ -4,11 +4,16 @@
This chapter contain information about basic and advanced MathGL, hints and samples for all types of graphics. I recommend you read first 2 sections one after another and at least look on @ref{Hints} section. Also I recommend you to look at @ref{General concepts} and @ref{FAQ}.
@menu
-* Basic usage::
-* Advanced usage::
-* Data handling::
-* Data plotting::
-* C/Fortran interface::
+* Basic usage::
+* Advanced usage::
+* Data handling::
+* Data plotting::
+* 1D samples::
+* 2D samples::
+* 3D samples::
+* Dual samples::
+* More samples::
+* C/Fortran interface::
* MathGL and PyQt::
* Hints::
* FAQ::
@@ -37,22 +42,22 @@ In this case the programmer has more freedom in selecting the window libraries (
Let me consider the aforesaid in more detail.
@menu
-* Using FLTK/GLUT window::
-* Drawing to file::
-* Drawing in memory::
-* Using QMathGL::
+* Using MathGL window::
+* Drawing to file::
+* Drawing in memory::
+* Using QMathGL::
@end menu
@c ------------------------------------------------------------------
-@node Using FLTK/GLUT window, Drawing to file, , Basic usage
-@subsection Using FLTK/Qt/GLUT window
+@node Using MathGL window, Drawing to file, , Basic usage
+@subsection Using MathGL window
@cindex window
@cindex widgets
-The ``interactive'' way of drawing in MathGL consists in window creation with help of class @code{mglGraphFLTK}, @code{mglGraphQT} or @code{mglGraphGLUT} (@pxref{Widget classes}) and the following drawing in this window. There is a corresponding code:
+The ``interactive'' way of drawing in MathGL consists in window creation with help of class @code{mglWindow} or @code{mglGLUT} (see @ref{Widget classes}) and the following drawing in this window. There is a corresponding code:
@verbatim
- int sample(mglGraph *gr, void *)
+ int sample(mglGraph *gr)
{
gr->Rotate(60,40);
gr->Box();
@@ -61,12 +66,11 @@ The ``interactive'' way of drawing in MathGL consists in window creation with h
//-----------------------------------------------------
int main(int argc,char **argv)
{
- mglGraphFLTK gr;
- gr.Window(argc,argv,sample,"MathGL examples");
- return mglFlRun();
+ mglWindow gr(0,sample,"MathGL examples");
+ return gr.Run();
}
@end verbatim
-Here function @code{sample} is defined. This function does all drawing. Other function @code{main} is entry point function for console program. Arguments of @code{main} should be transfered to @code{Window()} since it may contain OS specific information.
+Here function @code{sample} is defined. This function does all drawing. Other function @code{main} is entry point function for console program.
Alternatively you can create yours own class inherited from class @code{mglDraw} and re-implement the function @code{Draw()} in it:
@verbatim
@@ -74,7 +78,7 @@ Alternatively you can create yours own class inherited from class @code{mglDraw}
{
public:
int Draw(mglGraph *gr);
- } foo;
+ };
//-----------------------------------------------------
int Foo::Draw(mglGraph *gr)
{
@@ -85,25 +89,24 @@ Alternatively you can create yours own class inherited from class @code{mglDraw}
//-----------------------------------------------------
int main(int argc,char **argv)
{
- mglGraphFLTK gr;
- gr.Window(argc,argv,&foo,"MathGL examples");
- return mglFlRun();
+ mglDraw foo;
+ mglWindow gr(0,&foo,"MathGL examples");
+ return gr.Run();
}
@end verbatim
-The similar code can be written for @code{mglGraphQT} or for @code{mglGraphGLUT} window (function @code{sample()} is the same):
+The similar code can be written for @code{mglGLUT} window (function @code{sample()} is the same):
@verbatim
int main(int argc,char **argv)
{
- mglGraphGLUT gr;
- gr.Window(argc,argv,sample,"MathGL examples");
+ mglGLUT gr(sample,"MathGL examples");
return 0;
}
@end verbatim
-The rotation, shift, zooming, switching on/off transparency and lighting can be done with help of tool-buttons (for @code{mglGraphFLTK} and @code{mglGraphQT}) or by hot-keys: @samp{a}, @samp{d}, @samp{w}, @samp{s} for plot rotation, @samp{r} and @samp{f} switching on/off transparency and lighting. Press @samp{x} for exit (or closing the window).
+The rotation, shift, zooming, switching on/off transparency and lighting can be done with help of tool-buttons (for @code{mglWindow}) or by hot-keys: @samp{a}, @samp{d}, @samp{w}, @samp{s} for plot rotation, @samp{r} and @samp{f} switching on/off transparency and lighting. Press @samp{x} for exit (or closing the window).
-In this example function @code{sample} rotates axes (@code{Rotate()}, @pxref{Transformation matrix}) and draws the bounding box (@code{Box()}). Drawing procedure is separated in a function since it will be used on demand when window canvas needs to be redrawn. Widget classes (@code{mglGraphFLTK}, @code{mglGraphGLUT} and so on) support a delayed drawing, when all plotting functions are called once at the beginning of writing to memory lists. Further program displays the saved lists faster. Resulting redrawing will be faster but it requires sufficient memory. Several lists (frames) can be displayed one after another (by pressing @samp{,}, @samp{.}) or run as cinema. To switch these feature on one needs to modify function @code{sample}:
+In this example function @code{sample} rotates axes (@code{Rotate()}, @pxref{Transformation matrix}) and draws the bounding box (@code{Box()}). Drawing procedure is separated in a function since it will be used on demand when window canvas needs to be redrawn. Widget classes (@code{mglWindow}, @code{mglGLUT}) support a delayed drawing, when all plotting functions are called once at the beginning of writing to memory lists. Further program displays the saved lists faster. Resulting redrawing will be faster but it requires sufficient memory. Several lists (frames) can be displayed one after another (by pressing @samp{,}, @samp{.}) or run as cinema. To switch these feature on one needs to modify function @code{sample}:
@verbatim
int sample1(mglGraph *gr, void *)
{
@@ -120,8 +123,45 @@ In this example function @code{sample} rotates axes (@code{Rotate()}, @pxref{Tra
@end verbatim
First, the function creates a frame @code{NewFrame()} for rotated axes and draws the bounding box. After the frame drawing the function @code{EndFrame()} @strong{must be} called! The second frame contains the bounding box and axes @code{Axis("xy")} in the initial (unrotated) coordinates. Function @code{sample} returns the number of created frames @code{GetNumFrame()}.
+Note, that such kind of animation is rather slow and not well suitable for visualization of running calculations. For the last case one can use @code{Update()} function. The most simple case for doing this is to use @code{mglDraw} class and reimplement its @code{Calc()} method.
+@verbatim
+ class Foo : public mglDraw
+ {
+ mglPoint pnt; // some result of calculation
+ public:
+ mglGraph *Gr; // graphics to be updated
+ int Draw(mglGraph *gr);
+ void Calc();
+ } foo;
+ //-----------------------------------------------------
+ int Foo::Calc()
+ {
+ for(int i=0;i<30;i++) // do calculation
+ {
+ sleep(2); // which can be very long
+ pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1);
+ Gr.Update(); // update window
+ }
+ }
+ //-----------------------------------------------------
+ int Foo::Draw(mglGraph *gr)
+ {
+ gr.Line(mglPoint(),pnt,"Ar2");
+ gr->Box();
+ return 0;
+ }
+ //-----------------------------------------------------
+ int main(int argc,char **argv)
+ {
+ mglDraw foo;
+ mglWindow gr(0,&foo,"MathGL examples");
+ foo.Gr = &gr; foo.Run();
+ return gr.Run();
+ }
+@end verbatim
+
@c ------------------------------------------------------------------
-@node Drawing to file, Drawing in memory, Using FLTK/GLUT window, Basic usage
+@node Drawing to file, Drawing in memory, Using MathGL window, Basic usage
@subsection Drawing to file
Another way of using MathGL library is the direct picture writing to file. It is most usable for plot creating during calculation or for using of small programs (like Matlab or Scilab scripts) for visualizing repetitive sets of data. But the speed of drawing is much higher in comparison with a script language.
@@ -230,7 +270,7 @@ First of all you have to define the drawing function or inherit a class from @co
QMainWindow *Wnd = new QMainWindow;
Wnd->resize(650,480); // for fill up the QMGL, menu and toolbars
Wnd->setWindowTitle(title);
- // here I allow to scroll QMathGL -- the case
+ // here I allow to scroll QMathGL -- the case
// then user want to prepare huge picture
QScrollArea *scroll = new QScrollArea(Wnd);
@@ -258,11 +298,11 @@ First of all you have to define the drawing function or inherit a class from @co
Now I show several non-obvious features of MathGL: several subplots in a single picture, curvilinear coordinates, text printing and so on. Generally you may miss this section at first reading, but I don't recommend it.
@menu
-* Subplots::
-* Axis and grids::
-* Curvilinear coordinates::
-* Text printing example::
-* Animation::
+* Subplots::
+* Axis and grids::
+* Curvilinear coordinates::
+* Text printing example::
+* Animation::
@end menu
@c ------------------------------------------------------------------
@@ -543,7 +583,7 @@ Finally, you can use @code{mgl2gif} tool for doing the same with MGL scripts (@p
Class @code{mglData} contains all functions for the data handling in MathGL (@pxref{Data processing}). There are several matters why I use class @code{mglData} but not a single array: it does not depend on type of data (float or double), sizes of data arrays are kept with data, memory working is simpler and safer.
@menu
-* Array creation::
+* Array creation::
* Change data::
@end menu
@@ -680,16 +720,16 @@ Data smoothing (function @code{Smooth()}) is more interesting and important. Thi
Finally one can create new data arrays on base of the existing one: extract slice, row or column of data (@code{SubData()}), summarize along some of direction(s) (@code{Sum()}), find distribution of data elements (@code{Hist()}). Note, that all these functions are not thread-safe because they use static internal variable for output array. In particular, the using of several of them in arguments of the same function will lead to unpredictable result.
@c ------------------------------------------------------------------
-@node Data plotting, C/Fortran interface, Data handling, Examples
+@node Data plotting, 1D samples, Data handling, Examples
@section Data plotting
Let me now show how to plot the data. MathGL generally has 2 types of plotting functions. Simple variant requires a single data array for plotting, other data (coordinates) are considered uniformly distributed in interval @var{Min}*@var{Max}. Second variant requires data arrays for all coordinates. It allows one to plot rather complex multivalent curves and surfaces (in case of parametric dependencies). Argument setting to default values allows one to plot data in standard form. Manual arguments setting gives possibility for fine tuning of colors, positions and view of graphics. Note, that the call of drawing function adds something to picture but does not clear the previous plots (as it does in Matlab). Another difference from Matlab is that all setup (like transparency, lightning, axis borders and so on) must be specified @strong{before} plotting functions.
@menu
-* Plots for 1D data::
-* Plots for 2D data::
-* Plots for 3D data::
-* Surface transparency::
+* Plots for 1D data::
+* Plots for 2D data::
+* Plots for 3D data::
+* Surface transparency::
@end menu
@c ------------------------------------------------------------------
@@ -889,8 +929,31 @@ As example I shall show the variant of plot from @ref{Plots for 2D data} (grid d
@caption{Example of @code{TranspType=2}.}
@end float
+
+
+@c ------------------------------------------------------------------
+@node 1D samples, 2D samples, Data plotting, Examples
+@section 1D samples
+
+@c ------------------------------------------------------------------
+@node 2D samples, 3D samples, 1D samples, Examples
+@section 2D samples
+
+@c ------------------------------------------------------------------
+@node 3D samples, Dual samples, 2D samples, Examples
+@section 3D samples
+
+@c ------------------------------------------------------------------
+@node Dual samples, More samples, 3D samples, Examples
+@section Dual samples
+
@c ------------------------------------------------------------------
-@node C/Fortran interface, MathGL and PyQt, Data plotting, Examples
+@node More samples, C/Fortran interface, Dual samples, Examples
+@section More samples
+
+
+@c ------------------------------------------------------------------
+@node C/Fortran interface, MathGL and PyQt, More samples, Examples
@section C/Fortran interface
The usage of pure C or Fortran or any similar interfaces (@pxref{C interface}) is practically identical to classes usage. But there are some differences. C functions must have argument HMGL (for graphics) and/or HMDT (for data arrays) which specifies the object for drawing or manipulating (changing). Fortran users may regard these variables as integer. So, firstly the user has to create this object by function mgl_create_*() and has to delete it after the using by function mgl_delete_*().
@@ -955,7 +1018,7 @@ The Fortran code have some peculiarities. Exactly it not allow one to send arbit
call mgl_create_graph_fltk(sample, 'MathGL examples');
call mgl_fltk_run();
end program TEST
-
+
integer function sample(gr)
integer*8 gr
call mgl_rotate(gr,60,40,0);
@@ -983,7 +1046,7 @@ class hfQtPlot(QtGui.QWidget):
QtGui.QWidget.__init__(self, parent)
self.img=(QtGui.QImage())
def setgraph(self,gr):
- self.buffer='\t'
+ self.buffer='\t'
self.buffer=self.buffer.expandtabs(4*gr.GetWidth()*gr.GetHeight())
gr.GetBGRN(self.buffer,len(self.buffer))
self.img=QtGui.QImage(self.buffer, gr.GetWidth(),gr.GetHeight(),QtGui.QImage.Format_ARGB32)
@@ -1041,24 +1104,24 @@ qw.raise_()
@node Hints, , MathGL and PyQt, Examples
@section Hints
-In this section I have included some small hints and advices for the improving of the quality of plots and for the demonstration of some non-trivial features of MathGL library. In contrast to previous examples I showed mostly the idea but not the whole drawing function. More examples with the source code can be find at @uref{http://mathgl.sf.net/} or in section @ref{Samples}.
+In this section I have included some small hints and advices for the improving of the quality of plots and for the demonstration of some non-trivial features of MathGL library. In contrast to previous examples I showed mostly the idea but not the whole drawing function.
@menu
-* ``Compound'' graphics::
-* Two axes in one plot::
-* Titles for the plot::
-* Changing of the color range::
+* ``Compound'' graphics::
+* Two axes in one plot::
+* Titles for the plot::
+* Changing of the color range::
* Management of a point cutting::
-* Vector field visualization::
-* Several light sources::
-* CutMin and CutMax features::
-* Mapping visualization::
-* Log-scaled plot::
-* ``Templates''::
-* Nonlinear fitting hints::
-* PDE solving hints::
-* MGL parser using::
-* Stereo image::
+* Vector field visualization::
+* Several light sources::
+* CutMin and CutMax features::
+* Mapping visualization::
+* Log-scaled plot::
+* ``Templates''::
+* Nonlinear fitting hints::
+* PDE solving hints::
+* MGL parser using::
+* Stereo image::
@end menu
@c ------------------------------------------------------------------
@@ -1271,7 +1334,7 @@ The solution of PDE is a bit more complicated. As previous you have to specify t
Next step is specifing the initial conditions at @samp{z}=@code{Min.z}. The function need 2 arrays for real and for imaginary part. Note, that coordinates x,y,z are supposed to be in specified range [Min, Max]. So, the data arrays should have corresponding scales. Finally, you may set the integration step and paramter k0=@math{k_0}. Also keep in mind, that internally the 2 times large box is used (for suppressing numerical reflection from boundaries) and the equation should well defined even in this extended range.
-Final comment is concerning the possible form of pseudo-differential operator @math{H}. At this moment, simplified form of operator @math{H} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this operator is effectively @math{H = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed for 3D case.
+Final comment is concerning the possible form of pseudo-differential operator @math{H}. At this moment, simplified form of operator @math{H} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this operator is effectively @math{H = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed for 3D case.
So, for example let solve the equation for beam deflected from linear layer and absorbed later. The operator will have the form @samp{"p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)"} that correspond to equation @math{ik_0 \partial_z u + \Delta u + x \cdot u + i (x+z)/2 \cdot u = 0}. This is typical equation for Electron Cyclotron (EC) absorption in magnetized plasmas. For initial conditions let me select the beam with plane phase front @math{exp(-48*(x+0.7)^2)}. The corresponding code looks like this (@pxref{PDE sample}):
@verbatim
@@ -1317,7 +1380,7 @@ So, some simple example at the end. Here I define a data array, create variable,
mglData &d = (parser->AddVar("dat"))->d;
d.Set(a,100); // set data to variable
parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis");
- // you may break script at any line do something
+ // you may break script at any line do something
// and continue after that
parser->Execute(gr, "xlabel 'x'\nylabel 'y'");
// also you may use cycles or conditions in script
@@ -1333,7 +1396,7 @@ The code in C/Fortran looks practically the same:
HMDT d = mgl_add_var(parser, "dat");
mgl_data_set_float(d,a,100,1,1); // set data to variable
mgl_parse_text(gr, parser, "plot dat; xrange 0 1\nbox\naxis");
- // you may break script at any line do something
+ // you may break script at any line do something
// and continue after that
mgl_parse_text(gr, parser, "xlabel 'x'\nylabel 'y'");
// also you may use cycles or conditions in script
@@ -1350,7 +1413,7 @@ One can easily create stereo image in MathGL. Stereo image can be produced by ma
gr->SubPlot(2,1,0); // left image
gr->Rotate(40,60+3);
// draw something here
-
+
gr->SubPlot(2,1,1); // right image
gr->Rotate(40,60-3);
// draw the same here
diff --git a/texinfo/overview_en.texi b/texinfo/overview_en.texi
index 369e4f5..d82cc45 100644
--- a/texinfo/overview_en.texi
+++ b/texinfo/overview_en.texi
@@ -17,7 +17,7 @@ a library with large and growing set of graphics.
@menu
* What is MathGL?::
* MathGL features::
-* Installation and usage::
+* Installation::
* Quick guide::
* Changes from v.1::
* Utilities::
@@ -31,7 +31,7 @@ A code for making high-quality scientific graphics under Linux and Windows. A c
At this version (@value{VERSION}) MathGL has more than 50 general types of graphics for 1d, 2d and 3d data arrays. It can export graphics to bitmap and vector (EPS or SVG) files. It has OpenGL interface and can be used from console programs. It has functions for data handling and script MGL language for simplification of data plotting. It also has several types of transparency and smoothed lighting, vector fonts and TeX-like symbol parsing, arbitrary curvilinear coordinate system and many other useful things (see pictures section at @uref{http://mathgl.sf.net/, homepage}). Finally it is platform-independent and free (under GPL v.2.0 or later license).
-@node MathGL features, Installation and usage, What is MathGL?, Overview
+@node MathGL features, Installation, What is MathGL?, Overview
@section MathGL features
MathGL can plot a wide range of graphics. It includes:
@@ -54,7 +54,7 @@ and so on. For details see @pxref{MathGL core}.
In fact, I created the functions for drawing of all the types of scientific plots that I know. The list of plots is growing; if you need some special type of a plot then please email me @email{mathgl.abalakin@@gmail.com, e-mail} and it will appear in the new version.
-I tried to make plots as nice looking as possible: e.g., a surface can be transparent and highlighted by several (up to 10) light sources. Most of the drawing functions have 2 variants: simple one for the fast plotting of data, complex one for specifying of the exact position of the plot (including parametric representation). Resulting image can be saved in bitmap PNG, JPEG, TGA, BMP format or in vector EPS, SVG or TeX format, or in IDTF format (with the help of mglGraphIDTF) which can be converted into U3D.
+I tried to make plots as nice looking as possible: e.g., a surface can be transparent and highlighted by several (up to 10) light sources. Most of the drawing functions have 2 variants: simple one for the fast plotting of data, complex one for specifying of the exact position of the plot (including parametric representation). Resulting image can be saved in bitmap PNG, JPEG, TGA, BMP format, or in vector EPS, SVG or TeX format, or in 3D formats OBJ, OFF, STL or X3D, or in IDTF format which can be converted into U3D.
All texts are drawn by vector fonts, which allows for high scalability and portability. Texts may contain commands for: some of the TeX-like symbols, changing index (upper or lower indexes) and the style of font inside the text string (@pxref{Font styles}). Texts of ticks are rotated with axis rotation. It is possible to create a legend of plot and put text in an arbitrary position on the plot. Arbitrary text encoding (by the help of function @code{setlocale()}) and UTF-16 encoding are supported.
@@ -62,8 +62,8 @@ Special class mglData is used for data encapsulation (@pxref{Data processing}).
There is fast evaluation of a textual mathematical expression (@pxref{Textual formulas}). It is based on string precompilation to tree-like code at the creation of class instance. At evaluation stage code performs only fast tree-walk and returns the value of the expression. In addition to changing data values, textual formulas are also used for drawing in @emph{arbitrary} curvilinear coordinates. A set of such curvilinear coordinates is limited only by user's imagination rather than a fixed list like: polar, parabolic, spherical, and so on.
-@node Installation and usage, Quick guide, MathGL features, Overview
-@section Installation and usage
+@node Installation, Quick guide, MathGL features, Overview
+@section Installation
MathGL can be installed in 4 different ways.
@enumerate
@@ -73,26 +73,68 @@ Compile from sources. The standard script for autoconf/automake tool is included
Script @code{./configure} have several additional options which are switched off by default. They are: @code{--enable-fltk, --enable-glut, --enable-qt} for ebabling FLTK, GLUT and/or Qt windows; @code{--enable-jpeg, --enable-gif, --enable-hdf5} for enabling corresponding file formats; @code{--enable-all} for enabling all additional features. For using @code{double} as base internal data type use option @code{--enable-double}. For enabling language interfaces use @code{--enable-python, --enable-octave} or @code{--enable-langall} for all languages. The full list of options can be viewed by command @code{./configure --help}.
@item
-One can use also CMake for building MathGL library if autoconf/automake tools are absent. For example, it is the typical situation for Windows, MacOS and/or using of non-GNU compilers. You can use WYSIWYG tools to change CMake build options.
+One can use also CMake for building MathGL library if autoconf/automake tools are absent. For example, it is the typical situation for Windows, MacOS and/or using of non-GNU compilers. You can use WYSIWYG tools to change CMake build options. Just specify the features you need and resolve all possible conflicts -- specify the paths for header files or libraries if they are not found automatically. After it run @code{make} and @code{make install} with root/sudo rights.
@item
-Use a precompiled binary. There are binaries for MinGW (platform Win32). For a precompiled variant one needs only to unpack the archive to the location of the compiler (or in any other folder and setup paths). By default, precompiled versions include the support of GSL (www.gsl.org) and PNG. So, one needs to have these libraries installed on system (it can be found, for example, at @uref{http://gnuwin32.sourceforge.net/packages.html})..
+Use a precompiled binary. There are binaries for MinGW (platform Win32). For a precompiled variant one needs only to unpack the archive to the location of the compiler (or in any other folder and setup paths). By default, precompiled versions include the support of GSL (www.gsl.org) and PNG. So, one needs to have these libraries installed on system (it can be found, for example, at @uref{http://gnuwin32.sourceforge.net/packages.html}).
@item
Install precompiled versions from standard packages (RPM, deb, DevPak and so on, see @uref{http://mathgl.sf.net/download.html, Download} section at homepage).
@end enumerate
-To compile your own program, you need to specify the linker option @code{-lmgl} for a compilation in the console program or with external (non-MathGL) window library. If you want to use FLTK or GLUT windows then you need to add the option @code{-lmgl-fltk} or @code{-lmgl-glut}. Fortran users also should add C++ library by the option @code{-lstdc++}.
-
@c ------------------------------------------------------------------
-@node Quick guide, Changes from v.1, Installation and usage, Overview
+@node Quick guide, Changes from v.1, Installation, Overview
@section Quick guide
+
+There are 3 steps to prepare the plot in MathGL: (1) prepare data to be plotted, (2) setup plot, (3) plot data. Let me show this on the example of surface plotting.
+
+First we need the data. MathGL use its own class @code{mglData} to handle data arrays (see @ref{Data processing}). This class give ability to handle data arrays by more or less format independent way. So, create it
+@verbatim
+ int main()
+ {
+ mglData dat(30,40); // data to for plotting
+ for(long i=0;i<30;i++) for(long j=0;j<40;j++)
+ dat.a[i+30*j] = 1/(1+(i-15)*(i-15)/225.+(j-20)*(j-20)/400.);
+@end verbatim
+Here I create matrix 30*40 and initialize it by formula. Note, that I use @code{long} type for indexes @var{i}, @var{j} because data arrays can be really large and @code{long} type will automatically provide proper indexing.
+
+Next step is setup of the plot. The only setup I need is axis rotation and lighting.
+@verbatim
+ mglGraph gr; // class for plot drawing
+ gr.Rotate(50,60); // rotate axis
+ gr.Light(true); // enable lighting
+@end verbatim
+
+Everything is ready. And surface can be plotted.
+@verbatim
+ gr.Surf(dat); // plot surface
+@end verbatim
+Basically plot is done. But I decide to add yellow (@samp{y} color, see @ref{Color styles}) contour lines on the surface. To do it I can just add:
+@verbatim
+ gr.Cont(dat,"y"); // plot yellow contour lines
+@end verbatim
+This demonstrate one of base MathGL concept (see, @ref{General concepts}) -- ``new drawing never clears things drawn already''. So, you can just consequently call different plotting functions to obtain ``combined'' plot. For example, if one need to draw axis then he can just call one more plotting function
+@verbatim
+ gr.Axis(); // draw axis
+@end verbatim
+
+Now picture is ready and we can save it in a file.
+@verbatim
+ gr.WriteFrame("sample.png"); // save it
+ }
+@end verbatim
+
+To compile your program, you need to specify the linker option @code{-lmgl}.
+
+This is enough for a compilation of console program or with external (non-MathGL) window library. If you want to use FLTK or Qt windows provided by MathGL then you need to add the option @code{-lmgl-wnd}. Fortran users also should add C++ library by the option @code{-lstdc++}.
+
@c ------------------------------------------------------------------
@node Changes from v.1, Utilities, Quick guide, Overview
@section Changes from v.1.*
-
+* mglGraph class is single plotter class instead of mglGraphZB, mglGraphPS and so on.
+* Text style and text color positions are swapped. I.e. text style @samp{r:C} give red centered text, but not roman dark cyan text as for v.1.*.
@c ------------------------------------------------------------------
diff --git a/texinfo/parse_en.texi b/texinfo/parse_en.texi
index c9e53a0..742ca91 100644
--- a/texinfo/parse_en.texi
+++ b/texinfo/parse_en.texi
@@ -2,12 +2,163 @@
@c ------------------------------------------------------------------
@chapter MGL scripts
+MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mglconv, mglview programs and others, @pxref{Utilities}) or in the frame of the library using.
+
@menu
+* MGL definition::
+* Program flow commands::
* mglParse class::
@end menu
+
+@c ------------------------------------------------------------------
+@node MGL definition, Program flow commands, , MGL scripts
+@section MGL definition
+
+MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is sufficient, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets.
+
+If string contain references to external parameters (substrings @samp{$0}, @samp{$1} ... @samp{$9}) or definitions (substrings @samp{$a}, @samp{$b} ... @samp{$z}) then before execution the values of parameter/definition will be substituted instead of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on).
+
+Argument can be a string, a variable name or a number.
+@itemize @bullet
+@item
+The string is any symbols between ordinary marks @samp{'}.
+
+@item
+Usually variable have a name which is arbitrary combination of symbols (except spaces and @samp{'}) started from a letter and with length less than 64. A temporary array can be used as variable:
+@itemize @bullet
+@item
+sub-arrays (like in @ref{subdata} command) as command argument. For example, @code{a(1)} or @code{a(1,:)} or @code{a(1,:,:)} is second row, @code{a(:,2)} or @code{a(:,2,:)} is third column, @code{a(:,:,0)} is first slice and so on. Also you can extract a part of array from m-th to n-th element by code @code{a(m:n,:,:)} or just @code{a(m:n)}.
+
+@item
+any column combinations defined by formulas, like @code{a('n*w^2/exp(t)')} if names for data columns was specified (by @ref{idset} command or in the file at string started with @code{##}).
+
+@item
+any expression (without spaces) of existed variables produce temporary variable. For example, @samp{sqrt(dat(:,5)+1)} will produce temporary variable with data values equal to @code{tmp[i,j] = sqrt(dat[i,5,j]+1)}.
+
+@item
+temporary variable of higher dimensions by help of []. For example, @samp{[1,2,3]} will produce a temporary vector of 3 elements @{1, 2, 3@}; @samp{[[11,12],[21,22]]} will produce matrix 2*2 and so on. Here you can join even an arrays of the same dimensions by construction like @samp{[v1,v2,...,vn]}.
+
+@item
+result of code for making new data (@pxref{Make another data}) inside @{@}. For example, @samp{@{sum dat 'x'@}} produce temporary variable which contain result of summation of @var{dat} along direction 'x'. This is the same array @var{tmp} as produced by command @samp{sum tmp dat 'x'}. You can use nested constructions, like @samp{@{sum @{max dat 'z'@} 'x'@}}.
+@end itemize
+Temporary variables can not be used as 1st argument for commands which create (return) the data (like @samp{new}, @samp{read}, @samp{hist} and so on).
+
+@item
+Special names @code{nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1} are treated as number if they were not redefined by user. Variables with suffixes are treated as numbers (@pxref{Data information}). Names defined by @ref{define} command are treated as number. Also results of formulas with sizes 1x1x1 are treated as number (for example, @samp{pi/dat.nx}).
+@end itemize
+Before the first using all variables must be defined with the help of commands, like, @ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} and so on (see sections @ref{Data constructor}, @ref{Data filling} and @ref{Make another data}).
+
+Command may have several set of possible arguments (for example, @code{plot ydat} and @code{plot xdat ydat}). All command arguments for a selected set must be specified. However, some arguments can have default values. These argument are printed in [], like @code{plot ydat ['stl'='' zval=nan]}. At this, the record @code{[arg1 arg2 arg3 ...]} means @code{[arg1 [arg2 [arg3 ...]]]}, i.e. you can omit only tailing arguments if you agree with its default values. For example, @code{plot ydat '' 1} or @code{plot ydat ''} is correct, but @code{plot ydat 1} is incorrect (argument @code{'stl'} is missed).
+
+
+@c ------------------------------------------------------------------
+@node Program flow commands, MGL definition, MGL scripts
+@section Program flow commands
+
+Below I show commands to control program flow, like, conditions, cycles, define script arguments and so on. Other commands can be found in chapters @ref{MathGL core} and @ref{Data processing}.
+
+@cindex chdir
+@anchor{chdir}
+@deftypefn {MGL command} {} chdir 'path'
+Changes the current directory to @var{path}.
+@end deftypefn
+
+@cindex define
+@anchor{define}
+@deftypefn {MGL command} {} define $N smth
+Sets @var{N}-th script argument to @var{smth}. Note, that @var{smth} is used as is (with @samp{'} symbols if present). Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+@deftypefn {MGL command} {} define name smth
+Create scalar variable @code{name} which have the numeric value of @code{smth}. Later you can use this variable as usual number. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+@cindex defchr
+@anchor{defchr}
+@deftypefn {MGL command} {} defchr $N smth
+Sets @var{N}-th script argument to character with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+@cindex defnum
+@anchor{defnum}
+@deftypefn {MGL command} {} defnum $N smth
+Sets @var{N}-th script argument to number with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+@cindex defpal
+@anchor{defpal}
+@deftypefn {MGL command} {} defpal $N smth
+Sets @var{N}-th script argument to palette character at position evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+
+@cindex call
+@anchor{call}
+@deftypefn {MGL command} {} call 'fname' [ARG1 ARG2 ... ARG9]
+Executes function @var{fname} (or script if function is not found). Optional arguments will be passed to functions. See also @ref{func}.
+@end deftypefn
+@cindex func
+@anchor{func}
+@deftypefn {MGL command} {} func 'fname' [narg=0]
+Define the function @var{fname} and number of required arguments. The arguments will be placed in script parameters $1, $2, ... $9. Note, you should stop script execution before function definition(s) by command @ref{stop}. See also @ref{return}.
+@end deftypefn
+@cindex return
+@anchor{return}
+@deftypefn {MGL command} {} return
+Return from the function. See also @ref{func}.
+@end deftypefn
+
+
+@cindex if
+@anchor{if}
+@deftypefn {MGL command} {} if dat 'cond'
+Starts block which will be executed if @var{dat} satisfy to @var{cond}.
+@end deftypefn
+@deftypefn {MGL command} {} if @code{val}
+Starts block which will be executed if @code{val} is nonzero.
+@end deftypefn
+@cindex elseif
+@anchor{elseif}
+@deftypefn {MGL command} {} elseif dat 'cond'
+Starts block which will be executed if previous @code{if} or @code{elseif} is false and @var{dat} satisfy to @var{cond}.
+@end deftypefn
+@deftypefn {MGL command} {} elseif @code{val}
+Starts block which will be executed if previous @code{if} or @code{elseif} is false and @code{val} is nonzero.
+@end deftypefn
+@cindex else
+@anchor{else}
+@deftypefn {MGL command} {} else
+Starts block which will be executed if previous @code{if} or @code{elseif} is false.
+@end deftypefn
+@cindex endif
+@anchor{endif}
+@deftypefn {MGL command} {} endif
+Finishes @code{if/elseif/else} block.
+@end deftypefn
+
+@cindex for
+@anchor{for}
+@deftypefn {MGL command} {} for $N @code{v1 v2 [dv=1]}
+Starts cycle with $@var{N}-th argument changing from @var{v1} to @var{v2} with the step @var{dv}. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+@deftypefn {MGL command} {} for $N dat
+Starts cycle with $@var{N}-th argument changing for @var{dat} values. Here @var{N} is digit (0...9) or alpha (a...z).
+@end deftypefn
+@cindex next
+@anchor{next}
+@deftypefn {MGL command} {} next
+Finishes @code{for} cycle.
+@end deftypefn
+
+@cindex once
+@anchor{once}
+@deftypefn {MGL command} {} once @code{val}
+The code between @code{once on} and @code{once off} will be executed only once. Useful for large data manipulation in programs like UDAV.
+@end deftypefn
+@cindex stop
+@anchor{stop}
+@deftypefn {MGL command} {} stop
+Terminate execution.
+@end deftypefn
+
@c ------------------------------------------------------------------
-@node mglParse class, , , MGL scripts
+@node mglParse class, , Program flow commands, MGL scripts
@section mglParse class
@cindex mglParse
diff --git a/todo.txt b/todo.txt
index 7b547c4..738413f 100644
--- a/todo.txt
+++ b/todo.txt
@@ -4,7 +4,7 @@
2. test pthread for windows
3. Check export to MGLD/TeX/OBJ/XGL/X3D/STL.
4. add XInitThreads() from #include into all GUI
-5, Fl::lock() for Update()?!? + similar for Qt
+5. Check MGLD in mglview
============= NEW =============
@@ -93,7 +93,6 @@ Remove other setting if data name is changed.
6. Add help about cmake and GIF/JPEG to the "Installation and using"
7. On which things the subplot influence
8. About unrotated text
-9. Add "Howto" section
10. New samples + update old ones
11. Parallelization:
* user level -- SetDrawReg(), PutDrawReg() -- remove!?!
@@ -101,28 +100,21 @@ Remove other setting if data name is changed.
* MathGL level -- pthread in mglData, ???
12. Boxs() styles: '#' for wire, '@' for full box.
13. mglData::SetVal(), GetVal()
-14. Highlight(), changes in Execute() -- highlighting
-15. Add mgl_label_xyz(), mgl_label_xy(), mgl_label_y(). Possible numbers are: "%x" for x-coor, "%y" for y-coor, "%z" for z-coor.
-16. Check mglData::Insert(): now copy values from original array (x[i] -> x[2*i], x[2*i+1], ...)
-17. Symbol '!' denote sharp colors even in 1d plots (like different colors for points)
-18. Check Zoom() + in widgets (ToggleZoom(),...)
-19. ExportMGLD(), ImportMGLD() points+primitives to *.mgld file.
-20. Box() draw faces if '@' is specified
-21. Check export to LaTeX.
-22. Add DifLight() for diffusive light (for local sources only) + option "diffuse on|off" + local version of Light()/'light'. Default is diffuse light for local sources
-23. mglview can preview MGLD files too -- check it
-24. Handle mglBase::Stop everywhere
-25. Number of frames can be changed at reload + manual call of draw_func if number of frames is 0.
-26. Symbol '\' at the end continue string in MGL script
-27. Add mgl_data_sort(HMDT dat, long idx); -- sort rows of x-y table (or slices of 3D data) by value of idx-column (and idy-row for nz>1). Not thread safe!!!
-28. Add mgl_tape_*(), Tape() -- draw tapes which rotate as (bi)normale of curve. Width by value or depend on BarWidth
-29. Flow() and FlowP() draw tape of (bi)normales if character 'x' and/or 'z' is specified.
-30. Add MGL command "ask $N 'question'" -- like interactive "define". User (UDAV) must set mgl_ask_func to some non-zero value
-31. Cones() -- like Bars() but by Cone(). Support 'a' for above.
-32. Add Class diagram for MathGL core
-33. Add GridPlot -- Like ColumnPlot but grid
-34. Copy text about formats of SetTickTime from "man localtime" + comment about default values. Allow d=0 -- automatic step selection.
-35. Add mglBase, mglCanvas in other_en.texi + small comments about developing new plots.
+14. Add mgl_label_xyz(), mgl_label_xy(), mgl_label_y(). Possible numbers are: "%x" for x-coor, "%y" for y-coor, "%z" for z-coor.
+15. Check mglData::Insert(): now copy values from original array (x[i] -> x[2*i], x[2*i+1], ...)
+16. Symbol '!' denote sharp colors even in 1d plots (like different colors for points)
+17. Check export to LaTeX.
+18. mglview can preview MGLD files too -- check it
+19. Handle mglBase::Stop everywhere
+20. Number of frames can be changed at reload + manual call of draw_func if number of frames is 0.
+21. Symbol '\' at the end continue string in MGL script
+22. Add mgl_data_sort(HMDT dat, long idx); -- sort rows of x-y table (or slices of 3D data) by value of idx-column (and idy-row for nz>1). Not thread safe!!!
+23. Add mgl_tape_*(), Tape() -- draw tapes which rotate as (bi)normale of curve. Width by value or depend on BarWidth
+24. Flow() and FlowP() draw tape of (bi)normales if character 'x' and/or 'z' is specified.
+25. Add MGL command "ask $N 'question'" -- like interactive "define". User (UDAV) must set mgl_ask_func to some non-zero value
+26. Cones() -- like Bars() but by Cone(). Support 'a' for above.
+27. Add Class diagram for MathGL core
+28. Add mglBase, mglCanvas in other_en.texi + small comments about developing new plots.
============= BUGS =============
@@ -130,10 +122,10 @@ Remove other setting if data name is changed.
========= Docs structure =======
- 1. Overview
- 1.1 What is MathGL?
- 1.2 Installation and usage
- 1.3 Quick start
++ 1. Overview
++ 1.1 What is MathGL?
++ 1.2 Installation
++ 1.3 Quick start
1.4 Changes from v.1.*
1.5 Utilities
1.6 Thanks
@@ -147,66 +139,69 @@ Remove other setting if data name is changed.
2.6 2D data plotting
2.7 3D data plotting
2.8 Dual data plotting
- 2.9 Multi-threading
- 2.10 Hints
- 2.11 FAQ
-
- 3 General concepts (class-diagram)
- 3.1 Coordinate axes
- 3.2 Line styles
- 3.3 Color scheme
- 3.4 Font styles
- 3.5 Textual formulas
- 3.6 Command options
- 3.7 Interfaces (c++/python; c/fortran; mgl)
-
- 3. MathGL core
- 3.1 Create and delete objects
- 3.2 Graphics setup
- 3.3 Axis settings
- 3.4 Transformation matrix
- 3.5 Export picture
- 3.6 Primitives drawing
- 3.7 Text printing
- 3.8 Axis and Colorbar
- 3.9 Legend
- 3.10 1D plotting
- 3.11 2D plotting
- 3.12 3D plotting
- 3.13 Dual plotting
- 3.14 Vector fields
- 3.15 Other plotting
- 3.16 Nonlinear fitting
- 3.17 Data manipulation
-
- 4. Widget classes
- 4.1 mglWindow class
- 4.2 Fl_MathGL class
- 4.3 QMathGL class
-
- 5. Data processing
- 5.1 Public variables
- 5.2 Data constructor
- 5.3 Data resizing
- 5.4 Data filling
- 5.5 File I/O
- 5.6 Make another data
- 5.7 Data changing
- 5.8 Interpolation
- 5.9 Data information
- 5.10 Operators
- 5.11 Global functions
-
- 6 MGL scripts
- 6.1 MGL definition
- 6.2 mglParse class
- 6.3 Program flow commands
-
- 7. Other classes (c++ only)
- 7.1 mglBase class
- 7.2 mglDataA class
- 7.3 mglCanvas class
- 7.4 mglFormula class
- 7.5 mglColor class
- 7.6 mglPoint class
- 7.7 mglFont class (format)
+ 2.9 More samples
+ 2.10 Multi-threading
+ 2.11 Hints
+ 2.12 FAQ
+
++ 3. General concepts (class-diagram)
++ 3.1 Coordinate axes
++ 3.2 Color styles
++ 3.3 Line styles
++ 3.4 Color scheme
++ 3.5 Font styles
++ 3.6 Textual formulas
++ 3.7 Command options
++ 3.8 Interfaces (c++/python; c/fortran; mgl)
+
++ 4. MathGL core
++ 4.1 Create and delete objects
++ 4.2 Graphics setup
++ 4.3 Axis settings
++ 4.4 Transformation matrix
++ 4.5 Export picture
++ 4.6 Primitives drawing
++ 4.7 Text printing
++ 4.8 Axis and Colorbar
+ 4.9 Legend
+ 4.10 1D plotting
+ 4.11 2D plotting
+ 4.12 3D plotting
+ 4.13 Dual plotting
+ 4.14 Vector fields
+ 4.15 Other plotting
+ 4.16 Nonlinear fitting
+ 4.17 Data manipulation
+? 4.18 IDTF
+
+ 5. Widget classes
+ 5.1 mglWindow class
+ 5.2 Fl_MathGL class
+ 5.3 QMathGL class
+
+ 6. Data processing
+ 6.1 Public variables
+ 6.2 Data constructor
+ 6.3 Data resizing
+ 6.4 Data filling
+ 6.5 File I/O
+ 6.6 Make another data
+ 6.7 Data changing
+ 6.8 Interpolation
+ 6.9 Data information
+ 6.10 Operators
+ 6.11 Global functions
+
+ 7. MGL scripts
+ 7.1 MGL definition
+ 7.2 Program flow commands
+ 7.3 mglParse class
+
+ 8. Other classes (c++ only)
+ 8.1 mglBase class
+ 8.2 mglDataA class
+ 8.3 mglCanvas class
+ 8.4 mglFormula class
+ 8.5 mglColor class
+ 8.6 mglPoint class
+ 8.7 mglFont class (format)
diff --git a/widgets/CMakeLists.txt b/widgets/CMakeLists.txt
index 58d814c..27c1677 100644
--- a/widgets/CMakeLists.txt
+++ b/widgets/CMakeLists.txt
@@ -20,8 +20,8 @@ endif(use_fltk)
if(use_glut)
add_definitions(-DHAVE_GLUT)
include_directories(${GLUT_INCLUDE_DIR})
- set(mgl_glut_src glut.cpp)
- set(mgl_glut_hdr ../include/mgl/glut.h)
+ set(mgl_glut_src glut.cpp window.cpp)
+ set(mgl_glut_hdr ../include/mgl/glut.h ../include/mgl/window.h)
add_library(mgl-glut SHARED ${mgl_glut_src} ${mgl_glut_hdr})
add_library(mgl-glut-static STATIC ${mgl_glut_src} ${mgl_glut_hdr})
diff --git a/widgets/fltk.cpp b/widgets/fltk.cpp
index 462a6db..e36f6e9 100644
--- a/widgets/fltk.cpp
+++ b/widgets/fltk.cpp
@@ -652,7 +652,7 @@ HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, voi
g->Window(0,0,draw,title,par);
return g;
}
-void mgl_fltk_run() { Fl::run(); }
+int mgl_fltk_run() { return Fl::run(); }
//-----------------------------------------------------------------------------
uintptr_t mgl_create_graph_fltk_(const char *title, int l)
{
@@ -660,7 +660,7 @@ uintptr_t mgl_create_graph_fltk_(const char *title, int l)
uintptr_t t = uintptr_t(mgl_create_graph_fltk(0,s,0));
delete []s; return t;
}
-void mgl_fltk_run_() { mgl_fltk_run(); }
+int mgl_fltk_run_() { return mgl_fltk_run(); }
//-----------------------------------------------------------------------------
void *mgl_fl_tmp(void *) { Fl::run(); return 0; }
/*void mgl_fltk_thread()
diff --git a/widgets/qt.cpp b/widgets/qt.cpp
index 9fc5d02..0053cac 100644
--- a/widgets/qt.cpp
+++ b/widgets/qt.cpp
@@ -802,7 +802,7 @@ HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void
g->Window(0,0,draw,title,par);
return g;
}
-void mgl_qt_run() { if(qApp) qApp->exec(); }
+int mgl_qt_run() { return (qApp)?qApp->exec():-1; }
//-----------------------------------------------------------------------------
uintptr_t mgl_create_graph_qt_(const char *title, int l)
{
@@ -810,7 +810,7 @@ uintptr_t mgl_create_graph_qt_(const char *title, int l)
uintptr_t t = uintptr_t(mgl_create_graph_qt(0,s,0));
delete []s; return t;
}
-void mgl_qt_run_() { mgl_qt_run(); }
+int mgl_qt_run_() { return mgl_qt_run(); }
//-----------------------------------------------------------------------------
void *mgl_qt_tmp(void *) { mgl_qt_run(); return 0; }
/*void mgl_qt_thread()
diff --git a/widgets/window.cpp b/widgets/window.cpp
index 83192ce..7b0a465 100644
--- a/widgets/window.cpp
+++ b/widgets/window.cpp
@@ -180,3 +180,28 @@ uintptr_t mgl_create_graph_qt_(const char *title, int l)
void mgl_qt_run_() { mgl_qt_run(); }
#endif
//-----------------------------------------------------------------------------
+int mgl_draw_class(mglBase *gr, void *p)
+{ mglGraph g(gr); return p ? ((mglDraw *)p)->Draw(&g) : 0; }
+void mgl_reload_class(void *p)
+{ if(p) ((mglDraw *)p)->Reload(); }
+//-----------------------------------------------------------------------------
+int mgl_draw_graph(mglBase *gr, void *p)
+{
+ mglGraph g(gr);
+ draw_func func = (draw_func)(p);
+ return func ? func(&g) : 0;
+}
+//-----------------------------------------------------------------------------
+void *mgl_draw_calc(void *p)
+{ ((mglDraw *)p)->Calc(); }
+//-----------------------------------------------------------------------------
+void mgl_draw_thr(void *p)
+{
+#ifdef HAVE_PTHREAD
+ mglDraw *d = (mglDraw *)p;
+ if(!d || d->running) return;
+ pthread_create(&(d->thr),0,mgl_draw_calc,d);
+ pthread_detach(d->thr);
+#endif
+}
+//-----------------------------------------------------------------------------