1 /***************************************************************************** 2 * 3 * Elmer, A Finite Element Software for Multiphysical Problems 4 * 5 * Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program (in file fem/GPL-2); if not, write to the 19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * Boston, MA 02110-1301, USA. 21 * 22 *****************************************************************************/ 23 24 /******************************************************************************* 25 * 26 * Main include file of ElmerPost. Mainly includes other include files ;-) 27 * 28 ******************************************************************************* 29 * 30 * Author: Juha Ruokolainen 31 * 32 * Address: CSC - IT Center for Science Ltd. 33 * Keilaranta 14, P.O. BOX 405 34 * 02101 Espoo, Finland 35 * Tel. +358 0 457 2723 36 * Telefax: +358 0 457 2302 37 * EMail: Juha.Ruokolainen@csc.fi 38 * 39 * Date: 26 Sep 1995 40 * 41 * Modified by: 42 * 43 * Date of modification: 44 * 45 ******************************************************************************/ 46 47 #include "../config.h" 48 49 #if defined(WIN32) || defined(MINGW32) 50 #include <windows.h> 51 #endif 52 53 #include <stdlib.h> 54 #include <stdio.h> 55 56 /* #include <malloc.h> */ 57 #include <math.h> 58 59 #include <sys/types.h> 60 61 #include <signal.h> 62 63 #include <elmer/matc.h> 64 65 66 #if defined(MINGW32) || defined(WIN32) 67 68 #include "tk/tk.h" 69 70 #endif 71 72 73 #ifdef MODULE_MAIN 74 #define EXT 75 #else 76 #define EXT extern 77 #endif 78 79 #ifndef MIN 80 #define MIN(x,y) ( (x)>(y) ? (y) : (x) ) 81 #endif 82 83 #ifndef MAX 84 #define MAX(x,y) ( (x)>(y) ? (x) : (y) ) 85 #endif 86 87 #ifndef ABS 88 #define ABS(x) ( (x)>(0) ? (x) : (-(x)) ) 89 #endif 90 91 #define FALSE 0 92 #define TRUE 1 93 94 #ifndef DBL_MAX 95 #define DBL_MAX 1.79769313486231570e+308 96 #endif 97 98 #ifndef M_PI 99 #define M_PI (3.1415926535897931) 100 #endif 101 102 typedef unsigned char logical_t; 103 104 typedef struct 105 { 106 char *name; 107 double *f; 108 double min,max; 109 } scalar_t; 110 111 typedef struct 112 { 113 char *name; 114 double *f; 115 double min[3],max[3]; 116 } vector_t; 117 118 typedef struct 119 { 120 int VolumeSides; 121 int VolumeEdges; 122 int SurfaceSides; 123 int StereoMode; 124 int OutputPS, FitToPagePS; 125 double StereoTran,StereoRot; 126 } global_options_t; 127 128 #ifdef MODULE_MAIN 129 global_options_t GlobalOptions = { FALSE,FALSE,TRUE,FALSE,FALSE,TRUE,0.03,5.00 }; 130 #else 131 extern global_options_t GlobalOptions; 132 #endif 133 134 extern double RealTime(),CPUTime(); 135 136 #include "geometry.h" 137 #include "elements/elements.h" 138 #include "graphics/graphics.h" 139 #include "visuals/visual.h" 140 #include "objects/objects.h" 141 #include "camera/camera.h" 142 143 EXT unsigned int epMouseDown,epMouseDownTakesTooLong; 144 EXT double GraphicsAspect; 145 EXT unsigned int GraphicsXSize,GraphicsYSize; 146 147 #ifndef WIN32 148 EXT XFontStruct *CurrentXFont; 149 #endif 150 151 EXT int BreakLoop; 152 153 #ifdef MODULE_MAIN 154 void (*user_hook_before_all)() = NULL; 155 void (*user_hook_after_all)() = NULL; 156 157 void (*user_hook_camera_before)() = NULL; 158 void (*user_hook_camera_after)() = NULL; 159 160 void (*user_hook_object_before)() = NULL; 161 void (*user_hook_object_after)() = NULL; 162 #else 163 extern void (*user_hook_before_all)(); 164 extern void (*user_hook_after_all)(); 165 166 extern void (*user_hook_camera_before)(); 167 extern void (*user_hook_camera_after)(); 168 169 extern void (*user_hook_object_before)(); 170 extern void (*user_hook_object_after)(); 171 #endif 172