|
Basilisk CFD
Adaptive Cartesian mesh PDE framework
|
#include <gl/framebuffer.h>#include <gl/trackball.h>#include <gl/utils.h>#include "utils.h"#include "input.h"#include "vertexbuffer.h"#include "draw.h"#include "parse.h"#include "draw_get.h"Go to the source code of this file.
Data Structures | |
| struct | cexpr |
| struct | _bview |
Typedefs | |
| typedef void(* | MapFunc) (coord *) |
| typedef struct _bview | bview |
| typedef void * | pointer |
Functions | |
| static scalar | get_cexpr (cexpr *cache, const char *expr) |
| static cexpr * | add_cexpr (cexpr *cache, int maxlen, const char *expr, scalar s) |
| static void | free_cexpr (cexpr *cache) |
| bview * | bview_new () |
| The allocator method. | |
| void | bview_destroy (bview *p) |
| The destructor method. | |
| static void | destroy_view () |
| The current view needs to be destroyed when we exit Basilisk. | |
| bview * | get_view () |
| static void | redraw (bool clear=true) |
| The main drawing function. | |
| bview * | draw () |
| This is called by graphics primitives before drawing. | |
| static trace pointer | compose_image (bview *view) |
| bool | load (FILE *fp=NULL, char *file=NULL, Array *buf=NULL) |
| static void | bview_draw (bview *view) |
| trace bool | save (char *file=NULL, char *format="ppm", char *opt=NULL, FILE *fp=NULL, float lw=0, int sort=0, int options=0, FILE *checksum=NULL, bview *view=NULL) |
| static char * | remove_blanks (char *line) |
| bool | process_line (char *line) |
Variables | |
| static bview * | _view = NULL |
| For the moment there is a single (static) current view. | |
compose_image() returns an image buffer made by composition of the framebuffer images on each of the MPI processes.
The destructor method.
Definition at line 214 of file view.h.
References free(), free_cexpr(), p, and x.
Referenced by destroy_view().
| bview * bview_new | ( | ) |
The allocator method.
Definition at line 176 of file view.h.
References enable_fpe(), p, qcalloc, and x.
Referenced by get_view().
The current view needs to be destroyed when we exit Basilisk.
This is done by adding this callback to the free_solver() lists of destructors.
Definition at line 232 of file view.h.
References _view, assert, and bview_destroy().
Referenced by get_view().
| bview * draw | ( | ) |
This is called by graphics primitives before drawing.
Definition at line 302 of file view.h.
References get_view(), GL_PROJECTION, glMatrixMode, glTranslatef, redraw(), view(), and x.
Referenced by clear(), and translate().
Definition at line 122 of file view.h.
Referenced by bview_destroy(), and process_line().
Definition at line 78 of file view.h.
Referenced by compile_expression().
| bview * get_view | ( | ) |
Definition at line 238 of file view.h.
References _view, bview_new(), destroy_view(), and free_solver_func_add().
Referenced by clear(), compile_expression(), draw(), process_line(), redraw(), save(), and vertex_buffer_glBegin().
Drawing user functions are defined in [draw.h]().
The commands are calls of user functions. They can be read from a file defined by fp or file, or from the memory buffer buf.
Besides the load(), save() and drawing functions defined in [draw.h](), valid drawing commands also include:
Definition at line 719 of file view.h.
References buf, file, fp, i, line, process_line(), s, and x.
Referenced by gladLoadGLLoader(), load_GL_VERSION_1_0(), load_GL_VERSION_1_1(), load_GL_VERSION_1_2(), load_GL_VERSION_1_3(), load_GL_VERSION_1_4(), load_GL_VERSION_1_5(), load_GL_VERSION_2_0(), load_GL_VERSION_2_1(), load_GL_VERSION_3_0(), load_GL_VERSION_3_1(), load_GL_VERSION_3_2(), load_GL_VERSION_3_3(), load_GL_VERSION_4_0(), load_GL_VERSION_4_1(), load_GL_VERSION_4_2(), load_GL_VERSION_4_3(), and process_line().
The [draw_get.h]() file is generated automatically by [params.awk]() and contains parsing commands for the functions defined in [draw.h]().
Definition at line 645 of file view.h.
References all, calloc(), clear(), fields_stats(), file, free_cexpr(), get_view(), input_gfs(), line, list, load(), mystrtok(), parse_params(), pstring, remove_blanks(), restriction, s, save(), view(), and x.
Referenced by display_command(), and load().
The main drawing function.
Definition at line 249 of file view.h.
References clear(), get_view(), GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_MODELVIEW, GL_PROJECTION, glClear, glClearColor, glLoadIdentity, glMatrixMode, glMultMatrixf, glScalef, glTranslatef, L0, m(), max, view(), and x.
Referenced by draw().
| trace bool save | ( | char * | file = NULL, |
| char * | format = "ppm", |
||
| char * | opt = NULL, |
||
| FILE * | fp = NULL, |
||
| float | lw = 0, |
||
| int | sort = 0, |
||
| int | options = 0, |
||
| FILE * | checksum = NULL, |
||
| bview * | view = NULL |
||
| ) |
The file to write to is given either using its name file or the file pointer fp. If neither is specified, the default is stdout.
If file is used, options for 'convert' or 'ffmpeg' can be given in opt*.
The format to use is given either explicitly using format, or, if a file* name is given, using the file name extension (i.e. *.ppm*, .bv*, etc.). If neither is specified, the default is "ppm".
For vector graphics, the base line width can be specified using lw*. The default is one.
The recognised file formats are:
"ppm": Portable PixMap format. A basic uncompressed image format. "png", "jpg": Compressed image formats. Will only work if the convert* command from ImageMagick is installed on the system. "mp4", "gif", "ogv": Compressed animation formats. Will only work if ffmpeg is installed on the system.
The following formats are no longer supported, but this could be fixed later:
"bv": Basilisk View format. Saves all Basilisk function calls necessary to reproduce the figure. Use together with load(). "gnu": Gnuplot format. Saves a vector graphics (3D) representation of the objects. "obj": Wavefront 3D object format. Can be read by a number of 3D visualisation tools. "kml": Keyhole Markup Language. Can be used with Google Earth and other GIS. "ps", "eps", "tex", "pdf", "svg", "pgf": the various vector graphics formats supported by gl2ps.
Note that MPI-parallel output is only implemented for the "ppm" format at the moment. Other animation and image formats will be automatically converted to PPM when using MPI.
Definition at line 503 of file view.h.
References a32_hash(), a32_hash_add(), a32_hash_init(), assert, bview_draw(), close_image(), compose_image(), fflush(), file, fp, get_view(), is_animation(), open_image(), s, sizeof(), view(), which(), and x.
Referenced by process_line().
For the moment there is a single (static) current view.
Definition at line 225 of file view.h.
Referenced by destroy_view(), get_view(), and translate().