/*****************************************************************************1*2* Elmer, A Finite Element Software for Multiphysical Problems3*4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland5*6* This program is free software; you can redistribute it and/or7* modify it under the terms of the GNU General Public License8* as published by the Free Software Foundation; either version 29* of the License, or (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program (in file fem/GPL-2); if not, write to the18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,19* Boston, MA 02110-1301, USA.20*21*****************************************************************************/2223/*******************************************************************************24*25* Visual class definitions.26*27*******************************************************************************28*29* Author: Juha Ruokolainen30*31* Address: CSC - IT Center for Science Ltd.32* Keilaranta 14, P.O. BOX 40533* 02101 Espoo, Finland34* Tel. +358 0 457 272335* Telefax: +358 0 457 230236* EMail: [email protected]37*38* Date: 27 Sep 199539*40*41* Modification history:42*43* 28 Sep 1995, modified visual_t and visual_type_t structures to make a list44* rather than an array of visual types.45*46******************************************************************************/4748#ifdef EXT49#undef EXT50#endif5152#ifdef MODULE_VISUALS53#define EXT54#else55#define EXT extern56#endif5758#ifdef MODULE_VISUALS59double TooLong1 = 0.30,TooLong2 = 0.5;60#else61extern double TooLong1,TooLong2;62#endif6364#define VIS_VISUAL_PARAM_LOGICAL 165#define VIS_VISUAL_PARAM_INT 266#define VIS_VISUAL_PARAM_FLOAT 467#define VIS_VISUAL_PARAM_POINTER 86869typedef struct visual_param_s70{71/*72* Name string for the parameter73*/74char *Name;7576/*77* Format string for scanf when scanning parameter value78*/79char *Format;8081/*82* Parameter offset from structure beginning83*/84long int Offset;8586/*87* type of the parameter (one of VIS_VISUAL_PARAM_*)88*/89int ParamType;9091/*92* Initial values for the parameters93*/94int IntValue;95double FloatValue;96void *PointerValue;97} visual_param_t;9899typedef struct visual_type_s100{101/*102* Next visual type in the list103*/104struct visual_type_s *Next;105106/*107* One line description of the visual108*/109char *VisualName;110111/*112* Alloc memory for parameters113*/114void *(*AllocParams)();115116/*117* Dispose a visual118*/119void (*DeleteParams)(void *);120121/*122* Realize a visual instance123*/124int (*RealizeVisual)(geometry_t *,element_model_t *,void *,double);125126/*127* Structure holding names and offsets of particular128* visual types parameters129*/130visual_param_t *VisualParams;131} visual_type_t;132133/*134* visual type list (remove this)135*/136typedef struct visual_defs_s137{138int NumberOfVisualTypes;139visual_type_t *VisualTypes;140} visual_defs_t;141142/*143* Global variable holding start of the list of visual types144*/145EXT visual_defs_t VisualDefs;146147typedef struct visual_s148{149/*150* Next visual in list151*/152struct visual_s *Next;153154/*155* Name of the visual instance156*/157char *Name;158159/*160* this is pointer to arrow_t,mesh_t etc. structures, see below161*/162void *VisualParams;163164/*165* Pointer to visual type structure holding the function pointers166* acting on this type of visual167*/168169visual_type_t *VisualType;170} visual_t;171172typedef enum173{174mesh_style_none,mesh_style_line,mesh_style_surf,mesh_style_line_and_surf175} mesh_style_t;176177typedef enum178{179arrow_style_stick,arrow_style_arrow180} arrow_style_t;181182typedef enum183{184particle_style_vector,particle_style_sphere185} particle_style_t;186187typedef enum188{189particle_integ_euler, particle_integ_runge_kutta190} particle_integ_method_t;191192typedef enum193{194particle_policy_fixed, particle_policy_adaptive195} particle_integ_policy_t;196197198int vis_initialize_arrow_visual();199int vis_initialize_colscale_visual();200int vis_initialize_contour_line_visual();201int vis_initialize_isosurface_visual();202void vis_triangle ( triangle_t *t,vertex_t *v,double *color,double CScl,double CAdd);203int vis_initialize_mesh_visual();204int vis_initialize_particle_visual();205int vis_initialize_sphere_visual();206int vis_add_visual_type( visual_type_t *VisualDef );207visual_type_t *vis_get_visual_type(char *name);208char *vis_get_visual_type_name(visual_t *visual);209char *vis_get_visual_name(visual_t *visual);210int vis_set_param( visual_t *visual, char *name,int intvalue,double doublevalue,void *ptrvalue );211void vis_default_params( visual_t *visual );212visual_t *vis_new_visual(char *name);213visual_t *vis_link_visual( visual_t *list,visual_t *new );214visual_t *vis_add_visual(visual_t *visual,char *name);215void vis_delete_visual( visual_t *visual );216int vis_display_visual( geometry_t *geometry, element_model_t *model, visual_t *VL,double t );217int vis_display_list( geometry_t *geometry, element_model_t *model, visual_t *VL,double t );218int vis_initialize_visual_types();219220221