/***************************************************************************
* mgl.h is part of Math Graphic Library
* Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _MGL_H_
#define _MGL_H_
#include "mgl2/mgl_cf.h"
#ifdef __cplusplus
#include "mgl2/data.h"
#include "mgl2/datac.h"
#include <sys/stat.h>
//-----------------------------------------------------------------------------
/// Wrapper class for all graphics
class MGL_EXPORT mglGraph
{
mglGraph(const mglGraph &) {} // copying is not allowed
const mglGraph &operator=(const mglGraph &t) { return t; }
protected:
HMGL gr;
public:
HMPR pr; ///< Pointer to associated MGL parser
mglGraph(int kind=0, int width=600, int height=400)
{ pr = NULL;
if(kind==-1) gr=NULL;
#if MGL_HAVE_OPENGL
else if(kind==1) gr=mgl_create_graph_gl();
#else
else if(kind==1)
{ gr=mgl_create_graph(width, height);
SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL."); }
#endif
else gr=mgl_create_graph(width, height);
}
mglGraph(HMGL graph)
{ pr = NULL; gr = graph; mgl_use_graph(gr,1); }
virtual ~mglGraph()
{ if(mgl_use_graph(gr,-1)<1) mgl_delete_graph(gr); }
/// Get pointer to internal HMGL object
inline HMGL Self() { return gr; }
/// Set default parameters for plotting
inline void DefaultPlotParam() { mgl_set_def_param(gr); }
/// Set name of plot for saving filename
inline void SetPlotId(const char *id) { mgl_set_plotid(gr,id); }
/// Get name of plot for saving filename
inline const char *GetPlotId() { return mgl_get_plotid(gr); }
/// Ask to stop drawing
inline void Stop(bool stop=true) { mgl_ask_stop(gr, stop); }
/// Check if plot termination is asked
inline bool NeedStop() { return mgl_need_stop(gr); }
/// Set callback function for event processing
inline void SetEventFunc(void (*func)(void *), void *par=NULL)
{ mgl_set_event_func(gr, func, par); }
/// Set the transparency on/off.
inline void Alpha(bool enable) { mgl_set_alpha(gr, enable); }
/// Set the gray-scale mode on/off.
inline void Gray(bool enable) { mgl_set_gray(gr, enable); }
/// Set default value of alpha-channel
inline void SetAlphaDef(double alpha) { mgl_set_alpha_default(gr, alpha); }
/// Set the transparency type (0 - usual, 1 - glass, 2 - lamp)
inline void SetTranspType(int type) { mgl_set_transp_type(gr, type); }
/// Set the size of semi-transparent area around lines, marks, glyphs, ... Default is 1.
inline void SetPenDelta(double d) { mgl_pen_delta(gr,d); }
/// Set the using of light on/off.
inline void Light(bool enable) { mgl_set_light(gr, enable); }
/// Switch on/off the specified light source.
inline void Light(int n,bool enable) { mgl_set_light_n(gr, n, enable); }
/// Use diffusive light (only for local light sources) -- OBSOLETE
inline void SetDifLight(bool dif) { mgl_set_light_dif(gr, dif); }
/// Set to attach light settings to inplot.
inline void AttachLight(bool enable) { mgl_set_attach_light(gr, enable); }
/// Add a light source.
inline void AddLight(int n, mglPoint p, char col='w', double bright=0.5, double ap=0)
{ mgl_add_light_ext(gr, n, p.x, p.y, p.z, col, bright, ap); }
inline void AddLight(int n, mglPoint r, mglPoint p, char col='w', double bright=0.5, double ap=0)
{ mgl_add_light_loc(gr, n, r.x, r.y, r.z, p.x, p.y, p.z, col, bright, ap); }
/// Set ambient light brightness
inline void SetAmbient(double i) { mgl_set_ambbr(gr, i); }
/// Set diffusive light brightness
inline void SetDiffuse(double i) { mgl_set_difbr(gr, i); }
/// Set the fog distance or switch it off (if d=0).
inline void Fog(double d, double dz=0.25) { mgl_set_fog(gr, d, dz); }
/// Set relative width of rectangles in Bars, Barh, BoxPlot, Candle, OHLC (default is 0.7)
inline void SetBarWidth(double width) { mgl_set_bar_width(gr, width); }
/// Set default size of marks (locally you can use "size" option)
inline void SetMarkSize(double size) { mgl_set_mark_size(gr, size); }
/// Set default size of arrows (locally you can use "size" option)
inline void SetArrowSize(double size) { mgl_set_arrow_size(gr, size); }
/// Set number of mesh lines (use 0 to draw all of them)
inline void SetMeshNum(int num) { mgl_set_meshnum(gr, num); }
/// Set number of visible faces (use 0 to draw all of them)
inline void SetFaceNum(int num) { mgl_set_facenum(gr, num); }
/// Set cutting for points outside of bounding box
inline void SetCut(bool cut) { mgl_set_cut(gr, cut); }
/// Set additional cutting box
inline void SetCutBox(mglPoint p1, mglPoint p2)
{ mgl_set_cut_box(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z); }
/// Set the cutting off condition (formula)
inline void CutOff(const char *EqC) { mgl_set_cutoff(gr, EqC); }
/// Set default font size
inline void SetFontSize(double size) { mgl_set_font_size(gr, size); }
/// Set default font style and color
inline void SetFontDef(const char *fnt) { mgl_set_font_def(gr, fnt); }
/// Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72)
virtual void SetFontSizePT(double pt, int dpi=72) { SetFontSize(pt*27.f/dpi); }
/// Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt)
inline void SetFontSizeCM(double cm, int dpi=72) { SetFontSizePT(cm*28.45f,dpi); }
/// Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt)
inline void SetFontSizeIN(double in, int dpi=72) { SetFontSizePT(in*72.27f,dpi); }
/// Load font from file
inline void LoadFont(const char *name, const char *path=NULL)
{ mgl_load_font(gr, name, path); }
/// Copy font from another mglGraph instance
inline void CopyFont(const mglGraph *GR) { mgl_copy_font(gr, GR->gr);}
/// Restore font (load default font for new HMGL objects)
inline void RestoreFont() { mgl_restore_font(gr); }
/// Set to use or not text rotation
inline void SetRotatedText(bool enable) { mgl_set_rotated_text(gr, enable); }
/// Set to scale text in relative subplots too
inline void SetScaleText(bool enable) { mgl_set_scale_text(gr, enable); }
/// Set default font for all new HMGL and mglGraph objects
static inline void SetDefFont(const char *name, const char *path=NULL) { mgl_def_font(name,path); }
/// Add user-defined glyph for symbol and set its optional id
inline void DefineSymbol(char id, const mglDataA &x, const mglDataA &y)
{ mgl_define_symbol(gr, id, &x, &y); }
/// Set default palette
inline void SetPalette(const char *colors) { mgl_set_palette(gr, colors); }
/// Set default color scheme
inline void SetDefScheme(const char *sch) { mgl_set_def_sch(gr, sch); }
/// Sets RGB values for color with given i
没有合适的资源?快使用搜索试试~ 我知道了~
mathgl2.4.4+qt5 mathgl.zip可以直接使用
共62个文件
h:43个
lib:8个
fs:5个
需积分: 34 12 下载量 120 浏览量
2021-12-21
08:31:54
上传
评论
收藏 33.14MB ZIP 举报
温馨提示
mathgl2.4.4+qt5 debugx64 releasex64 lib包
资源详情
资源评论
资源推荐
收起资源包目录
mathgl.zip (62个子文件)
1640046089(1).jpg 9KB
include
mgl2
config.h 1KB
qt.h 3KB
canvas_wnd.h 5KB
qmathgl.h 12KB
plot.h 20KB
data.h 53KB
surf.h 13KB
data_cf.h 36KB
mgl.h 147KB
mgl_pas.pas 122KB
base.h 37KB
base_cf.h 13KB
Fl_MathGL.h 11KB
abstract.h 22KB
other.h 15KB
eval.h 4KB
canvas_cf.h 39KB
window.h 3KB
dllexport.h 896B
type.h 13KB
volume.h 11KB
mpi.h 3KB
fit.h 7KB
wx.h 6KB
datac.h 33KB
wnd_cf.h 5KB
thread.h 4KB
vectors.fs 5KB
define.h 16KB
evalc.h 3KB
vect.h 20KB
gsl.fs 49KB
build.h 105B
parser.h 10KB
glut.h 4KB
mathgl.fs 47KB
fltk.h 4KB
canvas.h 27KB
addon.h 4KB
datac_cf.h 24KB
opengl.h 3KB
wnd.h 8KB
mglplot.fs 16KB
font.h 8KB
pde.h 8KB
mgl.fs 38KB
prim.h 21KB
mgl_cf.h 3KB
cont.h 19KB
1640046122(1).png 8KB
lib
Releasex64
mgl-static.lib 37.75MB
zlibstatic.lib 171KB
mgl-qt5-static.lib 1.78MB
libpng16_static.lib 618KB
Debugx64
mgl-qt5-static.pdb 2.62MB
zlibstaticd.lib 277KB
mgl-static.lib 151.21MB
libpng16_staticd.lib 991KB
mgl-static.pdb 5.21MB
mgl-qt5-static.lib 4.91MB
1640046144(1).png 6KB
共 62 条
- 1
小黎GH
- 粉丝: 17
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0