00001
00002
00003
00004
00005
00006 #define WINDOW_SIZE 800
00007 #define MAX_WINDOW_WIDTH 800
00008 #define MAX_WINDOW_HEIGHT 600
00009
00010 #define LEFT_BUTTON 1
00011 #define MIDDLE_BUTTON 2
00012 #define RIGHT_BUTTON 3
00013
00016 namespace Gui {
00017 enum Elements {
00018 points=0,
00019 nodes,
00020 edges,
00021 faces,
00022 cells,
00023 frame,
00024 mesh,
00025 boundary_nodes,
00026 boundary_edges,
00027 boundary_faces,
00028 boundary_cells,
00029 maxelements
00030 };
00031 enum Color {
00032 red=0,
00033 green,
00034 blue,
00035 skyblue,
00036 brown,
00037 magenta,
00038 yellow,
00039 color6,
00040 color7,
00041 color8,
00042 color9,
00043 color10,
00044 color11,
00045 color12,
00046 color13,
00047 color14,
00048 color15,
00049 maxcolor
00050 };
00051 enum ColorSchemes {
00052 colorByType=0,
00053 colorByBoundary,
00054 colorByTime,
00055 colorByMass,
00056 maxColorSchemes
00057 };
00058 enum PointParameters
00059 {
00060 variable=maxcolor,
00061 vmin,vmax,size,
00062 sizevar,massvar,
00063 maxpointprm
00064 };
00065 enum LineParameters
00066 {
00067 thickness=maxcolor,
00068 length,
00069 maxlineprm
00070 };
00071 enum AxesParameters
00072 {
00073 axeswidth=0,
00074 xaxislength,
00075 yaxislength,
00076 zaxislength,
00077 arrowheight,
00078 arrowidth,
00079 maxaxesprm
00080 };
00081 enum SurfDispType
00082 {
00083 gridlines=0,
00084 solidsurface,
00085 maxsurfdisptypes
00086 };
00087 extern char *configfile;
00088 extern REAL
00089 xmin[],xmax[],
00090 lx,ly,lz,lmin,lmax;
00091 extern REAL
00092 step,
00093 vecval[maxlineprm],
00094 axes[maxaxesprm],
00095 rgbcolor[maxcolor][3];
00096
00097 struct ElementDisp
00098 { int
00099 lighting;
00100 REAL
00101 rgbcolor[3];
00102 };
00103 extern ElementDisp disp[maxelements];
00104 struct ColorScale {
00105 int relative :1;
00106 };
00107 struct Scene {
00108 struct Color {
00109 ColorSchemes scheme;
00110 REAL minvalue,maxvalue;
00111 } color;
00112 struct Mesh {
00113 REAL
00114 node[maxpointprm],
00115 line[maxlineprm];
00116 } mesh;
00117 struct Frame {
00118 REAL
00119 line[maxlineprm];
00120 } frame;
00121 };
00122
00123 enum Movement
00124 { stay=0,
00125 rotate,
00126 moveuv,
00127 movew
00128 };
00129 enum ShowPars
00130 { showRun=0,
00131 showAxes,
00132 showSpheres,
00133 showBonds,
00134 showGrid,
00135 showNodes,
00136 showVariables,
00137 showBoundaryVertexes,
00138 showBoundaryVectors,
00139 showToolVertexes,
00140 showBoundaryFaceCenters,
00141 showBoundaryFaces,
00142 showBoundaryGrid,
00143 showToolGrid,
00144 showFrame,
00145 showCellCenters,
00146 showFaceCenters,
00147 showIsoSurfaces,
00148 dumpWindow,
00149 maxshowpars
00150 };
00151 extern int
00152 showpar[maxshowpars],
00153 finished,
00154 animation;
00155 extern REAL
00156 xo[],
00157 dx,dy,dz,
00158 lastx, lasty, lastz;
00159
00160
00161 extern int mouseButtons[3];
00162 extern REAL zoom;
00163 extern REAL rotx;
00164 extern REAL roty;
00165 extern REAL tx;
00166 extern REAL ty;
00167
00168
00169 struct WindowGeom
00170 {
00171 int
00172 width,height;
00173 };
00174 void Exit();
00175 void Quit();
00176 void readconf();
00177 void helpDisplay();
00178 int readparam (
00179 char *s,
00180 char *param[],
00181 int maxparam,
00182 char *filename,
00183 REAL val[]
00184 );
00185 void initdisp();
00186 void Materials(int argc, char *argv[]);
00187 void display();
00188 void displayAxes();
00189 void writeData();
00190 void helpCommand();
00191 void printGridXLimits();
00192 void printGridVecLimits();
00193 void getXLimits(REAL *xmin, REAL *xmax);
00194 void getScaling(REAL &lmin, REAL &lmax);
00195 void printPartVelLimits();
00196 void printParticleVariables();
00197 void showGridElements
00198 (
00199 int ne,
00200 double *X,
00201 REAL color[]
00202 );
00203 void showVectorComponent
00204 (
00205 int ivar,
00206 int icomp,
00207 double *X,
00208 double vmn,
00209 double vmx
00210 );
00211 void showVector
00212 (
00213 int ivar,
00214 double *X
00215 );
00216 void commandMode();
00217 void printVariables
00218 (
00219 int n
00220
00221 );
00222
00223 void init(int argc, char *argv[], Domain *domain);
00224 void finish();
00225 void helpDisplay();
00226 void readconf();
00227 void initdisp();
00228 void InitMaterials(void);
00229
00230
00231 void showGridElements
00232 ( int ne,
00233 double *X,
00234 REAL color[]
00235 );
00236 void showVector
00237 (
00238 int ivar,
00239 double *X
00240 );
00241 void showVectorComponent
00242 (
00243 int ivar,
00244 int icomp,
00245 double *X,
00246 double vmn,
00247 double vmx
00248 );
00249 void displayAxes();
00250
00251
00252 void getScaling
00253 (
00254 double &l0,
00255 double &l1
00256 );
00257 void getXLimits
00258 ( double *x0,
00259 double *x1
00260 );
00261 void printPartVelLimits();
00262 void printVariables
00263 (
00264 int n
00265 );
00266 void Exit();
00267 void Quit();
00268 void selectVariable();
00269 void printParticleVariables();
00270 void setBackgroundRun();
00271 void setForegroundRun();
00272 void commandMode();
00273
00274
00275
00276
00277
00278 void display();
00279 void animate();
00280 void writeData();
00281 void printGridXLimits();
00282 void printGridVecLimits();
00283 void helpCommand();
00284 void reshape(int w, int h);
00285 void mouse(int button, int state, int x, int y);
00286 void motion(int x, int y);
00287
00288 void keyboard(unsigned char key, int x, int y);
00289 void menu(int value);
00290 void run();
00291 void drawSegment
00292 (
00293 REAL *x,
00294 REAL *y
00295 );
00296 void displaymessage(char *);
00297 void setElementColor(int element_type, REAL rgbcolor[]);
00298 void getElementColor(int element_type, REAL rgbcolor[]);
00299 }
00304 namespace Palette {
00305
00306
00307 extern void init(REAL vmin, REAL vmax);
00308 extern void pickcolor(REAL var, REAL color[]);
00309 }
00310