There are few end-user classes: mglGraph
(see Ядро MathGL), mglWindow
and mglGLUT
(see “Оконные” классы), mglData
(see Обработка данных), mglParse
(see Скрипты MGL). Exactly these classes I recommend to use in most of user programs. All methods in all of these classes are inline and have exact C/Fortran analogue functions. This give compiler independent binary libraries for MathGL.
However, sometimes you may need to extend MathGL by writing yours own plotting functions or handling yours own data structures. In these cases you may need to use low-level API. This chapter describes it.
The internal structure of MathGL is rather complicated. There are C++ classes mglBase
, mglCanvas
, ... for drawing primitives and positioning the plot (blue ones in the figure). There is a layer of C functions, which include interface for most important methods of these classes. Also most of plotting functions are implemented as C functions. After it, there are “inline” front-end classes which are created for user convenience (yellow ones in the figure). Also there are widgets for FLTK, Qt and other libraries (green ones in the figure).
Below I show how this internal classes can be used.