diff --git a/Motif/CbColorbar.cpp b/Motif/CbColorbar.cpp deleted file mode 100644 index 3e2490deb9c875cde640645cc77d71358cbb5720..0000000000000000000000000000000000000000 --- a/Motif/CbColorbar.cpp +++ /dev/null @@ -1,643 +0,0 @@ -// $Id: CbColorbar.cpp,v 1.3 2001-08-12 14:24:50 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Numeric.h" -#include "XColors.h" -#include "Widgets.h" -#include "Register.h" -#include "Context.h" -#include "XContext.h" -#include "ColorTable.h" - -#include "CbColorbar.h" - -extern Context_T CTX ; -extern XContext_T XCTX ; -extern Widgets_T WID; - -/* RGB/HSV transformation */ - -#define RETURN_HSV(h,s,v) {*H=h; *S=s; *V=v; return;} -#define RETURN_RGB(r,g,b) {*R=r; *G=g; *B=b; return;} -#define UNDEFINED 0 -#define EPS 1.e-10 - -/* rgb on [0, 1], sv returned on [0, 1] and h on [0, 6]. - Exception: h is returned UNDEFINED if S==0. */ - -void RGB_to_HSV(double R, double G, double B, - double *H, double *S, double *V) { - double v, x, f; - int i; - - x = DMIN(DMIN(R, G), B); - v = DMAX(DMAX(R, G), B); - if(v == x) RETURN_HSV(UNDEFINED, 0, v); - f = (R == x) ? G - B : ((G == x) ? B - R : R - G); - i = (R == x) ? 3 : ((G == x) ? 5 : 1); - RETURN_HSV(i - f /(v - x), (v - x)/v, v); -} - -/* h given on [0, 6] or UNDEFINED. s and v given on [0, 1]. - rgb each returned on [0, 1]. */ - -void HSV_to_RGB(double H, double S, double V, - double *R, double *G, double *B) { - double m, n, f; - int i; - - if (H == UNDEFINED) RETURN_RGB(V, V, V); - i = (int)floor(H); - f = H - i; - if ( !(i&1) ) f = 1 - f; /* if i is even */ - m = V * (1 - S); - n = V * (1 - S * f); - - switch (i) { - case 6: - case 0: RETURN_RGB(V, n, m); - case 1: RETURN_RGB(n, V, m); - case 2: RETURN_RGB(m, V, n); - case 3: RETURN_RGB(m, n, V); - case 4: RETURN_RGB(n, m, V); - case 5: RETURN_RGB(V, m, n); - } -} - - -/* Convert window X coordinate to color table index */ - -static int x_to_index(ColorBar *cb, int x){ - int index; - index = (int) (x * (float) cb->ct->size / (float) cb->width ); - if (index<0) - index = 0; - else if (index>=cb->ct->size) - index = cb->ct->size-1; - return index; -} - -/* Convert color table index to window X coordinate */ - -static int index_to_x(ColorBar *cb, int index){ - int x; - x = (int) (index * (float) cb->width / (float)(cb->ct->size-1) ); - if (x>=cb->width) - x = cb->width - 1; - return x; -} - -/* Convert a color intensity to a window Y coordinate */ - -static int intensity_to_y(ColorBar *cb, int intensity){ - int y; - y = (int) (cb->wedge_y - intensity * (float) cb->wedge_y / 255.0 ); - if (y<0) - y = 0; - else if (y>=cb->wedge_y) - y = cb->wedge_y - 1; - return y; -} - -/* Convert a window Y coordinate to a color intensity */ - -static int y_to_intensity(ColorBar *cb, int y){ - int intensity; - intensity = (int) ((cb->wedge_y - y ) * 255.0 / (float) cb->wedge_y ); - if (intensity<0) - intensity = 0; - else if (intensity>255) - intensity = 255; - return intensity; -} - - -/* Redraw part of a Color Widget (between a and b) */ - -#define HELP_LINES 9 - -static void redraw_range(ColorBar *cb, int a, int b){ - Window win; - int i; - int x,y, px,py; - int x1, y1, x2, y2; - int intensity; - double H,S,V; - char rgb_str[] = "RGB", hsv_str[] = "HSV" ; - char help_str[HELP_LINES][100] = { - "h show this message", - "1 -> 6 choose predefined colormap", - "m switch color mode", - "c/p/r copy/paste/reset", - "mouse draw color or alpha", - "left/right move or rotate", - "up/down color or alpha curvature", - "i invert x or y range", - "b increase or decrease gamma" - }; - - win = cb->window; - - if (a<0) a = 0; - if (b>=cb->ct->size) b = cb->ct->size-1; - - /* calc region to update */ - x1 = index_to_x( cb, a ); - x2 = index_to_x( cb, b); - - y1 = intensity_to_y( cb, 255 ); - y2 = intensity_to_y( cb, 0 ); - - /* erase region */ - XFillRectangle( XCTX.display, win, XCTX.xgc.black, - x1,y1, x2-x1+1, y2-y1+1 ); - - /* redraw region of entries in interval [a,b] */ - if (a>0) a--; - if (b<cb->ct->size-1) b++; - - /* draw red or hue levels */ - for (i=a;i<=b;i++) { - x = index_to_x( cb, i ); - - if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_RGB){ - intensity = UNPACK_RED(cb->ct->table[i]); - } - else if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_HSV){ - RGB_to_HSV(UNPACK_RED (cb->ct->table[i])/255., - UNPACK_GREEN(cb->ct->table[i])/255., - UNPACK_BLUE (cb->ct->table[i])/255., - &H,&S,&V); - intensity = (int) (H/6.*255.+EPS); - } - - y = intensity_to_y( cb, intensity ); - if (i!=a) - XDrawLine( XCTX.display, win, XCTX.xgc.red, px, py, x, y ); - px = x; py = y; - } - - /* draw green or saturation levels */ - for (i=a;i<=b;i++) { - x = index_to_x( cb, i ); - - if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_RGB){ - intensity = UNPACK_GREEN(cb->ct->table[i]); - } - else if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_HSV){ - RGB_to_HSV(UNPACK_RED (cb->ct->table[i])/255., - UNPACK_GREEN(cb->ct->table[i])/255., - UNPACK_BLUE (cb->ct->table[i])/255., - &H,&S,&V); - intensity = (int) (S*255.); - } - - y = intensity_to_y( cb, intensity); - if (i!=a) - XDrawLine( XCTX.display, win, XCTX.xgc.green, px,py, x,y ); - px = x; py = y; - } - - /* draw blue or value levels */ - for (i=a;i<=b;i++) { - x = index_to_x( cb, i ); - - if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_RGB){ - intensity = UNPACK_BLUE(cb->ct->table[i]); - } - else if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_HSV){ - RGB_to_HSV(UNPACK_RED (cb->ct->table[i])/255., - UNPACK_GREEN(cb->ct->table[i])/255., - UNPACK_BLUE (cb->ct->table[i])/255., - &H,&S,&V); - intensity = (int) (V*255.); - } - - y = intensity_to_y( cb, intensity ); - if (i!=a) - XDrawLine( XCTX.display, win, XCTX.xgc.blue, px,py, x,y ); - px = x; py = y; - } - - /* draw alpha levels */ - for (i=a;i<=b;i++) { - x = index_to_x( cb, i ); - y = intensity_to_y( cb, UNPACK_ALPHA(cb->ct->table[i]) ); - if (i!=a) - XDrawLine( XCTX.display, win, XCTX.xgc.white, px,py, x,y ); - px = x; py = y; - } - - /* draw the color bar */ - for (x=x1;x<=x2;x++) { - int r, g, b; - unsigned int color; - i = x_to_index( cb, x ); - color = cb->ct->table[i]; - r = UNPACK_RED( color ); - g = UNPACK_GREEN( color ); - b = UNPACK_BLUE( color ); - XSetForeground( XCTX.display, XCTX.xgc.xgc, AllocateColorInt(r,g,b) ); - XDrawLine( XCTX.display, win, XCTX.xgc.xgc, x, cb->wedge_y, - x, cb->wedge_y + WEDGE_HEIGHT-1 ); - } - - /* print colortable mode and help */ - - if (cb->helpflag) { - for (i=0;i<HELP_LINES;i++) { - XDrawString( XCTX.display, win, XCTX.xgc.white, - 10,10+(i+1)*XCTX.xfont.fixed_h, - help_str[i], strlen(help_str[i]) ); - } - } - else{ - if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_RGB) - XDrawString( XCTX.display, win, XCTX.xgc.white, - 10, 10+XCTX.xfont.fixed_h, - rgb_str, strlen(rgb_str) ); - else if(cb->ct->ipar[COLORTABLE_MODE]==COLORTABLE_HSV) - XDrawString( XCTX.display, win, XCTX.xgc.white, - 10, 10+XCTX.xfont.fixed_h, - hsv_str, strlen(hsv_str) ); - } -} - - -/* Redraw the marker and the text */ - -static void redraw_marker(ColorBar *cb){ - Window win; - int x, y0, y1; - char str[50]; - int dir,ascent, descent; - XCharStruct overall; - int xpos; - float val; - - win = cb->window; - - y0 = cb->marker_y; - y1 = cb->height - 1; - XFillRectangle( XCTX.display, win, XCTX.xgc.black, - 0, y0, cb->width, y1-y0+1 ); - - /* draw marker below color wedge */ - x = index_to_x( cb, cb->markerpos ); - XDrawLine( XCTX.display, win, XCTX.xgc.white, - x, cb->marker_y, x, cb->marker_y+MARKER_HEIGHT ); - XDrawLine( XCTX.display, win, XCTX.xgc.white, - x, cb->marker_y, x-3, cb->marker_y+6 ); - XDrawLine( XCTX.display, win, XCTX.xgc.white, - x, cb->marker_y, x+3, cb->marker_y+6 ); - - /* draw min value */ - sprintf( str, "%.2g", cb->minval ); - XDrawString( XCTX.display, win, XCTX.xgc.white, - 2, cb->label_y, str, strlen(str) ); - - /* draw marker value */ - val = cb->minval + (cb->maxval-cb->minval) - * ( (float) cb->markerpos / (float) (cb->ct->size-1)); - sprintf(str,"(%.2g)", val ); - XTextExtents(XCTX.xfont.fixed, str, strlen(str), &dir,&ascent,&descent,&overall ); - xpos = (cb->width - overall.width) / 2; - XDrawString( XCTX.display, win, XCTX.xgc.white, - xpos, cb->label_y, str, strlen(str) ); - - /* draw max value */ - sprintf( str, "%.2g", cb->maxval ); - XTextExtents( XCTX.xfont.fixed, str, strlen(str), &dir,&ascent,&descent,&overall ); - xpos = cb->width - overall.width - 2; - XDrawString( XCTX.display, win, XCTX.xgc.white, - xpos, cb->label_y, str, strlen(str) ); - -} - - -static void set_size(ColorBar *cb, int width, int height){ - cb->width = width; - cb->height = height; - cb->label_y = cb->height - 5; - cb->marker_y = cb->label_y + 1 - MARKER_HEIGHT - XCTX.xfont.fixed_h; - cb->wedge_y = cb->marker_y - WEDGE_HEIGHT; -} - - - - -/* creation, manipulation and callbacks functions */ - -static ColorBar *TheCB=NULL ; - -void ColorBarCreate(Window win, int width, int height){ - static int first=1 ; - - if(!TheCB) TheCB = (ColorBar *) calloc(1, sizeof(ColorBar)); - TheCB->window = win; - set_size(TheCB, width, height); - - if(first){ - TheCB->helpflag = 1; - first=0; - } -} - -void ColorBarShow(void){ - XMapWindow(XCTX.display, TheCB->window); -} - -void ColorBarHide(void){ - XUnmapWindow(XCTX.display, TheCB->window); -} - -void ColorBarRedraw(void){ - if(!TheCB) return; - redraw_range(TheCB, 0, TheCB->ct->size-1); - redraw_marker(TheCB); -} - -void ColorBarChange(char *label, float min, float max, ColorTable *ct, int rgb){ - strncpy(TheCB->label, label, 31); - TheCB->ct = ct; - TheCB->minval = min; - TheCB->maxval = max; - if (rgb) redraw_range(TheCB, 0, TheCB->ct->size-1); - redraw_marker(TheCB); -} - -void ColorBarResizeCb(Widget w, XtPointer client_data, - XmDrawingAreaCallbackStruct *call_data){ - Dimension w1,h1; - - if(!TheCB) return; - - XtVaGetValues(WID.PD.colorDrawingArea, - XmNwidth, &w1, - XmNheight, &h1, - NULL); - - set_size(TheCB, (int)w1, (int)h1); - XResizeWindow(XCTX.display, TheCB->window, (int)w1, (int)h1); - ColorBarRedraw(); -} - -void ColorBarExposeCb(Widget w,XtPointer client_data, - XmDrawingAreaCallbackStruct *call_data){ - ColorBarRedraw(); -} - -#define ANY_MODIFIER (ShiftMask|ControlMask|Mod1Mask) - -void ColorBarInputCb (Widget w, XtPointer client_data, - XmDrawingAreaCallbackStruct *call_data){ - - XEvent *event; - static int p1=0, p2=0, p3=0, p4=0; /* red, green, blue, alpha */ - static int pentry, move_marker; - int i, modify, entry, compute; - char keybuf[50]; - KeySym key; - XComposeStatus compose; - - event = call_data->event; - modify = 0; - compute = 0; - - /* touche */ - - if (event->type==KeyPress) { - XLookupString(&event->xkey, keybuf, 50, &key, &compose); - - switch(key){ - case XK_1 : ColorTable_InitParam(1, TheCB->ct, 1, 1); compute=1; break; - case XK_2 : ColorTable_InitParam(2, TheCB->ct, 1, 1); compute=1; break; - case XK_3 : ColorTable_InitParam(3, TheCB->ct, 1, 1); compute=1; break; - case XK_4 : ColorTable_InitParam(4, TheCB->ct, 1, 1); compute=1; break; - case XK_5 : ColorTable_InitParam(5, TheCB->ct, 1, 1); compute=1; break; - case XK_6 : ColorTable_InitParam(6, TheCB->ct, 1, 1); compute=1; break; - case XK_7 : ColorTable_InitParam(7, TheCB->ct, 1, 1); compute=1; break; - case XK_8 : ColorTable_InitParam(8, TheCB->ct, 1, 1); compute=1; break; - case XK_9 : ColorTable_InitParam(9, TheCB->ct, 1, 1); compute=1; break; - case XK_0 : ColorTable_InitParam(0, TheCB->ct, 1, 1); compute=1; break; - - case XK_c : case XK_C : ColorTable_Copy(TheCB->ct); break; - case XK_p : case XK_P : ColorTable_Paste(TheCB->ct); ColorBarRedraw(); break; - case XK_h : case XK_H : TheCB->helpflag = !TheCB->helpflag; ColorBarRedraw(); break; - - case XK_r : - case XK_R : - ColorTable_InitParam(TheCB->ct->ipar[COLORTABLE_NUMBER], - TheCB->ct, 1, 1); - compute=1; - break; - - case XK_m : - case XK_M : - if(TheCB->ct->ipar[COLORTABLE_MODE]==COLORTABLE_RGB) - TheCB->ct->ipar[COLORTABLE_MODE] = COLORTABLE_HSV; - else - TheCB->ct->ipar[COLORTABLE_MODE] = COLORTABLE_RGB; - ColorBarRedraw(); - break; - - case XK_i : - case XK_I : - if (event->xkey.state&ANY_MODIFIER) - TheCB->ct->ipar[COLORTABLE_INVERT] = !TheCB->ct->ipar[COLORTABLE_INVERT]; - else - TheCB->ct->ipar[COLORTABLE_SWAP] = !TheCB->ct->ipar[COLORTABLE_SWAP]; - compute=1; - break; - - case XK_b : - case XK_B : - if (event->xkey.state&ANY_MODIFIER) { - TheCB->ct->fpar[COLORTABLE_BETA] -= 0.05; - if(TheCB->ct->fpar[COLORTABLE_BETA]<-1.0) - TheCB->ct->fpar[COLORTABLE_BETA] = -1.0; - } - else{ - TheCB->ct->fpar[COLORTABLE_BETA] += 0.05; - if(TheCB->ct->fpar[COLORTABLE_BETA]>1.0) - TheCB->ct->fpar[COLORTABLE_BETA] = 1.0; - } - compute = 1; - break; - - case XK_Left : - if (event->xkey.state&ANY_MODIFIER) { - TheCB->ct->ipar[COLORTABLE_ROTATE] += 5; - if(TheCB->ct->ipar[COLORTABLE_ROTATE] > TheCB->ct->size-1) - TheCB->ct->ipar[COLORTABLE_ROTATE] -= TheCB->ct->size-1; - } - else - TheCB->ct->fpar[COLORTABLE_BIAS] -= 0.05; - compute = 1; - break; - - case XK_Right : - if (event->xkey.state&ANY_MODIFIER) { - TheCB->ct->ipar[COLORTABLE_ROTATE] -= 5; - if(TheCB->ct->ipar[COLORTABLE_ROTATE]<-(TheCB->ct->size-1)) - TheCB->ct->ipar[COLORTABLE_ROTATE] += TheCB->ct->size-1; - } - else{ - TheCB->ct->fpar[COLORTABLE_BIAS] += 0.05; - } - compute = 1; - break; - - case XK_Up : - if (event->xkey.state&ANY_MODIFIER) { - TheCB->ct->fpar[COLORTABLE_ALPHAPOW] -= 0.05; - if (TheCB->ct->fpar[COLORTABLE_ALPHAPOW]<0.0) - TheCB->ct->fpar[COLORTABLE_ALPHAPOW] = 0.0; - } - else - TheCB->ct->fpar[COLORTABLE_CURVE] -= 0.05; - compute = 1; - break; - - case XK_Down : - if (event->xkey.state&ANY_MODIFIER) - TheCB->ct->fpar[COLORTABLE_ALPHAPOW] += 0.05; - else - TheCB->ct->fpar[COLORTABLE_CURVE] += 0.05; - compute = 1; - break; - - } - - if(compute){ - ColorTable_Recompute(TheCB->ct, 1, 1); - ColorBarRedraw(); - } - - } - - /* souris enfoncee */ - - else if (event->type==ButtonPress) { - - if(TheCB->helpflag){ - TheCB->helpflag = 0; - ColorBarRedraw(); - } - - if (event->xbutton.y<TheCB->wedge_y) { - /* change color function */ - move_marker = 0; - } - else { - /* change marker position */ - move_marker = 1; - } - /* determine which curve to modify */ - if (event->xbutton.state&ANY_MODIFIER) { - p4 = 1; - } - else { - if (event->xbutton.button==Button1) p1 = 1; - if (event->xbutton.button==Button2) p2 = 1; - if (event->xbutton.button==Button3) p3 = 1; - } - pentry = x_to_index(TheCB, event->xbutton.x); - modify = 1; - } - - /* souris relachee */ - - else if (event->type==ButtonRelease) { - if (event->xbutton.button==Button1) p1 = 0; - if (event->xbutton.button==Button2) p2 = 0; - if (event->xbutton.button==Button3) p3 = 0; - p4 = 0; - } - - /* bouger */ - - else if (event->type==MotionNotify) { - /* Flush extra MotionNotify events */ - while (QLength(XCTX.display)>0) { - XEvent next; - XPeekEvent(XCTX.display, &next); - if (next.type!=MotionNotify) - break; - XNextEvent(XCTX.display, event); - } - modify = 1; - } - - /* Modify one or more of the color curves */ - - if (modify && (p1 || p2 || p3 || p4)) { - /* calculate which entry in color table to change */ - entry = x_to_index(TheCB, event->xbutton.x); - /* update */ - if (move_marker) { - /* changing marker position */ - TheCB->markerpos = entry; - redraw_marker(TheCB); - } - else { - /* changing color graph */ - int a, b, value; - - value = y_to_intensity(TheCB, event->xbutton.y); - - if (pentry<=entry) { - a = pentry; - b = entry; - } - else { - a = entry; - b = pentry; - } - - /* update entries from 'pentry' to 'entry' */ - for (i=a; i<=b; i++) { - int red, green, blue, alpha; - double R,G,B,H,S,V; - - red = UNPACK_RED (TheCB->ct->table[i]); - green = UNPACK_GREEN(TheCB->ct->table[i]); - blue = UNPACK_BLUE (TheCB->ct->table[i]); - alpha = UNPACK_ALPHA(TheCB->ct->table[i]); - - if(TheCB->ct->ipar[COLORTABLE_MODE]==COLORTABLE_RGB){ - if (p1) { red = value; } - if (p2) { green = value; } - if (p3) { blue = value; } - if (p4) { alpha = value; } - } - else if(TheCB->ct->ipar[COLORTABLE_MODE]==COLORTABLE_HSV){ - RGB_to_HSV((double)red/255.,(double)green/255.,(double)blue/255., - &H,&S,&V); - if (p1) { H = 6.*(double)value/255.+EPS ; } - if (p2) { S = (double)value/255.; } - if (p3) { V = (double)value/255.; } - if (p4) { alpha = value; } - HSV_to_RGB(H, S, V, &R,&G,&B); - red = (int)(255 * R); - green = (int)(255 * G); - blue = (int)(255 * B); - } - - TheCB->ct->table[i] = PACK_COLOR(red,green,blue,alpha); - } - - /* redraw the color curves */ - if (pentry<entry) - redraw_range(TheCB, pentry-1, entry+1); - else - redraw_range(TheCB, entry-1, pentry+1); - - pentry = entry; - - } - } - -} - diff --git a/Motif/CbColorbar.h b/Motif/CbColorbar.h deleted file mode 100644 index bd2d8ab71bf48f8f714eaf84cb72462bddce0ac6..0000000000000000000000000000000000000000 --- a/Motif/CbColorbar.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _CB_COLORBAR_H -#define _CB_COLORBAR_H - -typedef struct _colorbar { - Window window; - int width, height; /* size */ - int wedge_y; /* top coord of color wedge */ - int marker_y; /* top coord of marker arrow */ - int label_y; /* y coord of text labels */ - char label[32]; /* text label at bottom */ - float minval, maxval; /* min and max data values */ - int markerpos; /* position of marker as index into table */ - int helpflag; /* if nonzero, print help messages */ - ColorTable *ct; /* pointer to color table (allocated in Post_View) */ -} ColorBar; - -#define WEDGE_HEIGHT 12 /* epaisseur de la colorbar */ -#define MARKER_HEIGHT 10 /* hauteur de la fleche */ - -void ColorBarCreate(Window win, int width, int height); -void ColorBarShow(void); -void ColorBarChange(char *label, float min, float max, ColorTable *ct, int rgb); -void ColorBarCopy(ColorTable *ct); -void ColorBarPaste(ColorTable *ct); -void ColorBarResizeCb(Widget w, XtPointer client_data, - XmDrawingAreaCallbackStruct *call_data); -void ColorBarRedraw(void); - -#endif diff --git a/Motif/CbContext.cpp b/Motif/CbContext.cpp deleted file mode 100644 index 510f1ff020515d93d1cc0307195d6b895fe6a7e9..0000000000000000000000000000000000000000 --- a/Motif/CbContext.cpp +++ /dev/null @@ -1,653 +0,0 @@ -// $Id: CbContext.cpp,v 1.6 2001-08-11 23:28:33 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Geo.h" -#include "Mesh.h" -#include "Draw.h" -#include "Views.h" -#include "Widgets.h" -#include "Context.h" -#include "XContext.h" -#include "CbContext.h" -#include "CbGeom.h" -#include "CbMesh.h" - -extern Context_T CTX; -extern XContext_T XCTX; -extern Widgets_T WID; -extern Mesh M; - -static char *txt_new [] = - { "Parameter", "Point", "Line", "Spline", "Bezier", "BSpline", "Circle", "Ellipsis", - "Plane Surface", "Ruled Surface", "Nurbs Surface", "Volume", NULL }; - -static char *txt_translate_rotate_dilate_symmetry_delete [] = - { "Point", "Line", "Surface", NULL }; - -static char *txt_add [] = - { "Create", "Translate", "Rotate", "Dilate", "Symmetry", NULL }; - -static char *txt_move [] = - { "Translate", "Rotate", "Dilate", "Symmetry", NULL }; - -static char *txt_elem [] = - { "Add", "Move", "Extrude", "Delete", NULL }; - -static char *txt_phys [] = - { "Add", "Delete", NULL }; - -static char *txt_phys_add [] = - { "Point", "Line", "Surface", "Volume", NULL }; - -static char *txt_geom [] = - { "Elementary", "Physical", "Reload", NULL }; - -static char *txt_mesh [] = - { "Define", "1D", "2D", "3D", NULL }; - -static char *txt_mesh_define [] = - { "Length", "Recombine", "Transfinite Line", "Transfinite Surface", - "Transfinite Volume", NULL }; - -static char *txt_post[NB_BUTT_MAX] = - {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; - -static long int actual_context, actual_global_context; - -void UpdatePostButtons(void){ - Post_View *v; - int i; - - for(i = 0 ; i < NB_BUTT_MAX ; i++) { - - if(txt_post[i]){ - - v = (Post_View*)List_Pointer(Post_ViewList,i); - - /* defaultButt[i] */ - if(i==0 && XtIsManaged(WID.M.defaultButt)) XtUnmanageChild(WID.M.defaultButt); - - /* pushButt[i] */ - if(XtIsManaged(WID.M.pushButt[i])) XtUnmanageChild(WID.M.pushButt[i]); - - /* toggleButt[i] */ - XtVaSetValues(WID.M.toggleButt[i], - XmNlabelString, XmStringCreateSimple(txt_post[i]), - XmNset, v->Visible?True:False, - NULL); - XtManageChild(WID.M.toggleButt[i]); - - /* timeStepButt[i] */ - XtSetSensitive(WID.M.timeStepButt[i], (v->NbTimeStep>1)?1:0); - XtManageChild(WID.M.timeStepButt[i]); - - /* vectorButt[i] */ - XtSetSensitive(WID.M.vectorButt[i], v->ScalarOnly?0:1); - XtManageChild(WID.M.vectorButt[i]); - - /* exportBGMButt[i] */ - XtSetSensitive(WID.M.exportBGMButt[i], v->ScalarOnly?1:0); - XtManageChild(WID.M.exportBGMButt[i]); - - /* applyBGMButtXXX */ - XtSetSensitive(WID.M.applyBGMButt[i], v->ScalarOnly?1:0); - XtManageChild(WID.M.applyBGMButt[i]); - } - else{ - if(XtIsManaged(WID.M.pushButt[i])) XtUnmanageChild(WID.M.pushButt[i]); - if(XtIsManaged(WID.M.toggleButt[i])) XtUnmanageChild(WID.M.toggleButt[i]); - if(i==0) XtManageChild(WID.M.defaultButt); - } - } - -} - - -#define NB_HISTORY_MAX 100 - -void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data){ - char **ButtonText; - int i, last; - static int last_context[NB_HISTORY_MAX], numc = 0, numf = 0; - - if((long int)client_data == CONTEXT_BACKWARD){ - if(numc > 1){ - numc--; - numf++; - actual_context = last_context[numc-1]; - } - else return; - } - else if((long int)client_data == CONTEXT_FORWARD){ - if(numf > 0){ - numc++; - numf--; - actual_context = last_context[numc-1]; - } - else return; - } - else{ - actual_context = (long int)client_data; - if(last_context[numc-1] != actual_context){ - last_context[numc] = actual_context; - numc++; - } - numf = 0; - } - - if(numc > NB_HISTORY_MAX-1) numc = 1; /* Il faudrait faire un truc circulaire */ - - switch (actual_context){ - - case CONTEXT_GEOM : - actual_global_context = CONTEXT_GEOM; - XtVaSetValues(WID.M.modButt, XmNlabelString, XmStringCreateSimple("Geometry"), NULL); - CTX.geom.level = ELEMENTARY; - //if(M.status>0) mesh_event_handler(MESH_DELETE); - Msg(STATUS2, ""); - ButtonText = txt_geom; - break; - - case CONTEXT_GEOM_ELEM : - actual_global_context = CONTEXT_GEOM; - CTX.geom.level = ELEMENTARY; - Msg(STATUS2, "Elementary"); - ButtonText = txt_elem; - break; - - case CONTEXT_GEOM_ELEM_ADD : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Add"); - ButtonText = txt_add; - break; - - case CONTEXT_GEOM_ELEM_ADD_NEW : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Add Create"); - ButtonText = txt_new; - break; - - case CONTEXT_GEOM_ELEM_ADD_TRANSLATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Add Translate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_ADD_ROTATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Add Rotate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_ADD_DILATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Add Dilate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_ADD_SYMMETRY : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Add Symmetry"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_MOVE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Move"); - ButtonText = txt_move; - break; - - case CONTEXT_GEOM_ELEM_MOVE_TRANSLATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Move Translate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_MOVE_ROTATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Move Rotate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_MOVE_DILATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Move Dilate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_MOVE_SYMMETRY : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Move Symmetry"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Extrude"); - ButtonText = txt_move; - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_TRANSLATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Extrude Translate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_ROTATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Extrude Rotate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_DILATE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Extrude Dilate"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Extrude Symmetry"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_ELEM_DELETE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Elementary Delete"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_GEOM_PHYS : - actual_global_context = CONTEXT_GEOM; - CTX.geom.level = PHYSICAL; - Msg(STATUS2, "Physical"); - ButtonText = txt_phys; - break; - - case CONTEXT_GEOM_PHYS_ADD : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Physical Add"); - ButtonText = txt_phys_add; - break; - - case CONTEXT_GEOM_PHYS_DELETE : - actual_global_context = CONTEXT_GEOM; - Msg(STATUS2, "Physical Delete"); - ButtonText = txt_translate_rotate_dilate_symmetry_delete; - break; - - case CONTEXT_MESH : - actual_global_context = CONTEXT_MESH; - XtVaSetValues(WID.M.modButt, XmNlabelString, - XmStringCreateSimple("Mesh"), NULL); - Msg(STATUS2,""); - ButtonText = txt_mesh; - break; - - case CONTEXT_MESH_DEFINE : - actual_global_context = CONTEXT_MESH; - Msg(STATUS2,"Define"); - ButtonText = txt_mesh_define; - break; - - case CONTEXT_POST : - actual_global_context = CONTEXT_POST; - XtVaSetValues(WID.M.modButt, XmNlabelString, - XmStringCreateSimple("Post Processing"), NULL); - Msg(STATUS2,""); - UpdatePostButtons(); - return; - - default : - Msg(WARNING, "Unknown Event in ActualizeContextCb (%d)", actual_context); - return; - - } - - last = 0; - - if(XtIsManaged(WID.M.defaultButt)) XtUnmanageChild(WID.M.defaultButt); - - for(i=0 ; i < NB_BUTT_MAX ; i++){ - - if(!last && ButtonText[i] != NULL){ - if(XtIsManaged(WID.M.toggleButt[i])) XtUnmanageChild(WID.M.toggleButt[i]); - XtVaSetValues(WID.M.pushButt[i], - XmNlabelString,XmStringCreateSimple(ButtonText[i]), - NULL); - XtManageChild(WID.M.pushButt[i]); - } - else { - last = 1 ; - if(XtIsManaged(WID.M.pushButt[i])) XtUnmanageChild(WID.M.pushButt[i]); - if(XtIsManaged(WID.M.toggleButt[i])) XtUnmanageChild(WID.M.toggleButt[i]); - } - } -} - -#undef NB_HISTORY_MAX - - -void PreviousContextCb (Widget w, XtPointer client_data, XtPointer call_data){ - ActualizeContextCb(w,client_data,call_data); -} - -void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data){ - - switch(actual_context){ - - case CONTEXT_GEOM : - switch((long int)client_data){ - case 1: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM,call_data); break; - case 2: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_PHYS,call_data); break; - case 3: geom_event_handler(GEOM_PARSE); break; - } - break; - - case CONTEXT_GEOM_ELEM : - switch((long int)client_data){ - case 1: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD,call_data); break; - case 2: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE,call_data); break; - case 3: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE,call_data); break; - case 4: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_DELETE,call_data); break; - //case 5: geom_event_handler(GEOM_ELEM_SKETCH); break; - } - break; - - case CONTEXT_GEOM_ELEM_ADD : - switch((long int)client_data){ - case 1: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_NEW,call_data); break; - case 2: - XtManageChild(WID.GD.tranDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_TRANSLATE,call_data); - break; - case 3: - XtManageChild(WID.GD.rotDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_ROTATE,call_data); - break; - case 4: - XtManageChild(WID.GD.dilatDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_DILATE,call_data); - break; - case 5: - XtManageChild(WID.GD.symmDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_ADD_SYMMETRY,call_data); - break; - } - break; - - case CONTEXT_GEOM_ELEM_ADD_NEW : - switch((long int)client_data){ - case 1: XtManageChild(WID.GD.paramDialog); break ; - case 2: XtManageChild(WID.GD.pointDialog); break ; - case 3: geom_event_handler(GEOM_ELEM_ADD_NEW_LINE); break; - case 4: geom_event_handler(GEOM_ELEM_ADD_NEW_SPLINE); break; - case 5: geom_event_handler(GEOM_ELEM_ADD_NEW_BEZIER); break; - case 6: geom_event_handler(GEOM_ELEM_ADD_NEW_BSPLINE); break; - case 7: geom_event_handler(GEOM_ELEM_ADD_NEW_CIRCLE); break; - case 8: geom_event_handler(GEOM_ELEM_ADD_NEW_ELLIPSIS); break; - case 9: geom_event_handler(GEOM_ELEM_ADD_NEW_PLANE_SURF); break; - case 10:geom_event_handler(GEOM_ELEM_ADD_NEW_RULED_SURF); break; - case 11:geom_event_handler(GEOM_ELEM_ADD_NEW_NURBS_SURF); break; - case 12:geom_event_handler(GEOM_ELEM_ADD_NEW_VOLUME); break; - } - break; - - case CONTEXT_GEOM_ELEM_ADD_TRANSLATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_ADD_TRANSLATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_ADD_TRANSLATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_ADD_TRANSLATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_ADD_ROTATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_ADD_ROTATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_ADD_ROTATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_ADD_ROTATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_ADD_DILATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_ADD_DILATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_ADD_DILATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_ADD_DILATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_ADD_SYMMETRY : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_ADD_SYMMETRY_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_ADD_SYMMETRY_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_ADD_SYMMETRY_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_MOVE : - switch((long int)client_data){ - case 1: - XtManageChild(WID.GD.tranDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE_TRANSLATE,call_data); - break; - case 2: - XtManageChild(WID.GD.rotDialog); - ActualizeContextCb(w,(XtPointer) CONTEXT_GEOM_ELEM_MOVE_ROTATE,call_data); - break; - case 3: - XtManageChild(WID.GD.dilatDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE_DILATE,call_data); - break; - case 4: - XtManageChild(WID.GD.symmDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_MOVE_SYMMETRY,call_data); - break; - } - break; - - case CONTEXT_GEOM_ELEM_MOVE_TRANSLATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_MOVE_TRANSLATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_MOVE_TRANSLATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_MOVE_TRANSLATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_MOVE_ROTATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_MOVE_ROTATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_MOVE_ROTATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_MOVE_ROTATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_MOVE_DILATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_MOVE_DILATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_MOVE_DILATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_MOVE_DILATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_MOVE_SYMMETRY : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_MOVE_SYMMETRY_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_MOVE_SYMMETRY_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_MOVE_SYMMETRY_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE : - switch((long int)client_data){ - case 1: - XtManageChild(WID.GD.tranDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_TRANSLATE,call_data); - break; - case 2: - XtManageChild(WID.GD.rotDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_ROTATE,call_data); - break; - case 3: - XtManageChild(WID.GD.dilatDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_DILATE,call_data); - break; - case 4: - XtManageChild(WID.GD.symmDialog); - ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY,call_data); - break; - } - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_TRANSLATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_EXTRUDE_TRANSLATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_EXTRUDE_TRANSLATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_EXTRUDE_TRANSLATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_ROTATE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_EXTRUDE_ROTATE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_EXTRUDE_ROTATE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_EXTRUDE_ROTATE_SURF); break ; - } - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_DILATE : - Msg(WARNING, "Extrude Dilate is not implemented"); - break; - - case CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY : - Msg(WARNING, "Extrude Symmetry is not implemented"); - break; - - case CONTEXT_GEOM_ELEM_DELETE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_ELEM_DELETE_POINT); break ; - case 2: geom_event_handler(GEOM_ELEM_DELETE_LINE); break ; - case 3: geom_event_handler(GEOM_ELEM_DELETE_SURF); break ; - } - break; - - case CONTEXT_GEOM_PHYS : - switch((long int)client_data){ - case 1: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_PHYS_ADD,call_data); break; - case 2: ActualizeContextCb(w,(XtPointer)CONTEXT_GEOM_PHYS_DELETE,call_data); break; - } - break; - - case CONTEXT_GEOM_PHYS_ADD : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_PHYS_ADD_POINT); break ; - case 2: geom_event_handler(GEOM_PHYS_ADD_LINE); break ; - case 3: geom_event_handler(GEOM_PHYS_ADD_SURF); break ; - case 4: geom_event_handler(GEOM_PHYS_ADD_VOLUME); break ; - } - break; - - case CONTEXT_GEOM_PHYS_DELETE : - switch((long int)client_data){ - case 1: geom_event_handler(GEOM_PHYS_DELETE_POINT); break ; - case 2: geom_event_handler(GEOM_PHYS_DELETE_LINE); break ; - case 3: geom_event_handler(GEOM_PHYS_DELETE_SURF); break ; - case 4: geom_event_handler(GEOM_PHYS_DELETE_VOLUME); break ; - } - break; - - case CONTEXT_MESH : - - switch((long int)client_data){ - case 1: ActualizeContextCb(w,(XtPointer)CONTEXT_MESH_DEFINE,call_data); break; - case 2: mesh_event_handler(MESH_1D); break; - case 3: mesh_event_handler(MESH_2D); break; - case 4: mesh_event_handler(MESH_3D); break; - } - break; - - case CONTEXT_MESH_DEFINE : - switch((long int)client_data){ - case 1: - XtManageChild(WID.MD.charLengthDialog); - mesh_event_handler(MESH_DEFINE_CHAR_LENGTH); break; - case 2: - mesh_event_handler(MESH_DEFINE_RECOMBINE); break; - case 3: - XtManageChild(WID.MD.trsfLineDialog); - mesh_event_handler(MESH_DEFINE_TRSF_LINE); break; - case 4: - mesh_event_handler(MESH_DEFINE_TRSF_SURFACE); break; - case 5: - XtManageChild(WID.MD.trsfVolumeDialog); - mesh_event_handler(MESH_DEFINE_TRSF_VOLUME); break; - } - break; - - default : - Msg(WARNING, "Unknown Context in NextContextCb (%d)", actual_global_context); - break; - - } -} - - -int AddViewInUI(int i, char *Name, int Num){ - - if(i > NB_BUTT_MAX -1) return 1; - - txt_post[i-1] = (char*)Malloc(256*sizeof(char)); - strncpy(txt_post[i-1],Name,255); - - if(actual_global_context == CONTEXT_POST) - ActualizeContextCb(NULL,(XtPointer)actual_global_context,NULL); - - return 0; -} - -static int All = 0 ; - -void RemoveViewCb(Widget w, XtPointer client_data, XtPointer call_data){ - Post_View *v; - int i; - - i = (long int)client_data ; - - v = (Post_View*)List_Pointer(Post_ViewList,(long int)i-1); - - while(txt_post[i]){ - strncpy(txt_post[i-1], txt_post[i], 255); - i++; - } - Free(txt_post[i-1]); - txt_post[i-1] = NULL; - - FreeView(v); - - if(!List_Suppress(Post_ViewList, v, fcmpPostViewNum)) - Msg(GERROR, "Could Not Suppress View from List"); - - CTX.post.nb_views = List_Nbr(Post_ViewList); - - if(actual_global_context == CONTEXT_POST) - ActualizeContextCb(NULL,(XtPointer)actual_global_context,NULL); - - if(!All) Draw(); - -} - -void RemoveAllViewsCb(Widget w, XtPointer client_data, XtPointer call_data){ - int i=1; - if(!Post_ViewList) return; - All = 1; - while(List_Nbr(Post_ViewList)) - RemoveViewCb(NULL, (XtPointer)i, NULL); - All = 0; - Draw(); -} - diff --git a/Motif/CbContext.h b/Motif/CbContext.h deleted file mode 100644 index 7a888f7c709ed32d4082324b784b74268dfa3f57..0000000000000000000000000000000000000000 --- a/Motif/CbContext.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _CB_CONTEXT_H_ -#define _CB_CONTEXT_H_ - -#define CONTEXT_GEOM 101 -#define CONTEXT_GEOM_ELEM 102 -#define CONTEXT_GEOM_ELEM_ADD 103 -#define CONTEXT_GEOM_ELEM_ADD_NEW 104 -#define CONTEXT_GEOM_ELEM_ADD_TRANSLATE 105 -#define CONTEXT_GEOM_ELEM_ADD_ROTATE 106 -#define CONTEXT_GEOM_ELEM_ADD_DILATE 107 -#define CONTEXT_GEOM_ELEM_ADD_SYMMETRY 108 -#define CONTEXT_GEOM_ELEM_MOVE 109 -#define CONTEXT_GEOM_ELEM_MOVE_TRANSLATE 110 -#define CONTEXT_GEOM_ELEM_MOVE_ROTATE 111 -#define CONTEXT_GEOM_ELEM_MOVE_DILATE 112 -#define CONTEXT_GEOM_ELEM_MOVE_SYMMETRY 113 -#define CONTEXT_GEOM_ELEM_EXTRUDE 114 -#define CONTEXT_GEOM_ELEM_EXTRUDE_TRANSLATE 115 -#define CONTEXT_GEOM_ELEM_EXTRUDE_ROTATE 116 -#define CONTEXT_GEOM_ELEM_EXTRUDE_DILATE 117 -#define CONTEXT_GEOM_ELEM_EXTRUDE_SYMMETRY 118 -#define CONTEXT_GEOM_ELEM_DELETE 119 -#define CONTEXT_GEOM_PHYS 120 -#define CONTEXT_GEOM_PHYS_ADD 121 -#define CONTEXT_GEOM_PHYS_DELETE 122 -#define CONTEXT_MESH 123 -#define CONTEXT_MESH_DEFINE 124 -#define CONTEXT_POST 125 -#define CONTEXT_BACKWARD 126 -#define CONTEXT_FORWARD 127 - -#endif diff --git a/Motif/CbFile.cpp b/Motif/CbFile.cpp deleted file mode 100644 index 0a2b3de02755975853443471a2440858d5d3c77d..0000000000000000000000000000000000000000 --- a/Motif/CbFile.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// $Id: CbFile.cpp,v 1.7 2001-02-20 18:32:58 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "OpenFile.h" -#include "Mesh.h" -#include "Draw.h" -#include "Widgets.h" -#include "Context.h" -#include "Options.h" -#include "CreateFile.h" - -#include "CbFile.h" -#include "CbColorbar.h" - -extern Context_T CTX; -extern Widgets_T WID; -extern Mesh M; - -void SaveToDisk (char *FileName, Widget warning, - void (*function)(char *filename, int format)){ - FILE *fp ; - static char KeepFileName[256]; - - if(FileName){ - fp = fopen(FileName,"r"); - if(fp) { - XtManageChild(warning); - strcpy(KeepFileName,FileName); - fclose(fp); - return; - } - else{ - strcpy(KeepFileName,FileName); - } - } - - function(KeepFileName, CTX.print.format); -} - -/* ------------------------------------------------------------------------ - F i l e C b - ------------------------------------------------------------------------ */ - -void FileCb(Widget w, XtPointer client_data, XtPointer call_data){ - char *c; - XmString xms; - - switch ((long int)client_data) { - case FILE_SAVE_MESH : - Print_Mesh(&M, NULL, CTX.mesh.format); - return; - case FILE_SAVE_AS_OVERWRITE : - SaveToDisk(NULL, WID.ED.saveAsDialog, CreateOutputFile); - return; - } - - XtVaGetValues(w, XmNtextString, &xms, NULL); - XmStringGetLtoR(xms, XmSTRING_DEFAULT_CHARSET, &c); - XmStringFree(xms); - - switch ((long int)client_data) { - case FILE_LOAD_GEOM : OpenProblem(c); Draw(); break; - case FILE_LOAD_POST : MergeProblem(c); ColorBarRedraw(); Draw(); break; - case FILE_SAVE_AS : SaveToDisk(c, WID.ED.saveAsDialog, CreateOutputFile); break; - case FILE_SAVE_OPTIONS_AS : Print_Options(0,GMSH_FULLRC,c); break; - default : - Msg(WARNING, "Unknown event in FileCb : %d", (long int)client_data); - break; - } - -} - diff --git a/Motif/CbFile.h b/Motif/CbFile.h deleted file mode 100644 index d2405785e718148ea8b066339e487d0968f9972b..0000000000000000000000000000000000000000 --- a/Motif/CbFile.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _CB_FILE_H_ -#define _CB_FILE_H_ - -#define FILE_LOAD_GEOM 301 -#define FILE_LOAD_POST 302 -#define FILE_SAVE_MESH 303 -#define FILE_SAVE_AS 304 -#define FILE_SAVE_AS_OVERWRITE 305 -#define FILE_SAVE_OPTIONS_AS 306 - -#endif diff --git a/Motif/CbGeneral.cpp b/Motif/CbGeneral.cpp deleted file mode 100644 index 003c42136d559b17d452f0ae5d41c21c61cecb77..0000000000000000000000000000000000000000 --- a/Motif/CbGeneral.cpp +++ /dev/null @@ -1,200 +0,0 @@ -// $Id: CbGeneral.cpp,v 1.3 2001-08-28 20:40:21 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Mesh.h" -#include "Draw.h" -#include "Views.h" -#include "Context.h" -#include "XContext.h" -#include "Widgets.h" - -extern Context_T CTX; -extern XContext_T XCTX; -extern Widgets_T WID; - -extern void GetStatistics(double s[50]); - -static char label[32]; - -/* ------------------------------------------------------------------------ - E x i t C b - ------------------------------------------------------------------------ */ - -void ExitCb(Widget w, XtPointer cd, XtPointer cb){ - exit(0); -} - -/* ------------------------------------------------------------------------ - M a n a g e C b - ------------------------------------------------------------------------ */ - -void ManageCb (Widget w, XtPointer client_data, XtPointer call_data){ - XtIsManaged((Widget)client_data) ? - XtUnmanageChild((Widget)client_data) : - XtManageChild((Widget)client_data) ; -} - - -/* ------------------------------------------------------------------------ - P o p u p H a n d l e r - ------------------------------------------------------------------------ */ - -void PopupHandler (Widget w, Widget pw, XEvent *event, Boolean *ctd ){ - if(((XButtonEvent *)event)->button != Button3) return; - - /* force the pointer to be slightly over the first button */ - ((XButtonEvent *)event)->x_root -= 7 ; - ((XButtonEvent *)event)->y_root -= 7 ; - - XmMenuPosition(pw, (XButtonEvent *)event); - XtManageChild(pw); -} - - - -/* ------------------------------------------------------------------------ - CurrentInfoCb - ------------------------------------------------------------------------ */ - -void CurrentInfoCb (Widget w, XtPointer client_data, XtPointer call_data){ - double s[50], p[20]; - int i; - Post_View *v ; - - if((long int)client_data && XtIsManaged(WID.OD.infoDialog)){ - XtUnmanageChild(WID.OD.infoDialog); - } - else{ - GetStatistics(s); - -#define VLAB(caca) WID.OD.infoValueLabel[(caca)], XmNlabelString, \ - XmStringCreateSimple(label), NULL - - /* info geom */ - sprintf(label, "%g", s[0]); XtVaSetValues(VLAB(0)); - sprintf(label, "%g", s[1]); XtVaSetValues(VLAB(1)); - sprintf(label, "%g", s[2]); XtVaSetValues(VLAB(2)); - sprintf(label, "%g", s[3]); XtVaSetValues(VLAB(3)); - - /* info mesh */ - sprintf(label, "%g", s[4]); XtVaSetValues(VLAB(4)); - sprintf(label, "%g", s[5]); XtVaSetValues(VLAB(5)); - sprintf(label, "%g", s[6]); XtVaSetValues(VLAB(6)); - - sprintf(label, "%g", s[7]-s[8]); XtVaSetValues(VLAB(7)); - sprintf(label, "%g", s[8]); XtVaSetValues(VLAB(8)); - sprintf(label, "%g", s[9]); XtVaSetValues(VLAB(9)); - sprintf(label, "%g", s[10]); XtVaSetValues(VLAB(10)); - sprintf(label, "%g", s[11]); XtVaSetValues(VLAB(11)); - sprintf(label, "%g", s[12]); XtVaSetValues(VLAB(12)); - - sprintf(label, "%g", s[13]); XtVaSetValues(VLAB(13)); - sprintf(label, "%g", s[14]); XtVaSetValues(VLAB(14)); - sprintf(label, "%g", s[15]); XtVaSetValues(VLAB(15)); - - sprintf(label, "%.4g (%.4g->%.4g)", s[17], s[19], s[18]); XtVaSetValues(VLAB(16)); - sprintf(label, "%.4g (%.4g->%.4g)", s[20], s[22], s[21]); XtVaSetValues(VLAB(17)); - sprintf(label, "%.4g (%.4g->%.4g)", s[23], s[25], s[24]); XtVaSetValues(VLAB(18)); - - /* info post */ - - p[0] = List_Nbr(Post_ViewList) ; - sprintf(label, "%g", p[0]); XtVaSetValues(VLAB(19)); - - s[1] = s[2] = s[3] = s[4] = 0 ; - for(i=0 ; i<List_Nbr(Post_ViewList) ; i++){ - v = (Post_View*)List_Pointer(Post_ViewList, i); - if(v->Visible){ - s[1] += v->NbSP + v->NbVP + v->NbTP; - s[2] += v->NbSL + v->NbVL + v->NbTL; - s[3] += v->NbST + v->NbVT + v->NbTT; - s[4] += v->NbSS + v->NbVS + v->NbTS; - } - } - sprintf(label, "%g", s[1]); XtVaSetValues(VLAB(20)); - sprintf(label, "%g", s[2]); XtVaSetValues(VLAB(21)); - sprintf(label, "%g", s[3]); XtVaSetValues(VLAB(22)); - sprintf(label, "%g", s[4]); XtVaSetValues(VLAB(23)); - -#undef VLAB - - if((long int)client_data) - XtManageChild(WID.OD.infoDialog) ; - else - XmUpdateDisplay(WID.OD.infoDialog); - } - -} - -/* ------------------------------------------------------------------------ - set_XXX - ------------------------------------------------------------------------ */ - -void set_r(int i, double val){ - if(CTX.useTrackball){ - if(XtIsManaged(WID.OD.viewportDialog)){ - sprintf(label, "---"); - XtVaSetValues(WID.OD.viewportText[0][i], XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.viewportText[0][i]); - } - } - else{ - if(!CTX.rlock[i]){ - CTX.r[i] = val; - if(XtIsManaged(WID.OD.viewportDialog)){ - sprintf(label, "%.5g", CTX.r[i]); - XtVaSetValues(WID.OD.viewportText[0][i], XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.viewportText[0][i]); - } - } - } -} - -void set_t(int i, double val){ - if(!CTX.tlock[i]){ - CTX.t[i] = val; - if(XtIsManaged(WID.OD.viewportDialog)){ - sprintf(label, "%.5g", CTX.t[i]); - XtVaSetValues(WID.OD.viewportText[1][i], XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.viewportText[1][i]); - } - } -} - -void set_s(int i, double val){ - if(!CTX.slock[i]){ - CTX.s[i] = val; - if(XtIsManaged(WID.OD.viewportDialog)){ - sprintf(label, "%.5g", CTX.s[i]); - XtVaSetValues(WID.OD.viewportText[2][i], XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.viewportText[2][i]); - } - } -} - - -/* ------------------------------------------------------------------------ - CurrentViewportCb - ------------------------------------------------------------------------ */ - -void CurrentViewportCb (Widget w, XtPointer client_data, XtPointer call_data){ - int i; - - if(XtIsManaged(WID.OD.viewportDialog)){ - XtUnmanageChild(WID.OD.viewportDialog); - } - else{ - for(i=0 ; i<3 ; i++){ - sprintf(label, "%.5g", CTX.r[i]); - XtVaSetValues(WID.OD.viewportText[0][i], XmNvalue, label, NULL); - sprintf(label, "%.5g", CTX.t[i]); - XtVaSetValues(WID.OD.viewportText[1][i], XmNvalue, label, NULL); - sprintf(label, "%.5g", CTX.s[i]); - XtVaSetValues(WID.OD.viewportText[2][i], XmNvalue, label, NULL); - } - XtManageChild(WID.OD.viewportDialog) ; - } - -} - diff --git a/Motif/CbGeom.cpp b/Motif/CbGeom.cpp deleted file mode 100644 index 5e6928b49c8d4dcad819398a73d7219511a0ccb4..0000000000000000000000000000000000000000 --- a/Motif/CbGeom.cpp +++ /dev/null @@ -1,621 +0,0 @@ -// $Id: CbGeom.cpp,v 1.5 2001-01-29 08:43:44 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Geo.h" -#include "Mesh.h" -#include "Draw.h" -#include "Widgets.h" -#include "Context.h" -#include "Verif.h" -#include "OpenFile.h" - -#include "CbGeom.h" - -extern Context_T CTX; -extern Widgets_T WID; -extern Mesh M; - -static char name_text[100], value_text[100]; - -int SelectContour (int type, int num, List_T *Liste1){ - int k,ip,i; - List_T *Liste2; - - Liste2 = List_Create(1,1,sizeof(int)); - - if(!List_Nbr(Liste1)){ - switch(type){ - case ENT_LINE : k = alledgeslinked (num, Liste1, (List_T*)NULL); break; - case ENT_SURFACE : k = allfaceslinked (num, Liste1, (List_T*)NULL); break; - } - } - else{ - List_Reset(Liste2); - for(i=0;i<List_Nbr(Liste1);i++) - List_Add(Liste2,List_Pointer(Liste1,i)); - List_Reset(Liste1); - switch(type){ - case ENT_LINE : k = alledgeslinked (num, Liste1, Liste2); break; - case ENT_SURFACE : k = allfaceslinked (num, Liste1, Liste2); break; - } - } - - for(i=0;i<List_Nbr(Liste1);i++){ - List_Read(Liste1,i,&ip); - switch(type){ - case ENT_LINE : HighlightEntityNum(0,abs(ip),0,1); break ; - case ENT_SURFACE : HighlightEntityNum(0,0,abs(ip),1); break ; - } - } - - List_Delete(Liste2); - return k; -} - - -/* ------------------------------------------------------------------------ */ -/* g e o m _ e v e n t _ h a n d l e r */ -/* ------------------------------------------------------------------------ */ - -void geom_event_handler (int event) { - Vertex *v; - Curve *c; - Surface *s; - static int n=0, p[100]; - - int ib,zone,type; - List_T *Liste1, *Liste2; - - if(CTX.threads_lock) return ; - - switch (event) { - - case GEOM_PARSE : - OpenProblem(CTX.filename); - Draw(); - break; - - case GEOM_ELEM_ADD_NEW_POINT : - add_point(CTX.filename); - ZeroHighlight(&M); - Replot(); - break; - - case GEOM_ELEM_ADD_NEW_LINE : - case GEOM_ELEM_ADD_NEW_SPLINE : - case GEOM_ELEM_ADD_NEW_BEZIER : - case GEOM_ELEM_ADD_NEW_BSPLINE : - n=0; - while(1){ - Msg(STATUS3,"Select Point ('e'=end, 'q'=quit)"); - ib = SelectEntity(ENT_POINT, &v,&c,&s); - if(ib == 1){ /* left mouse butt */ - p[n++] = v->Num; - } - if (ib == -1){ /* 'e' */ - if(n >= 2) { - switch(event){ - case GEOM_ELEM_ADD_NEW_LINE : add_multline(n,p,CTX.filename); break; - case GEOM_ELEM_ADD_NEW_SPLINE : add_spline (n,p,CTX.filename); break; - case GEOM_ELEM_ADD_NEW_BEZIER : add_bezier (n,p,CTX.filename); break; - case GEOM_ELEM_ADD_NEW_BSPLINE: add_bspline (n,p,CTX.filename); break; - } - } - n=0; - ZeroHighlight(&M); - Replot(); - } - if(ib == 0){ /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - } - break; - - case GEOM_ELEM_ADD_NEW_CIRCLE : - n=0; - while(1){ - if(n == 0) Msg(STATUS3,"Select Center ('q'=quit)"); - if(n == 1) Msg(STATUS3,"Select Starting Point ('q'=quit)"); - if(n == 2) Msg(STATUS3,"Select Ending Point ('q'=quit)"); - ib = SelectEntity(ENT_POINT, &v,&c,&s); - if(ib == 1) { /* left mouse butt */ - p[n++] = v->Num; - } - if(ib == 0) { /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - if(n == 3){ - add_circ(p[1],p[0],p[2],CTX.filename); /* begin, center, end */ - ZeroHighlight(&M); - Replot(); - n=0; - } - } - break; - - case GEOM_ELEM_ADD_NEW_ELLIPSIS : - n = 0; - while(1){ - if(n == 0) Msg(STATUS3,"Select Center ('q'=quit)"); - if(n == 1) Msg(STATUS3,"Select an Axis Point ('q'=quit)"); - if(n == 2) Msg(STATUS3,"Select Starting Point ('q'=quit)"); - if(n == 3) Msg(STATUS3,"Select Ending Point ('q'=quit)"); - ib = SelectEntity(ENT_POINT, &v,&c,&s); - if(ib == 1) { /* left mouse butt */ - p[n++] = v->Num; - } - if(ib == 0){ /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - if(n == 4){ - add_ell(p[3],p[2],p[0],p[1],CTX.filename); - ZeroHighlight(&M); - Replot(); - n=0; - } - } - break; - - case GEOM_ELEM_ADD_NEW_PLANE_SURF : - case GEOM_ELEM_ADD_NEW_RULED_SURF : - case GEOM_ELEM_ADD_NEW_VOLUME : - Liste1 = List_Create(10,10,sizeof(int)); - Liste2 = List_Create(10,10,sizeof(int)); - - if(event == GEOM_ELEM_ADD_NEW_VOLUME) - type = ENT_SURFACE; - else - type = ENT_LINE; - - while(1){ - List_Reset(Liste1); - List_Reset(Liste2); - - while(1) { - Msg(STATUS3,"Select Boundary ('q'=quit)"); - ib = SelectEntity(type, &v,&c,&s); - if(ib <= 0){ - ZeroHighlight(&M); - Replot(); - goto stopall; - } - if(SelectContour (type, (type==ENT_LINE)?c->Num:s->Num, Liste1)){ - if(type==ENT_LINE) - add_loop(Liste1,CTX.filename,&zone); - else - add_vol(Liste1,CTX.filename,&zone); - List_Reset(Liste1); - List_Add(Liste2,&zone); - while(1){ - Msg(STATUS3,"Select Holes ('q'=quit)"); - ib = SelectEntity(type, &v,&c,&s); - if(ib <= 0){ - ZeroHighlight(&M); - Replot(); - break; - } - if(SelectContour (type, (type==ENT_LINE)?c->Num:s->Num, Liste1)){ - if(type==ENT_LINE) - add_loop(Liste1,CTX.filename,&zone); - else - add_vol(Liste1,CTX.filename,&zone); - List_Reset(Liste1); - List_Add(Liste2,&zone); - } - } - if(List_Nbr(Liste2)){ - switch(event){ - case GEOM_ELEM_ADD_NEW_RULED_SURF : add_surf(Liste2,CTX.filename,0,1); break; - case GEOM_ELEM_ADD_NEW_PLANE_SURF : add_surf(Liste2,CTX.filename,0,2); break; - case GEOM_ELEM_ADD_NEW_VOLUME : add_multvol(Liste2,CTX.filename); break; - } - ZeroHighlight(&M); - Replot(); - break; - } - } - } - } - stopall : ; - List_Delete(Liste1); - List_Delete(Liste2); - break; - - - case GEOM_ELEM_ADD_TRANSLATE_POINT : - case GEOM_ELEM_MOVE_TRANSLATE_POINT : - while(1){ - Msg(STATUS3,"Select Point ('q'=quit)"); - if(!SelectEntity(ENT_POINT, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - translate(event==GEOM_ELEM_ADD_TRANSLATE_POINT?1:0,v->Num,CTX.filename, "Point"); - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_ADD_TRANSLATE_LINE : - case GEOM_ELEM_MOVE_TRANSLATE_LINE : - while(1){ - Msg(STATUS3,"Select Line ('q'=quit)"); - if(!SelectEntity(ENT_LINE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - translate(event==GEOM_ELEM_ADD_TRANSLATE_LINE?1:0,c->Num,CTX.filename, "Line"); - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_ADD_TRANSLATE_SURF : - case GEOM_ELEM_MOVE_TRANSLATE_SURF : - while(1){ - Msg(STATUS3,"Select Surface ('q'=quit)"); - if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - translate(event==GEOM_ELEM_ADD_TRANSLATE_SURF?1:0,s->Num,CTX.filename, "Surface"); - ZeroHighlight(&M); - Replot(); - } - break; - - - case GEOM_ELEM_ADD_ROTATE_POINT : - case GEOM_ELEM_MOVE_ROTATE_POINT : - while(1){ - Msg(STATUS3,"Select Point ('q'=quit)"); - if(!SelectEntity(ENT_POINT, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - rotate(event==GEOM_ELEM_ADD_ROTATE_POINT?1:0,v->Num,CTX.filename,"Point"); - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_ADD_ROTATE_LINE : - case GEOM_ELEM_MOVE_ROTATE_LINE : - while(1){ - Msg(STATUS3,"Select Line ('q'=quit)"); - if(!SelectEntity(ENT_LINE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - rotate(event==GEOM_ELEM_ADD_ROTATE_LINE?1:0,c->Num,CTX.filename,"Line"); - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_ADD_ROTATE_SURF : - case GEOM_ELEM_MOVE_ROTATE_SURF : - while(1){ - Msg(STATUS3,"Select Surface ('q'=quit)"); - if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - rotate(event==GEOM_ELEM_ADD_ROTATE_SURF?1:0,s->Num,CTX.filename,"Surface"); - ZeroHighlight(&M); - Replot(); - } - break; - - - - case GEOM_ELEM_EXTRUDE_TRANSLATE_POINT : - case GEOM_ELEM_EXTRUDE_ROTATE_POINT : - while(1){ - Msg(STATUS3,"Select Point ('q'=quit)"); - if(!SelectEntity(ENT_POINT, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - event==GEOM_ELEM_EXTRUDE_TRANSLATE_POINT ? - extrude(v->Num,CTX.filename, "Point") : - protude(v->Num,CTX.filename, "Point") ; - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_EXTRUDE_TRANSLATE_LINE : - case GEOM_ELEM_EXTRUDE_ROTATE_LINE : - while(1){ - Msg(STATUS3,"Select Line ('q'=quit)"); - if(!SelectEntity(ENT_LINE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - event==GEOM_ELEM_EXTRUDE_TRANSLATE_LINE ? - extrude(c->Num,CTX.filename, "Line") : - protude(c->Num,CTX.filename, "Line") ; - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_EXTRUDE_TRANSLATE_SURF : - case GEOM_ELEM_EXTRUDE_ROTATE_SURF : - while(1){ - Msg(STATUS3,"Select Surface ('q'=quit)"); - if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - event==GEOM_ELEM_EXTRUDE_TRANSLATE_SURF ? - extrude(s->Num,CTX.filename, "Surface") : - protude(s->Num,CTX.filename, "Surface") ; - ZeroHighlight(&M); - Replot(); - } - break; - - - case GEOM_ELEM_ADD_DILATE_POINT : - case GEOM_ELEM_MOVE_DILATE_POINT : - case GEOM_ELEM_ADD_SYMMETRY_POINT : - case GEOM_ELEM_MOVE_SYMMETRY_POINT : - while(1){ - Msg(STATUS3,"Select Point ('q'=quit)"); - if(!SelectEntity(ENT_POINT, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - switch(event){ - case GEOM_ELEM_ADD_DILATE_POINT : - dilate(1,v->Num,CTX.filename,"Point"); - break; - case GEOM_ELEM_MOVE_DILATE_POINT : - dilate(0,v->Num,CTX.filename,"Point"); - break; - case GEOM_ELEM_ADD_SYMMETRY_POINT : - symmetry(1,v->Num,CTX.filename,"Point"); - break; - case GEOM_ELEM_MOVE_SYMMETRY_POINT : - symmetry(0,v->Num,CTX.filename,"Point"); - break; - } - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_ADD_DILATE_LINE : - case GEOM_ELEM_MOVE_DILATE_LINE : - case GEOM_ELEM_ADD_SYMMETRY_LINE : - case GEOM_ELEM_MOVE_SYMMETRY_LINE : - while(1){ - Msg(STATUS3,"Select Line ('q'=quit)"); - if(!SelectEntity(ENT_LINE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - switch(event){ - case GEOM_ELEM_ADD_DILATE_LINE : - dilate(1,c->Num,CTX.filename,"Line"); - break; - case GEOM_ELEM_MOVE_DILATE_LINE : - dilate(0,c->Num,CTX.filename,"Line"); - break; - case GEOM_ELEM_ADD_SYMMETRY_LINE : - symmetry(1,c->Num,CTX.filename,"Line"); - break; - case GEOM_ELEM_MOVE_SYMMETRY_LINE : - symmetry(0,c->Num,CTX.filename,"Line"); - break; - } - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_ADD_DILATE_SURF : - case GEOM_ELEM_MOVE_DILATE_SURF : - case GEOM_ELEM_ADD_SYMMETRY_SURF : - case GEOM_ELEM_MOVE_SYMMETRY_SURF : - while(1){ - Msg(STATUS3,"Select Surface ('q'=quit)"); - if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - switch(event){ - case GEOM_ELEM_ADD_DILATE_SURF : - dilate(1,s->Num,CTX.filename,"Surface"); - break; - case GEOM_ELEM_MOVE_DILATE_SURF : - dilate(0,s->Num,CTX.filename,"Surface"); - break; - case GEOM_ELEM_ADD_SYMMETRY_SURF : - symmetry(1,s->Num,CTX.filename,"Surface"); - break; - case GEOM_ELEM_MOVE_SYMMETRY_SURF : - symmetry(0,s->Num,CTX.filename,"Surface"); - break; - } - ZeroHighlight(&M); - Replot(); - } - break; - - - - - case GEOM_ELEM_DELETE_POINT : - while(1){ - Msg(STATUS3,"Select Point ('q'=quit)"); - if(!SelectEntity(ENT_POINT, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - delet(v->Num,CTX.filename, "Point"); - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_DELETE_LINE : - while(1){ - Msg(STATUS3,"Select Line ('q'=quit)"); - if(!SelectEntity(ENT_LINE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - delet(c->Num,CTX.filename, "Line"); - ZeroHighlight(&M); - Replot(); - } - break; - case GEOM_ELEM_DELETE_SURF : - while(1){ - Msg(STATUS3,"Select Point ('q'=quit)"); - if(!SelectEntity(ENT_SURFACE, &v,&c,&s)){ - ZeroHighlight(&M); - Replot(); - break; - } - delet(s->Num,CTX.filename, "Surface"); - ZeroHighlight(&M); - Replot(); - } - break; - - - case GEOM_ELEM_SKETCH : - Msg(STATUS3,"Verifying Geometry"); - add_infile("Coherence;",CTX.filename); - ZeroHighlight(&M); - Replot(); - break; - - case GEOM_PHYS_ADD_POINT: - case GEOM_PHYS_ADD_LINE: - case GEOM_PHYS_ADD_SURF: - Liste1 = List_Create(5,5,sizeof(int)); - while(1){ - switch(event){ - case GEOM_PHYS_ADD_POINT: - Msg(STATUS3,"Select Point ('e'=end, 'q'=quit)"); - type = ENT_POINT; - break; - case GEOM_PHYS_ADD_LINE: - Msg(STATUS3,"Select Line ('e'=end, 'q'=quit)"); - type = ENT_LINE; - break; - case GEOM_PHYS_ADD_SURF: - Msg(STATUS3,"Select Surface ('e'=end, 'q'=quit)"); - type = ENT_SURFACE; - break; - } - ib = SelectEntity(type, &v,&c,&s); - if(ib == 1){ /* left mouse */ - switch(event){ - case GEOM_PHYS_ADD_POINT: List_Add(Liste1, &v->Num); break; - case GEOM_PHYS_ADD_LINE: List_Add(Liste1, &c->Num); break; - case GEOM_PHYS_ADD_SURF: List_Add(Liste1, &s->Num); break; - } - } - if(ib == -1){ /* end */ - if(List_Nbr(Liste1)){ - add_physical(Liste1,CTX.filename,type,&zone); - List_Reset(Liste1); - ZeroHighlight(&M); - Replot(); - } - } - if(ib == 0){ - ZeroHighlight(&M); - Replot(); - break; - } - } - break; - - case GEOM_PHYS_ADD_VOLUME : - Msg(WARNING, "Add Physical Volume not done Interactively (Please Edit File Manually)"); - break; - - case GEOM_PHYS_DELETE_POINT : - case GEOM_PHYS_DELETE_LINE : - case GEOM_PHYS_DELETE_SURF : - case GEOM_PHYS_DELETE_VOLUME : - Msg(WARNING, "Deletetion of Physical Entities not Done"); - break; - - case GEOM_ELEM_ADD_NEW_NURBS_SURF : - Msg(WARNING, "Add NURBS not not done Interactively (Please Edit File Manually)"); - break; - - default : - Msg(WARNING, "Unknown Event in geom_event_handler"); - break; - - } - - Msg(STATUS3,"Ready"); -} - - -/* ------------------------------------------------------------------------ - G e o m C b - ------------------------------------------------------------------------ */ - -void GeomCb (Widget w, XtPointer client_data, XtPointer call_data){ - - switch((long int)client_data){ - - case GEOM_PARAMETER_ADD : add_param(name_text,value_text,CTX.filename); break; - case GEOM_PARAMETER_NAME : strcpy(name_text,XmTextGetString(w)); break; - case GEOM_PARAMETER_VALUE : strcpy(value_text,XmTextGetString(w)); break; - case GEOM_POINT_ADD : geom_event_handler(GEOM_ELEM_ADD_NEW_POINT); Replot(); break; - case GEOM_POINT_X : strcpy(x_text,XmTextGetString(w)); break; - case GEOM_POINT_Y : strcpy(y_text,XmTextGetString(w)); break; - case GEOM_POINT_Z : strcpy(z_text,XmTextGetString(w)); break; - case GEOM_POINT_L : strcpy(l_text,XmTextGetString(w)); break; - case GEOM_TRAN_X : strcpy(tx_text,XmTextGetString(w)); break; - case GEOM_TRAN_Y : strcpy(ty_text,XmTextGetString(w)); break; - case GEOM_TRAN_Z : strcpy(tz_text,XmTextGetString(w)); break; - case GEOM_ROT_PX : strcpy(px_text,XmTextGetString(w)); break; - case GEOM_ROT_PY : strcpy(py_text,XmTextGetString(w)); break; - case GEOM_ROT_PZ : strcpy(pz_text,XmTextGetString(w)); break; - case GEOM_ROT_AX : strcpy(ax_text,XmTextGetString(w)); break; - case GEOM_ROT_AY : strcpy(ay_text,XmTextGetString(w)); break; - case GEOM_ROT_AZ : strcpy(az_text,XmTextGetString(w)); break; - case GEOM_ROT_ANGLE : strcpy(angle_text,XmTextGetString(w)); break; - case GEOM_DILAT_X : strcpy(dx_text,XmTextGetString(w)); break; - case GEOM_DILAT_Y : strcpy(dy_text,XmTextGetString(w)); break; - case GEOM_DILAT_Z : strcpy(dz_text,XmTextGetString(w)); break; - case GEOM_DILAT_F : strcpy(df_text,XmTextGetString(w)); break; - case GEOM_SYMMETRY_A : strcpy(sa_text,XmTextGetString(w)); break; - case GEOM_SYMMETRY_B : strcpy(sb_text,XmTextGetString(w)); break; - case GEOM_SYMMETRY_C : strcpy(sc_text,XmTextGetString(w)); break; - case GEOM_SYMMETRY_D : strcpy(sd_text,XmTextGetString(w)); break; - default : - Msg(WARNING, "Unknown Value in GeomCb (%d)", (long int)client_data); - break; - - } -} - diff --git a/Motif/CbGeom.h b/Motif/CbGeom.h deleted file mode 100644 index 08f85e139e6cdc7984268fd3eda05c50cf9f66f0..0000000000000000000000000000000000000000 --- a/Motif/CbGeom.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef _CB_GEOM_H_ -#define _CB_GEOM_H_ - -/* geom event handler */ - -#define GEOM_ELEM_ADD_NEW_PARAMETER 1 -#define GEOM_ELEM_ADD_NEW_POINT 2 -#define GEOM_ELEM_ADD_NEW_LINE 3 -#define GEOM_ELEM_ADD_NEW_SPLINE 4 -#define GEOM_ELEM_ADD_NEW_BEZIER 5 -#define GEOM_ELEM_ADD_NEW_BSPLINE 6 -#define GEOM_ELEM_ADD_NEW_CIRCLE 7 -#define GEOM_ELEM_ADD_NEW_ELLIPSIS 8 -#define GEOM_ELEM_ADD_NEW_PLANE_SURF 9 -#define GEOM_ELEM_ADD_NEW_RULED_SURF 10 -#define GEOM_ELEM_ADD_NEW_NURBS_SURF 11 -#define GEOM_ELEM_ADD_NEW_VOLUME 12 -#define GEOM_ELEM_ADD_TRANSLATE_POINT 13 -#define GEOM_ELEM_ADD_TRANSLATE_LINE 14 -#define GEOM_ELEM_ADD_TRANSLATE_SURF 15 -#define GEOM_ELEM_ADD_ROTATE_POINT 16 -#define GEOM_ELEM_ADD_ROTATE_LINE 17 -#define GEOM_ELEM_ADD_ROTATE_SURF 18 -#define GEOM_ELEM_ADD_DILATE_POINT 19 -#define GEOM_ELEM_ADD_DILATE_LINE 20 -#define GEOM_ELEM_ADD_DILATE_SURF 21 -#define GEOM_ELEM_ADD_SYMMETRY_POINT 22 -#define GEOM_ELEM_ADD_SYMMETRY_LINE 23 -#define GEOM_ELEM_ADD_SYMMETRY_SURF 24 -#define GEOM_ELEM_MOVE_TRANSLATE_POINT 25 -#define GEOM_ELEM_MOVE_TRANSLATE_LINE 26 -#define GEOM_ELEM_MOVE_TRANSLATE_SURF 27 -#define GEOM_ELEM_MOVE_ROTATE_POINT 28 -#define GEOM_ELEM_MOVE_ROTATE_LINE 29 -#define GEOM_ELEM_MOVE_ROTATE_SURF 30 -#define GEOM_ELEM_MOVE_DILATE_POINT 31 -#define GEOM_ELEM_MOVE_DILATE_LINE 32 -#define GEOM_ELEM_MOVE_DILATE_SURF 33 -#define GEOM_ELEM_MOVE_SYMMETRY_POINT 34 -#define GEOM_ELEM_MOVE_SYMMETRY_LINE 35 -#define GEOM_ELEM_MOVE_SYMMETRY_SURF 36 -#define GEOM_ELEM_EXTRUDE_TRANSLATE_POINT 37 -#define GEOM_ELEM_EXTRUDE_TRANSLATE_LINE 38 -#define GEOM_ELEM_EXTRUDE_TRANSLATE_SURF 39 -#define GEOM_ELEM_EXTRUDE_ROTATE_POINT 40 -#define GEOM_ELEM_EXTRUDE_ROTATE_LINE 41 -#define GEOM_ELEM_EXTRUDE_ROTATE_SURF 42 -#define GEOM_ELEM_DELETE_POINT 43 -#define GEOM_ELEM_DELETE_LINE 44 -#define GEOM_ELEM_DELETE_SURF 45 -#define GEOM_ELEM_SKETCH 46 -#define GEOM_PHYS_ADD_POINT 47 -#define GEOM_PHYS_ADD_LINE 48 -#define GEOM_PHYS_ADD_SURF 49 -#define GEOM_PHYS_ADD_VOLUME 50 -#define GEOM_PHYS_DELETE_POINT 51 -#define GEOM_PHYS_DELETE_LINE 52 -#define GEOM_PHYS_DELETE_SURF 53 -#define GEOM_PHYS_DELETE_VOLUME 54 -#define GEOM_PARSE 55 - -/* GeomCb */ - -#define GEOM_PARAMETER_ADD 1 -#define GEOM_PARAMETER_NAME 2 -#define GEOM_PARAMETER_VALUE 3 -#define GEOM_POINT_ADD 4 -#define GEOM_POINT_X 5 -#define GEOM_POINT_Y 6 -#define GEOM_POINT_Z 7 -#define GEOM_POINT_L 8 -#define GEOM_TRAN_X 9 -#define GEOM_TRAN_Y 10 -#define GEOM_TRAN_Z 11 -#define GEOM_ROT_PX 12 -#define GEOM_ROT_PY 13 -#define GEOM_ROT_PZ 14 -#define GEOM_ROT_AX 15 -#define GEOM_ROT_AY 16 -#define GEOM_ROT_AZ 17 -#define GEOM_ROT_ANGLE 18 -#define GEOM_DILAT_X 19 -#define GEOM_DILAT_Y 20 -#define GEOM_DILAT_Z 21 -#define GEOM_DILAT_F 22 -#define GEOM_SYMMETRY_A 23 -#define GEOM_SYMMETRY_B 24 -#define GEOM_SYMMETRY_C 25 -#define GEOM_SYMMETRY_D 26 - -void geom_event_handler (int event); - -#endif diff --git a/Motif/CbInput.cpp b/Motif/CbInput.cpp deleted file mode 100644 index 17a80f5206ef237d9caf3a9299ec94b43e4a56ff..0000000000000000000000000000000000000000 --- a/Motif/CbInput.cpp +++ /dev/null @@ -1,719 +0,0 @@ -// $Id: CbInput.cpp,v 1.7 2001-02-17 22:04:05 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Mesh.h" -#include "Draw.h" -#include "Widgets.h" -#include "Context.h" -#include "Options.h" -#include "XContext.h" -#include "Register.h" - -#include "CbContext.h" -#include "CbGeom.h" -#include "CbPost.h" -#include "CbMesh.h" - -extern Context_T CTX ; -extern XContext_T XCTX ; -extern Widgets_T WID ; -extern Mesh M; - -static int Modifier=0; - -void KeyboardAccel(XEvent *event){ - XComposeStatus stat; - KeySym keysym; - char buf[100]; - - XLookupString(&event->xkey, buf, sizeof(buf), &keysym, &stat); - - switch(Modifier){ - - /* ----------------------------------------------------- */ - /* No modifier or shift is pressed */ - /* ----------------------------------------------------- */ - - case 0 : - - /* modifier check and trash */ - switch (keysym) { - case XK_Control_L : case XK_Control_R : - Modifier = 1; - break; - case XK_Alt_L : case XK_Alt_R : - case XK_Meta_L : case XK_Meta_R : - Modifier = 2; - break; - - /* hacks */ - - /* - case XK_Up : - CTX.clip_plane0[2] = 1. ; - if(fabs(CTX.clip_plane0[3]-CTX.lc/20. <1.)) CTX.clip_plane0[3] -= CTX.lc/20. ; - Draw(); - break; - case XK_Down : - CTX.clip_plane0[2] = 1. ; - if(fabs(CTX.clip_plane0[3]+CTX.lc/20 <1.)) CTX.clip_plane0[3] += CTX.lc/20. ; - Draw(); - break; - */ - - /* mesh shortcuts */ - case XK_0 : case XK_KP_0 : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_GEOM,NULL); - geom_event_handler(GEOM_PARSE); - break; - case XK_1 : case XK_KP_1 : - case XK_F1 : case XK_KP_F1 : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_MESH,NULL); - mesh_event_handler(MESH_1D); - break; - case XK_2 : case XK_KP_2 : - case XK_F2 : case XK_KP_F2 : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_MESH,NULL); - mesh_event_handler(MESH_2D); - break; - case XK_3 : case XK_KP_3 : - case XK_F3 : case XK_KP_F3 : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_MESH,NULL); - mesh_event_handler(MESH_3D); - break; - - /* post shortcuts */ - case XK_s: - CTX.post.anim_delay += 0.01 ; - XtVaSetValues(WID.OD.postAnimScale, XmNvalue, (int)(CTX.post.anim_delay), NULL); - XmUpdateDisplay(WID.OD.postAnimScale); - break ; - case XK_S: - CTX.post.anim_delay -= 0.01 ; - if(CTX.post.anim_delay < 0.) CTX.post.anim_delay = 0. ; - XtVaSetValues(WID.OD.postAnimScale, XmNvalue, (int)(CTX.post.anim_delay), NULL); - XmUpdateDisplay(WID.OD.postAnimScale); - break ; - - /* module shortcuts */ - case XK_g : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_GEOM,NULL); - break; - case XK_m : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_MESH,NULL); - break; - case XK_p : - ActualizeContextCb (NULL,(XtPointer)CONTEXT_POST,NULL); - break; - - /* options menu shortcuts */ - case XK_G : - ManageCb(NULL,(XtPointer)WID.OD.geomDialog,NULL); - break; - case XK_M : - ManageCb(NULL,(XtPointer)WID.OD.meshDialog,NULL); - break; - case XK_P : - ManageCb(NULL,(XtPointer)WID.OD.postDialog,NULL); - break; - case XK_O : - ManageCb(NULL,(XtPointer)WID.OD.miscDialog,NULL); - break; - case XK_I : - Modifier = 0 ; - CurrentInfoCb(NULL, (XtPointer)1, NULL); - break; - case XK_V : - Modifier = 0 ; - CurrentViewportCb (NULL, NULL, NULL); - break; - } - break; - - - /* ----------------------------------------------------- */ - /* Control is pressed */ - /* ----------------------------------------------------- */ - - case 1 : - - switch (keysym) { - - /* file menu shortcuts */ - case XK_q : case XK_Q : - exit(1); - case XK_a : case XK_A : - case XK_c : case XK_C : - CancelMeshThread(); - break; - case XK_s : - Print_Mesh(&M,NULL, CTX.mesh.format); - break; - case XK_p : - case XK_S : - Modifier = 0 ; - ManageCb(NULL,(XtPointer)WID.FD.saveAsDialog,NULL); - break ; - case XK_o : case XK_O : - Modifier = 0 ; - ManageCb(NULL,(XtPointer)WID.FD.openDialog,NULL); - break; - case XK_m : case XK_M : - Modifier = 0 ; - ManageCb(NULL,(XtPointer)WID.FD.mergeDialog,NULL); - break; - case XK_l : case XK_L : - Modifier = 0 ; - ReloadAllViewsCb(NULL,NULL,NULL); - break; - case XK_r : case XK_R : - Modifier = 0 ; - RemoveAllViewsCb(NULL,NULL,NULL); - break; - } - break ; - - - /* ----------------------------------------------------- */ - /* Alt is pressed */ - /* ----------------------------------------------------- */ - - case 2 : - - /* everything that is not "cascade menu" */ - switch (keysym) { - case XK_f : case XK_F : - CTX.fast = !CTX.fast; - XtVaSetValues(WID.OD.miscMiscButt[2], XmNset, CTX.fast, NULL); - XmUpdateDisplay(WID.OD.miscMiscCheck); - break; - case XK_b : case XK_B : - CTX.post.scales = !CTX.post.scales; - Draw(); - break; - case XK_o : case XK_O : - CTX.ortho = !CTX.ortho; - XtVaSetValues(WID.OD.miscProjButt[0], XmNset, CTX.ortho, NULL); - XtVaSetValues(WID.OD.miscProjButt[1], XmNset, !CTX.ortho, NULL); - XmUpdateDisplay(WID.OD.miscProjCheck); - Draw(); - break; - case XK_h : case XK_H : - CTX.geom.highlight = !CTX.geom.highlight; - CTX.geom.highlight ? Msg(INFO, "Highlight Enabled") : - Msg(INFO, "Highlight Disabled"); - break; - case XK_c : case XK_C : - opt_general_color_scheme(0,GMSH_SET,opt_general_color_scheme(0,GMSH_GET,0)+1); - opt_geometry_color_scheme(0,GMSH_SET,opt_general_color_scheme(0,GMSH_GET,0)); - opt_mesh_color_scheme(0,GMSH_SET,opt_general_color_scheme(0,GMSH_GET,0)); - XtVaSetValues(WID.OD.miscColorSchemeScale,XmNvalue, CTX.color_scheme, NULL); - XmUpdateDisplay(WID.OD.miscColorSchemeScale); - Draw(); - break; - case XK_d : case XK_D : - if(!CTX.mesh.hidden && !CTX.mesh.shade) - CTX.mesh.hidden = 1; - else if(CTX.mesh.hidden && !CTX.mesh.shade) - CTX.mesh.shade = 1; - else{ - CTX.mesh.hidden = 0; CTX.mesh.shade = 0; - } - XtVaSetValues(WID.OD.meshAspectButt[2],XmNset,CTX.mesh.hidden&&CTX.mesh.shade, NULL); - XtVaSetValues(WID.OD.meshAspectButt[1],XmNset,CTX.mesh.hidden&&!CTX.mesh.shade, NULL); - XtVaSetValues(WID.OD.meshAspectButt[0],XmNset,!CTX.mesh.hidden&&!CTX.mesh.shade, NULL); - XmUpdateDisplay(WID.OD.meshAspectCheck); - Draw(); - break; - case XK_x : case XK_X : - if(CTX.useTrackball) - CTX.setQuaternion(0.,-1./sqrt(2.),0.,1./sqrt(2.)); - set_r(0,0.); set_r(1,90.);set_r(2,0.); Draw(); - break; - case XK_y : case XK_Y : - if(CTX.useTrackball) - CTX.setQuaternion(1./sqrt(2.),0.,0.,1./sqrt(2.)); - set_r(0,-90.);set_r(1,0.); set_r(2,0.); Draw(); - break; - case XK_z : case XK_Z : - if(CTX.useTrackball) - CTX.setQuaternion(0.,0.,0.,1.); - set_r(0,0.); set_r(1,0.); set_r(2,0.); Draw(); - break; - case XK_a : - CTX.small_axes = !CTX.small_axes; - XtVaSetValues(WID.OD.miscMiscButt[1], XmNset, CTX.small_axes, NULL); - XmUpdateDisplay(WID.OD.miscMiscCheck); - Draw(); - break; - case XK_A : - CTX.axes = !CTX.axes; - XtVaSetValues(WID.OD.miscMiscButt[0], XmNset, CTX.axes, NULL); - XmUpdateDisplay(WID.OD.miscMiscCheck); - Draw(); - break; - case XK_p : - CTX.geom.points = !CTX.geom.points; - if(!CTX.geom.vis_type){ - XtVaSetValues(WID.OD.geomVisibleButt[0], XmNset, CTX.geom.points, NULL); - XmUpdateDisplay(WID.OD.geomVisibleButt[0]); - } - Draw(); - break; - case XK_P : - CTX.mesh.points = !CTX.mesh.points; - if(!CTX.mesh.vis_type){ - XtVaSetValues(WID.OD.meshVisibleButt[0], XmNset, CTX.mesh.points, NULL); - XmUpdateDisplay(WID.OD.meshVisibleButt[0]); - } - Draw(); - break; - case XK_l : - CTX.geom.lines = !CTX.geom.lines; - if(!CTX.geom.vis_type){ - XtVaSetValues(WID.OD.geomVisibleButt[1], XmNset, CTX.geom.lines, NULL); - XmUpdateDisplay(WID.OD.geomVisibleButt[1]); - } - Draw(); - break; - case XK_L : - CTX.mesh.lines = !CTX.mesh.lines; - if(!CTX.mesh.vis_type){ - XtVaSetValues(WID.OD.meshVisibleButt[1], XmNset, CTX.mesh.lines, NULL); - XmUpdateDisplay(WID.OD.meshVisibleButt[1]); - } - Draw(); - break; - case XK_s : - CTX.geom.surfaces = !CTX.geom.surfaces; - if(!CTX.geom.vis_type){ - XtVaSetValues(WID.OD.geomVisibleButt[2], XmNset, CTX.geom.surfaces, NULL); - XmUpdateDisplay(WID.OD.geomVisibleButt[2]); - } - Draw(); - break; - case XK_S : - CTX.mesh.surfaces = !CTX.mesh.surfaces; - if(!CTX.mesh.vis_type){ - XtVaSetValues(WID.OD.meshVisibleButt[2], XmNset, CTX.mesh.surfaces, NULL); - XmUpdateDisplay(WID.OD.meshVisibleButt[2]); - } - Draw(); - break; - case XK_v : - CTX.geom.volumes = !CTX.geom.volumes; - if(!CTX.geom.vis_type){ - XtVaSetValues(WID.OD.geomVisibleButt[3], XmNset, CTX.geom.volumes, NULL); - XmUpdateDisplay(WID.OD.geomVisibleButt[3]); - } - Draw(); - break; - case XK_V : - CTX.mesh.volumes = !CTX.mesh.volumes; - if(!CTX.mesh.vis_type){ - XtVaSetValues(WID.OD.meshVisibleButt[3], XmNset, CTX.mesh.volumes, NULL); - XmUpdateDisplay(WID.OD.meshVisibleButt[3]); - } - Draw(); - break; - case XK_m : case XK_M : - CTX.mesh.points = !CTX.mesh.points; - CTX.mesh.lines = !CTX.mesh.lines; - CTX.mesh.surfaces = !CTX.mesh.surfaces; - CTX.mesh.volumes = !CTX.mesh.volumes; - XtVaSetValues(WID.OD.meshVisibleButt[0], XmNset, CTX.mesh.points, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[1], XmNset, CTX.mesh.lines, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[2], XmNset, CTX.mesh.surfaces, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[3], XmNset, CTX.mesh.volumes, NULL); - XmUpdateDisplay(WID.OD.meshVisibleCheck); - Draw(); - break; - case XK_t : case XK_T : - MarkAllViewsChanged(1); - Draw(); - break; - } - break ; - - } - -} - - -/* ------------------------------------------------------------------------ */ -/* I n p u t */ -/* ------------------------------------------------------------------------ */ - -void Process_SelectionBuffer(int x, int y, int *n, GLuint *ii, GLuint *jj); -void Filter_SelectionBuffer(int n, GLuint *typ, GLuint *ient, Vertex **thev, - Curve **thec, Surface **thes, Mesh *m); -void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2, - GLdouble Xc1, GLdouble Xc2, GLdouble Yc1, GLdouble Yc2); - -void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb){ - XEvent *event; - XComposeStatus stat; - KeySym keysym; - GLuint ii[SELECTION_BUFFER_SIZE], jj[SELECTION_BUFFER_SIZE]; - char buf[100]; - int previous_mesh_draw, previous_post_draw ; - int width, height ; - - static int ibut, hits; - static int ButtonPressed=0, ZoomClick=0, FirstClick=0; - static int x, y, movx, movy; - static GLdouble xc1, yc1, xc2, yc2, xt1, yt1, xscale1, yscale1; - static GLdouble xb, yb, xc, yc, xe, ye, xz, yz; - static GLdouble movzx, movzy; - static Vertex *v=NULL, *ov; - static Curve *c=NULL, *oc; - static Surface *s=NULL, *os; - - width = CTX.viewport[2]-CTX.viewport[0] ; - height = CTX.viewport[3]-CTX.viewport[1] ; - - event = cb->event; - - switch(event->type){ - - /* ------------------------------------------------------------- - K e y s - ------------------------------------------------------------- */ - - case KeyPress : - KeyboardAccel(event); - break; - - case KeyRelease : - XLookupString(&event->xkey, buf, sizeof(buf), &keysym, &stat); - if(keysym == XK_Control_L || - keysym == XK_Control_R || - keysym == XK_Alt_L || - keysym == XK_Alt_R || - keysym == XK_Meta_L || - keysym == XK_Meta_R) - Modifier = 0; - break; - - /* ------------------------------------------------------------- - B u t t o n P r e s s - ------------------------------------------------------------- */ - - case ButtonPress : - ButtonPressed++; - FirstClick=1; - ibut = event->xbutton.button; - x = event->xbutton.x; - y = event->xbutton.y; - - switch(ibut){ - case 1: - if(!ZoomClick && Modifier){ - xb = CTX.vxmin + ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin); - yb = CTX.vymax - ((GLdouble) y / height) * (CTX.vymax - CTX.vymin); - xc1 = xb/CTX.s[0] - CTX.t[0]; - yc1 = yb/CTX.s[1] - CTX.t[1]; - ZoomClick=1; - movzx = movzy = 0; - Modifier = 0; - } - else if(ZoomClick){ - xe = CTX.vxmin + ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin); - ye = CTX.vymax - ((GLdouble) y / height) * (CTX.vymax - CTX.vymin); - xc2 = xe/CTX.s[0] - CTX.t[0]; - yc2 = ye/CTX.s[1] - CTX.t[1]; - ZoomClick=0; - if(CTX.overlay){ - glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context); - glClearIndex(0); - glClear(GL_COLOR_BUFFER_BIT); - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - } - if(xb!=xe && yb!=ye) - myZoom(xb,xe,yb,ye,xc1,xc2,yc1,yc2); - } - break; - case 2: - if(Modifier && !ZoomClick){ - Modifier = 0; - set_s(1, CTX.s[0]); - set_s(2, CTX.s[0]); - Draw(); - } - else{ - ZoomClick=0; - if(CTX.overlay){ - glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context); - glClearIndex(0); - glClear(GL_COLOR_BUFFER_BIT); - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - } - } - break; - case 3: - if(Modifier && !ZoomClick){ - Modifier = 0; - if(CTX.useTrackball){ - CTX.setQuaternion(0.,0.,0.,1.); - } - else{ - set_r(0,0.); set_r(1,0.); set_r(2,0.); - } - set_t(0,0.); set_t(1,0.); set_t(2,0.); - set_s(0,1.); set_s(1,1.); set_s(2,1.); - Draw(); - } - else{ - ZoomClick=0; - if(CTX.overlay){ - glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context); - glClearIndex(0); - glClear(GL_COLOR_BUFFER_BIT); - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - } - } - break; - } - break; - - /* ------------------------------------------------------------- - B u t t o n R e l e a s e - ------------------------------------------------------------- */ - - case ButtonRelease : - if(ButtonPressed>0){ - ButtonPressed--; - ibut = event->xbutton.button; - x = event->xbutton.x; - y = event->xbutton.y; - } - if(!ZoomClick){ - previous_mesh_draw = CTX.mesh.draw ; - previous_post_draw = CTX.post.draw ; - if(ButtonPressed>0){ - if(CTX.fast) CTX.mesh.draw = CTX.post.draw = 0; - } - Draw(); - CTX.mesh.draw = previous_mesh_draw ; - CTX.post.draw = previous_post_draw ; - } - break; - - /* ------------------------------------------------------------- - E n t e r / L e a v e N o t i f y - ------------------------------------------------------------- */ - - case EnterNotify : - case LeaveNotify : - ButtonPressed = 0; - Modifier = 0; - break; - - /* ------------------------------------------------------------- - M o t i o n N o t i f y - ------------------------------------------------------------- */ - - case MotionNotify : - movx = (event->xbutton.x-x); - movy = (event->xbutton.y-y); - - if(ZoomClick) { - - xz = CTX.vxmin + ((GLdouble) event->xbutton.x / width) * - (CTX.vxmax - CTX.vxmin); - yz = CTX.vymax - ((GLdouble) event->xbutton.y / height) * - (CTX.vymax - CTX.vymin) ; - if(CTX.overlay) { - movzx = xz - xb; movzy = yz - yb; - InitOverlay(); - glLineWidth(1.); - glClearIndex(0); - glClear(GL_COLOR_BUFFER_BIT); - glIndexi((CTX.color.bg<CTX.color.fg)?XCTX.xcolor.ovwhite:XCTX.xcolor.ovblack); - glBegin(GL_LINE_STRIP); - glVertex2d(xb,yb); - glVertex2d(xb+movzx,yb); - glVertex2d(xb+movzx,yb+movzy); - glVertex2d(xb,yb+movzy); - glVertex2d(xb,yb); - glEnd(); - - /* Dessine le plus gd rectangle possible si ortho */ - - /* - if(fabs((double)movzx/(double)movzy) > ((double)width/(double)height)){ - constry = movzy; - constrx = sign(movzx)*fabs(movzy)*((double)width/(double)height); - } - else{ - constrx = movzx; - constry = sign(movzy)*fabs(movzx)*((double)height/(double)width); - } - glIndexi(theRed); - glBegin(GL_LINE_STRIP); - glVertex2d(xb+constrx,yb); - glVertex2d(xb+constrx,yb+constry); - glVertex2d(xb,yb+constry); - glEnd(); - */ - - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - } - else { - glPopMatrix(); - glDisable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - gluOrtho2D(CTX.vxmin, CTX.vxmax, CTX.vymin, CTX.vymax); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - if(CTX.db) glDrawBuffer(GL_BACK); - - glDisable(GL_DEPTH_TEST); - /* c'est une maniere de contourner l'absence de XOR, mais ca ne marche - evidemment qu'avec un background tout noir ou tout blanc !*/ - glColor3f(1.,1.,1.); - glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO); - glEnable(GL_BLEND); - - glBegin(GL_LINE_STRIP); - glVertex2d(xb,yb); - glVertex2d(xb+movzx,yb); - glVertex2d(xb+movzx,yb+movzy); - glVertex2d(xb,yb+movzy); - glVertex2d(xb,yb); - glEnd(); - movzx = xz - xb; movzy = yz - yb; - - glBegin(GL_LINE_STRIP); - glVertex2d(xb,yb); - glVertex2d(xb+movzx,yb); - glVertex2d(xb+movzx,yb+movzy); - glVertex2d(xb,yb+movzy); - glVertex2d(xb,yb); - glEnd(); - - glDisable(GL_BLEND); - glEnable(GL_DEPTH_TEST); - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - - if(CTX.db) - glXSwapBuffers(XCTX.display,XtWindow(WID.G.glw)); - else - glFlush(); - - } - } - else { - if(ButtonPressed){ - - if(CTX.overlay){ - glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context); - glClearIndex(0); - glClear(GL_COLOR_BUFFER_BIT); - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - } - - if(FirstClick){ - xc1 = ( ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin) - + CTX.vxmin )/CTX.s[0] - CTX.t[0]; - yc1 = ( CTX.vymax - ((GLdouble) y / height) * - (CTX.vymax - CTX.vymin))/CTX.s[1] - CTX.t[1]; - xt1 = CTX.t[0]; - yt1 = CTX.t[1]; - xscale1 = CTX.s[0]; - yscale1 = CTX.s[1]; - FirstClick=0; - } - - switch(ibut){ - case 1: - - if(CTX.useTrackball) - { - CTX.addQuaternion ((2.0*x - width) / width, - (height - 2.0*y) / height, - (2.0*event->xbutton.x - width) / width, - (height - 2.0*event->xbutton.y) / height); - } - else - { - set_r(1, CTX.r[1] + ((abs(movx) > abs(movy))?180*(float)movx/(float)width:0)); - set_r(0, CTX.r[0] + ((abs(movx) > abs(movy))?0:180*(float)movy/(float)height)); - } - break; - case 2: - if(!CTX.useTrackball) - set_r(2, CTX.r[2] + ((abs(movy) > abs(movx))?0:-180*(float)movx/(float)width)); - - set_s(0, CTX.s[0] * ( (abs(movy) > abs(movx)) ? - ( (movy>0) ? (float)(1.04*(abs(movy)+height))/(float)height - : (float)(height)/(float)(1.04*(abs(movy)+height)) ) - : 1.) ); - set_s(1, CTX.s[0]); - set_s(2, CTX.s[0]); - - if(abs(movy) > abs(movx)){ - set_t(0, xt1*(xscale1/CTX.s[0])-xc1*(1.-(xscale1/CTX.s[0]))); - set_t(1, yt1*(yscale1/CTX.s[1])-yc1*(1.-(yscale1/CTX.s[1]))); - } - break; - case 3: - xc = ( ((GLdouble) x / width) * (CTX.vxmax - CTX.vxmin) + - CTX.vxmin ) / CTX.s[0]; - yc = ( CTX.vymax - ((GLdouble) y / height) * - (CTX.vymax - CTX.vymin)) / CTX.s[1]; - set_t(0, xc-xc1); - set_t(1, yc-yc1); - set_t(2, 0.); - break; - } - previous_mesh_draw = CTX.mesh.draw ; - previous_post_draw = CTX.post.draw ; - if(CTX.fast) CTX.mesh.draw = CTX.post.draw = 0; - Draw(); - CTX.mesh.draw = previous_mesh_draw ; - CTX.post.draw = previous_post_draw ; - } - else{ - Process_SelectionBuffer(event->xbutton.x, event->xbutton.y, &hits, ii, jj); - ov = v; oc = c; os = s; - v = NULL; c = NULL; s = NULL; - Filter_SelectionBuffer(hits,ii,jj,&v,&c,&s,&M); - - if(CTX.overlay){ - glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context); - if(ov != v || oc != c || os != s) { - glClearIndex(0); - glClear(GL_COLOR_BUFFER_BIT); - glIndexi((CTX.color.bg<CTX.color.fg)?XCTX.xcolor.ovwhite:XCTX.xcolor.ovblack); - BeginHighlight(); - HighlightEntity(v,c,s,0); - EndHighlight(0); - } - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - } - else{ - if(ov != v || oc != c || os != s) { - if(CTX.geom.highlight) Draw(); - BeginHighlight(); - HighlightEntity(v,c,s,0); - EndHighlight(0); - } - } - } - x += movx; - y += movy; - } - break; - } -} - diff --git a/Motif/CbMesh.cpp b/Motif/CbMesh.cpp deleted file mode 100644 index 351be097a3cfd9c0b96b763ee3879319e2fa0dfc..0000000000000000000000000000000000000000 --- a/Motif/CbMesh.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// $Id: CbMesh.cpp,v 1.4 2001-01-29 08:43:44 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Geo.h" -#include "Mesh.h" -#include "Draw.h" -#include "CbMesh.h" -#include "Context.h" -#include "Widgets.h" - -extern Widgets_T WID; -extern Context_T CTX; -extern Mesh M; - -/* ------------------------------------------------------------------------ */ -/* m e s h _ e v e n t _ h a n d l e r */ -/* ------------------------------------------------------------------------ */ - -#ifdef _USETHREADS - -#include <pthread.h> - -int MeshDim ; -pthread_t MeshThread ; -//pthread_mutex_t MeshMutex ; - -void* StartMeshThread(void * data){ - - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); - // pthread_mutex_unlock(&MeshMutex); - - mai3d(&M,MeshDim); - Msg(STATUS3,"Ready"); - CTX.mesh.draw = 1; - CTX.threads_lock = 0; - XtSetSensitive(WID.G.Butt[6], 0); - Draw(); - pthread_exit(NULL); - return NULL ; -} - -void CancelMeshThread(void){ - if(CTX.threads){ - // pthread_mutex_lock(&MeshMutex); - // pthread_join(MeshThread,NULL); - // pthread_detach(MeshThread); - - pthread_cancel(MeshThread); - CTX.mesh.draw = 1; - CTX.threads_lock = 0; - XtSetSensitive(WID.G.Butt[6], 0); - Msg(STATUS2,"Mesh Aborted"); - mesh_event_handler(MESH_DELETE); - Msg(STATUS3,"Ready"); - Draw(); - } -} - -#else - -void CancelMeshThread(void){ - -} - -#endif - - - -void mesh_event_handler (int event) { - Vertex *v; - Curve *c; - Surface *s; - int ib; - static int n=0, p[100]; - - if(CTX.threads_lock) return ; - - switch (event) { - - case MESH_DELETE : - mai3d(&M, 0); - break; - - case MESH_1D : -#ifdef _USETHREADS - if(CTX.threads){ - XtSetSensitive(WID.G.Butt[6], 1); - CTX.mesh.draw = 0; CTX.threads_lock = 1 ; MeshDim = 1 ; - // pthread_mutex_init(&MeshMutex,NULL); - // pthread_mutex_lock(&MeshMutex); - pthread_create(&MeshThread, NULL, StartMeshThread, NULL); - } - else -#endif - mai3d(&M, 1); - break; - - case MESH_2D : -#ifdef _USETHREADS - if(CTX.threads){ - XtSetSensitive(WID.G.Butt[6], 1); - CTX.mesh.draw = 0; CTX.threads_lock = 1 ; MeshDim = 2 ; - // pthread_mutex_init(&MeshMutex,NULL); - // pthread_mutex_lock(&MeshMutex); - pthread_create(&MeshThread, NULL, StartMeshThread, NULL); - } - else -#endif - mai3d(&M, 2); - break; - - case MESH_3D : -#ifdef _USETHREADS - if(CTX.threads){ - XtSetSensitive(WID.G.Butt[6], 1); - CTX.mesh.draw = 0; CTX.threads_lock = 1 ; MeshDim = 3 ; - // pthread_mutex_init(&MeshMutex,NULL); - // pthread_mutex_lock(&MeshMutex); - pthread_create(&MeshThread, NULL, StartMeshThread, NULL); - } - else -#endif - mai3d(&M, 3); - break; - - - case MESH_DEFINE_CHAR_LENGTH : - n=0; - while(1){ - Msg(STATUS3,"Select Point ('e'=end, 'q'=quit)"); - ib = SelectEntity(ENT_POINT, &v,&c,&s); - if(ib == 1){ /* left mouse butt */ - p[n++] = v->Num; - } - if (ib == -1){ /* 'e' */ - if(n >= 1) { - add_charlength(n,p,CTX.filename); break; - } - n=0; - ZeroHighlight(&M); - Replot(); - } - if(ib == 0){ /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - } - break ; - - case MESH_DEFINE_RECOMBINE : - n=0; - while(1){ - Msg(STATUS3,"Select Surface ('e'=end, 'q'=quit)"); - ib = SelectEntity(ENT_SURFACE, &v,&c,&s); - if(ib == 1){ /* left mouse butt */ - p[n++] = s->Num; - } - if (ib == -1){ /* 'e' */ - if(n >= 1) { - add_recosurf(n,p,CTX.filename); break; - } - n=0; - ZeroHighlight(&M); - Replot(); - } - if(ib == 0){ /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - } - break ; - - case MESH_DEFINE_TRSF_LINE : - case MESH_DEFINE_TRSF_SURFACE : - case MESH_DEFINE_TRSF_VOLUME : - n=0; - while(1){ - switch (event) { - case MESH_DEFINE_TRSF_LINE : - Msg(STATUS3,"Select Line ('e'=end, 'q'=quit)"); - ib = SelectEntity(ENT_LINE, &v,&c,&s); - break ; - case MESH_DEFINE_TRSF_SURFACE : - Msg(STATUS3,"Select Surface ('e'=end, 'q'=quit)"); - ib = SelectEntity(ENT_SURFACE, &v,&c,&s); - break; - case MESH_DEFINE_TRSF_VOLUME : - ib = 1; - break; - } - if(ib == 1){ /* left mouse butt */ - switch (event) { - case MESH_DEFINE_TRSF_LINE : p[n++] = c->Num ; break ; - case MESH_DEFINE_TRSF_SURFACE : p[n++] = s->Num; - case MESH_DEFINE_TRSF_VOLUME : - while(1){ - Msg(STATUS3,"Select Point ('e'=end, 'q'=quit)"); - ib = SelectEntity(ENT_POINT, &v,&c,&s); - if(ib == 1){ /* left mouse butt */ - p[n++] = v->Num ; - } - if (ib == -1){ /* 'e' */ - switch (event) { - case MESH_DEFINE_TRSF_SURFACE : - if(n == 3+1 || n == 4+1) - add_trsfsurf(n,p,CTX.filename); - else - Msg(STATUS2, "Wrong Number of Points for Transfinite Surface"); - break; - case MESH_DEFINE_TRSF_VOLUME : - if(n == 6 || n == 8) - add_trsfvol(n,p,CTX.filename); - else - Msg(STATUS2, "Wrong Number of Points for Transfinite Volume"); - break; - } - n=0; - ZeroHighlight(&M); - Replot(); - break; - } - if(ib == 0){ /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - } - break ; - } - } - if (ib == -1){ /* 'e' */ - if (event == MESH_DEFINE_TRSF_LINE){ - if(n >= 1) add_trsfline(n,p,CTX.filename); - } - n=0; - ZeroHighlight(&M); - Replot(); - } - if(ib == 0){ /* 'q' */ - n=0 ; - ZeroHighlight(&M); - Replot(); - break; - } - } - break ; - - case MESH_DEFINE_ATTRACTOR_POINT : - case MESH_DEFINE_ATTRACTOR_LINE : - case MESH_DEFINE_ATTRACTOR_SURFACE : - Msg(WARNING, "Interactive Attractor Definition not done yet"); - break ; - - default : - Msg(WARNING, "Unkown Event in mesh_event_handler"); - break; - } - - if(!CTX.threads){ - Msg(STATUS3,"Ready"); - Draw(); - } -} - -/* ------------------------------------------------------------------------ - M e s h C b - ------------------------------------------------------------------------ */ - -void MeshCb (Widget w, XtPointer client_data, XtPointer call_data){ - - switch((long int)client_data){ - - case MESH_TRSF_LINE_PTS : strcpy(trsf_pts_text,XmTextGetString(w)); break; - case MESH_TRSF_LINE_TYPE : strcpy(trsf_type_text,XmTextGetString(w)); break; - case MESH_TRSF_VOL_NUM : strcpy(trsf_vol_text,XmTextGetString(w)); break; - case MESH_CHAR_LENGTH : strcpy(char_length_text,XmTextGetString(w)); break; - case MESH_ATTRACTOR_X : strcpy(attrx_text,XmTextGetString(w)); break; - case MESH_ATTRACTOR_Y : strcpy(attry_text,XmTextGetString(w)); break; - case MESH_ATTRACTOR_Z : strcpy(attrz_text,XmTextGetString(w)); break; - default : - Msg(WARNING, "Unknown Event in MeshCb (%d)", (long int)client_data); - break; - - } -} diff --git a/Motif/CbMesh.h b/Motif/CbMesh.h deleted file mode 100644 index b5fe82fd27016d1d4fb80dd4a5b7befd29d5c4d1..0000000000000000000000000000000000000000 --- a/Motif/CbMesh.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _CB_MESH_H_ -#define _CB_MESH_H_ - -/* mesh event handler */ - -#define MESH_DELETE 1 -#define MESH_1D 2 -#define MESH_2D 3 -#define MESH_3D 4 -#define MESH_DEFINE_CHAR_LENGTH 5 -#define MESH_DEFINE_TRSF_LINE 6 -#define MESH_DEFINE_TRSF_SURFACE 7 -#define MESH_DEFINE_TRSF_VOLUME 8 -#define MESH_DEFINE_RECOMBINE 9 -#define MESH_DEFINE_ATTRACTOR_POINT 10 -#define MESH_DEFINE_ATTRACTOR_LINE 11 -#define MESH_DEFINE_ATTRACTOR_SURFACE 12 - -/* MeshCb */ - -#define MESH_TRSF_LINE_PTS 100 -#define MESH_TRSF_LINE_TYPE 101 -#define MESH_TRSF_VOL_NUM 102 -#define MESH_CHAR_LENGTH 103 -#define MESH_ATTRACTOR_X 104 -#define MESH_ATTRACTOR_Y 105 -#define MESH_ATTRACTOR_Z 106 - -void CancelMeshThread(void); -void mesh_event_handler (int event); - -#endif diff --git a/Motif/CbOptions.cpp b/Motif/CbOptions.cpp deleted file mode 100644 index 6ac576c9e6529efe68a1922e861d38e89a9aba06..0000000000000000000000000000000000000000 --- a/Motif/CbOptions.cpp +++ /dev/null @@ -1,380 +0,0 @@ -// $Id: CbOptions.cpp,v 1.12 2001-08-20 07:38:30 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Numeric.h" -#include "Geo.h" -#include "Verif.h" -#include "Mesh.h" -#include "Draw.h" -#include "Widgets.h" -#include "Pixmaps.h" -#include "Context.h" -#include "Options.h" -#include "XContext.h" -#include "Register.h" -#include "Timer.h" -#include "Visibility.h" - -#include "CbOptions.h" -#include "CbGeom.h" -#include "CbMesh.h" -#include "CbPost.h" - -extern Context_T CTX; -extern XContext_T XCTX ; -extern Widgets_T WID; -extern Pixmaps_T PIX; -extern Mesh M; - -static int select_by_number=OPTIONS_MESH_SELECT_ENTITY ; -static int stop_anim ; -static long anim_time ; - -/* ------------------------------------------------------------------------ - O p t i o n s C b - ------------------------------------------------------------------------ */ - -void OptionsCb (Widget w, XtPointer client_data, XtPointer call_data){ - int i, e; - char *c, label[32]; - XWindowAttributes xattrib; - XEvent event; - - switch((long int)client_data){ - - /* globales */ - - case OPTIONS_REPLOT : Draw(); break; - case OPTIONS_AXES : CTX.axes = !CTX.axes; break; - case OPTIONS_LITTLE_AXES : CTX.small_axes = !CTX.small_axes; break; - case OPTIONS_FAST_REDRAW : CTX.fast = !CTX.fast ; break ; - case OPTIONS_DISPLAY_LISTS : CTX.display_lists = !CTX.display_lists ; break ; - case OPTIONS_ALPHA_BLENDING: CTX.alpha = !CTX.alpha; break; - case OPTIONS_TRACKBALL : CTX.useTrackball = !CTX.useTrackball; break; - case OPTIONS_COLOR_SCHEME_SCALE: - XmScaleGetValue(WID.OD.miscColorSchemeScale, &e); - opt_general_color_scheme(0,GMSH_SET,e); - opt_geometry_color_scheme(0,GMSH_SET,e); - opt_mesh_color_scheme(0,GMSH_SET,e); - Draw(); - break ; - case OPTIONS_ORTHOGRAPHIC : CTX.ortho = 1; break; - case OPTIONS_PERSPECTIVE : CTX.ortho = 0; break; - case OPTIONS_LIGHT_X_SCALE : - XmScaleGetValue(WID.OD.miscLightScale[0], &e); CTX.light_position[0][0] = 0.04*e ; - MarkAllViewsChanged (0); break ; - case OPTIONS_LIGHT_Y_SCALE : - XmScaleGetValue(WID.OD.miscLightScale[1], &e); CTX.light_position[0][1] = 0.04*e ; - MarkAllViewsChanged (0); break ; - case OPTIONS_LIGHT_Z_SCALE : - XmScaleGetValue(WID.OD.miscLightScale[2], &e); CTX.light_position[0][2] = 0.04*e ; - MarkAllViewsChanged (0);break ; - case OPTIONS_SHINE_SCALE : - XmScaleGetValue(WID.OD.miscShineScale, &e); CTX.shine = 0.04*e ; - MarkAllViewsChanged (0);break ; - case OPTIONS_SCALEX : CTX.s[0] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_SCALEY : CTX.s[1] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_SCALEZ : CTX.s[2] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_TRANX : CTX.t[0] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_TRANY : CTX.t[1] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_TRANZ : CTX.t[2] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_ROTX : CTX.r[0] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_ROTY : CTX.r[1] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_ROTZ : CTX.r[2] = (GLdouble)atof(XmTextGetString(w)); break; - case OPTIONS_ROTX_LOCKED : CTX.rlock[0] = !CTX.rlock[0]; break; - case OPTIONS_ROTY_LOCKED : CTX.rlock[1] = !CTX.rlock[1]; break; - case OPTIONS_ROTZ_LOCKED : CTX.rlock[2] = !CTX.rlock[2]; break; - case OPTIONS_TRANX_LOCKED : CTX.tlock[0] = !CTX.tlock[0]; break; - case OPTIONS_TRANY_LOCKED : CTX.tlock[1] = !CTX.tlock[1]; break; - case OPTIONS_TRANZ_LOCKED : CTX.tlock[2] = !CTX.tlock[2]; break; - case OPTIONS_SCALEX_LOCKED : CTX.slock[0] = !CTX.slock[0]; break; - case OPTIONS_SCALEY_LOCKED : CTX.slock[1] = !CTX.slock[1]; break; - case OPTIONS_SCALEZ_LOCKED : CTX.slock[2] = !CTX.slock[2]; break; - case OPTIONS_XVIEW : - if(CTX.useTrackball) - CTX.setQuaternion(0.,-1./sqrt(2.),0.,1./sqrt(2.)); - set_r(0,0.); set_r(1,90.);set_r(2,0.); - Draw(); - break; - case OPTIONS_YVIEW : - if(CTX.useTrackball) - CTX.setQuaternion(1./sqrt(2.),0.,0.,1./sqrt(2.)); - set_r(0,-90.);set_r(1,0.); set_r(2,0.); - Draw(); - break; - case OPTIONS_ZVIEW : - if(CTX.useTrackball) - CTX.setQuaternion(0.,0.,0.,1.); - set_r(0,0.); set_r(1,0.); set_r(2,0.); - Draw(); - break; - case OPTIONS_CVIEW : - set_t(0,0.); set_t(1,0.); set_t(2,0.); - set_s(0,1.); set_s(1,1.); set_s(2,1.); - Draw(); - break; - case OPTIONS_PVIEW : - XGetWindowAttributes(XtDisplay(WID.G.shell),XtWindow(WID.G.shell),&xattrib); - fprintf(stderr, "-geometry %dx%d -viewport %g %g %g %g %g %g %g %g %g\n", - xattrib.width, xattrib.height, - CTX.r[0],CTX.r[1],CTX.r[2], - CTX.t[0],CTX.t[1],CTX.t[2], - CTX.s[0],CTX.s[1],CTX.s[2]); - Print_Options(0, GMSH_FULLRC, NULL); - break ; - - /* save */ - - case OPTIONS_SAVE_MSH : - CTX.print.format = CTX.mesh.format = FORMAT_MSH; - break; - case OPTIONS_SAVE_UNV : - CTX.print.format = CTX.mesh.format = FORMAT_UNV; - break; - case OPTIONS_SAVE_GREF : - CTX.print.format = CTX.mesh.format = FORMAT_GREF; - break; - case OPTIONS_SAVE_GEO : - CTX.print.format = FORMAT_GEO; - break; - case OPTIONS_SAVE_AUTO : - CTX.print.format = FORMAT_AUTO; - break; - case OPTIONS_SAVE_XPM : - CTX.print.format = FORMAT_XPM; - break; - case OPTIONS_SAVE_GIF : - CTX.print.format = FORMAT_GIF; - CTX.print.gif_dither = 0; - CTX.print.gif_transparent = 0; - break; - case OPTIONS_SAVE_GIF_DITHERED : - CTX.print.format = FORMAT_GIF; - CTX.print.gif_dither = 1; - CTX.print.gif_transparent = 0; - break; - case OPTIONS_SAVE_GIF_TRANSPARENT : - CTX.print.format = FORMAT_GIF; - CTX.print.gif_dither = 0; - CTX.print.gif_transparent = 1; - break; - case OPTIONS_SAVE_JPEG : - CTX.print.format = FORMAT_JPEG; - break; - case OPTIONS_SAVE_PPM : - CTX.print.format = FORMAT_PPM; - break; - case OPTIONS_SAVE_YUV : - CTX.print.format = FORMAT_YUV; - break; - case OPTIONS_SAVE_EPS_IMAGE : - CTX.print.format = FORMAT_EPS; - CTX.print.eps_quality = 0; - break; - case OPTIONS_SAVE_EPS_SIMPLE : - CTX.print.format = FORMAT_EPS; - CTX.print.eps_quality = 1; - break; - case OPTIONS_SAVE_EPS_COMPLEX : - CTX.print.format = FORMAT_EPS; - CTX.print.eps_quality = 2; - break; - - /* geometrie */ - - case OPTIONS_GEOM_CHECK : /* Print_Geo(&M,filename); */ break; - case OPTIONS_GEOM_VISIBILITY_ENTITY : - CTX.geom.vis_type = 0; - XtVaSetValues(WID.OD.geomVisibleButt[0], XmNset, CTX.geom.points?True:False, NULL); - XtVaSetValues(WID.OD.geomVisibleButt[1], XmNset, CTX.geom.lines?True:False, NULL); - XtVaSetValues(WID.OD.geomVisibleButt[2], XmNset, CTX.geom.surfaces?True:False, NULL); - XtVaSetValues(WID.OD.geomVisibleButt[3], XmNset, CTX.geom.volumes?True:False, NULL); - for(i=0;i<4;i++)XmUpdateDisplay(WID.OD.geomVisibleButt[i]); - break; - case OPTIONS_GEOM_VISIBILITY_NUMBER : - CTX.geom.vis_type = 1; - XtVaSetValues(WID.OD.geomVisibleButt[0], XmNset, CTX.geom.points_num?True:False, NULL); - XtVaSetValues(WID.OD.geomVisibleButt[1], XmNset, CTX.geom.lines_num?True:False, NULL); - XtVaSetValues(WID.OD.geomVisibleButt[2], XmNset, CTX.geom.surfaces_num?True:False, NULL); - XtVaSetValues(WID.OD.geomVisibleButt[3], XmNset, CTX.geom.volumes_num?True:False, NULL); - for(i=0;i<4;i++)XmUpdateDisplay(WID.OD.geomVisibleButt[i]); - break; - case OPTIONS_GEOM_POINTS : - if(!CTX.geom.vis_type) CTX.geom.points = !CTX.geom.points; - else CTX.geom.points_num = !CTX.geom.points_num; break; - case OPTIONS_GEOM_LINES : - if(!CTX.geom.vis_type) CTX.geom.lines = !CTX.geom.lines; - else CTX.geom.lines_num = !CTX.geom.lines_num; break; - case OPTIONS_GEOM_SURFACES : - if(!CTX.geom.vis_type) CTX.geom.surfaces = !CTX.geom.surfaces; - else CTX.geom.surfaces_num = !CTX.geom.surfaces_num; break; - case OPTIONS_GEOM_VOLUMES : - if(!CTX.geom.vis_type) CTX.geom.volumes = !CTX.geom.volumes; - else CTX.geom.volumes_num = !CTX.geom.volumes_num; break; - case OPTIONS_GEOM_NORMALS_SCALE : - XmScaleGetValue(WID.OD.geomNormalsScale, &e); CTX.geom.normals = e ; - sprintf(label,"%g",CTX.geom.normals); - XtVaSetValues(WID.OD.geomNormalsText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.geomNormalsText); break; - case OPTIONS_GEOM_NORMALS_TEXT : - CTX.geom.normals = atof(XmTextGetString(w)); - XtVaSetValues(WID.OD.geomNormalsScale, XmNvalue, - THRESHOLD((int)CTX.geom.normals,0,100), NULL); - XmUpdateDisplay(WID.OD.geomNormalsScale); break; - case OPTIONS_GEOM_TANGENTS_SCALE : - XmScaleGetValue(WID.OD.geomTangentsScale, &e); CTX.geom.tangents = e ; - sprintf(label,"%g",CTX.geom.tangents); - XtVaSetValues(WID.OD.geomTangentsText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.geomTangentsText); break; - case OPTIONS_GEOM_TANGENTS_TEXT : - CTX.geom.tangents = atof(XmTextGetString(w)); - XtVaSetValues(WID.OD.geomTangentsScale, XmNvalue, - THRESHOLD((int)CTX.geom.tangents,0,100), NULL); - XmUpdateDisplay(WID.OD.geomTangentsScale); break; - - - /* mesh */ - - case OPTIONS_MESH_SHADING : CTX.mesh.hidden = 1; CTX.mesh.shade = 1; break; - case OPTIONS_MESH_HIDDEN_LINES : CTX.mesh.hidden = 1; CTX.mesh.shade = 0; break; - case OPTIONS_MESH_WIREFRAME : CTX.mesh.hidden = 0; CTX.mesh.shade = 0; break; - case OPTIONS_MESH_VISIBILITY_ENTITY : - CTX.mesh.vis_type = 0; - XtVaSetValues(WID.OD.meshVisibleButt[0], XmNset, CTX.mesh.points?True:False, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[1], XmNset, CTX.mesh.lines?True:False, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[2], XmNset, CTX.mesh.surfaces?True:False, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[3], XmNset, CTX.mesh.volumes?True:False, NULL); - for(i=0;i<4;i++)XmUpdateDisplay(WID.OD.meshVisibleButt[i]); - break; - case OPTIONS_MESH_VISIBILITY_NUMBER : - CTX.mesh.vis_type = 1; - XtVaSetValues(WID.OD.meshVisibleButt[0], XmNset, CTX.mesh.points_num?True:False, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[1], XmNset, CTX.mesh.lines_num?True:False, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[2], XmNset, CTX.mesh.surfaces_num?True:False, NULL); - XtVaSetValues(WID.OD.meshVisibleButt[3], XmNset, CTX.mesh.volumes_num?True:False, NULL); - for(i=0;i<4;i++)XmUpdateDisplay(WID.OD.meshVisibleButt[i]); - break; - case OPTIONS_MESH_POINTS : - if(!CTX.mesh.vis_type) CTX.mesh.points = !CTX.mesh.points; - else CTX.mesh.points_num = !CTX.mesh.points_num; break; - case OPTIONS_MESH_LINES : - if(!CTX.mesh.vis_type) CTX.mesh.lines = !CTX.mesh.lines; - else CTX.mesh.lines_num = !CTX.mesh.lines_num; break; - case OPTIONS_MESH_SURFACES : - if(!CTX.mesh.vis_type) CTX.mesh.surfaces = !CTX.mesh.surfaces; - else CTX.mesh.surfaces_num = !CTX.mesh.surfaces_num; break; - case OPTIONS_MESH_VOLUMES : - if(!CTX.mesh.vis_type) CTX.mesh.volumes = !CTX.mesh.volumes; - else CTX.mesh.volumes_num = !CTX.mesh.volumes_num; break; - case OPTIONS_MESH_DEGRE2 : - (CTX.mesh.degree==2) ? CTX.mesh.degree=1 : CTX.mesh.degree=2; break ; - case OPTIONS_MESH_ANISOTROPIC : - (CTX.mesh.algo==DELAUNAY_ISO) ? - CTX.mesh.algo=DELAUNAY_ANISO : - CTX.mesh.algo=DELAUNAY_ISO; break ; - case OPTIONS_MESH_INTERACTIVE : - CTX.mesh.interactive = !CTX.mesh.interactive; break ; - case OPTIONS_MESH_SMOOTHING_SCALE : - XmScaleGetValue(WID.OD.meshSmoothingScale, &e); CTX.mesh.nb_smoothing = e ; - sprintf(label,"%d",CTX.mesh.nb_smoothing); - XtVaSetValues(WID.OD.meshSmoothingText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.meshSmoothingText); break; - case OPTIONS_MESH_SMOOTHING_TEXT : - CTX.mesh.nb_smoothing = atoi(XmTextGetString(w)); - XtVaSetValues(WID.OD.meshSmoothingScale, XmNvalue, - THRESHOLD(CTX.mesh.nb_smoothing,0,100), NULL); - XmUpdateDisplay(WID.OD.meshSmoothingScale); break; - case OPTIONS_MESH_EXPLODE_SCALE : - XmScaleGetValue(WID.OD.meshExplodeScale, &e); CTX.mesh.explode = 0.01*e ; - sprintf(label,"%g",CTX.mesh.explode); - XtVaSetValues(WID.OD.meshExplodeText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.meshExplodeText); break; - case OPTIONS_MESH_EXPLODE_TEXT : - CTX.mesh.explode = atof(XmTextGetString(w)); - XtVaSetValues(WID.OD.meshExplodeScale, XmNvalue, - THRESHOLD((int)(100*CTX.mesh.explode),0,100), NULL); - XmUpdateDisplay(WID.OD.meshExplodeScale); break; - case OPTIONS_MESH_NORMALS_SCALE : - XmScaleGetValue(WID.OD.meshNormalsScale, &e); CTX.mesh.normals = e ; - sprintf(label,"%g",CTX.mesh.normals); - XtVaSetValues(WID.OD.meshNormalsText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.OD.meshNormalsText); break; - case OPTIONS_MESH_NORMALS_TEXT : - CTX.mesh.normals = atof(XmTextGetString(w)); - XtVaSetValues(WID.OD.meshNormalsScale, XmNvalue, - THRESHOLD((int)CTX.mesh.normals,0,100), NULL); - XmUpdateDisplay(WID.OD.meshNormalsScale); break; - case OPTIONS_MESH_ABORT : - CancelMeshThread(); - break; - case OPTIONS_MESH_SELECT_ENTITY : select_by_number = OPTIONS_MESH_SELECT_ENTITY; break; - case OPTIONS_MESH_SELECT_QUALITY : select_by_number = OPTIONS_MESH_SELECT_QUALITY; break; - - /* post */ - - case OPTIONS_POST_LINK_NONE : CTX.post.link = 0; break; - case OPTIONS_POST_LINK_VISIBLE : CTX.post.link = 1; break; - case OPTIONS_POST_LINK_ALL : CTX.post.link = 2; break; - case OPTIONS_POST_ANIM_START: - stop_anim = 0 ; - Set_AnimPixmap(&WID, &PIX, 0) ; - Set_AnimCallback(&WID, 0) ; - anim_time = GetTime(); - while(1){ - if(XtAppPending(XCTX.AppContext)){ - XtAppNextEvent(XCTX.AppContext,&event); - XtDispatchEvent(&event); - if(stop_anim) break ; - } - else{ - if(GetTime() - anim_time > 1.e6*CTX.post.anim_delay){ - anim_time = GetTime(); - MarkAllViewsChanged(2); - Draw(); - } - } - } - break ; - case OPTIONS_POST_ANIM_STOP: - stop_anim = 1; - Set_AnimPixmap(&WID, &PIX, 1) ; - Set_AnimCallback(&WID, 1) ; - break ; - case OPTIONS_POST_ANIM_DELAY: - XmScaleGetValue(WID.OD.postAnimScale, &e); - CTX.post.anim_delay = e ; - break ; - - /* mesh + geom : a changer...*/ - case OPTIONS_GEOM_HIDE_SHOW : - select_by_number=OPTIONS_MESH_SELECT_ENTITY; - /* Fal-through */ - case OPTIONS_MESH_HIDE_SHOW : - c = XmTextGetString(w); - if(select_by_number == OPTIONS_MESH_SELECT_ENTITY){ - if (!strcmp(c,"all") || !strcmp(c,"*")){ - if(SHOW_ALL_ENTITIES){ RemplirEntitesVisibles(0); SHOW_ALL_ENTITIES = 0; } - else { RemplirEntitesVisibles(1); SHOW_ALL_ENTITIES = 1; } - } - else{ - i = atoi(c); - if(EntiteEstElleVisible(i)) ToutesLesEntitesRelatives(i,EntitesVisibles,0); - else ToutesLesEntitesRelatives(i,EntitesVisibles,1); - } - } - else{ - if (!strcmp(c,"all") || !strcmp(c,"*")) - CTX.mesh.gamma_sup = 0.0 ; - else - CTX.mesh.gamma_sup = atof(c); - } - break; - - default : - Msg(WARNING, "Unknown value in OptionsCb : %d", (long int)client_data); - break; - } - -} - diff --git a/Motif/CbOptions.h b/Motif/CbOptions.h deleted file mode 100644 index 086c9dc4a409b5515e2629017e36b26905f09c95..0000000000000000000000000000000000000000 --- a/Motif/CbOptions.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _CB_OPTIONS_H_ -#define _CB_OPTIONS_H_ - -/* options globales */ - -#define OPTIONS_REPLOT 1 -#define OPTIONS_AXES 2 -#define OPTIONS_LITTLE_AXES 3 -#define OPTIONS_XVIEW 4 -#define OPTIONS_YVIEW 5 -#define OPTIONS_ZVIEW 6 -#define OPTIONS_CVIEW 7 -#define OPTIONS_PVIEW 8 -#define OPTIONS_SCALEX 9 -#define OPTIONS_SCALEY 10 -#define OPTIONS_SCALEZ 11 -#define OPTIONS_ROTX 12 -#define OPTIONS_ROTY 13 -#define OPTIONS_ROTZ 14 -#define OPTIONS_TRANX 15 -#define OPTIONS_TRANY 16 -#define OPTIONS_TRANZ 17 -#define OPTIONS_ROTX_LOCKED 18 -#define OPTIONS_ROTY_LOCKED 19 -#define OPTIONS_ROTZ_LOCKED 20 -#define OPTIONS_TRANX_LOCKED 21 -#define OPTIONS_TRANY_LOCKED 22 -#define OPTIONS_TRANZ_LOCKED 23 -#define OPTIONS_SCALEX_LOCKED 24 -#define OPTIONS_SCALEY_LOCKED 25 -#define OPTIONS_SCALEZ_LOCKED 26 -#define OPTIONS_ORTHOGRAPHIC 27 -#define OPTIONS_PERSPECTIVE 28 -#define OPTIONS_LIGHT_X_SCALE 29 -#define OPTIONS_LIGHT_Y_SCALE 30 -#define OPTIONS_LIGHT_Z_SCALE 31 -#define OPTIONS_SHINE_SCALE 32 -#define OPTIONS_ALPHA_BLENDING 33 -#define OPTIONS_DISPLAY_LISTS 34 -#define OPTIONS_FAST_REDRAW 35 -#define OPTIONS_COLOR_SCHEME_SCALE 36 -#define OPTIONS_TRACKBALL 37 - -/* options geometrie */ - -#define OPTIONS_GEOM_CHECK 100 -#define OPTIONS_GEOM_POINTS 101 -#define OPTIONS_GEOM_LINES 102 -#define OPTIONS_GEOM_SURFACES 103 -#define OPTIONS_GEOM_VOLUMES 104 -#define OPTIONS_GEOM_NORMALS_SCALE 105 -#define OPTIONS_GEOM_NORMALS_TEXT 106 -#define OPTIONS_GEOM_TANGENTS_SCALE 107 -#define OPTIONS_GEOM_TANGENTS_TEXT 108 -#define OPTIONS_GEOM_HIDE_SHOW 109 -#define OPTIONS_GEOM_VISIBILITY_ENTITY 110 -#define OPTIONS_GEOM_VISIBILITY_NUMBER 111 - -/* options mesh */ - -#define OPTIONS_MESH_POINTS 200 -#define OPTIONS_MESH_LINES 201 -#define OPTIONS_MESH_SURFACES 202 -#define OPTIONS_MESH_VOLUMES 203 -#define OPTIONS_MESH_HIDDEN_LINES 204 -#define OPTIONS_MESH_SHADING 205 -#define OPTIONS_MESH_WIREFRAME 206 -#define OPTIONS_MESH_NORMALS_SCALE 207 -#define OPTIONS_MESH_NORMALS_TEXT 208 -#define OPTIONS_MESH_TANGENTS_SCALE 209 -#define OPTIONS_MESH_TANGENTS_TEXT 210 -#define OPTIONS_MESH_EXPLODE_SCALE 211 -#define OPTIONS_MESH_EXPLODE_TEXT 212 -#define OPTIONS_MESH_HIDE_SHOW 216 -#define OPTIONS_MESH_ABORT 217 -#define OPTIONS_MESH_SMOOTHING_SCALE 218 -#define OPTIONS_MESH_SMOOTHING_TEXT 219 -#define OPTIONS_MESH_DEGRE2 220 -#define OPTIONS_MESH_ANISOTROPIC 221 -#define OPTIONS_MESH_INTERACTIVE 222 -#define OPTIONS_MESH_VISIBILITY_ENTITY 223 -#define OPTIONS_MESH_VISIBILITY_NUMBER 224 -#define OPTIONS_MESH_SELECT_ENTITY 225 -#define OPTIONS_MESH_SELECT_QUALITY 226 - -/* options post */ - -#define OPTIONS_POST_LINK_NONE 300 -#define OPTIONS_POST_LINK_VISIBLE 301 -#define OPTIONS_POST_LINK_ALL 302 -#define OPTIONS_POST_ANIM_START 303 -#define OPTIONS_POST_ANIM_STOP 304 -#define OPTIONS_POST_ANIM_DELAY 305 - -/* options save */ - -#define OPTIONS_SAVE_AUTO 400 -#define OPTIONS_SAVE_MSH 401 -#define OPTIONS_SAVE_UNV 402 -#define OPTIONS_SAVE_GREF 403 -#define OPTIONS_SAVE_XPM 404 -#define OPTIONS_SAVE_EPS_SIMPLE 405 -#define OPTIONS_SAVE_EPS_COMPLEX 406 -#define OPTIONS_SAVE_EPS_IMAGE 407 -#define OPTIONS_SAVE_GIF 408 -#define OPTIONS_SAVE_GIF_DITHERED 409 -#define OPTIONS_SAVE_GIF_TRANSPARENT 410 -#define OPTIONS_SAVE_GEO 411 -#define OPTIONS_SAVE_JPEG 412 -#define OPTIONS_SAVE_PPM 413 -#define OPTIONS_SAVE_YUV 414 - - - -#endif diff --git a/Motif/CbPost.cpp b/Motif/CbPost.cpp deleted file mode 100644 index e8940c13349d19cb91ff47e44a9bf95b5f4ab4f8..0000000000000000000000000000000000000000 --- a/Motif/CbPost.cpp +++ /dev/null @@ -1,713 +0,0 @@ -// $Id: CbPost.cpp,v 1.8 2001-08-12 13:08:21 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Numeric.h" -#include "Geo.h" -#include "Mesh.h" -#include "Draw.h" -#include "Views.h" -#include "ColorTable.h" -#include "Widgets.h" -#include "Context.h" -#include "XContext.h" -#include "OpenFile.h" - -#include "CbPost.h" -#include "CbGeom.h" -#include "CbMesh.h" -#include "CbColorbar.h" - -extern Widgets_T WID ; -extern Context_T CTX ; -extern XContext_T XCTX ; -extern Mesh *THEM; - -static double ADAPTATION_ERROR=10. ; -static int ADAPTATION_METHOD=3 ; -static int OFFSET_MODE = 0; -static Post_View *CurrentView = NULL; -static long int CurrentViewNumber = -1; -static Post_View *ViewForDialog[10]; - -void MarkAllViewsChanged (int action){ - int i; - char label[256]; - Post_View *v; - - for(i = 0 ; i< List_Nbr(Post_ViewList) ; i++){ - v = (Post_View*)List_Pointer(Post_ViewList, i); - switch(action){ - case 1: // toggle drawing mode - if(v->IntervalsType == DRAW_POST_ISO) - v->IntervalsType = DRAW_POST_DISCRETE ; - else if(v->IntervalsType == DRAW_POST_DISCRETE) - v->IntervalsType = DRAW_POST_CONTINUOUS ; - else - v->IntervalsType = DRAW_POST_ISO ; - break; - case 2: // time step++ - if(v->TimeStep < v->NbTimeStep-1) - v->TimeStep++ ; - else - v->TimeStep = 0 ; - sprintf(label, "%d", v->TimeStep); - XtVaSetValues(WID.PD.timeStepScale, XmNvalue, v->TimeStep, NULL); - XmUpdateDisplay(WID.PD.timeStepScale); - XtVaSetValues(WID.PD.timeStepText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.timeStepText); - break; - case 3: // time step-- - if(v->TimeStep > 0) - v->TimeStep-- ; - else - v->TimeStep = v->NbTimeStep-1 ; - sprintf(label, "%d", v->TimeStep); - XtVaSetValues(WID.PD.timeStepScale, XmNvalue, v->TimeStep, NULL); - XmUpdateDisplay(WID.PD.timeStepScale); - XtVaSetValues(WID.PD.timeStepText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.timeStepText); - break; - default : - break; - } - - v->Changed = 1 ; - } -} - -void SwapViewCb (Widget w, XtPointer client_data, XtPointer call_data){ - Post_View *v ; - - if(!Post_ViewList) return; - - v = (Post_View*)List_Pointer(Post_ViewList,(long int)client_data-1); - - Msg(DEBUG1, "View %d", v->Num); - Msg(DEBUG2, " -> Name '%s'", v->Name); - Msg(DEBUG2, " -> FileName '%s'", v->FileName); - Msg(DEBUG2, " -> DuplicateOf %d", v->DuplicateOf); - Msg(DEBUG3, " -> Links %d", v->Links); - - v->Visible = !v->Visible; - - Draw(); -} - - - -void DuplicateViewCb (Widget w, XtPointer client_data, XtPointer call_data){ - Post_View v, *v1, *v2, *v3 ; - extern void AddViewInUI(int , char *, int); - - if(!Post_ViewList) return; - - v1 = (Post_View*)List_Pointer(Post_ViewList,(long int)client_data-1); - - v2 = BeginView(0); - EndView(v2, 0, v1->FileName, v1->Name); - - if(!v1->DuplicateOf){ - v2->DuplicateOf = v1->Num ; - v1->Links++ ; - } - else{ - v.Num = v1->DuplicateOf ; - if(!(v3 = (Post_View*)List_PQuery(Post_ViewList, &v, fcmpPostViewNum))){ - v2->DuplicateOf = v1->Num ; - v1->Links++ ; - } - else{ - v2->DuplicateOf = v3->Num; - v3->Links++ ; - } - } - - v2->Time = v1->Time; - v2->NbSP = v1->NbSP; v2->SP = v1->SP; - v2->NbVP = v1->NbVP; v2->VP = v1->VP; - v2->NbTP = v1->NbTP; v2->TP = v1->TP; - v2->NbSL = v1->NbSL; v2->SL = v1->SL; - v2->NbVL = v1->NbVL; v2->VL = v1->VL; - v2->NbTL = v1->NbTL; v2->TL = v1->TL; - v2->NbST = v1->NbST; v2->ST = v1->ST; - v2->NbVT = v1->NbVT; v2->VT = v1->VT; - v2->NbTT = v1->NbTT; v2->TT = v1->TT; - v2->NbSS = v1->NbSS; v2->SS = v1->SS; - v2->NbVS = v1->NbVS; v2->VS = v1->VS; - v2->NbTS = v1->NbTS; v2->TS = v1->TS; - v2->ScalarOnly = v1->ScalarOnly; - v2->Min = v1->Min; - v2->Max = v1->Max; - v2->NbTimeStep = v1->NbTimeStep; - - CopyViewOptions(v1, v2); - - AddViewInUI(List_Nbr(Post_ViewList), v2->Name, v2->Num); - Draw(); -} - -static int All = 0; - -void ReloadViewCb (Widget w, XtPointer client_data, XtPointer call_data){ - Post_View *v, tmp ; - char filename[256]; - - if(!Post_ViewList) return; - - v = (Post_View*)List_Pointer(Post_ViewList,(long int)client_data-1); - strcpy(filename, v->FileName); - CopyViewOptions(v, &tmp); - - Post_ViewForceNumber = v->Num ; - FreeView(v); - MergeProblem(filename); - Post_ViewForceNumber = 0 ; - - v = (Post_View*)List_Pointer(Post_ViewList,(long int)client_data-1); - CopyViewOptions(&tmp, v); - - if(!All){ - Draw(); - } -} - -void ReloadAllViewsCb(Widget w, XtPointer client_data, XtPointer call_data){ - int i; - if(!Post_ViewList) return; - All = 1; - for(i = 1 ; i<=List_Nbr(Post_ViewList) ; i++) - ReloadViewCb(NULL, (XtPointer)i, NULL); - All = 0; - Draw(); -} - -/* ------------------------------------------------------------------------ - create a post dialog - ------------------------------------------------------------------------ */ - -void CurrentViewCb (Widget w, XtPointer client_data, XtPointer call_data){ - CurrentViewNumber = (long int)client_data; - CurrentView = (Post_View*)List_Pointer(Post_ViewList, CurrentViewNumber-1); -} - -void PostDialogCb (Widget w, XtPointer client_data, XtPointer call_data){ - double d, sfact; - char label[256]; - int nb, i; - Post_View *v; - - v = CurrentView ; - - /* le slider (gradue en interne de -100 a 100) va de -CTX.lc a +CTX.lc */ - sfact = pow(10.,2.-CTX.lc_order); - - sprintf(label, "\"%s\" (%ld)", v->Name, CurrentViewNumber); - - switch((long int)client_data){ - - /* Toggle Lightning */ - case POST_LIGHT: - v->Light = !v->Light; - v->Changed = 1; - Draw() ; - break; - - /* Toggle Show Elements */ - case POST_ELEMENT: - v->ShowElement = !v->ShowElement; - v->Changed = 1; - Draw() ; - break; - - /* Offset */ - case POST_OFFSET: - ViewForDialog[POST_OFFSET] = v; - XtVaSetValues(WID.PD.offsetDialog, XmNdialogTitle, XmStringCreateSimple(label), NULL); - XtVaSetValues(WID.PD.offsetModeButt[0], XmNset, (OFFSET_MODE==0)?True:False, NULL); - XtVaSetValues(WID.PD.offsetModeButt[1], XmNset, (OFFSET_MODE==1)?True:False, NULL); - for(i=0 ; i<3 ; i++){ - d = (OFFSET_MODE==1)?v->Raise[i]:v->Offset[i] ; - sprintf(label, "%g", d); - XtVaSetValues(WID.PD.offsetText[i], XmNvalue, label, NULL); - XtVaSetValues(WID.PD.offsetScale[i], XmNvalue, THRESHOLD((int)(sfact*d),-100,100), NULL); - } - XtManageChild(WID.PD.offsetDialog); - break; - - /* Time Step */ - case POST_TIME_STEP: - ViewForDialog[POST_TIME_STEP] = v; - XtVaSetValues(WID.PD.timeStepDialog, XmNdialogTitle, XmStringCreateSimple(label), NULL); - XtVaSetValues(WID.PD.timeStepScale, XmNmaximum, v->NbTimeStep-1, XmNvalue, v->TimeStep, NULL); - sprintf(label, "%d", v->TimeStep); - XtVaSetValues(WID.PD.timeStepText, XmNvalue, label, NULL); - XtManageChild(WID.PD.timeStepDialog); - break; - - /* Scale */ - case POST_SCALE: - ViewForDialog[POST_SCALE] = v; - XtVaSetValues(WID.PD.scaleDialog, XmNdialogTitle, XmStringCreateSimple(label), NULL); - - XtVaSetValues(WID.PD.scaleShowButt, XmNset, v->ShowScale?True:False, NULL); - XtVaSetValues(WID.PD.scaleTransButt, XmNset, v->TransparentScale?True:False, NULL); - XtVaSetValues(WID.PD.scaleTimeButt, XmNset, v->ShowTime?True:False, NULL); - - XtVaSetValues(WID.PD.scaleText[0], XmNvalue, v->Format, NULL); - XtSetSensitive(WID.PD.scaleText[0], v->ShowScale?1:0); - XtVaSetValues(WID.PD.scaleText[1], XmNvalue, v->Name, NULL); - XtSetSensitive(WID.PD.scaleText[1], v->ShowScale?1:0); - - XtVaSetValues(WID.PD.scaleRangeButt, XmNset, (v->RangeType==DRAW_POST_CUSTOM)?True:False, NULL); - sprintf(label, v->Format, v->CustomMin); - XtVaSetValues(WID.PD.scaleRangeText[0], XmNvalue, label, NULL); - sprintf(label, v->Format, v->CustomMax); - XtVaSetValues(WID.PD.scaleRangeText[1], XmNvalue, label, NULL); - XtSetSensitive(WID.PD.scaleRangeText[0], (v->RangeType==DRAW_POST_CUSTOM)?1:0); - XtSetSensitive(WID.PD.scaleRangeText[1], (v->RangeType==DRAW_POST_CUSTOM)?1:0); - - XtVaSetValues(WID.PD.scaleTypeButt[0], XmNset,(v->ScaleType==DRAW_POST_LINEAR)?True:False, NULL); - XtVaSetValues(WID.PD.scaleTypeButt[1], XmNset,(v->ScaleType==DRAW_POST_LOGARITHMIC)?True:False, NULL); - - XtVaSetValues(WID.PD.scaleIntervalsButt[0], XmNset, - (v->IntervalsType==DRAW_POST_ISO)?True:False, NULL); - XtVaSetValues(WID.PD.scaleIntervalsButt[1], XmNset, - (v->IntervalsType==DRAW_POST_DISCRETE)?True:False, NULL); - XtVaSetValues(WID.PD.scaleIntervalsButt[2], XmNset, - (v->IntervalsType==DRAW_POST_CONTINUOUS)?True:False, NULL); - XtVaSetValues(WID.PD.scaleIntervalsButt[3], XmNset, - (v->IntervalsType==DRAW_POST_NUMERIC)?True:False, NULL); - XtVaSetValues(WID.PD.scaleIntervalsScale, XmNvalue, THRESHOLD((int)v->NbIso,1,100), NULL); - - sprintf(label, "%d", v->NbIso); - XtVaSetValues(WID.PD.scaleIntervalsText, XmNvalue, label, NULL); - - XtManageChild(WID.PD.scaleDialog); - break; - - /* Color */ - case POST_COLOR: - ViewForDialog[POST_COLOR] = v; - XtVaSetValues(WID.PD.colorDialog, XmNdialogTitle, XmStringCreateSimple(label), NULL); - XtManageChild(WID.PD.colorDialog); - - XSelectInput(XCTX.display, XtWindow(WID.PD.colorDrawingArea), EV_MASK); - ColorBarCreate(XtWindow(WID.PD.colorDrawingArea),255,200); - ColorBarChange(v->Name, - (v->RangeType==DRAW_POST_CUSTOM)?v->CustomMin:v->Min, - (v->RangeType==DRAW_POST_CUSTOM)?v->CustomMax:v->Max, - &v->CT, 1); - ColorBarResizeCb((Widget)NULL, NULL, NULL); // Force resize - ColorBarShow(); - break; - - /* Vector */ - case POST_VECTOR: - ViewForDialog[POST_VECTOR] = v; - XtVaSetValues(WID.PD.vectorDialog, XmNdialogTitle, XmStringCreateSimple(label), NULL); - XtVaSetValues(WID.PD.vectorTypeButt[0], XmNset, (v->ArrowType == DRAW_POST_SEGMENT)?True:False, NULL); - XtVaSetValues(WID.PD.vectorTypeButt[1], XmNset, (v->ArrowType == DRAW_POST_ARROW)?True:False, NULL); - XtVaSetValues(WID.PD.vectorTypeButt[2], XmNset, (v->ArrowType == DRAW_POST_PYRAMID)?True:False, NULL); - XtVaSetValues(WID.PD.vectorTypeButt[3], XmNset, (v->ArrowType == DRAW_POST_CONE)?True:False, NULL); - XtVaSetValues(WID.PD.vectorTypeButt[4], XmNset, - (v->ArrowType == DRAW_POST_DISPLACEMENT)?True:False, NULL); - sprintf(label, "%g", v->ArrowScale); - XtVaSetValues(WID.PD.vectorScaleText, XmNvalue, label, NULL); - XtVaSetValues(WID.PD.vectorScaleScale, XmNvalue, THRESHOLD((int)v->ArrowScale,0,500), NULL); - XtVaSetValues(WID.PD.vectorLocationButt[0], XmNset, - (v->ArrowLocation == DRAW_POST_LOCATE_COG)?True:False, NULL); - XtVaSetValues(WID.PD.vectorLocationButt[1], XmNset, - (v->ArrowLocation == DRAW_POST_LOCATE_VERTEX)?True:False, NULL); - XtSetSensitive(WID.PD.vectorLocationCheck, v->ArrowType==DRAW_POST_DISPLACEMENT?False:True); - XtManageChild(WID.PD.vectorDialog); - break; - - /* Export BGM */ - case POST_EXPORT_BGM: - ViewForDialog[POST_EXPORT_BGM] = v; - strcat(label, " : Export as Background Mesh"); - XtVaSetValues(WID.PD.exportBGMDialog, XmNdialogTitle, XmStringCreateSimple(label), NULL); - d = ErrorInView(v,&nb) ; - sprintf(label, "Options (Current: %d elements, error=%g%%)", nb, d); - XtVaSetValues(WID.PD.exportBGMFrame[1], XmNlabelString, XmStringCreateSimple(label), NULL); - XtManageChild(WID.PD.exportBGMDialog); - break; - - - /* apply BGM */ - case POST_APPLY_BGM : - ViewForDialog[POST_APPLY_BGM] = v; - BGMWithView(v); - break; - - default: - Msg(WARNING, "Unknown Event in PostDialogCb (%d)", (long int)client_data); - break; - } -} - - -/* ------------------------------------------------------------------------ - functions in post dialogs - ------------------------------------------------------------------------ */ - -void ChangeViewParam (Post_View *v, XtPointer client_data, XtPointer call_data) ; - -void PostCb (Widget w, XtPointer client_data, XtPointer call_data){ - int j; - Post_View *v=NULL; - double d; - char *c; - XmString xms; - static int LastTimeStep = 0; - - switch((long int)client_data){ - - case POST_EXPORT_BGM_METHOD_H_ERROR : ADAPTATION_METHOD = 3; break; - case POST_EXPORT_BGM_METHOD_H_ELEMENTS : ADAPTATION_METHOD = 4; break; - case POST_EXPORT_BGM_METHOD_P_ERROR : ADAPTATION_METHOD = 1; break; - case POST_EXPORT_BGM_METHOD_P_ELEMENTS : ADAPTATION_METHOD = 2; break; - case POST_EXPORT_BGM_CONSTRAINT : - v = ViewForDialog[POST_EXPORT_BGM]; - ADAPTATION_ERROR = atof(XmTextGetString(w)); - return ; - case POST_EXPORT_BGM_CREATE : - v = ViewForDialog[POST_EXPORT_BGM]; - XtVaGetValues(w, XmNtextString, &xms, NULL); - XmStringGetLtoR(xms, XmSTRING_DEFAULT_CHARSET, &c); - XmStringFree(xms); - CreateBGM(v, ADAPTATION_METHOD, 1.0, ADAPTATION_ERROR, &d, c); - MergeProblem(c); - Draw(); - return; - case POST_COLOR_REPLOT : - v = ViewForDialog[POST_COLOR]; - ColorBarChange(v->Name, - (v->RangeType==DRAW_POST_CUSTOM)?v->CustomMin:v->Min, - (v->RangeType==DRAW_POST_CUSTOM)?v->CustomMax:v->Max, - &v->CT, 0); - ColorBarShow(); - if(v->CT.ipar[COLORTABLE_CHANGED]){ - v->Changed = 1; - if(CTX.post.link){ - ColorTable_Copy(&v->CT); - for(j=0 ; j< List_Nbr(Post_ViewList) ; j++){ - v = (Post_View*)List_Pointer(Post_ViewList, j); - if(v->Visible || CTX.post.link>1){ - ColorTable_Paste(&v->CT); - v->Changed=1; - } - } - } - } - Draw(); - return; - } - - if(CTX.post.link){ - for(j=0 ; j< List_Nbr(Post_ViewList) ; j++){ - v = (Post_View*)List_Pointer(Post_ViewList, j); - if(v->Visible || CTX.post.link>1) ChangeViewParam(v, client_data, call_data); - } - } - else{ - switch((long int)client_data){ - case POST_OFFSET_TRANSLATE: - case POST_OFFSET_RAISE: - case POST_OFFSET_X_TEXT: - case POST_OFFSET_Y_TEXT: - case POST_OFFSET_Z_TEXT: - case POST_OFFSET_X_SCALE: - case POST_OFFSET_Y_SCALE: - case POST_OFFSET_Z_SCALE: - v = ViewForDialog[POST_OFFSET]; - break; - case POST_TIME_STEP_TEXT: - case POST_TIME_STEP_SCALE: - v = ViewForDialog[POST_TIME_STEP]; - break; - case POST_SCALE_SHOW: - case POST_SCALE_TRANSPARENCY: - case POST_SCALE_TIME: - case POST_SCALE_FORMAT: - case POST_SCALE_LABEL: - case POST_SCALE_MIN: - case POST_SCALE_MAX: - case POST_SCALE_TYPE_LIN: - case POST_SCALE_TYPE_LOG: - case POST_SCALE_FORCE_RANGE: - case POST_SCALE_INTERVALS_TYPE_ISO : - case POST_SCALE_INTERVALS_TYPE_DISCRETE : - case POST_SCALE_INTERVALS_TYPE_CONTINUOUS: - case POST_SCALE_INTERVALS_TYPE_NUMERIC: - case POST_SCALE_INTERVALS_TEXT: - case POST_SCALE_INTERVALS_SCALE: - v = ViewForDialog[POST_SCALE]; - break; - case POST_VECTOR_TYPE_SEGMENT: - case POST_VECTOR_TYPE_ARROW: - case POST_VECTOR_TYPE_PYRAMID: - case POST_VECTOR_TYPE_CONE: - case POST_VECTOR_TYPE_DISPLACEMENT: - case POST_VECTOR_SCALE_TEXT: - case POST_VECTOR_SCALE_SCALE: - case POST_VECTOR_LOCATION_COG: - case POST_VECTOR_LOCATION_VERTEX: - v = ViewForDialog[POST_VECTOR]; - break; - default : - Msg(WARNING, "Unknown Event in PostCb"); - break; - } - ChangeViewParam(v, client_data, call_data); - } - - - if((long int)client_data == POST_TIME_STEP_SCALE){ - if(LastTimeStep != v->TimeStep){ - LastTimeStep = v->TimeStep; - Draw(); - } - } - -} - -void ChangeViewParam (Post_View *v, XtPointer client_data, XtPointer call_data){ - double d, sfact; - char *c, label[256]; - int i; - - /* le slider (gradue en interne de -100 a 100) va de -CTX.lc a +CTX.lc */ - sfact = pow(10.,2.-CTX.lc_order); - - switch((long int)client_data){ - - /* Offset */ - case POST_OFFSET_TRANSLATE: - OFFSET_MODE = 0; - for(i=0 ; i<3 ; i++){ - sprintf(label, "%g", v->Offset[i]); - XtVaSetValues(WID.PD.offsetText[i], XmNvalue, label, NULL); - XtVaSetValues(WID.PD.offsetScale[i], XmNvalue, - THRESHOLD((int)(sfact*v->Offset[i]),-100,100), NULL); - XmUpdateDisplay(WID.PD.offsetText[i]); - XmUpdateDisplay(WID.PD.offsetScale[i]); - } - break; - case POST_OFFSET_RAISE: - OFFSET_MODE = 1; - for(i=0 ; i<3 ; i++){ - sprintf(label, "%g", v->Raise[i]); - XtVaSetValues(WID.PD.offsetText[i], XmNvalue, label, NULL); - XtVaSetValues(WID.PD.offsetScale[i], XmNvalue, - THRESHOLD((int)(sfact*v->Raise[i]),-100,100), NULL); - XmUpdateDisplay(WID.PD.offsetText[i]); - XmUpdateDisplay(WID.PD.offsetScale[i]); - } - break; - case POST_OFFSET_X_TEXT: - d = atof(XmTextGetString(WID.PD.offsetText[0])); - OFFSET_MODE ? (v->Raise[0] = d) : (v->Offset[0] = d); - XtVaSetValues(WID.PD.offsetScale[0], XmNvalue, THRESHOLD((int)(sfact*d),-100,100), NULL); - XmUpdateDisplay(WID.PD.offsetScale[0]); - v->Changed = 1; - break; - case POST_OFFSET_Y_TEXT: - d = atof(XmTextGetString(WID.PD.offsetText[1])); - OFFSET_MODE ? (v->Raise[1] = d) : (v->Offset[1] = d); - XtVaSetValues(WID.PD.offsetScale[1], XmNvalue, THRESHOLD((int)(sfact*d),-100,100), NULL); - XmUpdateDisplay(WID.PD.offsetScale[1]); - v->Changed = 1; - break; - case POST_OFFSET_Z_TEXT: - d = atof(XmTextGetString(WID.PD.offsetText[2])); - OFFSET_MODE ? (v->Raise[2] = d) : (v->Offset[2] = d); - XtVaSetValues(WID.PD.offsetScale[2], XmNvalue, THRESHOLD((int)(sfact*d),-100,100), NULL); - XmUpdateDisplay(WID.PD.offsetScale[2]); - v->Changed = 1; - break; - case POST_OFFSET_X_SCALE: - XmScaleGetValue (WID.PD.offsetScale[0], &i); - d = i/sfact ; - sprintf(label, "%g", d); - OFFSET_MODE ? (v->Raise[0] = d) : (v->Offset[0] = d); - XtVaSetValues(WID.PD.offsetText[0],XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.offsetText[0]); - v->Changed = 1; - break; - case POST_OFFSET_Y_SCALE: - XmScaleGetValue (WID.PD.offsetScale[1], &i); - d = i/sfact ; - sprintf(label, "%g",d); - OFFSET_MODE ? (v->Raise[1]) = d : (v->Offset[1] = d); - XtVaSetValues(WID.PD.offsetText[1],XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.offsetText[1]); - v->Changed = 1; - break; - case POST_OFFSET_Z_SCALE: - XmScaleGetValue (WID.PD.offsetScale[2], &i); - d = i/sfact ; - sprintf(label, "%g", d); - OFFSET_MODE ? (v->Raise[2] = d) : (v->Offset[2] = d); - XtVaSetValues(WID.PD.offsetText[2],XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.offsetText[2]); - v->Changed = 1; - break; - - /* Time Step */ - case POST_TIME_STEP_TEXT: - i = atoi(XmTextGetString(WID.PD.timeStepText)); - if(i < 0) - v->TimeStep = 0; - else if(i > v->NbTimeStep-1) - v->TimeStep = v->NbTimeStep-1; - else - v->TimeStep = i; - XtVaSetValues(WID.PD.timeStepScale, XmNvalue, v->TimeStep, NULL); - XmUpdateDisplay(WID.PD.timeStepScale); - v->Changed = 1; - break; - case POST_TIME_STEP_SCALE: - XmScaleGetValue (WID.PD.timeStepScale, &i); - if(i < 0) - v->TimeStep = 0; - else if(i > v->NbTimeStep-1) - v->TimeStep = v->NbTimeStep-1; - else - v->TimeStep = i; - sprintf(label, "%d", v->TimeStep); - XtVaSetValues(WID.PD.timeStepText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.timeStepText); - v->Changed = 1; - break; - - - /* Scale */ - case POST_SCALE_SHOW: - v->ShowScale = !v->ShowScale; - XtSetSensitive(WID.PD.scaleText[0], v->ShowScale?1:0); - XtSetSensitive(WID.PD.scaleText[1], v->ShowScale?1:0); - break; - case POST_SCALE_TRANSPARENCY: - v->TransparentScale = !v->TransparentScale; - break; - case POST_SCALE_TIME: - v->ShowTime = !v->ShowTime; - break; - case POST_SCALE_FORMAT: - c = XmTextGetString(WID.PD.scaleText[0]); strcpy(v->Format,c); - break; - case POST_SCALE_LABEL: - c = XmTextGetString(WID.PD.scaleText[1]); strcpy(v->Name,c); - break; - case POST_SCALE_MIN: - v->CustomMin = atof(XmTextGetString(WID.PD.scaleRangeText[0])); - if(v->RangeType==DRAW_POST_CUSTOM) v->Changed = 1; - break; - case POST_SCALE_MAX: - v->CustomMax = atof(XmTextGetString(WID.PD.scaleRangeText[1])); - if(v->RangeType==DRAW_POST_CUSTOM) v->Changed = 1; - break; - case POST_SCALE_TYPE_LIN: - v->ScaleType = DRAW_POST_LINEAR; - v->Changed = 1; - break; - case POST_SCALE_TYPE_LOG: - v->ScaleType = DRAW_POST_LOGARITHMIC; - v->Changed = 1; - break; - case POST_SCALE_FORCE_RANGE: - (v->RangeType == DRAW_POST_DEFAULT) ? - (v->RangeType=DRAW_POST_CUSTOM) : (v->RangeType=DRAW_POST_DEFAULT); - XtSetSensitive(WID.PD.scaleRangeText[0], (v->RangeType==DRAW_POST_CUSTOM)?1:0); - XtSetSensitive(WID.PD.scaleRangeText[1], (v->RangeType==DRAW_POST_CUSTOM)?1:0); - v->Changed = 1; - break; - case POST_SCALE_INTERVALS_TYPE_ISO : - v->IntervalsType = DRAW_POST_ISO; - v->Changed = 1; - break; - case POST_SCALE_INTERVALS_TYPE_DISCRETE : - v->IntervalsType = DRAW_POST_DISCRETE; - v->Changed = 1; - break; - case POST_SCALE_INTERVALS_TYPE_CONTINUOUS: - v->IntervalsType = DRAW_POST_CONTINUOUS; - v->Changed = 1; - break; - case POST_SCALE_INTERVALS_TYPE_NUMERIC: - v->IntervalsType = DRAW_POST_NUMERIC; - v->Changed = 1; - break; - case POST_SCALE_INTERVALS_TEXT: - v->NbIso = atoi(XmTextGetString(WID.PD.scaleIntervalsText)); - XtVaSetValues(WID.PD.scaleIntervalsScale, XmNvalue, THRESHOLD((int)v->NbIso,1,100), NULL); - XmUpdateDisplay(WID.PD.scaleIntervalsScale); - v->Changed = 1; - break; - case POST_SCALE_INTERVALS_SCALE: - XmScaleGetValue(WID.PD.scaleIntervalsScale, &v->NbIso); - sprintf(label, "%d", v->NbIso); - XtVaSetValues(WID.PD.scaleIntervalsText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.scaleIntervalsText); - v->Changed = 1; - break; - - /* Vector */ - case POST_VECTOR_TYPE_SEGMENT: - v->ArrowType = DRAW_POST_SEGMENT; - XtSetSensitive(WID.PD.vectorLocationCheck, True); - v->Changed = 1; - break; - case POST_VECTOR_TYPE_ARROW: - v->ArrowType = DRAW_POST_ARROW; - XtSetSensitive(WID.PD.vectorLocationCheck, True); - v->Changed = 1; - break; - case POST_VECTOR_TYPE_PYRAMID: - v->ArrowType = DRAW_POST_PYRAMID; - XtSetSensitive(WID.PD.vectorLocationCheck, True); - v->Changed = 1; - break; - case POST_VECTOR_TYPE_CONE: - v->ArrowType = DRAW_POST_CONE; - XtSetSensitive(WID.PD.vectorLocationCheck, True); - v->Changed = 1; - break; - case POST_VECTOR_TYPE_DISPLACEMENT: - v->ArrowType = DRAW_POST_DISPLACEMENT; - XtSetSensitive(WID.PD.vectorLocationCheck, False); - v->Changed = 1; - break; - case POST_VECTOR_SCALE_TEXT: - v->ArrowScale = atof(XmTextGetString(WID.PD.vectorScaleText)); - XtVaSetValues(WID.PD.vectorScaleScale, XmNvalue, THRESHOLD((int)v->ArrowScale,0,500), NULL); - XmUpdateDisplay(WID.PD.vectorScaleScale); - v->Changed = 1; - break; - case POST_VECTOR_SCALE_SCALE: - XmScaleGetValue(WID.PD.vectorScaleScale, &i); - v->ArrowScale = (double)i; - sprintf(label, "%g", v->ArrowScale); - XtVaSetValues(WID.PD.vectorScaleText, XmNvalue, label, NULL); - XmUpdateDisplay(WID.PD.vectorScaleText); - v->Changed = 1; - break; - case POST_VECTOR_LOCATION_COG: - v->ArrowLocation = DRAW_POST_LOCATE_COG; - v->Changed = 1; - break; - case POST_VECTOR_LOCATION_VERTEX: - v->ArrowLocation = DRAW_POST_LOCATE_VERTEX; - v->Changed = 1; - break; - - default: - Msg(WARNING, "Unknown Event in PostCb (%d)", (long int)client_data); - break; - - } - -} - diff --git a/Motif/CbPost.h b/Motif/CbPost.h deleted file mode 100644 index d5b135fb6b9e26514e03fea8f69ebc00e1ce7a14..0000000000000000000000000000000000000000 --- a/Motif/CbPost.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _CB_POST_H_ -#define _CB_POST_H_ - -#define POST_LINK 1 -#define POST_OFFSET 2 -#define POST_TIME_STEP 3 -#define POST_SCALE 4 -#define POST_VECTOR 5 -#define POST_EXPORT_BGM 6 -#define POST_APPLY_BGM 7 -#define POST_LIGHT 8 -#define POST_COLOR 9 -#define POST_ELEMENT 10 - -#define POST_OFFSET_TRANSLATE 403 -#define POST_OFFSET_RAISE 404 -#define POST_OFFSET_X_TEXT 405 -#define POST_OFFSET_Y_TEXT 406 -#define POST_OFFSET_Z_TEXT 407 -#define POST_OFFSET_X_SCALE 408 -#define POST_OFFSET_Y_SCALE 409 -#define POST_OFFSET_Z_SCALE 410 - -#define POST_TIME_STEP_TEXT 417 -#define POST_TIME_STEP_SCALE 418 - -#define POST_SCALE_SHOW 421 -#define POST_SCALE_TRANSPARENCY 422 -#define POST_SCALE_FORMAT 423 -#define POST_SCALE_LABEL 424 -#define POST_SCALE_FORCE_RANGE 425 -#define POST_SCALE_MIN 426 -#define POST_SCALE_MAX 427 -#define POST_SCALE_TYPE_LIN 428 -#define POST_SCALE_TYPE_LOG 429 -#define POST_SCALE_INTERVALS_TYPE_ISO 430 -#define POST_SCALE_INTERVALS_TYPE_DISCRETE 431 -#define POST_SCALE_INTERVALS_TYPE_CONTINUOUS 432 -#define POST_SCALE_INTERVALS_TYPE_NUMERIC 433 -#define POST_SCALE_INTERVALS_SCALE 434 -#define POST_SCALE_INTERVALS_TEXT 435 -#define POST_SCALE_TIME 436 - -#define POST_COLOR_REPLOT 440 - -#define POST_VECTOR_TYPE_SEGMENT 450 -#define POST_VECTOR_TYPE_ARROW 451 -#define POST_VECTOR_TYPE_PYRAMID 452 -#define POST_VECTOR_TYPE_CONE 453 -#define POST_VECTOR_TYPE_DISPLACEMENT 454 -#define POST_VECTOR_SCALE_TEXT 455 -#define POST_VECTOR_SCALE_SCALE 456 -#define POST_VECTOR_LOCATION_COG 457 -#define POST_VECTOR_LOCATION_VERTEX 458 - -#define POST_EXPORT_BGM_METHOD_H_ERROR 461 -#define POST_EXPORT_BGM_METHOD_H_ELEMENTS 462 -#define POST_EXPORT_BGM_METHOD_P_ERROR 463 -#define POST_EXPORT_BGM_METHOD_P_ELEMENTS 464 -#define POST_EXPORT_BGM_CONSTRAINT 465 -#define POST_EXPORT_BGM_CREATE 466 - -void MarkAllViewsChanged (int action); - -#endif diff --git a/Motif/Geometry.cpp b/Motif/Geometry.cpp deleted file mode 100644 index 45a436971be88ccbe9298bf79374e28c6aa127e1..0000000000000000000000000000000000000000 --- a/Motif/Geometry.cpp +++ /dev/null @@ -1,825 +0,0 @@ -// $Id: Geometry.cpp,v 1.1 2001-01-08 08:20:10 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Context.h" -#include "XContext.h" -#include "Widgets.h" - -extern Context_T CTX ; -extern XContext_T XCTX ; - -#define WINDOW_SHADOW 1 -#define SHADOW 2 -#define IN_FRAME_TYPE XmSHADOW_ETCHED_IN -#define IN_FRAME_SHADOW 2 -#define TITLE_SPACE 0 -#define TITLE_ALIGN XmALIGNMENT_WIDGET_TOP -#define DIALOG_W 6 -#define DIALOG_H 4 - - -/* - XmNchildVerticalAlignment : - CENTER, WIDGET_TOP, WIDGET_BOTTOM, BASELINE_BOTTOM, BASELINE_TOP - - XmNshadowType : - ETCHED_IN, ETCHED_OUT, IN, OUT -*/ - -/* ------------------------------------------------------------------------ - MENU WINDOW - ------------------------------------------------------------------------ */ - -void ForceGeometry_M (Widgets_T *w){ - int n; - - XtVaSetValues(w->M.containerWin, - XmNmenuBar, w->M.menuBar, - NULL); - - XtVaSetValues(w->M.menuBar, - XmNmenuHelpWidget, w->M.helpCascade, - NULL); - - XtVaSetValues(w->M.menuFrame, - XmNshadowType, XmSHADOW_OUT, - XmNshadowThickness, WINDOW_SHADOW, - NULL); - - XtVaSetValues(w->M.menuForm, - XmNfractionBase, 100, - XmNmarginWidth, 3, - XmNmarginHeight, 3, - NULL); - - XtVaSetValues(w->M.modButt, - XmNmarginHeight, 5, - XmNmarginWidth, 2, - XmNtopAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_WIDGET, - XmNleftWidget, w->M.navigButt[0], - XmNrightAttachment, XmATTACH_WIDGET, - XmNrightWidget, w->M.navigButt[1], - NULL); - - XtVaSetValues(w->M.navigButt[0], - XmNshadowThickness, 0, - XmNwidth, 20, - XmNleftAttachment, XmATTACH_FORM, - NULL); - - XtVaSetValues(w->M.navigButt[1], - XmNshadowThickness, 0, - XmNwidth, 20, - XmNrightAttachment, XmATTACH_FORM, - NULL); - - XtVaSetValues(w->M.defaultButt, - XmNmarginHeight, 5, - XmNtopAttachment, XmATTACH_WIDGET, - XmNtopWidget, w->M.modButt, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - NULL); - - XtVaSetValues(w->M.pushButt[0], - XmNshadowThickness, SHADOW, - XmNmarginHeight, 5, - XmNtopAttachment, XmATTACH_WIDGET, - XmNtopWidget, w->M.modButt, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - NULL); - - XtVaSetValues(w->M.toggleButt[0], - XmNshadowThickness, SHADOW, - XmNmarginHeight, 3, - XmNtopAttachment, XmATTACH_WIDGET, - XmNtopWidget, w->M.modButt, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - NULL); - - for(n=1 ; n<NB_BUTT_MAX ; n++){ - XtVaSetValues(w->M.pushButt[n], - XmNtopAttachment, XmATTACH_WIDGET, - XmNtopWidget, w->M.pushButt[n-1], - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - XmNshadowThickness, SHADOW, - XmNmarginHeight, 5, - NULL); - - XtVaSetValues(w->M.toggleButt[n], - XmNtopAttachment, XmATTACH_WIDGET, - XmNtopWidget, w->M.toggleButt[n-1], - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - XmNshadowThickness, SHADOW, - XmNmarginHeight, 3, - NULL); - } - -} - -/* ------------------------------------------------------------------------ - GRAPHIC WINDOW - ------------------------------------------------------------------------ */ - -void ForceGeometry_G (Widgets_T *w){ - int i; - - XtVaSetValues(w->G.glw, - XmNtopAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_WIDGET, - XmNbottomWidget, w->G.bottomForm, - NULL); - - if(CTX.overlay) - XtVaSetValues(w->G.glo, - XmNtopAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_WIDGET, - XmNbottomWidget, w->G.bottomForm, - NULL); - - XtVaSetValues(w->G.bottomForm, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNmarginHeight, 2, - XmNmarginWidth, 1, - XmNshadowThickness, WINDOW_SHADOW, - XmNfractionBase, 100, - NULL); - - XtVaSetValues(w->G.Butt[0], - XmNtopAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_FORM, - XmNshadowThickness, 0, - XmNmarginHeight, 1, - NULL); - - for(i=1 ; i<7 ; i++) { - XtVaSetValues(w->G.Butt[i], - XmNtopAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_WIDGET, - XmNleftWidget, w->G.Butt[i-1], - XmNshadowThickness, 0, - XmNmarginHeight, 1, - NULL); - } - - XtVaSetValues(w->G.textForm, - XmNbottomAttachment, XmATTACH_FORM, - XmNtopAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_WIDGET, - XmNleftWidget, w->G.Butt[6], - XmNrightAttachment, XmATTACH_FORM, - XmNfractionBase, 300, - NULL); - - XtVaSetValues(w->G.selectLabel, - XmNtopAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_POSITION, - XmNleftPosition, 2, - XmNrightAttachment, XmATTACH_POSITION, - XmNrightPosition, 90, - XmNmarginHeight, 0, - NULL); - - XtVaSetValues(w->G.infoLabel, - XmNtopAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_POSITION, - XmNleftPosition, 92, - XmNrightAttachment, XmATTACH_POSITION, - XmNrightPosition, 180, - XmNmarginHeight, 0, - NULL); - - XtVaSetValues(w->G.statusLabel, - XmNtopAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_POSITION, - XmNleftPosition, 182, - XmNrightAttachment, XmATTACH_POSITION, - XmNrightPosition, 298, - XmNmarginHeight, 0, - NULL); - -} - -/* ------------------------------------------------------------------------ - COMMAND WINDOW - ------------------------------------------------------------------------ */ - -void ForceGeometry_C (Widgets_T *w){ - - XtVaSetValues(w->C.command, - XmNshadowThickness, WINDOW_SHADOW, - XmNshadowType, XmSHADOW_OUT, - XmNmarginHeight, 2, - XmNmarginWidth, 2, - NULL); - - XtVaSetValues(w->C.commandList, - XmNshadowThickness, SHADOW, - XmNmarginHeight, 0, - NULL); - - XtVaSetValues(w->C.commandText, - XmNshadowThickness, SHADOW, - XmNmarginHeight, 4, - NULL); -} - -/* ------------------------------------------------------------------------ - DIALOGS - ------------------------------------------------------------------------ */ - -void ForceGeometry_ED (Widgets_T *w){ -} - -void ForceGeometry_FD (Widgets_T *w){ - - XtVaSetValues(w->FD.openDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->FD.mergeDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->FD.saveAsDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->FD.saveAsFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->FD.saveAsFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->FD.saveAsRowCol, - XmNmarginWidth, 0, - NULL); - - XtVaSetValues(w->FD.saveOptionsAsDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - -} - -void ForceGeometry_OD (Widgets_T *w){ - int i,j; - - XtVaSetValues(w->OD.geomDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->OD.geomVisibleFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.geomVisibleFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.geomVisibleByNumFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.geomVisibleByNumFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.geomNormalsFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.geomNormalsFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.geomTangentsFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.geomTangentsFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->OD.meshAlgoFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshAlgoFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshSmoothingFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshSmoothingFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshVisibleFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshVisibleFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshVisibleByNumFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshVisibleByNumFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshAspectFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshAspectFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshExplodeFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshExplodeFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.meshNormalsFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.meshNormalsFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.postDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->OD.postLinkFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.postLinkFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.postAnimFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.postAnimFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.miscDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->OD.miscMiscFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.miscMiscFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.miscColorSchemeFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.miscColorSchemeFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.miscProjFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.miscProjFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.miscLightFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.miscLightFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.miscShineFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.miscShineFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->OD.viewportDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<3 ; i++){ - XtVaSetValues(w->OD.viewportFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.viewportFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - for(j=0 ; j<3 ; j++){ - XtVaSetValues(w->OD.viewportLockButt[j][i], - XmNmarginHeight, 0, - NULL); - } - } - - XtVaSetValues(w->OD.infoDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<3 ; i++){ - XtVaSetValues(w->OD.infoFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->OD.infoFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - -} - -void ForceGeometry_HD (Widgets_T *w){ - - XtVaSetValues(w->HD.keysDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); -} - -void ForceGeometry_GD (Widgets_T *w){ - int i; - - XtVaSetValues(w->GD.paramDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<2 ; i++){ - XtVaSetValues(w->GD.paramFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->GD.paramFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - - XtVaSetValues(w->GD.pointDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<2 ; i++){ - XtVaSetValues(w->GD.pointFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->GD.pointFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - XtVaSetValues(w->GD.rotDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<3 ; i++){ - XtVaSetValues(w->GD.rotFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->GD.rotFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - XtVaSetValues(w->GD.tranDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->GD.tranFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->GD.tranFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->GD.dilatDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<2 ; i++){ - XtVaSetValues(w->GD.dilatFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->GD.dilatFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - XtVaSetValues(w->GD.symmDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->GD.symmFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->GD.symmFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - -} - -void ForceGeometry_MD (Widgets_T *w){ - int i; - - XtVaSetValues(w->MD.charLengthDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->MD.charLengthFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->MD.charLengthFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->MD.trsfLineDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<2 ; i++){ - XtVaSetValues(w->MD.trsfLineFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - XtVaSetValues(w->MD.trsfLineFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - XtVaSetValues(w->MD.trsfVolumeDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->MD.trsfVolumeFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->MD.trsfVolumeFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - -} - -void ForceGeometry_PD (Widgets_T *w){ - int i; - - - XtVaSetValues(w->PD.offsetDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<4 ; i++){ - XtVaSetValues(w->PD.offsetFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - XtVaSetValues(w->PD.offsetFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - XtVaSetValues(w->PD.timeStepDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->PD.timeStepFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - XtVaSetValues(w->PD.timeStepFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->PD.scaleDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<3 ; i++){ - XtVaSetValues(w->PD.scaleFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - XtVaSetValues(w->PD.scaleFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - - XtVaSetValues(w->PD.colorDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - XtVaSetValues(w->PD.colorFrame[0][0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - XtVaSetValues(w->PD.colorFrame[1][0], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - XtVaSetValues(w->PD.colorDrawingArea, - XmNtopAttachment, XmATTACH_FORM, - XmNleftAttachment, XmATTACH_FORM, - XmNrightAttachment, XmATTACH_FORM, - XmNbottomAttachment, XmATTACH_FORM, - XmNwidth, 255, - XmNheight, 200, - NULL); - - - XtVaSetValues(w->PD.vectorDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - for(i=0 ; i<3 ; i++){ - XtVaSetValues(w->PD.vectorFrame[0][i], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - XtVaSetValues(w->PD.vectorFrame[1][i], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - } - - XtVaSetValues(w->PD.exportBGMDialog, - XmNmarginHeight, DIALOG_H, - XmNmarginWidth, DIALOG_W, - NULL); - - XtVaSetValues(w->PD.exportBGMFrame[0], - XmNshadowType, IN_FRAME_TYPE, - XmNshadowThickness, IN_FRAME_SHADOW, - NULL); - - XtVaSetValues(w->PD.exportBGMFrame[1], - XmNchildHorizontalSpacing, TITLE_SPACE, - XmNchildVerticalAlignment, TITLE_ALIGN, - NULL); - - XtVaSetValues(w->PD.exportBGMText, - XmNmarginHeight, 2, - NULL); - -} - - -/* ------------------------------------------------------------------------ - F o r c e G e o m e t r y - ------------------------------------------------------------------------ */ - -void ForceGeometry (Widgets_T *w){ - ForceGeometry_M(w) ; /* menu win */ - ForceGeometry_G(w) ; /* graphic win */ - if(CTX.command_win) ForceGeometry_C(w) ; /* command win */ - - ForceGeometry_ED(w); /* error dialogs */ - ForceGeometry_FD(w); /* file dialogs */ - ForceGeometry_OD(w); /* option dialogs */ - ForceGeometry_HD(w); /* help dialogs */ - ForceGeometry_GD(w); /* geometry dialogs */ - ForceGeometry_MD(w); /* mesh dialogs */ - ForceGeometry_PD(w); /* post dialogs */ -} - diff --git a/Motif/Geometry.h b/Motif/Geometry.h deleted file mode 100644 index 9793884fc83258996240a4f5bb8d79c7683c22c3..0000000000000000000000000000000000000000 --- a/Motif/Geometry.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _GEOMETRY_H_ -#define _GEOMETRY_H_ - -void ForceGeometry(Widgets_T *w); - -#endif diff --git a/Motif/Help.h b/Motif/Help.h deleted file mode 100644 index 813b0127cb83c87b6216cf27e3f2aa40acfee106..0000000000000000000000000000000000000000 --- a/Motif/Help.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef _HELP_H_ -#define _HELP_H_ - -static char txt_help[]= -"\n" -" (x) stands for \"press x\"\n" -" (x-y) stands for \"press x and, keeping it down, press y\"\n" -" (x-y-z) stands for \"press x and, keeping it down, press y and z\"\n" -" C, M and S stand for Control, Meta (or Alt) and Shift\n" -"\n" -"MOUSE:\n" -"\n" -" move . highlight the elementary geometrical entity \n" -" currently under the mouse pointer and display\n" -" its properties in the status bar\n" -" . size a rubber zoom started with (C-left)\n" -"\n" -" (left) . rotate\n" -" . accept a rubber zoom started by (C-left)\n" -" (middle) . zoom (isotropic)\n" -" . cancel a rubber zoom\n" -" (right) . pan\n" -" . cancel a rubber zoom\n" -" . pop up menu on module name\n" -" . pop up menu on post-processing view button\n" -"\n" -" (C-left) start (anisotropic) rubber zoom\n" -" (C-middle) orthogonalize display\n" -" (C-right) reset viewpoint to default\n" -"\n" -"KEYBOARD:\n" -"\n" -"No modifier: basic module interaction\n" -"\n" -" (0) reload input file\n" -" (1), (F1) mesh curves\n" -" (2), (F2) mesh surfaces\n" -" (3), (F3) mesh volumes\n" -" (g) go to geometry module\n" -" (m) go to mesh module\n" -" (p) go to post processor module\n" -"\n" -"Control modifier: file menu\n" -"\n" -" (C-q) quit\n" -" (C-o) hide/show open file dialog\n" -" (C-p) hide/show save/print dialog\n" -" (C-m) hide/show merge file dialog\n" -" (C-s) quick mesh save\n" -"\n" -"Shift modifier: pop up option menus\n" -"\n" -" (S-g) hide/show geometry options\n" -" (S-i) hide/show statistics window\n" -" (S-m) hide/show mesh options\n" -" (S-o) hide/show miscellaneous options\n" -" (S-p) hide/show post-processing general options\n" -" (S-v) hide/show viewpoint options\n" -"\n" -"Meta (Alt) modifier: quick shortcuts (no pop up)\n" -"\n" -" (M-a) hide/show small axes\n" -" (M-S-a) hide/show big moving axes\n" -" (M-b) hide/show all post processing scales\n" -" (M-c) alternate between predefined color schemes\n" -" (M-d) alternate between mesh wire frame, hidden lines\n" -" and shading modes\n" -" (M-f) toggle redraw mode (fast/full)\n" -" (M-h) toggle highlight mode\n" -" (M-l) hide/show geometry lines\n" -" (M-S-l) hide/show mesh lines\n" -" (M-m) toggle visibility of all mesh entities\n" -" (M-o) change projection mode\n" -" (M-p) hide/show geometry points\n" -" (M-S-p) hide/show mesh points\n" -" (M-s) hide/show geometry surfaces\n" -" (M-S-s) hide/show mesh surfaces\n" -" (M-t) alternate intervals mode for all post-processing\n" -" views\n" -" (M-v) hide/show geometry volumes\n" -" (M-S-v) hide/show mesh volumes\n" -" (M-x) set X view\n" -" (M-y) set Y view\n" -" (M-z) set Z view\n" -"\n" -; - - -#endif diff --git a/Motif/Info.h b/Motif/Info.h deleted file mode 100644 index 21bd1d2d9c6166337a2d53b5142f6ae35db33b97..0000000000000000000000000000000000000000 --- a/Motif/Info.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _INFO_H_ -#define _INFO_H_ - -static char *txt_info [] = - { - /* Geometry */ - "Points", - "Curves", - "Surfaces", - "Volumes", - - /* Mesh */ - "Nodes on Curves", - "Nodes on Surfaces", - "Nodes in Volumes", - "Triangles", - "Quadrangles", - "Tetrahedra", - "Hexahedra", - "Prisms", - "Pyramids", - "Time for 1D Mesh", - "Time for 2D Mesh", - "Time for 3D Mesh", - - "Gamma", - "Eta", - "Rho", - - /* Post */ - "Views loaded", - "Visible Points", - "Visible Lines", - "Visible Triangles", - "Visible Tetrahedra" - } ; - -#endif diff --git a/Motif/Main.cpp b/Motif/Main.cpp deleted file mode 100644 index 8c99e0b1f2a4cdd44c14a1e34dbfe185e29cc295..0000000000000000000000000000000000000000 --- a/Motif/Main.cpp +++ /dev/null @@ -1,419 +0,0 @@ -// $Id: Main.cpp,v 1.11 2001-05-22 08:30:26 geuzaine Exp $ - -#include <signal.h> - -#include "Gmsh.h" -#include "GmshUI.h" -#include "GmshVersion.h" -#include "Geo.h" -#include "Verif.h" -#include "Mesh.h" -#include "Draw.h" -#include "Context.h" -#include "Options.h" -#include "ColorTable.h" -#include "Parser.h" -#include "Views.h" - -#include "Widgets.h" -#include "Pixmaps.h" -#include "XColors.h" -#include "XContext.h" -#include "XRessources.h" -#include "CbContext.h" -#include "CbGeom.h" -#include "Register.h" -#include "Geometry.h" -#include "OpenFile.h" -#include "GetOptions.h" - -#include "Static.h" -#include "XStatic.h" - -char* ShowVisualClass(int cls){ - if(cls==TrueColor) return "TrueColor"; - if(cls==DirectColor) return "DirectColor"; - if(cls==PseudoColor) return "PseudoColor"; - if(cls==StaticColor) return "StaticColor"; - if(cls==GrayScale) return "GrayScale"; - if(cls==StaticGray) return "StaticGray"; - return "Unknown"; -} - -int main(int argc, char *argv[]){ - int i, nbf; - XColor ov_color_def, ov_color_exact; - extern char *TextBuffer, TextAbout[1024]; - - /* Gmsh default context options */ - - Init_Options(0); - - /* Command line options */ - - Get_Options(argc, argv, &nbf); - - if(CTX.verbosity) - fprintf(stderr, "%s, Version %.2f\n", gmsh_progname, GMSH_VERSION); - - /* Initialize the static Mesh */ - - M.Vertices = NULL ; - M.VertexEdges = NULL ; - M.Simplexes = NULL ; - M.Points = NULL ; - M.Curves = NULL ; - M.SurfaceLoops = NULL ; - M.EdgeLoops = NULL ; - M.Surfaces = NULL ; - M.Volumes = NULL ; - M.PhysicalGroups = NULL ; - M.Metric = NULL ; - - /* Signal handling */ - - signal(SIGINT, Signal); - signal(SIGSEGV, Signal); - signal(SIGFPE, Signal); - - /* Non-interactive Gmsh */ - - if(CTX.batch){ - OpenProblem(CTX.filename); - if(yyerrorstate) - exit(1); - else { - if(nbf > 1){ - for(i=1;i<nbf;i++) MergeProblem(TheFileNameTab[i]); - } - if(TheBgmFileName){ - MergeProblem(TheBgmFileName); - if(List_Nbr(Post_ViewList)) - BGMWithView((Post_View*)List_Pointer(Post_ViewList, List_Nbr(Post_ViewList)-1)); - else - Msg(GERROR, "Invalid Background Mesh (no View)"); - } - if(CTX.batch > 0){ - mai3d(THEM, CTX.batch); - Print_Mesh(THEM,CTX.output_filename,CTX.mesh.format); - } - else - Print_Geo(THEM,CTX.output_filename); - exit(1); - } - } - - - /* Interactive Gmsh */ - - CTX.batch = -1 ; /* The GUI is not ready yet for interactivity */ - - /* Text for about window */ - - sprintf(TextAbout, "%s\n \n%s%.2f\n%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n \n%s\n \n" - "Type 'gmsh -help' for command line options", - gmsh_progname, gmsh_version, GMSH_VERSION, - gmsh_os, gmsh_gui, XmVERSION_STRING, - gmsh_date, gmsh_host, gmsh_packager, - gmsh_url, gmsh_email, gmsh_copyright); - - /* Xlib Threads init */ - -#ifdef _USETHREADS - if(CTX.threads){ - if(!XInitThreads()){ - Msg(WARNING, "Xlib is not Thread Safe (Reverting to '-nothreads')"); - CTX.threads = 0; - } - } -#else - CTX.threads = 0; -#endif - - /* Xtoolkit init */ - - XtToolkitInitialize(); - -#ifdef _USETHREADS - if(CTX.threads){ - if(!XtToolkitThreadInitialize()){ - Msg(WARNING, "Xtoolkit is not Thread Safe (Reverting to '-nothreads')"); - CTX.threads = 0; - } - } -#endif - - XCTX.AppContext = XtCreateApplicationContext(); - - /* X/Motif default resources */ - - XtAppSetFallbackResources(XCTX.AppContext, FallbackResources); - - /* Open display */ - - XCTX.display = XtOpenDisplay(XCTX.AppContext, NULL, "gmshGW", ".gmshrc", - NULL, 0, &argc, argv); - - if(!XCTX.display){ - Msg(FATAL1, "Unable to open the specified display. Set the `DISPLAY'"); - Msg(FATAL2, "environment variable properly or use the `xhost' command"); - Msg(FATAL3, "to authorize access to the display"); - } - - /* Check for GLX extension; for Mesa, this is always OK */ - - if(!glXQueryExtension(XCTX.display,NULL,NULL)){ - Msg(FATAL1, "The specified display does not support the OpenGL extension (GLX)."); - Msg(FATAL3, "You may consider using Mesa instead"); - } - - /* Init with default screen num and default depth */ - - XCTX.scrnum = DefaultScreen(XCTX.display); - XCTX.depth = DefaultDepth(XCTX.display, XCTX.scrnum); - - /* Init with default visual for the gui */ - - XCTX.gui.visual = DefaultVisual(XCTX.display,XCTX.scrnum); - - /* Find visual the regular way for glw */ - - if(CTX.db){ - if(!(XCTX.glw.visinfo = - glXChooseVisual(XCTX.display,XCTX.scrnum, glw_attrib_db))){ - Msg(WARNING,"GBA Double Buffured Visual not Available"); - CTX.db = 0; - } - } - - if(!CTX.db){ - if(!(XCTX.glw.visinfo = - glXChooseVisual(XCTX.display,XCTX.scrnum, glw_attrib_sb))) - Msg(FATAL, "RGBA Single Buffured Visual not Available"); - } - - Msg(DEBUG, "Visual id=%lx depth=%d screen=%d bits/rgb=%d class=%s dblbuf=%d", - XCTX.glw.visinfo->visualid, XCTX.glw.visinfo->depth, - XCTX.glw.visinfo->screen, XCTX.glw.visinfo->bits_per_rgb, -#if defined(__cplusplus) || defined(c_plusplus) - ShowVisualClass(XCTX.glw.visinfo->c_class), -#else - ShowVisualClass(XCTX.glw.visinfo->class), -#endif - CTX.db); - - /* Find visual the regular way for glo */ - -#ifndef _NOOV - if(CTX.overlay){ - if(!(XCTX.glo.visinfo = glXChooseVisual(XCTX.display,XCTX.scrnum,glo_attrib))){ - Msg(DEBUG, "Overlay Visual not Available (Using Blend Function Instead)"); - CTX.overlay = 0; - CTX.geom.highlight = 0; - } - } -#else - CTX.overlay = 0 ; - CTX.geom.highlight = 0; -#endif - - if(CTX.overlay){ - Msg(DEBUG,"Overlay Visual id=%lx depth=%d screen=%d bits/rgb=%d class=%s", - XCTX.glo.visinfo->visualid, XCTX.glo.visinfo->depth, - XCTX.glo.visinfo->screen, XCTX.glo.visinfo->bits_per_rgb, -#if defined(__cplusplus) || defined(c_plusplus) - ShowVisualClass(XCTX.glo.visinfo->c_class) -#else - ShowVisualClass(XCTX.glo.visinfo->class) -#endif - ); - } - - - /* Init with default colormaps */ - - XCTX.gui.colormap = DefaultColormap(XCTX.display,0); - XCTX.glw.colormap = DefaultColormap(XCTX.display,0); - XCTX.glo.colormap = DefaultColormap(XCTX.display,0); - - /* - If not using default visual (i.e. not using the gui visual), we need a colormap for - this visual. Yes, the GL widget can allocate one itself, but we want to make sure - the GUI and the 3D have the same one (if hardware does not allow more than one - simultaneously). This prevents nasty flashing when the window with the 3D widget - looses the focus. - */ - - if(!CTX.flash && (XCTX.glw.visinfo->visual != XCTX.gui.visual)){ - Msg(DEBUG, "Making Another Colormap for Graphic Window"); - XCTX.glw.colormap = XCreateColormap(XCTX.display, RootWindow(XCTX.display,XCTX.scrnum), - XCTX.glw.visinfo->visual, AllocNone); - if(!XCTX.glw.colormap) - Msg(FATAL, "Unable to Create Colormap for Graphic Window (Try Option '-flash')"); - } - - if(CTX.overlay){ - if(!CTX.flash && (XCTX.glo.visinfo->visual != XCTX.gui.visual)){ - Msg(DEBUG, "Making Another Colormap for Overlay Window"); - XCTX.glo.colormap = XCreateColormap(XCTX.display, RootWindow(XCTX.display,XCTX.scrnum), - XCTX.glo.visinfo->visual, AllocNone); - if(!XCTX.glo.colormap){ - Msg(FATAL1, "Unable to Create Private Colormap for Overlay Window"); - Msg(FATAL3, "(Try '-noov' and/or '-flash' Options)"); - } - } - } - - /* Force to use common visual for GUI and GL? Maybe you can invoke - some hardware interrogation function and see if more than one - hardware map is supported. Here, we check for the -samevisual - flag */ - - if(CTX.same_visual){ - XCTX.gui.visual = XCTX.glw.visinfo->visual; - XCTX.gui.colormap = XCTX.glw.colormap; - } - - /* Create all the motif widgets */ - - CreateWidgets(&WID); - - /* create the OpenGL contexts */ - - XCTX.glw.context = glXCreateContext(XtDisplay(WID.G.glw),XCTX.glw.visinfo,NULL,GL_TRUE); - - if(CTX.overlay){ - XCTX.glo.context = glXCreateContext(XtDisplay(WID.G.glo), - XCTX.glo.visinfo,NULL,GL_TRUE); - - if (!XAllocNamedColor(XCTX.display, XCTX.glo.colormap, - "white", &ov_color_def, &ov_color_exact)) { - Msg(WARNING, "Couldn't Allocate White for Overlay window (Reverting to '-noov')"); - CTX.overlay = 0; - } - else - XCTX.xcolor.ovwhite = ov_color_def.pixel; - } - - if(CTX.overlay){ - if (!XAllocNamedColor(XCTX.display, XCTX.glo.colormap, - "black", &ov_color_def, &ov_color_exact)) { - Msg(WARNING, "Couldn't Allocate Black for Overlay Window (Reverting to '-noov')"); - CTX.overlay = 0; - } - else - XCTX.xcolor.ovblack = ov_color_def.pixel; - } - - /* X font initialisation */ - XCTX.xfont.helve = XLoadQueryFont(XCTX.display, CTX.font); - XCTX.xfont.fixed = XLoadQueryFont(XCTX.display, CTX.fixed_font); - - if(XCTX.xfont.helve == NULL){ - Msg(WARNING, "Unable to Load Font '%s'", CTX.font); - XCTX.xfont.helve = XCTX.xfont.fixed ; - } - if(XCTX.xfont.fixed == NULL) - Msg(FATAL, "Unable to Load Font '%s'", CTX.fixed_font); - - XCTX.xfont.helve_h = XCTX.xfont.helve->max_bounds.ascent + - XCTX.xfont.helve->max_bounds.descent; - XCTX.xfont.helve_a = XCTX.xfont.helve->max_bounds.ascent; - XCTX.xfont.helve_w = XCTX.xfont.helve->max_bounds.width; - - XCTX.xfont.fixed_h = XCTX.xfont.fixed->max_bounds.ascent + - XCTX.xfont.fixed->max_bounds.descent; - XCTX.xfont.fixed_a = XCTX.xfont.fixed->max_bounds.ascent; - XCTX.xfont.fixed_w = XCTX.xfont.fixed->max_bounds.width; - - CTX.gl_fontheight = XCTX.xfont.helve_h ; - CTX.gl_fontascent = XCTX.xfont.helve_a ; - - - /* X color initialisation (set the pixel format and allocate some colors in XCTX) */ - - XColorInitialize(); - - /* Force widget geometry */ - - ForceGeometry(&WID); - - /* Register all the callbacks */ - - RegisterCallbacks(&WID); - - /* Realize widgets in the 3 windows (M=menu, G=graphics, C=command) */ - - XtRealizeWidget(WID.M.shell); - XtRealizeWidget(WID.G.shell); - if(CTX.command_win) XtRealizeWidget(WID.C.shell); - - /* Create the pixmaps */ - - CreatePixmaps(&WID, &PIX, XCTX.depth); - - /* Select input events for the graphic window and raise overlay window */ - - if(CTX.overlay){ - XRaiseWindow(XtDisplay(WID.G.glo), XtWindow(WID.G.glo)); - XSelectInput(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), EV_MASK); - } - else{ - XSelectInput(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), EV_MASK); - } - - /* OpenGL display list for the font */ - - if((CTX.font_base = glGenLists(XCTX.xfont.helve->max_char_or_byte2+1)) == 0) - Msg(FATAL, "Font out of OpenGL Display Lists"); - - glXUseXFont(XCTX.xfont.helve->fid, - XCTX.xfont.helve->min_char_or_byte2, - XCTX.xfont.helve->max_char_or_byte2-XCTX.xfont.helve->min_char_or_byte2+1, - CTX.font_base+XCTX.xfont.helve->min_char_or_byte2); - - /* The GUI is ready */ - CTX.batch = 0 ; - CTX.expose = 1 ; - - /* Say welcome! */ - - TextBuffer = (char*)Malloc(1024*sizeof(char)); - Msg(STATUS3, "Ready"); - Msg(STATUS1, "Gmsh %.2f", GMSH_VERSION); - - /* Open input file */ - - OpenProblem(CTX.filename); - - /* Merge all Input Files if any, then init first context (geometry or post) */ - - if(nbf > 1){ - for(i=1;i<nbf;i++) MergeProblem(TheFileNameTab[i]); - ActualizeContextCb (NULL,(XtPointer)CONTEXT_POST,NULL); - } - else { - ActualizeContextCb(NULL,(XtPointer)CONTEXT_GEOM,NULL); - } - - /* Read background mesh on disk if any */ - - if(TheBgmFileName){ - MergeProblem(TheBgmFileName); - if(List_Nbr(Post_ViewList)) - BGMWithView((Post_View*)List_Pointer(Post_ViewList, List_Nbr(Post_ViewList)-1)); - else - Msg(GERROR, "Invalid Background Mesh (no View)"); - } - - /* Draw the actual scene */ - Draw(); - - /* Loop until were done */ - - XtAppMainLoop(XCTX.AppContext); - - /* never here */ - -} - diff --git a/Motif/Makefile b/Motif/Makefile deleted file mode 100644 index 6bcf9ad661643adf6f4b3d2f4354995f62cf6110..0000000000000000000000000000000000000000 --- a/Motif/Makefile +++ /dev/null @@ -1,183 +0,0 @@ -# $Id: Makefile,v 1.21 2001-08-20 08:25:24 geuzaine Exp $ -# -# Makefile for "libMotif.a" -# - -.IGNORE: - -CXX = c++ -AR = ar ruvs -RM = rm -RANLIB = ranlib - -LIB = ../lib/libMotif.a -INCLUDE = -I../Common -I../DataStr -I../Graphics -I../Geo\ - -I../Mesh -I../Parser -I../Motif -I../Fltk - -OPT_FLAGS = -g -Wall -OS_FLAGS = -D_LITTLE_ENDIAN -VERSION_FLAGS = -D_XMOTIF -D_NOTHREADS - -GL_INCLUDE = -I$(HOME)/SOURCES/Mesa-3.1/include\ - -I$(HOME)/SOURCES/Mesa-3.1/include/GL -GUI_INCLUDE = -I/usr/X11R6/LessTif/Motif1.2/include - -RMFLAGS = -f -CFLAGS = $(OPT_FLAGS) $(OS_FLAGS) $(VERSION_FLAGS) $(INCLUDE)\ - $(GUI_INCLUDE) $(GL_INCLUDE) - -SRC = Main.cpp \ - Widgets.cpp \ - Geometry.cpp \ - Register.cpp \ - Pixmaps.cpp \ - Opengl.cpp \ - XColors.cpp \ - Message.cpp \ - CbContext.cpp \ - CbPost.cpp \ - CbColorbar.cpp \ - CbGeom.cpp \ - CbMesh.cpp \ - CbOptions.cpp \ - CbFile.cpp \ - CbInput.cpp \ - CbGeneral.cpp - - -OBJ = $(SRC:.cpp=.o) - -.SUFFIXES: .o .cpp - -$(LIB): $(OBJ) - $(AR) $(LIB) $(OBJ) - $(RANLIB) $(LIB) - -.cpp.o: - $(CXX) $(CFLAGS) -c $< - -clean: - $(RM) $(RMFLAGS) *.o - -lint: - $(LINT) $(CFLAGS) $(SRC) - -depend: - (sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \ - $(CXX) -MM $(CFLAGS) ${SRC} \ - ) >Makefile.new - cp Makefile Makefile.bak - cp Makefile.new Makefile - $(RM) $(RMFLAGS) Makefile.new - -# DO NOT DELETE THIS LINE -Main.o: Main.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \ - ../Common/GmshVersion.h ../Geo/Geo.h ../Geo/Verif.h ../Mesh/Mesh.h \ - ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h ../Common/Context.h \ - ../Common/Options.h ../Parser/Parser.h Widgets.h Pixmaps.h XColors.h \ - XContext.h XRessources.h CbContext.h CbGeom.h Register.h Geometry.h \ - ../Parser/OpenFile.h ../Common/GetOptions.h ../Common/Static.h \ - XStatic.h -Widgets.o: Widgets.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \ - ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Common/Context.h \ - XContext.h Info.h Widgets.h Help.h -Geometry.o: Geometry.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \ - ../Common/Context.h XContext.h Widgets.h -Register.o: Register.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \ - ../Common/Context.h XContext.h Widgets.h Register.h CbOptions.h \ - CbContext.h CbFile.h CbGeom.h CbMesh.h CbPost.h -Pixmaps.o: Pixmaps.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h Widgets.h \ - ../Common/Context.h Pixmaps.h ../Common/Bitmaps.h XColors.h -Opengl.o: Opengl.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \ - ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h ../Common/Context.h \ - ../Geo/MinMax.h Widgets.h XContext.h ../Graphics/gl2ps.h -XColors.o: XColors.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h XContext.h -Message.o: Message.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \ - ../Common/GmshVersion.h ../Common/Context.h Widgets.h -CbContext.o: CbContext.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \ - ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h Widgets.h \ - ../Common/Context.h XContext.h CbContext.h CbGeom.h CbMesh.h -CbPost.o: CbPost.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \ - ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h Widgets.h \ - ../Common/Context.h XContext.h ../Parser/OpenFile.h CbPost.h CbGeom.h \ - CbMesh.h CbColorbar.h -CbColorbar.o: CbColorbar.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \ - ../Common/Numeric.h XColors.h Widgets.h Register.h \ - ../Common/Context.h XContext.h ../Common/ColorTable.h CbColorbar.h -CbGeom.o: CbGeom.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \ - ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h Widgets.h \ - ../Common/Context.h ../Geo/Verif.h ../Parser/OpenFile.h CbGeom.h -CbMesh.o: CbMesh.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \ - ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h CbMesh.h ../Common/Context.h \ - Widgets.h -CbOptions.o: CbOptions.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Geo/Geo.h \ - ../Geo/Verif.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \ - ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h \ - ../Graphics/Draw.h ../Common/Views.h ../Common/ColorTable.h Widgets.h \ - Pixmaps.h ../Common/Context.h ../Common/Options.h XContext.h \ - Register.h ../Common/Timer.h ../Geo/Visibility.h CbOptions.h CbGeom.h \ - CbMesh.h CbPost.h -CbFile.o: CbFile.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \ - ../Parser/OpenFile.h ../Mesh/Mesh.h ../Mesh/Vertex.h \ - ../Mesh/Simplex.h ../Mesh/Edge.h ../Geo/ExtrudeParams.h \ - ../Mesh/Metric.h ../Graphics/Draw.h ../Common/Views.h \ - ../Common/ColorTable.h Widgets.h ../Common/Context.h \ - ../Common/Options.h ../Graphics/CreateFile.h CbFile.h CbColorbar.h -CbInput.o: CbInput.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \ - ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h Widgets.h \ - ../Common/Context.h ../Common/Options.h XContext.h Register.h \ - CbContext.h CbGeom.h CbPost.h CbMesh.h -CbGeneral.o: CbGeneral.cpp ../Common/Gmsh.h ../Common/Message.h \ - ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ - ../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h ../Mesh/Mesh.h \ - ../Mesh/Vertex.h ../Mesh/Simplex.h ../Mesh/Edge.h \ - ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Graphics/Draw.h \ - ../Common/Views.h ../Common/ColorTable.h ../Common/Context.h \ - XContext.h Widgets.h diff --git a/Motif/Message.cpp b/Motif/Message.cpp deleted file mode 100644 index 2de5c03744dca8f92c3185a1958bef2ba69b48bd..0000000000000000000000000000000000000000 --- a/Motif/Message.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// $Id: Message.cpp,v 1.8 2001-02-20 18:32:58 geuzaine Exp $ - -#include <signal.h> -#include <sys/resource.h> - -#include "Gmsh.h" -#include "GmshUI.h" -#include "GmshVersion.h" -#include "Context.h" -#include "Widgets.h" - -extern Context_T CTX; -extern Widgets_T WID; - -/* ------------------------------------------------------------------------ */ -/* S i g n a l */ -/* ------------------------------------------------------------------------ */ - -void Signal (int sig_num){ - - switch (sig_num){ - case SIGSEGV : - Msg(FATAL, "Segmentation Violation (Invalid Memory Reference)\n" - "------------------------------------------------------\n" - "You have discovered a bug in Gmsh. You may e-mail the\n" - "context in which it occurred to one of the authors:\n" - "type 'gmsh -info' to get feedback information"); - break; - case SIGFPE : - Msg(FATAL, "Floating Point Exception (Division by Zero?)"); - break; - case SIGINT : - Msg(FATAL, "Interrupt (Generated from Terminal Special Character)"); - break; - default : - Msg(FATAL, "Unknown Signal"); - break; - } -} - - -/* ------------------------------------------------------------------------ */ -/* M s g */ -/* ------------------------------------------------------------------------ */ - -char *TextBuffer; - -#define PUT_IN_COMMAND_WIN \ - vsprintf(TextBuffer, fmt, args); \ - XmListAddItem(WID.C.commandList,XmStringCreateSimple(TextBuffer),0); \ - XtSetArg(arg[0], XmNitemCount, &nb); \ - XtSetArg(arg[1], XmNvisibleItemCount, &nbvis); \ - XtGetValues(WID.C.commandList, arg, 2); \ - XmListSetPos(WID.C.commandList,(nb>nbvis)?nb-nbvis+1:0); \ - XmUpdateDisplay(WID.C.commandList); - -void Msg(int level, char *fmt, ...){ - va_list args; - int abort=0; - Arg arg[2]; - int nb, nbvis; - - if(level != FATAL && level != GERROR && level != PARSER_ERROR && - CTX.batch && !CTX.verbosity) - return ; - - va_start (args, fmt); - - switch(level){ - case DIRECT : - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - break; - case FATAL : - fprintf(stderr, FATAL_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - abort = 1; - break; - case GERROR : - if(CTX.batch || !CTX.command_win){ - fprintf(stderr, ERROR_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - else{ - PUT_IN_COMMAND_WIN ; - } - break; - case WARNING : - if(CTX.batch || !CTX.command_win){ - if(CTX.verbosity > 0){ - fprintf(stderr, WARNING_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else{ - PUT_IN_COMMAND_WIN ; - } - break; - case INFO : - if(CTX.batch || !CTX.command_win){ - if(CTX.verbosity > 1){ - fprintf(stderr, INFO_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else{ - PUT_IN_COMMAND_WIN ; - } - break; - case STATUS2 : - case STATUS2N : - if(CTX.batch){ - if(CTX.verbosity > 1){ - fprintf(stderr, STATUS_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else if(CTX.expose){ - vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.infoLabel, XmNlabelString, - XmStringCreateSimple(TextBuffer), NULL); - XmUpdateDisplay(WID.G.infoLabel); - } - break; - case STATUS1 : - case STATUS1N : - if(CTX.batch){ - if(CTX.verbosity > 1){ - fprintf(stderr, STATUS_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else if(CTX.expose){ - vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.selectLabel, XmNlabelString, - XmStringCreateSimple(TextBuffer), NULL); - XmUpdateDisplay(WID.G.selectLabel); - } - break; - case STATUS3 : - case STATUS3N : - if(CTX.batch){ - if(CTX.verbosity > 1){ - fprintf(stderr, STATUS_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else if(CTX.expose){ - vsprintf(TextBuffer, fmt, args); - XtVaSetValues(WID.G.statusLabel, XmNlabelString, - XmStringCreateSimple(TextBuffer), NULL); - XmUpdateDisplay(WID.G.statusLabel); - } - break; - case PARSER_ERROR : - if(CTX.batch || !CTX.command_win){ - if(CTX.verbosity > 0){ - fprintf(stderr, PARSER_ERROR_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else{ - PUT_IN_COMMAND_WIN ; - } - break; - case PARSER_INFO : - if(CTX.batch || !CTX.command_win){ - if(CTX.verbosity > 1){ - fprintf(stderr, PARSER_INFO_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else{ - PUT_IN_COMMAND_WIN ; - } - break; - case DEBUG : - if(CTX.batch || !CTX.command_win){ - if(CTX.verbosity > 2){ - fprintf(stderr, DEBUG_STR); - vfprintf(stderr, fmt, args); - fprintf(stderr, "\n"); - } - } - else{ - PUT_IN_COMMAND_WIN ; - } - break; - } - - va_end (args); - - if(abort) exit(1); - -} - - -/* ------------------------------------------------------------------------ */ -/* C p u */ -/* ------------------------------------------------------------------------ */ - -void GetResources(long *s, long *us, long *mem){ - static struct rusage r; - - getrusage(RUSAGE_SELF,&r); - *s = (long)r.ru_utime.tv_sec ; - *us = (long)r.ru_utime.tv_usec ; - *mem = (long)r.ru_maxrss ; -} - -void PrintResources(FILE *stream, char *fmt, long s, long us, long mem){ - fprintf(stream, "Resources = %scpu %ld.%ld s / mem %ld kb\n", fmt, s, us, mem); -} - -double Cpu(void){ - long s, us, mem; - GetResources(&s, &us, &mem); - return (double)s + (double)us/1.e6 ; -} - -/* ------------------------------------------------------------------------ */ -/* P r o g r e s s */ -/* ------------------------------------------------------------------------ */ - -void Progress(int i){ -} - -/* ------------------------------------------------------------------------ */ -/* E d i t G e o m e t r y */ -/* ------------------------------------------------------------------------ */ - -void AddALineInTheEditGeometryForm (char* line){ -} diff --git a/Motif/Opengl.cpp b/Motif/Opengl.cpp deleted file mode 100644 index 5c5783324e79582de8ed9af1527d996c333cf947..0000000000000000000000000000000000000000 --- a/Motif/Opengl.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// $Id: Opengl.cpp,v 1.6 2001-09-25 08:21:14 geuzaine Exp $ - -#include <X11/IntrinsicP.h> - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Geo.h" -#include "Mesh.h" -#include "Draw.h" -#include "Context.h" -#include "MinMax.h" -#include "Widgets.h" -#include "XContext.h" -#include "gl2ps.h" - -extern XContext_T XCTX ; -extern Widgets_T WID ; -extern Context_T CTX ; -extern Mesh M; - -void Process_SelectionBuffer(int x, int y, int *n, GLuint *ii, GLuint *jj); -void Filter_SelectionBuffer(int n, GLuint *typ, GLuint *ient, Vertex **thev, - Curve **thec, Surface **thes, Mesh *m); -void myZoom(GLdouble X1, GLdouble X2, GLdouble Y1, GLdouble Y2, - GLdouble Xc1, GLdouble Xc2, GLdouble Yc1, GLdouble Yc2); - -/* ------------------------------------------------------------------------ */ -/* Init/Draw */ -/* ------------------------------------------------------------------------ */ - -void InitOpengl(void){ - /* Resize Graphical Window if told to do it */ - XWindowAttributes xattrib; - XGetWindowAttributes(XtDisplay(WID.G.bottomForm),XtWindow(WID.G.bottomForm),&xattrib); - XtResizeWidget(WID.G.shell, - CTX.viewport[2]-CTX.viewport[0], - xattrib.height+CTX.viewport[3]-CTX.viewport[1], - 0); - /* X11 forbids to change the context (GLX) in GL_FEEDBACK or GL_SELECT mode, - which would happen for postscript output */ - if(CTX.stream == TO_SCREEN) - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - Orthogonalize(0,0); -} - -void InitOverlay(void){ - glXMakeCurrent(XtDisplay(WID.G.glo), XtWindow(WID.G.glo), XCTX.glo.context); - Orthogonalize(0,0); -} - -void ClearOpengl(void){ - glClearColor(UNPACK_RED(CTX.color.bg)/255., - UNPACK_GREEN(CTX.color.bg)/255., - UNPACK_BLUE(CTX.color.bg)/255., - 0.); - glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); -} - -void Draw(void){ - InitOpengl(); - ClearOpengl(); - if(CTX.db) glDrawBuffer(GL_BACK); - Draw3d(); - Draw2d(); - glFlush(); - if(CTX.db) glXSwapBuffers(XCTX.display,XtWindow(WID.G.glw)); -} - -void DrawUI(void){ -} - -void Draw_String(char *s){ - - if(CTX.stream == TO_FILE){ - if(!CTX.print.gl_fonts && CTX.print.eps_quality > 0){ - gl2psText(s,CTX.print.eps_font,CTX.print.eps_font_size); - return ; - } - } - - glListBase(CTX.font_base); - glCallLists(strlen(s), GL_UNSIGNED_BYTE, (GLubyte *)s); -} - -/* ------------------------------------------------------------------------ */ -/* SelectEntity */ -/* ------------------------------------------------------------------------ */ - - -int check_type(int type, Vertex *v, Curve *c, Surface *s){ - return ( (type==ENT_POINT && v) || - (type==ENT_LINE && c) || - (type==ENT_SURFACE && s) ) ; -} - -int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){ - XEvent event; - XComposeStatus stat; - KeySym keysym; - int hits; - GLuint ii[SELECTION_BUFFER_SIZE],jj[SELECTION_BUFFER_SIZE]; - char buf[100]; - - *v = NULL; - *c = NULL; - *s = NULL; - - while(1){ - XtAppNextEvent(XCTX.AppContext,&event); - XtDispatchEvent(&event); - switch(event.type){ - case KeyPress : - XLookupString(&event.xkey, buf, sizeof(buf), &keysym, &stat); - if(keysym == XK_q) return(0); - if(keysym == XK_e) return(-1); - break; - case ButtonPress : - Process_SelectionBuffer(event.xbutton.x, event.xbutton.y, &hits, ii, jj); - Filter_SelectionBuffer(hits,ii,jj,v,c,s,&M); - if(check_type(type,*v,*c,*s)){ - BeginHighlight(); - HighlightEntity(*v,*c,*s,1); - EndHighlight(1); - return(event.xbutton.button); - } - } - } -} - -/* ------------------------------------------------------------------------ */ -/* Callbacks */ -/* ------------------------------------------------------------------------ */ - -void InitCb(Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb){ - glXMakeCurrent(XtDisplay(WID.G.glw), XtWindow(WID.G.glw), XCTX.glw.context); - CTX.viewport[0] = 0 ; - CTX.viewport[1] = 0 ; - CTX.viewport[2] = cb->width ; - CTX.viewport[3] = cb->height ; - glViewport(CTX.viewport[0], - CTX.viewport[1], - CTX.viewport[2], - CTX.viewport[3]); -} - -void ResizeCb(Widget w,XtPointer client_data, GLwDrawingAreaCallbackStruct *cb){ - CTX.viewport[0] = 0 ; - CTX.viewport[1] = 0 ; - CTX.viewport[2] = cb->width ; - CTX.viewport[3] = cb->height ; - glViewport(CTX.viewport[0], - CTX.viewport[1], - CTX.viewport[2], - CTX.viewport[3]); - Draw(); - if(CTX.overlay) InitOverlay(); -} - -void ExposeCb(Widget w,XtPointer client_data, GLwDrawingAreaCallbackStruct *cb){ - - /* compress incoming events as much as possible */ - if(cb->event->xexpose.count != 0){ - return; - } - - if(!CTX.expose) return; - Draw(); - -} - diff --git a/Motif/Pixmaps.cpp b/Motif/Pixmaps.cpp deleted file mode 100644 index 882e0714b1e970c46410b00653c4c1ad5584312e..0000000000000000000000000000000000000000 --- a/Motif/Pixmaps.cpp +++ /dev/null @@ -1,129 +0,0 @@ -// $Id: Pixmaps.cpp,v 1.1 2001-01-08 08:20:11 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Widgets.h" -#include "Context.h" -#include "Pixmaps.h" -#include "Bitmaps.h" -#include "XColors.h" - -extern Widgets_T WID; -extern Context_T CTX; - -Pixmap bm_to_px(Widget w, void *bits, int width, int height, int depth, int mode){ - Display *display ; - Window window ; - int screen ; - Pixmap ret_pixmap; - Pixel fg, bg; - - display = XtDisplay(w); - window = XtScreen(WID.M.shell)->root; /* XtWindow(w); */ - screen = DefaultScreen(display); - - if (DisplayCells(display, screen) > 2 && depth > 1) { - - switch (mode) { - case BM_PX_BW: - fg = BlackPixel(display, screen); - bg = WhitePixel(display, screen); - break; - case BM_PX_BWREV: - fg = WhitePixel(display, screen); - bg = BlackPixel(display, screen); - break; - case BM_PX_WHITE: - fg = WhitePixel(display, screen); - XtVaGetValues(w,XmNbackground, &bg,NULL); - break; - case BM_PX_BLACK: - fg = BlackPixel(display, screen); - XtVaGetValues(w,XmNbackground, &bg,NULL); - break; - case BM_PX_RED: - fg = AllocateColorInt(255,0,0) ; - XtVaGetValues(w,XmNbackground, &bg,NULL); - break; - case BM_PX_HIGHLIGHT: - XtVaGetValues(w,XmNhighlightColor, &fg,XmNbackground, &bg,NULL); - break; - case BM_PX_NORMAL: - default: - XtVaGetValues(w,XmNforeground, &fg,XmNbackground, &bg,NULL ); - break; - } - } - else { - fg = BlackPixel(display, screen); - bg = WhitePixel(display, screen); - } - - ret_pixmap = - XCreatePixmapFromBitmapData(display, window, (char*)bits, width, height, fg, bg, depth); - - if (ret_pixmap == (Pixmap) NULL){ - Msg(WARNING, "Failing to create pixmap"); - return ((Pixmap) NULL); - } - - return (ret_pixmap); -} - - -void Set_AnimPixmap(Widgets_T *w, Pixmaps_T *p, int start){ - if(start) - XtVaSetValues(w->G.Butt[5], XmNlabelPixmap, p->G.start, NULL); - else - XtVaSetValues(w->G.Butt[5], XmNlabelPixmap, p->G.stop, NULL); -} - -void CreatePixmaps(Widgets_T *w, Pixmaps_T *p, int depth){ - - /* Icons for 3 main windows */ - - XtVaSetValues(w->M.shell, - XmNiconPixmap, - XCreateBitmapFromData(XtDisplay(w->M.shell),XtScreen(w->M.shell)->root, - (char*)g1_bits, g1_width, g1_height), - NULL); - - - XtVaSetValues(w->G.shell, - XmNiconPixmap, - XCreateBitmapFromData(XtDisplay(w->G.shell), XtScreen(w->G.shell)->root, - (char*)g2_bits, g2_width, g2_height), - NULL); - - if(CTX.command_win) - XtVaSetValues(w->C.shell, - XmNiconPixmap, - XCreateBitmapFromData(XtDisplay(w->C.shell), XtScreen(w->C.shell)->root, - (char*)g3_bits, g3_width, g3_height), - NULL); - - /* Graphic window */ - - p->G.abort = bm_to_px(w->G.Butt[6], abort_bits, - abort_width, abort_height, depth, BM_PX_RED); - XtVaSetValues(w->G.Butt[6], XmNlabelPixmap, p->G.abort, NULL); - - p->G.abort_insens = bm_to_px(w->G.Butt[6], abort_bits, - abort_width, abort_height, depth, BM_PX_NORMAL); - XtVaSetValues(w->G.Butt[6], XmNlabelInsensitivePixmap, p->G.abort_insens, NULL); - - p->G.start = bm_to_px(w->G.Butt[5], start_bits, - start_width, start_height, depth, BM_PX_NORMAL); - p->G.stop = bm_to_px(w->G.Butt[5], stop_bits, - stop_width, stop_height, depth, BM_PX_NORMAL); - Set_AnimPixmap(w, p, 1); - - /* About window */ - - p->HD.about = bm_to_px(w->HD.aboutDialog, about_bits, - about_width, about_height, depth, BM_PX_NORMAL); - XtVaSetValues(w->HD.aboutDialog, XmNsymbolPixmap, p->HD.about, NULL); - - -} - diff --git a/Motif/Pixmaps.h b/Motif/Pixmaps.h deleted file mode 100644 index 88b301ef76f55c0d4cba456887d8b24caf8c2e3d..0000000000000000000000000000000000000000 --- a/Motif/Pixmaps.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _PIXMAPS_H_ -#define _PIXMAPS_H_ - -#define BM_PX_NORMAL 0 /* normal/normal */ -#define BM_PX_HIGHLIGHT 1 /* highlight/normal */ -#define BM_PX_WHITE 2 /* white/normal */ -#define BM_PX_BLACK 3 /* black/normal */ -#define BM_PX_BW 4 /* black/white */ -#define BM_PX_BWREV 5 /* white/black */ -#define BM_PX_RED 6 /* red/normal */ - -typedef struct { - - struct { - Pixmap abort, abort_insens, start, stop ; - } G ; - - struct { - Pixmap about ; - } HD ; - -} Pixmaps_T ; - -void CreatePixmaps(Widgets_T *w, Pixmaps_T *p, int depth); -void Set_AnimCallback(Widgets_T *w, int start) ; -void Set_AnimPixmap(Widgets_T *w, Pixmaps_T *p, int start) ; - -#endif diff --git a/Motif/Register.cpp b/Motif/Register.cpp deleted file mode 100644 index 0c816d344b25a31105ed4dc5dd899ab6561d7d19..0000000000000000000000000000000000000000 --- a/Motif/Register.cpp +++ /dev/null @@ -1,406 +0,0 @@ -// $Id: Register.cpp,v 1.1 2001-01-08 08:20:11 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Context.h" -#include "XContext.h" -#include "Widgets.h" -#include "Register.h" -#include "CbOptions.h" -#include "CbContext.h" -#include "CbFile.h" -#include "CbGeom.h" -#include "CbMesh.h" -#include "CbPost.h" - -extern Context_T CTX ; -extern XContext_T XCTX ; - -void RegisterCallbacks_M(Widgets_T *w){ - long int n ; - XtPointer l[5] ; - - register_activate_cb (w->M.fileButt[0], ManageCb, w->FD.openDialog); - register_activate_cb (w->M.fileButt[1], ManageCb, w->FD.mergeDialog); - register_activate_cb (w->M.fileButt[2], FileCb, FILE_SAVE_MESH); - register_activate_cb (w->M.fileButt[3], ManageCb, w->FD.saveAsDialog); - register_activate_cb (w->M.fileButt[4], ManageCb, w->FD.saveOptionsAsDialog); - register_activate_cb (w->M.fileButt[5], ReloadAllViewsCb, NULL); - register_activate_cb (w->M.fileButt[6], RemoveAllViewsCb, NULL); - register_activate_cb (w->M.fileButt[7], ExitCb, NULL); - - register_activate_cb (w->M.moduleButt[0], ActualizeContextCb, CONTEXT_GEOM); - register_activate_cb (w->M.moduleButt[1], ActualizeContextCb, CONTEXT_MESH); - register_activate_cb (w->M.moduleButt[2], ActualizeContextCb, CONTEXT_POST); - - register_activate_cb (w->M.optionButt[0], ManageCb, w->OD.geomDialog); - register_activate_cb (w->M.optionButt[1], ManageCb, w->OD.meshDialog); - register_activate_cb (w->M.optionButt[2], ManageCb, w->OD.postDialog); - register_activate_cb (w->M.optionButt[3], ManageCb, w->OD.miscDialog); - register_activate_cb (w->M.optionButt[4], CurrentViewportCb, NULL); - register_activate_cb (w->M.optionButt[5], CurrentInfoCb, 1); - - register_activate_cb (w->M.helpButt[0], ManageCb, w->HD.keysDialog); - register_activate_cb (w->M.helpButt[1], ManageCb, w->HD.aboutDialog); - - register_popup_ev (w->M.modButt, w->M.modPop); - register_activate_cb (w->M.geomButt, ActualizeContextCb, CONTEXT_GEOM); - register_activate_cb (w->M.meshButt, ActualizeContextCb, CONTEXT_MESH); - register_activate_cb (w->M.postButt, ActualizeContextCb, CONTEXT_POST); - - register_activate_cb (w->M.navigButt[0], PreviousContextCb, CONTEXT_BACKWARD); - register_activate_cb (w->M.navigButt[1], PreviousContextCb, CONTEXT_FORWARD); - - l[0] = (XtPointer)CurrentViewCb ; - l[2] = (XtPointer)PostDialogCb ; - - for(n=0 ; n<NB_BUTT_MAX ; n++){ - register_activate_cb (w->M.pushButt[n], NextContextCb, n+1); - register_valchg_cb (w->M.toggleButt[n], SwapViewCb, n+1); - register_popup_ev (w->M.toggleButt[n], w->M.popMenu[n]); - register_activate_cb (w->M.reloadButt[n], ReloadViewCb, n+1); - register_activate_cb (w->M.removeButt[n], RemoveViewCb, n+1); - register_activate_cb (w->M.duplicateButt[n], DuplicateViewCb, n+1); - - l[1] = (XtPointer)(n+1) ; - l[4] = NULL ; - l[3] = (XtPointer)POST_LIGHT; register_valchg_cb_list (w->M.lightButt[n],l); - l[3] = (XtPointer)POST_ELEMENT; register_valchg_cb_list (w->M.elementButt[n],l); - l[3] = (XtPointer)POST_OFFSET; register_activate_cb_list (w->M.offsetButt[n],l); - l[3] = (XtPointer)POST_TIME_STEP; register_activate_cb_list (w->M.timeStepButt[n],l); - l[3] = (XtPointer)POST_SCALE; register_activate_cb_list (w->M.scaleButt[n],l); - l[3] = (XtPointer)POST_COLOR; register_activate_cb_list (w->M.colorButt[n],l); - l[3] = (XtPointer)POST_VECTOR; register_activate_cb_list (w->M.vectorButt[n],l); - l[3] = (XtPointer)POST_TIME_STEP; register_activate_cb_list (w->M.timeStepButt[n],l); - l[3] = (XtPointer)POST_EXPORT_BGM; register_activate_cb_list (w->M.exportBGMButt[n],l); - l[3] = (XtPointer)POST_APPLY_BGM; register_activate_cb_list (w->M.applyBGMButt[n],l); - } - -} - - -void RegisterCallbacks_G(Widgets_T *w){ - - register_GLexpose_cb (w->G.glw, ExposeCb, NULL); - register_GLresize_cb (w->G.glw, ResizeCb, NULL); - register_GLinit_cb (w->G.glw, InitCb, NULL); - register_GLinput_cb (w->G.glw, InputCb, NULL); - - if(CTX.overlay){ - register_GLexpose_cb (w->G.glo, ExposeCb, NULL); - register_GLresize_cb (w->G.glo, ResizeCb, NULL); - register_GLinput_cb (w->G.glo, InputCb, NULL); - } - - register_activate_cb (w->G.Butt[0], OptionsCb, OPTIONS_XVIEW); - register_activate_cb (w->G.Butt[1], OptionsCb, OPTIONS_YVIEW); - register_activate_cb (w->G.Butt[2], OptionsCb, OPTIONS_ZVIEW); - register_activate_cb (w->G.Butt[3], OptionsCb, OPTIONS_CVIEW); - register_activate_cb (w->G.Butt[4], OptionsCb, OPTIONS_PVIEW); - register_activate_cb (w->G.Butt[5], OptionsCb, OPTIONS_POST_ANIM_START); - register_activate_cb (w->G.Butt[6], OptionsCb, OPTIONS_MESH_ABORT); - -} - -void Set_AnimCallback(Widgets_T *w, int start){ - if(start){ - register_remove_cb (w->G.Butt[5], OptionsCb, OPTIONS_POST_ANIM_STOP); - register_activate_cb (w->G.Butt[5], OptionsCb, OPTIONS_POST_ANIM_START); - } - else{ - register_remove_cb (w->G.Butt[5], OptionsCb, OPTIONS_POST_ANIM_START); - register_activate_cb (w->G.Butt[5], OptionsCb, OPTIONS_POST_ANIM_STOP); - } -} - - -void RegisterCallbacks_C(Widgets_T *w){ - -} - - -void RegisterCallbacks_ED(Widgets_T *w){ - - register_ok_cb (w->ED.saveAsDialog, FileCb, FILE_SAVE_AS_OVERWRITE); - -} - - -void RegisterCallbacks_FD(Widgets_T *w){ - - register_ok_cb (w->FD.openDialog, FileCb, FILE_LOAD_GEOM); - register_cancel_cb (w->FD.openDialog, ManageCb, w->FD.openDialog); - - register_ok_cb (w->FD.mergeDialog, FileCb, FILE_LOAD_POST); - register_cancel_cb (w->FD.mergeDialog, ManageCb, w->FD.mergeDialog); - - register_ok_cb (w->FD.saveAsDialog, FileCb, FILE_SAVE_AS); - register_cancel_cb (w->FD.saveAsDialog, ManageCb, w->FD.saveAsDialog); - register_activate_cb (w->FD.saveAsButt[0], OptionsCb, OPTIONS_SAVE_AUTO); - register_activate_cb (w->FD.saveAsButt[1], OptionsCb, OPTIONS_SAVE_GEO); - register_activate_cb (w->FD.saveAsButt[2], OptionsCb, OPTIONS_SAVE_MSH); - register_activate_cb (w->FD.saveAsButt[3], OptionsCb, OPTIONS_SAVE_UNV); - register_activate_cb (w->FD.saveAsButt[4], OptionsCb, OPTIONS_SAVE_GREF); - register_activate_cb (w->FD.saveAsButt[5], OptionsCb, OPTIONS_SAVE_EPS_SIMPLE); - register_activate_cb (w->FD.saveAsButt[6], OptionsCb, OPTIONS_SAVE_EPS_COMPLEX); - register_activate_cb (w->FD.saveAsButt[7], OptionsCb, OPTIONS_SAVE_XPM); - register_activate_cb (w->FD.saveAsButt[8], OptionsCb, OPTIONS_SAVE_JPEG); - register_activate_cb (w->FD.saveAsButt[9], OptionsCb, OPTIONS_SAVE_GIF); - register_activate_cb (w->FD.saveAsButt[10], OptionsCb, OPTIONS_SAVE_GIF_DITHERED); - register_activate_cb (w->FD.saveAsButt[11], OptionsCb, OPTIONS_SAVE_GIF_TRANSPARENT); - register_activate_cb (w->FD.saveAsButt[12], OptionsCb, OPTIONS_SAVE_PPM); - register_activate_cb (w->FD.saveAsButt[13], OptionsCb, OPTIONS_SAVE_YUV); - - register_ok_cb (w->FD.saveOptionsAsDialog, FileCb, FILE_SAVE_OPTIONS_AS); - register_cancel_cb (w->FD.saveOptionsAsDialog, ManageCb, w->FD.saveOptionsAsDialog); -} - -void RegisterCallbacks_OD(Widgets_T *w){ - - register_ok_cb (w->OD.geomDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->OD.geomDialog, ManageCb, w->OD.geomDialog); - register_valchg_cb (w->OD.geomVisibleTypeButt[0], OptionsCb, OPTIONS_GEOM_VISIBILITY_ENTITY); - register_valchg_cb (w->OD.geomVisibleTypeButt[1], OptionsCb, OPTIONS_GEOM_VISIBILITY_NUMBER); - register_valchg_cb (w->OD.geomVisibleButt[0], OptionsCb, OPTIONS_GEOM_POINTS); - register_valchg_cb (w->OD.geomVisibleButt[1], OptionsCb, OPTIONS_GEOM_LINES); - register_valchg_cb (w->OD.geomVisibleButt[2], OptionsCb, OPTIONS_GEOM_SURFACES); - register_valchg_cb (w->OD.geomVisibleButt[3], OptionsCb, OPTIONS_GEOM_VOLUMES); - register_activate_cb(w->OD.geomVisibleByNumText, OptionsCb, OPTIONS_GEOM_HIDE_SHOW); - register_valchg_cb (w->OD.geomNormalsScale, OptionsCb, OPTIONS_GEOM_NORMALS_SCALE); - register_drag_cb (w->OD.geomNormalsScale, OptionsCb, OPTIONS_GEOM_NORMALS_SCALE); - register_activate_cb(w->OD.geomNormalsText, OptionsCb, OPTIONS_GEOM_NORMALS_TEXT); - register_valchg_cb (w->OD.geomTangentsScale, OptionsCb, OPTIONS_GEOM_TANGENTS_SCALE); - register_drag_cb (w->OD.geomTangentsScale, OptionsCb, OPTIONS_GEOM_TANGENTS_SCALE); - register_activate_cb(w->OD.geomTangentsText, OptionsCb, OPTIONS_GEOM_TANGENTS_TEXT); - - register_ok_cb (w->OD.meshDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->OD.meshDialog, ManageCb, w->OD.meshDialog); - register_valchg_cb (w->OD.meshAlgoButt[0], OptionsCb, OPTIONS_MESH_DEGRE2); - register_valchg_cb (w->OD.meshAlgoButt[1], OptionsCb, OPTIONS_MESH_ANISOTROPIC); - register_valchg_cb (w->OD.meshAlgoButt[2], OptionsCb, OPTIONS_MESH_INTERACTIVE); - register_valchg_cb (w->OD.meshSmoothingScale, OptionsCb, OPTIONS_MESH_SMOOTHING_SCALE); - register_drag_cb (w->OD.meshSmoothingScale, OptionsCb, OPTIONS_MESH_SMOOTHING_SCALE); - register_activate_cb(w->OD.meshSmoothingText, OptionsCb, OPTIONS_MESH_SMOOTHING_TEXT); - register_valchg_cb (w->OD.meshVisibleTypeButt[0], OptionsCb, OPTIONS_MESH_VISIBILITY_ENTITY); - register_valchg_cb (w->OD.meshVisibleTypeButt[1], OptionsCb, OPTIONS_MESH_VISIBILITY_NUMBER); - register_valchg_cb (w->OD.meshVisibleButt[0], OptionsCb, OPTIONS_MESH_POINTS); - register_valchg_cb (w->OD.meshVisibleButt[1], OptionsCb, OPTIONS_MESH_LINES); - register_valchg_cb (w->OD.meshVisibleButt[2], OptionsCb, OPTIONS_MESH_SURFACES); - register_valchg_cb (w->OD.meshVisibleButt[3], OptionsCb, OPTIONS_MESH_VOLUMES); - register_valchg_cb (w->OD.meshVisibleByNumButt[0], OptionsCb, OPTIONS_MESH_SELECT_ENTITY); - register_valchg_cb (w->OD.meshVisibleByNumButt[1], OptionsCb, OPTIONS_MESH_SELECT_QUALITY); - register_activate_cb(w->OD.meshVisibleByNumText, OptionsCb, OPTIONS_MESH_HIDE_SHOW); - register_valchg_cb (w->OD.meshAspectButt[0], OptionsCb, OPTIONS_MESH_WIREFRAME); - register_valchg_cb (w->OD.meshAspectButt[1], OptionsCb, OPTIONS_MESH_HIDDEN_LINES); - register_valchg_cb (w->OD.meshAspectButt[2], OptionsCb, OPTIONS_MESH_SHADING); - register_valchg_cb (w->OD.meshExplodeScale, OptionsCb, OPTIONS_MESH_EXPLODE_SCALE); - register_drag_cb (w->OD.meshExplodeScale, OptionsCb, OPTIONS_MESH_EXPLODE_SCALE); - register_activate_cb(w->OD.meshExplodeText, OptionsCb, OPTIONS_MESH_EXPLODE_TEXT); - register_valchg_cb (w->OD.meshNormalsScale, OptionsCb, OPTIONS_MESH_NORMALS_SCALE); - register_drag_cb (w->OD.meshNormalsScale, OptionsCb, OPTIONS_MESH_NORMALS_SCALE); - register_activate_cb(w->OD.meshNormalsText, OptionsCb, OPTIONS_MESH_NORMALS_TEXT); - - register_ok_cb (w->OD.postDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->OD.postDialog, ManageCb, w->OD.postDialog); - register_valchg_cb (w->OD.postLinkButt[0], OptionsCb, OPTIONS_POST_LINK_NONE); - register_valchg_cb (w->OD.postLinkButt[1], OptionsCb, OPTIONS_POST_LINK_VISIBLE); - register_valchg_cb (w->OD.postLinkButt[2], OptionsCb, OPTIONS_POST_LINK_ALL); - register_valchg_cb (w->OD.postAnimScale, OptionsCb, OPTIONS_POST_ANIM_DELAY); - register_drag_cb (w->OD.postAnimScale, OptionsCb, OPTIONS_POST_ANIM_DELAY); - - register_ok_cb (w->OD.miscDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->OD.miscDialog, ManageCb, w->OD.miscDialog); - register_valchg_cb (w->OD.miscMiscButt[0], OptionsCb, OPTIONS_AXES); - register_valchg_cb (w->OD.miscMiscButt[1], OptionsCb, OPTIONS_LITTLE_AXES); - register_valchg_cb (w->OD.miscMiscButt[2], OptionsCb, OPTIONS_FAST_REDRAW); - register_valchg_cb (w->OD.miscMiscButt[3], OptionsCb, OPTIONS_DISPLAY_LISTS); - register_valchg_cb (w->OD.miscMiscButt[4], OptionsCb, OPTIONS_ALPHA_BLENDING); - register_valchg_cb (w->OD.miscMiscButt[5], OptionsCb, OPTIONS_TRACKBALL); - register_valchg_cb (w->OD.miscColorSchemeScale, OptionsCb, OPTIONS_COLOR_SCHEME_SCALE); - register_drag_cb (w->OD.miscColorSchemeScale, OptionsCb, OPTIONS_COLOR_SCHEME_SCALE); - register_valchg_cb (w->OD.miscProjButt[0], OptionsCb, OPTIONS_ORTHOGRAPHIC); - register_valchg_cb (w->OD.miscProjButt[1], OptionsCb, OPTIONS_PERSPECTIVE); - register_valchg_cb (w->OD.miscLightScale[0], OptionsCb, OPTIONS_LIGHT_X_SCALE); - register_drag_cb (w->OD.miscLightScale[0], OptionsCb, OPTIONS_LIGHT_X_SCALE); - register_valchg_cb (w->OD.miscLightScale[1], OptionsCb, OPTIONS_LIGHT_Y_SCALE); - register_drag_cb (w->OD.miscLightScale[1], OptionsCb, OPTIONS_LIGHT_Y_SCALE); - register_valchg_cb (w->OD.miscLightScale[2], OptionsCb, OPTIONS_LIGHT_Z_SCALE); - register_drag_cb (w->OD.miscLightScale[2], OptionsCb, OPTIONS_LIGHT_Z_SCALE); - register_valchg_cb (w->OD.miscShineScale, OptionsCb, OPTIONS_SHINE_SCALE); - register_drag_cb (w->OD.miscShineScale, OptionsCb, OPTIONS_SHINE_SCALE); - - register_ok_cb (w->OD.viewportDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->OD.viewportDialog, ManageCb, w->OD.viewportDialog); - register_valchg_cb (w->OD.viewportText[0][0], OptionsCb, OPTIONS_ROTX); - register_valchg_cb (w->OD.viewportText[0][1], OptionsCb, OPTIONS_ROTY); - register_valchg_cb (w->OD.viewportText[0][2], OptionsCb, OPTIONS_ROTZ); - register_valchg_cb (w->OD.viewportText[1][0], OptionsCb, OPTIONS_TRANX); - register_valchg_cb (w->OD.viewportText[1][1], OptionsCb, OPTIONS_TRANY); - register_valchg_cb (w->OD.viewportText[1][2], OptionsCb, OPTIONS_TRANZ); - register_valchg_cb (w->OD.viewportText[2][0], OptionsCb, OPTIONS_SCALEX); - register_valchg_cb (w->OD.viewportText[2][1], OptionsCb, OPTIONS_SCALEY); - register_valchg_cb (w->OD.viewportText[2][2], OptionsCb, OPTIONS_SCALEZ); - register_valchg_cb (w->OD.viewportLockButt[0][0], OptionsCb, OPTIONS_ROTX_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[0][1], OptionsCb, OPTIONS_ROTY_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[0][2], OptionsCb, OPTIONS_ROTZ_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[1][0], OptionsCb, OPTIONS_TRANX_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[1][1], OptionsCb, OPTIONS_TRANY_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[1][2], OptionsCb, OPTIONS_TRANZ_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[2][0], OptionsCb, OPTIONS_SCALEX_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[2][1], OptionsCb, OPTIONS_SCALEY_LOCKED); - register_valchg_cb (w->OD.viewportLockButt[2][2], OptionsCb, OPTIONS_SCALEZ_LOCKED); - - register_ok_cb (w->OD.infoDialog, CurrentInfoCb, 0); - register_cancel_cb (w->OD.infoDialog, ManageCb, w->OD.infoDialog); - -} - -void RegisterCallbacks_HD(Widgets_T *w){ - -} - -void RegisterCallbacks_GD(Widgets_T *w){ - - register_ok_cb (w->GD.paramDialog, GeomCb, GEOM_PARAMETER_ADD); - register_cancel_cb (w->GD.paramDialog, ManageCb, w->GD.paramDialog); - register_valchg_cb (w->GD.paramText[0], GeomCb, GEOM_PARAMETER_NAME); - register_valchg_cb (w->GD.paramText[1], GeomCb, GEOM_PARAMETER_VALUE); - - register_ok_cb (w->GD.pointDialog, GeomCb, GEOM_POINT_ADD); - register_cancel_cb (w->GD.pointDialog, ManageCb, w->GD.pointDialog); - register_valchg_cb (w->GD.pointText[0], GeomCb, GEOM_POINT_X); - register_valchg_cb (w->GD.pointText[1], GeomCb, GEOM_POINT_Y); - register_valchg_cb (w->GD.pointText[2], GeomCb, GEOM_POINT_Z); - register_valchg_cb (w->GD.pointText[3], GeomCb, GEOM_POINT_L); - - register_cancel_cb (w->GD.rotDialog, ManageCb, w->GD.rotDialog); - register_valchg_cb (w->GD.rotText[0], GeomCb, GEOM_ROT_PX); - register_valchg_cb (w->GD.rotText[1], GeomCb, GEOM_ROT_PY); - register_valchg_cb (w->GD.rotText[2], GeomCb, GEOM_ROT_PZ); - register_valchg_cb (w->GD.rotText[3], GeomCb, GEOM_ROT_AX); - register_valchg_cb (w->GD.rotText[4], GeomCb, GEOM_ROT_AY); - register_valchg_cb (w->GD.rotText[5], GeomCb, GEOM_ROT_AZ); - register_valchg_cb (w->GD.rotText[6], GeomCb, GEOM_ROT_ANGLE); - - register_cancel_cb (w->GD.tranDialog, ManageCb, w->GD.tranDialog); - register_valchg_cb (w->GD.tranText[0], GeomCb, GEOM_TRAN_X); - register_valchg_cb (w->GD.tranText[1], GeomCb, GEOM_TRAN_Y); - register_valchg_cb (w->GD.tranText[2], GeomCb, GEOM_TRAN_Z); - - register_cancel_cb (w->GD.dilatDialog, ManageCb, w->GD.dilatDialog); - register_valchg_cb (w->GD.dilatText[0], GeomCb, GEOM_DILAT_X); - register_valchg_cb (w->GD.dilatText[1], GeomCb, GEOM_DILAT_Y); - register_valchg_cb (w->GD.dilatText[2], GeomCb, GEOM_DILAT_Z); - register_valchg_cb (w->GD.dilatText[3], GeomCb, GEOM_DILAT_F); - - register_cancel_cb (w->GD.symmDialog, ManageCb, w->GD.symmDialog); - register_valchg_cb (w->GD.symmText[0], GeomCb, GEOM_SYMMETRY_A); - register_valchg_cb (w->GD.symmText[1], GeomCb, GEOM_SYMMETRY_B); - register_valchg_cb (w->GD.symmText[2], GeomCb, GEOM_SYMMETRY_C); - register_valchg_cb (w->GD.symmText[3], GeomCb, GEOM_SYMMETRY_D); -} - -void RegisterCallbacks_MD(Widgets_T *w){ - - register_cancel_cb (w->MD.charLengthDialog, ManageCb, w->MD.charLengthDialog); - register_valchg_cb (w->MD.charLengthText, MeshCb, MESH_CHAR_LENGTH); - - register_cancel_cb (w->MD.trsfLineDialog, ManageCb, w->MD.trsfLineDialog); - register_valchg_cb (w->MD.trsfLineText[0], MeshCb, MESH_TRSF_LINE_TYPE); - register_valchg_cb (w->MD.trsfLineText[1], MeshCb, MESH_TRSF_LINE_PTS); - - register_cancel_cb (w->MD.trsfVolumeDialog, ManageCb, w->MD.trsfVolumeDialog); - register_valchg_cb (w->MD.trsfVolumeText, MeshCb, MESH_TRSF_VOL_NUM); - -} - -void RegisterCallbacks_PD(Widgets_T *w){ - - register_ok_cb (w->PD.offsetDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->PD.offsetDialog, ManageCb, w->PD.offsetDialog); - register_valchg_cb (w->PD.offsetModeButt[0], PostCb, POST_OFFSET_TRANSLATE); - register_valchg_cb (w->PD.offsetModeButt[1], PostCb, POST_OFFSET_RAISE); - register_valchg_cb (w->PD.offsetScale[0], PostCb, POST_OFFSET_X_SCALE); - register_drag_cb (w->PD.offsetScale[0], PostCb, POST_OFFSET_X_SCALE); - register_activate_cb (w->PD.offsetText[0], PostCb, POST_OFFSET_X_TEXT); - register_valchg_cb (w->PD.offsetScale[1], PostCb, POST_OFFSET_Y_SCALE); - register_drag_cb (w->PD.offsetScale[1], PostCb, POST_OFFSET_Y_SCALE); - register_activate_cb (w->PD.offsetText[1], PostCb, POST_OFFSET_Y_TEXT); - register_valchg_cb (w->PD.offsetScale[2], PostCb, POST_OFFSET_Z_SCALE); - register_drag_cb (w->PD.offsetScale[2], PostCb, POST_OFFSET_Z_SCALE); - register_activate_cb (w->PD.offsetText[2], PostCb, POST_OFFSET_Z_TEXT); - - register_ok_cb (w->PD.timeStepDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->PD.timeStepDialog, ManageCb, w->PD.timeStepDialog); - register_valchg_cb (w->PD.timeStepScale, PostCb, POST_TIME_STEP_SCALE); - register_drag_cb (w->PD.timeStepScale, PostCb, POST_TIME_STEP_SCALE); - register_activate_cb (w->PD.timeStepText, PostCb, POST_TIME_STEP_TEXT); - - register_ok_cb (w->PD.scaleDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->PD.scaleDialog, ManageCb, w->PD.scaleDialog); - register_valchg_cb (w->PD.scaleShowButt, PostCb, POST_SCALE_SHOW); - register_valchg_cb (w->PD.scaleTransButt, PostCb, POST_SCALE_TRANSPARENCY); - register_valchg_cb (w->PD.scaleTimeButt, PostCb, POST_SCALE_TIME); - register_valchg_cb (w->PD.scaleText[0], PostCb, POST_SCALE_FORMAT); - register_valchg_cb (w->PD.scaleText[1], PostCb, POST_SCALE_LABEL); - register_valchg_cb (w->PD.scaleRangeButt, PostCb, POST_SCALE_FORCE_RANGE); - register_valchg_cb (w->PD.scaleRangeText[0], PostCb, POST_SCALE_MIN); - register_valchg_cb (w->PD.scaleRangeText[1], PostCb, POST_SCALE_MAX); - register_valchg_cb (w->PD.scaleTypeButt[0], PostCb, POST_SCALE_TYPE_LIN); - register_valchg_cb (w->PD.scaleTypeButt[1], PostCb, POST_SCALE_TYPE_LOG); - register_valchg_cb (w->PD.scaleIntervalsButt[0], PostCb, POST_SCALE_INTERVALS_TYPE_ISO); - register_valchg_cb (w->PD.scaleIntervalsButt[1], PostCb, POST_SCALE_INTERVALS_TYPE_DISCRETE); - register_valchg_cb (w->PD.scaleIntervalsButt[2], PostCb, POST_SCALE_INTERVALS_TYPE_CONTINUOUS); - register_valchg_cb (w->PD.scaleIntervalsButt[3], PostCb, POST_SCALE_INTERVALS_TYPE_NUMERIC); - register_valchg_cb (w->PD.scaleIntervalsScale, PostCb, POST_SCALE_INTERVALS_SCALE); - register_drag_cb (w->PD.scaleIntervalsScale, PostCb, POST_SCALE_INTERVALS_SCALE); - register_activate_cb (w->PD.scaleIntervalsText, PostCb, POST_SCALE_INTERVALS_TEXT); - - register_ok_cb (w->PD.colorDialog, PostCb, POST_COLOR_REPLOT); - register_cancel_cb (w->PD.colorDialog, ManageCb, w->PD.colorDialog); - register_expose_cb (w->PD.colorDrawingArea, ColorBarExposeCb, NULL); - register_resize_cb (w->PD.colorDrawingArea, ColorBarResizeCb, NULL); - register_input_cb (w->PD.colorDrawingArea, ColorBarInputCb, NULL); - - register_ok_cb (w->PD.vectorDialog, OptionsCb, OPTIONS_REPLOT); - register_cancel_cb (w->PD.vectorDialog, ManageCb, w->PD.vectorDialog); - register_valchg_cb (w->PD.vectorTypeButt[0], PostCb, POST_VECTOR_TYPE_SEGMENT); - register_valchg_cb (w->PD.vectorTypeButt[1], PostCb, POST_VECTOR_TYPE_ARROW); - register_valchg_cb (w->PD.vectorTypeButt[2], PostCb, POST_VECTOR_TYPE_PYRAMID); - register_valchg_cb (w->PD.vectorTypeButt[3], PostCb, POST_VECTOR_TYPE_CONE); - register_valchg_cb (w->PD.vectorTypeButt[4], PostCb, POST_VECTOR_TYPE_DISPLACEMENT); - register_valchg_cb (w->PD.vectorScaleScale, PostCb, POST_VECTOR_SCALE_SCALE); - register_drag_cb (w->PD.vectorScaleScale, PostCb, POST_VECTOR_SCALE_SCALE); - register_activate_cb (w->PD.vectorScaleText, PostCb, POST_VECTOR_SCALE_TEXT); - register_valchg_cb (w->PD.vectorLocationButt[0],PostCb, POST_VECTOR_LOCATION_COG); - register_valchg_cb (w->PD.vectorLocationButt[1],PostCb, POST_VECTOR_LOCATION_VERTEX); - - register_ok_cb (w->PD.exportBGMDialog, PostCb, POST_EXPORT_BGM_CREATE); - register_cancel_cb (w->PD.exportBGMDialog, ManageCb, w->PD.exportBGMDialog); - register_activate_cb (w->PD.exportBGMButt[0], PostCb, POST_EXPORT_BGM_METHOD_H_ERROR) ; - register_activate_cb (w->PD.exportBGMButt[1], PostCb, POST_EXPORT_BGM_METHOD_H_ELEMENTS) ; - register_activate_cb (w->PD.exportBGMButt[2], PostCb, POST_EXPORT_BGM_METHOD_P_ERROR) ; - register_activate_cb (w->PD.exportBGMButt[3], PostCb, POST_EXPORT_BGM_METHOD_P_ELEMENTS) ; - register_valchg_cb (w->PD.exportBGMText, PostCb, POST_EXPORT_BGM_CONSTRAINT) ; - -} - - - -void RegisterCallbacks(Widgets_T *w){ - - RegisterCallbacks_M(w); /* menu win */ - RegisterCallbacks_G(w); /* graphic win */ - if(CTX.command_win) RegisterCallbacks_C(w); /* command win */ - - RegisterCallbacks_ED(w); /* error dialogs */ - RegisterCallbacks_FD(w); /* file dialogs */ - RegisterCallbacks_OD(w); /* option dialogs */ - RegisterCallbacks_HD(w); /* help dialogs */ - RegisterCallbacks_GD(w); /* geometry dialogs */ - RegisterCallbacks_MD(w); /* mesh dialogs */ - RegisterCallbacks_PD(w); /* post dialogs */ - -} - - diff --git a/Motif/Register.h b/Motif/Register.h deleted file mode 100644 index 126a166dc5cc1dc0286b44b8103653490e1f3266..0000000000000000000000000000000000000000 --- a/Motif/Register.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef _REGISTER_H_ -#define _REGISTER_H_ - -void InitCb(Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *cb); -void ResizeCb(Widget w,XtPointer client_data, GLwDrawingAreaCallbackStruct *cb); -void ExposeCb(Widget w,XtPointer client_data, GLwDrawingAreaCallbackStruct *cb); - -void RegisterCallbacks(Widgets_T *w); - -void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data); - -void ExposeCb(Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *call_data); -void InitCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *call_data); -void InputCb (Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *call_data); -void ResizeCb(Widget w, XtPointer client_data, GLwDrawingAreaCallbackStruct *call_data); - -void ColorBarResizeCb(Widget w, XtPointer client_data, XmDrawingAreaCallbackStruct *cb); -void ColorBarExposeCb(Widget w, XtPointer client_data, XmDrawingAreaCallbackStruct *cb); -void ColorBarInputCb (Widget w, XtPointer client_data, XmDrawingAreaCallbackStruct *cb); - -void ExitCb (Widget w, XtPointer client_data, XtPointer call_data); -void ManageCb (Widget w, XtPointer client_data, XtPointer call_data); -void PreviousContextCb (Widget w, XtPointer client_data, XtPointer call_data); -void NextContextCb (Widget w, XtPointer client_data, XtPointer call_data); -void ActualizeContextCb (Widget w, XtPointer client_data, XtPointer call_data); -void DrawAboutCb (Widget w, XtPointer client_data, XtPointer call_data); -void CurrentInfoCb (Widget w, XtPointer client_data, XtPointer call_data); -void CurrentViewportCb (Widget w, XtPointer client_data, XtPointer call_data); -void CurrentViewCb (Widget w, XtPointer client_data, XtPointer call_data); -void SwapViewCb (Widget w, XtPointer client_data, XtPointer call_data); -void DuplicateViewCb (Widget w, XtPointer client_data, XtPointer call_data); -void ReloadViewCb (Widget w, XtPointer client_data, XtPointer call_data); -void ReloadAllViewsCb (Widget w, XtPointer client_data, XtPointer call_data); -void RemoveViewCb (Widget w, XtPointer client_data, XtPointer call_data); -void RemoveAllViewsCb (Widget w, XtPointer client_data, XtPointer call_data); - -void OptionsCb (Widget w, XtPointer client_data, XtPointer call_data); -void FileCb (Widget w, XtPointer client_data, XtPointer call_data); -void GeomCb (Widget w, XtPointer client_data, XtPointer call_data); -void MeshCb (Widget w, XtPointer client_data, XtPointer call_data); -void PostDialogCb (Widget w, XtPointer client_data, XtPointer call_data); -void PostCb (Widget w, XtPointer client_data, XtPointer call_data); - -void PopupHandler (Widget w, Widget pw, XEvent *event, Boolean *ctd); - - -/* special GL callback registering */ - -#define register_GLexpose_cb(w, func, arg) \ - XtAddCallback((w), GLwNexposeCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_GLresize_cb(w, func, arg) \ - XtAddCallback((w), GLwNresizeCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_GLinput_cb(w, func, arg) \ - XtAddCallback((w), GLwNinputCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_GLinit_cb(w, func, arg) \ - XtAddCallback((w), GLwNginitCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -/* classic motif callback registering */ - -#define register_help_cb(w, func, arg) \ - XtAddCallback((w), XmNhelpCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_expose_cb(w, func, arg) \ - XtAddCallback((w), XmNexposeCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_resize_cb(w, func, arg) \ - XtAddCallback((w), XmNresizeCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_input_cb(w, func, arg) \ - XtAddCallback((w), XmNinputCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_activate_cb(w, func, arg) \ - XtAddCallback((w), XmNactivateCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_remove_cb(w, func, arg) \ - XtRemoveCallback((w), XmNactivateCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_activate_cb_list(w, list) \ - XtAddCallbacks((w), XmNactivateCallback, \ - (XtCallbackList)(list)) - -#define register_valchg_cb(w, func, arg) \ - XtAddCallback((w), XmNvalueChangedCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_valchg_cb_list(w, list) \ - XtAddCallbacks((w), XmNvalueChangedCallback, \ - (XtCallbackList)(list)) - -#define register_ok_cb(w, func, arg) \ - XtAddCallback((w), XmNokCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_cancel_cb(w, func, arg) \ - XtAddCallback((w), XmNcancelCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_apply_cb(w, func, arg) \ - XtAddCallback((w), XmNapplyCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -#define register_drag_cb(w, func, arg) \ - XtAddCallback((w), XmNdragCallback, \ - (XtCallbackProc) (func), \ - (XtPointer) (arg)) - -/* event loop */ - -#define register_popup_ev(parent, w) \ - XtAddEventHandler((parent), ButtonPressMask, \ - False, \ - (XtEventHandler)PopupHandler, \ - (XtPointer)(w)) - -#endif diff --git a/Motif/Widgets.cpp b/Motif/Widgets.cpp deleted file mode 100644 index ac9f0b70bc44fecb98519560757347f7abc0fd52..0000000000000000000000000000000000000000 --- a/Motif/Widgets.cpp +++ /dev/null @@ -1,2747 +0,0 @@ -// $Id: Widgets.cpp,v 1.4 2001-08-20 07:38:30 geuzaine Exp $ - -#include "Gmsh.h" -#include "GmshUI.h" -#include "Mesh.h" -#include "Context.h" -#include "XContext.h" -#include "Info.h" -#include "Widgets.h" -#include "Help.h" - -extern Context_T CTX ; -extern XContext_T XCTX ; - -/* hardcoded this one, since it is required for the motion handling */ - -static char DrawingAreaTranslations[] = "#replace\n\ -~s ~m ~a <Key>Return:DrawingAreaInput() ManagerParentActivate()\n\ -<Key>Return:DrawingAreaInput() ManagerGadgetSelect()\n\ -<Key>osfActivate:DrawingAreaInput() ManagerParentActivate()\n\ -<Key>osfCancel:DrawingAreaInput() ManagerParentCancel()\n\ -<Key>osfHelp:DrawingAreaInput() ManagerGadgetHelp()\n\ -<Key>space:DrawingAreaInput() ManagerGadgetSelect()\n\ -<Key>osfSelect:DrawingAreaInput() ManagerGadgetSelect()\n\ -<KeyDown>:DrawingAreaInput() ManagerGadgetKeyInput()\n\ -<KeyUp>:DrawingAreaInput()\n\ -<BtnMotion>:DrawingAreaInput() ManagerGadgetButtonMotion()\n\ -<Motion>:DrawingAreaInput() ManagerGadgetButtonMotion()\n\ -<Btn1Down>:DrawingAreaInput() ManagerGadgetArm()\n\ -<Btn1Up>:DrawingAreaInput() ManagerGadgetActivate()\n\ -<Btn2Down>:DrawingAreaInput() ManagerGadgetDrag()\n\ -<BtnDown>:DrawingAreaInput()\n\ -<BtnUp>:DrawingAreaInput()"; - -/* ------------------------------------------------------------------------ - MENU WINDOW - ------------------------------------------------------------------------ */ - -void CreateWidgets_M(Widgets_T *w){ - int i, n ; - Arg arg[10] ; - - /* menu shell */ - w->M.shell = - XtVaAppCreateShell("Gmsh", "gmshMW", applicationShellWidgetClass, XCTX.display, - XmNvisual, XCTX.gui.visual, - XmNcolormap, XCTX.gui.colormap, - NULL); - - /* menu main window */ - i=0; - w->M.containerWin = XmCreateMainWindow(w->M.shell, "McontainerWin", arg, i); - XtManageChild(w->M.containerWin); - - /* menu bar */ - i=0; - w->M.menuBar = XmCreateMenuBar(w->M.containerWin, "MmenuBar", arg, i); - XtManageChild(w->M.menuBar); - - /* file menu */ - i=0; - w->M.filePane = XmCreatePulldownMenu(w->M.menuBar, "MfilePane", arg, i); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Open")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-o)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>o:"); i++; - w->M.fileButt[0] = XmCreatePushButton(w->M.filePane, "MfileButt0", arg, i); - XtManageChild(w->M.fileButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Merge")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-m)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>m:"); i++; - w->M.fileButt[1] = XmCreatePushButton(w->M.filePane, "MfileButt1", arg, i); - XtManageChild(w->M.fileButt[1]); - - i=0; - w->M.fileSep[0] = XmCreateSeparator(w->M.filePane, "MfileSep0", arg, i); - XtManageChild(w->M.fileSep[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Save Mesh")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-s)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>s:"); i++; - w->M.fileButt[2] = XmCreatePushButton(w->M.filePane, "MfileButt2", arg, i); - XtManageChild(w->M.fileButt[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Save as")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-p)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>p:"); i++; - w->M.fileButt[3] = XmCreatePushButton(w->M.filePane, "MfileButt3", arg, i); - XtManageChild(w->M.fileButt[3]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Save Options as")); i++; - w->M.fileButt[4] = XmCreatePushButton(w->M.filePane, "MfileButt4", arg, i); - XtManageChild(w->M.fileButt[4]); - - i=0; - w->M.fileSep[1] = XmCreateSeparator(w->M.filePane, "MfileSep1", arg, i); - XtManageChild(w->M.fileSep[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Reload All Views")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-l)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>l:"); i++; - w->M.fileButt[5] = XmCreatePushButton(w->M.filePane, "MfileButt6", arg, i); - XtManageChild(w->M.fileButt[5]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Remove All Views")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-r)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>r:"); i++; - w->M.fileButt[6] = XmCreatePushButton(w->M.filePane, "MfileButt7", arg, i); - XtManageChild(w->M.fileButt[6]); - - i=0; - w->M.fileSep[2] = XmCreateSeparator(w->M.filePane, "MfileSep2", arg, i); - XtManageChild(w->M.fileSep[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Quit")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(C-q)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Ctrl<Key>q:"); i++; - w->M.fileButt[7] = XmCreatePushButton(w->M.filePane, "MfileButt8", arg, i); - XtManageChild(w->M.fileButt[7]); - - i=0; - XtSetArg(arg[i], XmNsubMenuId, w->M.filePane); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("File")); i++; - w->M.fileCascade = XmCreateCascadeButton(w->M.menuBar, "MfileCascade", arg, i); - XtManageChild(w->M.fileCascade); - - /* module menu */ - i=0; - w->M.modulePane = XmCreatePulldownMenu(w->M.menuBar, "MmodulePane", arg, i); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Geometry")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(g)")); i++; - XtSetArg(arg[i], XmNaccelerator, "<Key>g:"); i++; - w->M.moduleButt[0] = XmCreatePushButton(w->M.modulePane, "MmoduleButt0", arg, i); - XtManageChild(w->M.moduleButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Mesh")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(m)")); i++; - XtSetArg(arg[i], XmNaccelerator, "<Key>m:"); i++; - w->M.moduleButt[1] = XmCreatePushButton(w->M.modulePane, "MmoduleButt1", arg, i); - XtManageChild(w->M.moduleButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Post Processing")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(p)")); i++; - XtSetArg(arg[i], XmNaccelerator, "<Key>p:"); i++; - w->M.moduleButt[2] = XmCreatePushButton(w->M.modulePane, "MmoduleButt2", arg, i); - XtManageChild(w->M.moduleButt[2]); - - i=0; - XtSetArg(arg[i], XmNsubMenuId, w->M.modulePane); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Module")); i++; - w->M.moduleCascade = XmCreateCascadeButton(w->M.menuBar, "MmoduleCascade", arg, i); - XtManageChild(w->M.moduleCascade); - - /* option menu */ - i=0; - w->M.optionPane = XmCreatePulldownMenu(w->M.menuBar, "MoptionPane", arg, i); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Geometry Options")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(S-g)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Shift<Key>g:"); i++; - w->M.optionButt[0] = XmCreatePushButton(w->M.optionPane, "MoptionButt0", arg, i); - XtManageChild(w->M.optionButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Mesh Options")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(S-m)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Shift<Key>m:"); i++; - w->M.optionButt[1] = XmCreatePushButton(w->M.optionPane, "MoptionButt1", arg, i); - XtManageChild(w->M.optionButt[1]); - - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Post Processing Options")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(S-p)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Shift<Key>p:"); i++; - w->M.optionButt[2] = XmCreatePushButton(w->M.optionPane, "MoptionButt2", arg, i); - XtManageChild(w->M.optionButt[2]); - - i=0; - w->M.optionSep[0] = XmCreateSeparator(w->M.optionPane, "MoptionSep0", arg, i); - XtManageChild(w->M.optionSep[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("General Options")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(S-o)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Shift<Key>o:"); i++; - w->M.optionButt[3] = XmCreatePushButton(w->M.optionPane, "MoptionButt3", arg, i); - XtManageChild(w->M.optionButt[3]); - - i=0; - w->M.optionSep[1] = XmCreateSeparator(w->M.optionPane, "MoptionSep1", arg, i); - XtManageChild(w->M.optionSep[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Viewport")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(S-v)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Shift<Key>v:"); i++; - w->M.optionButt[4] = XmCreatePushButton(w->M.optionPane, "MoptionButt4", arg, i); - XtManageChild(w->M.optionButt[4]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Statistics")); i++; - XtSetArg(arg[i], XmNacceleratorText, XmStringCreateSimple("(S-i)")); i++; - XtSetArg(arg[i], XmNaccelerator, "Shift<Key>i:"); i++; - w->M.optionButt[5] = XmCreatePushButton(w->M.optionPane, "MoptionButt5", arg, i); - XtManageChild(w->M.optionButt[5]); - - i=0; - XtSetArg(arg[i], XmNsubMenuId, w->M.optionPane); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Options")); i++; - w->M.optionCascade = XmCreateCascadeButton(w->M.menuBar, "MoptionCascade", arg, i); - XtManageChild(w->M.optionCascade); - - /* help menu */ - i=0; - w->M.helpPane = XmCreatePulldownMenu(w->M.menuBar, "MhelpPane", arg, i); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Short Help")); i++; - w->M.helpButt[0] = XmCreatePushButton(w->M.helpPane, "MhelpButt0", arg, i); - XtManageChild(w->M.helpButt[0]); - - i=0; - w->M.helpSep[0] = XmCreateSeparator(w->M.helpPane, "MhelpSep0", arg, i); - XtManageChild(w->M.helpSep[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("About...")); i++; - w->M.helpButt[1] = XmCreatePushButton(w->M.helpPane, "MhelpButt1", arg, i); - XtManageChild(w->M.helpButt[1]); - - i=0; - XtSetArg(arg[i], XmNsubMenuId, w->M.helpPane); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("?")); i++; - w->M.helpCascade = XmCreateCascadeButton(w->M.menuBar, "MhelpCascade", arg, i); - XtManageChild(w->M.helpCascade); - - /* menu frame */ - - i=0; - w->M.menuFrame = XmCreateFrame(w->M.containerWin, "MmenuFrame", arg, i); - XtManageChild(w->M.menuFrame); - - /* menu form */ - - i=0; - XtSetArg(arg[i], XmNresizable, False); i++; - XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; - /* pour eviter des redimensionnements intempestifs sous HP */ - w->M.menuForm = XmCreateForm(w->M.menuFrame, "MmenuForm", arg, i); - XtManageChild(w->M.menuForm); - - /* module butt */ - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(" ")); i++; - w->M.modButt = XmCreateLabel(w->M.menuForm, "MmodButt", arg, i); - XtManageChild(w->M.modButt); - - i=0; - w->M.modPop = XmCreatePopupMenu(w->M.modButt, "MmodPop", arg, i); - XtUnmanageChild(w->M.modPop); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Geometry")); i++; - w->M.geomButt = XmCreatePushButton(w->M.modPop, "MgeomButt", arg, i); - XtManageChild(w->M.geomButt); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Mesh")); i++; - w->M.meshButt = XmCreatePushButton(w->M.modPop, "MmeshButt", arg, i); - XtManageChild(w->M.meshButt); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Post Processing")); i++; - w->M.postButt = XmCreatePushButton(w->M.modPop, "MpostButt", arg, i); - XtManageChild(w->M.postButt); - - /* navigation arrows */ - - i=0; - XtSetArg(arg[i], XmNarrowDirection, XmARROW_LEFT); i++; - w->M.navigButt[0] = XmCreateArrowButton(w->M.menuForm, "MnavigButt0", arg, i); - XtManageChild(w->M.navigButt[0]); - - i=0; - XtSetArg(arg[i], XmNarrowDirection, XmARROW_RIGHT); i++; - w->M.navigButt[1] = XmCreateArrowButton(w->M.menuForm, "MnavigButt1", arg, i); - XtManageChild(w->M.navigButt[1]); - - /* default button */ - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("No View Loaded")); i++; - w->M.defaultButt = XmCreateLabel(w->M.menuForm, "MdefaultButt", arg, i); - XtUnmanageChild(w->M.defaultButt); - - /* buttons */ - - for(n=0 ; n<NB_BUTT_MAX ; n++){ - i=0; - w->M.pushButt[n] = XmCreatePushButton(w->M.menuForm, "MpushButtn", arg, i); - XtUnmanageChild(w->M.pushButt[n]); - - i=0; - w->M.toggleButt[n] = XmCreateToggleButton(w->M.menuForm, "MtoggleButtn", arg, i); - XtUnmanageChild(w->M.toggleButt[n]); - - i=0; - w->M.popMenu[n] = XmCreatePopupMenu(w->M.toggleButt[n], "MpopMenun", arg, i); - XtUnmanageChild(w->M.popMenu[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Reload")); i++; - w->M.reloadButt[n] = XmCreatePushButton(w->M.popMenu[n], "MreloadButtn", arg, i); - XtManageChild(w->M.reloadButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Remove")); i++; - w->M.removeButt[n] = XmCreatePushButton(w->M.popMenu[n], "MremoveButtn", arg, i); - XtManageChild(w->M.removeButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Duplicate")); i++; - w->M.duplicateButt[n] = XmCreatePushButton(w->M.popMenu[n], "MduplicateButtn", arg, i); - XtManageChild(w->M.duplicateButt[n]); - - i=0; - w->M.popSep[0][n] = XmCreateSeparator(w->M.popMenu[n], "MpopSep0n", arg, i); - XtManageChild(w->M.popSep[0][n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Lighting")); i++; - w->M.lightButt[n] = XmCreateToggleButton(w->M.popMenu[n], "MlightButtn", arg, i); - XtManageChild(w->M.lightButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Show Elements")); i++; - w->M.elementButt[n] = XmCreateToggleButton(w->M.popMenu[n], "MelementButtn", arg, i); - XtManageChild(w->M.elementButt[n]); - - i=0; - w->M.popSep[1][n] = XmCreateSeparator(w->M.popMenu[n], "MpopSep1n", arg, i); - XtManageChild(w->M.popSep[1][n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Scale, Range and Intervals")); i++; - w->M.scaleButt[n] = XmCreatePushButton(w->M.popMenu[n], "MscaleButtn", arg, i); - XtManageChild(w->M.scaleButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Colors")); i++; - w->M.colorButt[n] = XmCreatePushButton(w->M.popMenu[n], "McolorButtn", arg, i); - XtManageChild(w->M.colorButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Offset")); i++; - w->M.offsetButt[n] = XmCreatePushButton(w->M.popMenu[n], "MoffsetButtn", arg, i); - XtManageChild(w->M.offsetButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Vector Display")); i++; - w->M.vectorButt[n] = XmCreatePushButton(w->M.popMenu[n], "MvectorButtn", arg, i); - XtManageChild(w->M.vectorButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Time Step")); i++; - w->M.timeStepButt[n] = XmCreatePushButton(w->M.popMenu[n], "MtimeStepButtn", arg, i); - XtManageChild(w->M.timeStepButt[n]); - - i=0; - w->M.popSep[2][n] = XmCreateSeparator(w->M.popMenu[n], "MpopSep2n", arg, i); - XtManageChild(w->M.popSep[2][n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Export as Background Mesh")); i++; - w->M.exportBGMButt[n] = XmCreatePushButton(w->M.popMenu[n], "MexportBGMButtn", arg, i); - XtManageChild(w->M.exportBGMButt[n]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Apply as Current Background Mesh")); i++; - w->M.applyBGMButt[n] = XmCreatePushButton(w->M.popMenu[n], "MapplyBGMButtn", arg, i); - XtManageChild(w->M.applyBGMButt[n]); - } - -} - - -/* ------------------------------------------------------------------------ - GRAPHIC WINDOW - ------------------------------------------------------------------------ */ - -void CreateWidgets_G(Widgets_T *w){ - int i; - Arg arg[10]; - - /* graphic shell */ - w->G.shell = - XtVaAppCreateShell("Gmsh graphics", "gmshGW", applicationShellWidgetClass, XCTX.display, - XmNvisual,XCTX.gui.visual, - XmNcolormap,XCTX.gui.colormap, - NULL); - - /* container form */ - i=0; - // We want glw to be able to force the size of the container win - //XtSetArg(arg[i], XmNresizable, False); i++; - //XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; - XtSetArg(arg[i], XmNwidth, 700); i++; - XtSetArg(arg[i], XmNheight, 525); i++; - w->G.containerForm = XmCreateForm(w->G.shell, "GcontainerForm", arg, i); - XtManageChild(w->G.containerForm); - - /* opengl drawing area */ - i=0; - XtSetArg(arg[i], XmNcolormap, XCTX.glw.colormap); i++; - XtSetArg(arg[i], GLwNvisualInfo, XCTX.glw.visinfo); i++; - XtSetArg(arg[i], GLwNinstallColormap, True); i++; - - w->G.glw = GLwCreateMDrawingArea(w->G.containerForm, "glw", arg, i); - XtManageChild(w->G.glw); - - /* overlay opengl drawing area */ - if(CTX.overlay){ - i=0; - XtSetArg(arg[i], XmNcolormap, XCTX.glo.colormap); i++; - XtSetArg(arg[i], GLwNvisualInfo, XCTX.glo.visinfo); i++; - XtSetArg(arg[i], GLwNinstallColormap, True); i++; - w->G.glo = GLwCreateMDrawingArea(w->G.containerForm, "glo", arg, i); - XtManageChild(w->G.glo); - } - - /* bottom */ - - i=0; - XtSetArg(arg[i], XmNresizable, False); i++; - XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; - w->G.bottomForm = XmCreateForm(w->G.containerForm, "GbottomForm", arg, i); - XtManageChild(w->G.bottomForm); - - /* buttons de gauche: X Y Z 1 Geometry Abort Play Stop */ - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("X")); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[0] = XmCreatePushButton(w->G.bottomForm, "GButt0", arg, i); - XtManageChild(w->G.Butt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Y")); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[1] = XmCreatePushButton(w->G.bottomForm, "GButt1", arg, i); - XtManageChild(w->G.Butt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Z")); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[2] = XmCreatePushButton(w->G.bottomForm, "GButt2", arg, i); - XtManageChild(w->G.Butt[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("1:1")); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[3] = XmCreatePushButton(w->G.bottomForm, "GButt3", arg, i); - XtManageChild(w->G.Butt[3]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("?")); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[4] = XmCreatePushButton(w->G.bottomForm, "GButt4", arg, i); - XtManageChild(w->G.Butt[4]); - - i=0; - XtSetArg(arg[i], XmNlabelType, XmPIXMAP); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[5] = XmCreatePushButton(w->G.bottomForm, "GButt5", arg, i); - XtManageChild(w->G.Butt[5]); - - i=0; - XtSetArg(arg[i], XmNlabelType, XmPIXMAP); i++; - XtSetArg(arg[i], XmNtraversalOn, False); i++; - w->G.Butt[6] = XmCreatePushButton(w->G.bottomForm, "GButt6", arg, i); - XtManageChild(w->G.Butt[6]); - XtSetSensitive(w->G.Butt[6],0); - - /* 3 textes au milieu */ - - i=0; - //XtSetArg(arg[i], XmNresizable, False); i++; - //XtSetArg(arg[i], XmNresizePolicy, XmRESIZE_NONE); i++; - w->G.textForm = XmCreateForm(w->G.bottomForm, "GtextForm", arg, i); - XtManageChild(w->G.textForm); - - i=0; - XtSetArg(arg[i], XmNalignment, XmALIGNMENT_BEGINNING); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(" ")); i++; - w->G.selectLabel = XmCreateLabel(w->G.textForm, "GselectLabel", arg, i); - XtManageChild(w->G.selectLabel); - - i=0; - XtSetArg(arg[i], XmNalignment, XmALIGNMENT_BEGINNING); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(" ")); i++; - w->G.infoLabel = XmCreateLabel(w->G.textForm, "GinfoLabel", arg, i); - XtManageChild(w->G.infoLabel); - - i=0; - XtSetArg(arg[i], XmNalignment, XmALIGNMENT_BEGINNING); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(" ")); i++; - w->G.statusLabel = XmCreateLabel(w->G.textForm, "GstatusLabel", arg, i); - XtManageChild(w->G.statusLabel); - -} - - -/* ------------------------------------------------------------------------ - COMMAND WINDOW - ------------------------------------------------------------------------ */ - -void CreateWidgets_C(Widgets_T *w){ - int i; - Arg arg[10]; - - w->C.shell = - XtVaAppCreateShell("Gmsh commands", "gmshCW", applicationShellWidgetClass, XCTX.display, - XmNvisual,XCTX.gui.visual, - XmNcolormap,XCTX.gui.colormap, - NULL); - - i=0; - XtSetArg(arg[i], XmNpromptString, XmStringCreateSimple("")); i++; - w->C.command = XmCreateCommand(w->C.shell, "Ccommand", arg, i); - XtManageChild(w->C.command); - - w->C.commandList = XmCommandGetChild(w->C.command, XmDIALOG_HISTORY_LIST); - w->C.commandText = XmCommandGetChild(w->C.command, XmDIALOG_COMMAND_TEXT); -} - - -/* ------------------------------------------------------------------------ - ERROR DIALOGS - ------------------------------------------------------------------------ */ - -void CreateWidgets_ED(Widgets_T *w){ - int i; - Arg arg[10]; - Widget tmp ; - - i=0 ; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Warning")); i++; - XtSetArg(arg[i], XmNmessageString, XmStringCreateSimple("File exists")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->ED.saveAsDialog = XmCreateWarningDialog(w->M.shell, "EDsaveAsDialog", arg, i); - - tmp = XmMessageBoxGetChild(w->ED.saveAsDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - -} - - -/* ------------------------------------------------------------------------ - FILE DIALOGS - ------------------------------------------------------------------------ */ - -void CreateWidgets_FD(Widgets_T *w){ - int i; - Arg arg[10]; - Widget tmp ; - - /* open */ - i=0 ; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Open")); i++; - XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; - XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*.geo")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->FD.openDialog = XmCreateFileSelectionDialog(w->M.shell, "FDopenDialog", arg, i); - XtUnmanageChild(w->FD.openDialog); - - /* merge */ - i=0 ; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Merge")); i++; - XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; - XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*.[pm][os][sh]")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->FD.mergeDialog = XmCreateFileSelectionDialog(w->M.shell, "FDmergeDialog", arg, i); - XtUnmanageChild(w->FD.mergeDialog); - - /* save as */ - - i=0 ; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Save")); i++; - XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; - XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; /* + pratique qd on sauve des animations */ - w->FD.saveAsDialog = XmCreateFileSelectionDialog(w->M.shell, "FDsaveAsDialog", arg, i); - XtUnmanageChild(w->FD.saveAsDialog); - - i=0; - w->FD.saveAsFrame[0] = XmCreateFrame(w->FD.saveAsDialog, "FDsaveAsFrame0", arg, i); - XtManageChild(w->FD.saveAsFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Format")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->FD.saveAsFrame[1] = XmCreateLabel(w->FD.saveAsFrame[0], "FDsaveAsFrame1", arg, i); - XtManageChild(w->FD.saveAsFrame[1]); - - i=0 ; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - XtSetArg(arg[i], XmNspacing, 0); i++; - w->FD.saveAsRowCol = XmCreateRowColumn(w->FD.saveAsFrame[0], "FDsaveAsRowCol", arg, i); - XtManageChild(w->FD.saveAsRowCol); - - /* save as - type */ - i=0; - w->FD.saveAsPane[0] = XmCreatePulldownMenu(w->FD.saveAsRowCol, "FDsaveAsPane0", arg, i); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("By Extension")); i++; - w->FD.saveAsButt[0] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt0", arg, i); - XtManageChild(w->FD.saveAsButt[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("GEO")); i++; - w->FD.saveAsButt[1] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt1", arg, i); - XtManageChild(w->FD.saveAsButt[1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("MSH")); i++; - w->FD.saveAsButt[2] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt2", arg, i); - XtManageChild(w->FD.saveAsButt[2]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("UNV")); i++; - w->FD.saveAsButt[3] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt3", arg, i); - XtManageChild(w->FD.saveAsButt[3]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("GREF")); i++; - w->FD.saveAsButt[4] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt4", arg, i); - XtManageChild(w->FD.saveAsButt[4]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("EPS Simple Sort")); i++; - w->FD.saveAsButt[5] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt5", arg, i); - XtManageChild(w->FD.saveAsButt[5]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("EPS Accurate Sort")); i++; - w->FD.saveAsButt[6] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt6", arg, i); - XtManageChild(w->FD.saveAsButt[6]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("XPM")); i++; - w->FD.saveAsButt[7] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt7", arg, i); - XtManageChild(w->FD.saveAsButt[7]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("JPEG")); i++; - w->FD.saveAsButt[8] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt8", arg, i); - XtManageChild(w->FD.saveAsButt[8]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("GIF")); i++; - w->FD.saveAsButt[9] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt9", arg, i); - XtManageChild(w->FD.saveAsButt[9]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("GIF Dithered")); i++; - w->FD.saveAsButt[10] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt10", arg, i); - XtManageChild(w->FD.saveAsButt[10]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("GIF Transparent")); i++; - w->FD.saveAsButt[11] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt11", arg, i); - XtManageChild(w->FD.saveAsButt[11]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("PPM")); i++; - w->FD.saveAsButt[12] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt12", arg, i); - XtManageChild(w->FD.saveAsButt[12]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("UCB YUV")); i++; - w->FD.saveAsButt[13] = XmCreatePushButton(w->FD.saveAsPane[0], "MsaveAsButt13", arg, i); - XtManageChild(w->FD.saveAsButt[13]); - - i=0; - XtSetArg(arg[i], XmNsubMenuId, w->FD.saveAsPane[0]); i++; - XtSetArg(arg[i], XmNspacing, 0); i++; - w->FD.saveAsMenu[0] = XmCreateOptionMenu(w->FD.saveAsRowCol, "FDsaveAsMenu0", arg, i); - XtManageChild(w->FD.saveAsMenu[0]); - - /* save options as */ - i=0 ; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Save Options")); i++; - XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; - XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*.[gp][eo][os]")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->FD.saveOptionsAsDialog = XmCreateFileSelectionDialog(w->M.shell, "FDsaveOptionsAsDialog", arg, i); - XtUnmanageChild(w->FD.saveOptionsAsDialog); - - tmp = XmFileSelectionBoxGetChild(w->FD.openDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - tmp = XmFileSelectionBoxGetChild(w->FD.mergeDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - tmp = XmFileSelectionBoxGetChild(w->FD.saveAsDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - tmp = XmFileSelectionBoxGetChild(w->FD.saveOptionsAsDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - -} - - -/* ------------------------------------------------------------------------ - OPTIONS DIALOGS - ------------------------------------------------------------------------ */ - -void CreateWidgets_OD(Widgets_T *w){ - int i, n; - Arg arg[10]; - char label[32]; - - /* Geometry */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Geometry Options")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->OD.geomDialog = XmCreateTemplateDialog(w->M.shell, "ODgeomDialog", arg, i); - XtUnmanageChild(w->OD.geomDialog); - - i=0; - w->OD.geomRowCol = XmCreateRowColumn(w->OD.geomDialog, "ODgeomRowCol", arg, i); - XtManageChild(w->OD.geomRowCol); - - /* Geometry - Visible */ - - i=0; - w->OD.geomVisibleFrame[0] = XmCreateFrame(w->OD.geomRowCol, "ODgeomVisibleFrame0", arg, i); - XtManageChild(w->OD.geomVisibleFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Global Visibility")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.geomVisibleFrame[1] = XmCreateLabel(w->OD.geomVisibleFrame[0], "ODgeomVisibleFrame1", arg, i); - XtManageChild(w->OD.geomVisibleFrame[1]); - - i=0; - w->OD.geomVisibleRowCol = XmCreateRowColumn(w->OD.geomVisibleFrame[0], "ODgeomVisibleRowCol", arg, i); - XtManageChild(w->OD.geomVisibleRowCol); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.geomVisibleCheck = XmCreateSimpleCheckBox(w->OD.geomVisibleRowCol, "ODgeomVisibleCheck", arg, i); - XtManageChild(w->OD.geomVisibleCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Points")); i++; - XtSetArg(arg[i], XmNset, CTX.geom.points?True:False); i++; - w->OD.geomVisibleButt[0] = XmCreateToggleButton(w->OD.geomVisibleCheck, "ODgeomVisibleButt0", arg, i); - XtManageChild(w->OD.geomVisibleButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Lines")); i++; - XtSetArg(arg[i], XmNset, CTX.geom.lines?True:False); i++; - w->OD.geomVisibleButt[1] = XmCreateToggleButton(w->OD.geomVisibleCheck, "ODgeomVisibleButt1", arg, i); - XtManageChild(w->OD.geomVisibleButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Surfaces")); i++; - XtSetArg(arg[i], XmNset, CTX.geom.surfaces?True:False); i++; - w->OD.geomVisibleButt[2] = XmCreateToggleButton(w->OD.geomVisibleCheck, "ODgeomVisibleButt2", arg, i); - XtManageChild(w->OD.geomVisibleButt[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Volumes")); i++; - XtSetArg(arg[i], XmNset, CTX.geom.volumes?True:False); i++; - w->OD.geomVisibleButt[3] = XmCreateToggleButton(w->OD.geomVisibleCheck, "ODgeomVisibleButt3", arg, i); - XtManageChild(w->OD.geomVisibleButt[3]); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.geomVisibleTypeCheck = XmCreateRadioBox(w->OD.geomVisibleRowCol, "ODgeomVisibleTypeCheck", arg, i); - XtManageChild(w->OD.geomVisibleTypeCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Entities")); i++; - XtSetArg(arg[i], XmNset, True); i++; - w->OD.geomVisibleTypeButt[0] = XmCreateToggleButton(w->OD.geomVisibleTypeCheck, "ODgeomVisibleTypeButt0", arg, i); - XtManageChild(w->OD.geomVisibleTypeButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Labels")); i++; - XtSetArg(arg[i], XmNset, False); i++; - w->OD.geomVisibleTypeButt[1] = XmCreateToggleButton(w->OD.geomVisibleTypeCheck, "ODgeomVisibleTypeButt1", arg, i); - XtManageChild(w->OD.geomVisibleTypeButt[1]); - - - /* Geometry - Visible by Number */ - - i=0; - w->OD.geomVisibleByNumFrame[0] = XmCreateFrame(w->OD.geomRowCol, "ODgeomVisibleByNumFrame0", arg, i); - XtManageChild(w->OD.geomVisibleByNumFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Visibility by Entity Number")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.geomVisibleByNumFrame[1] = XmCreateLabel(w->OD.geomVisibleByNumFrame[0], "ODgeomVisibleByNumFrame1", arg, i); - XtManageChild(w->OD.geomVisibleByNumFrame[1]); - - i=0; - w->OD.geomVisibleByNumRowCol = XmCreateRowColumn(w->OD.geomVisibleByNumFrame[0], "ODgeomVisibleByNumRowCol", arg, i); - XtManageChild(w->OD.geomVisibleByNumRowCol); - - i=0; - XtSetArg(arg[i], XmNvalue, "*"); i++; - w->OD.geomVisibleByNumText = XmCreateTextField(w->OD.geomVisibleByNumRowCol, "ODgeomVisibleByNumText", arg, i); - XtManageChild(w->OD.geomVisibleByNumText); - - /* Geometry - normals */ - - i=0; - w->OD.geomNormalsFrame[0] = XmCreateFrame(w->OD.geomRowCol, "ODgeomNormalsFrame0", arg, i); - XtManageChild(w->OD.geomNormalsFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Normals")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.geomNormalsFrame[1] = XmCreateLabel(w->OD.geomNormalsFrame[0], "ODgeomNormalsFrame1", arg, i); - XtManageChild(w->OD.geomNormalsFrame[1]); - - i=0; - w->OD.geomNormalsRowCol = XmCreateRowColumn(w->OD.geomNormalsFrame[0], "ODgeomNormalsRowCol", arg, i); - XtManageChild(w->OD.geomNormalsRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNdecimalPoints, 0); i++; - XtSetArg(arg[i], XmNvalue, CTX.geom.normals); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.geomNormalsScale = XmCreateScale(w->OD.geomNormalsRowCol, "ODgeomNormalsScale", arg, i); - XtManageChild(w->OD.geomNormalsScale); - - i=0; - sprintf(label, "%g", CTX.geom.normals); - XtSetArg(arg[i], XmNvalue, label); i++; - w->OD.geomNormalsText = XmCreateTextField(w->OD.geomNormalsRowCol, "ODgeomNormalsText", arg, i); - XtManageChild(w->OD.geomNormalsText); - - /* Geometry - tangents */ - - i=0; - w->OD.geomTangentsFrame[0] = XmCreateFrame(w->OD.geomRowCol, "ODgeomTangentsFrame0", arg, i); - XtManageChild(w->OD.geomTangentsFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Tangents")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.geomTangentsFrame[1] = XmCreateLabel(w->OD.geomTangentsFrame[0], "ODgeomTangentsFrame1", arg, i); - XtManageChild(w->OD.geomTangentsFrame[1]); - - i=0; - w->OD.geomTangentsRowCol = XmCreateRowColumn(w->OD.geomTangentsFrame[0], "ODgeomTangentsRowCol", arg, i); - XtManageChild(w->OD.geomTangentsRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNdecimalPoints, 0); i++; - XtSetArg(arg[i], XmNvalue, CTX.geom.tangents); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.geomTangentsScale = XmCreateScale(w->OD.geomTangentsRowCol, "ODgeomTangentsScale", arg, i); - XtManageChild(w->OD.geomTangentsScale); - - i=0; - sprintf(label, "%g", CTX.geom.tangents); - XtSetArg(arg[i], XmNvalue, label); i++; - w->OD.geomTangentsText = XmCreateTextField(w->OD.geomTangentsRowCol, "ODgeomTangentsText", arg, i); - XtManageChild(w->OD.geomTangentsText); - - /* Mesh */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Mesh Options")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->OD.meshDialog = XmCreateTemplateDialog(w->M.shell, "ODmeshDialog", arg, i); - XtUnmanageChild(w->OD.meshDialog); - - i=0; - w->OD.meshRowCol = XmCreateRowColumn(w->OD.meshDialog, "ODmeshRowCol", arg, i); - XtManageChild(w->OD.meshRowCol); - - - /* Mesh - algo */ - - i=0; - w->OD.meshAlgoFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshAlgoFrame0", arg, i); - XtManageChild(w->OD.meshAlgoFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Algorithm")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshAlgoFrame[1] = XmCreateLabel(w->OD.meshAlgoFrame[0], "ODmeshAlgoFrame1", arg, i); - XtManageChild(w->OD.meshAlgoFrame[1]); - - i=0; - w->OD.meshAlgoRowCol = XmCreateRowColumn(w->OD.meshAlgoFrame[0], "ODmeshAlgoRowCol", arg, i); - XtManageChild(w->OD.meshAlgoRowCol); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.meshAlgoCheck = XmCreateSimpleCheckBox(w->OD.meshAlgoRowCol, "ODmeshAlgoCheck", arg, i); - XtManageChild(w->OD.meshAlgoCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Degree 2")); i++; - XtSetArg(arg[i], XmNset, (CTX.mesh.degree==2)?True:False); i++; - w->OD.meshAlgoButt[0] = XmCreateToggleButton(w->OD.meshAlgoCheck, "ODmeshAlgoButt0", arg, i); - XtManageChild(w->OD.meshAlgoButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Anisotropic")); i++; - XtSetArg(arg[i], XmNset, (CTX.mesh.algo==DELAUNAY_ANISO)?True:False); i++; - w->OD.meshAlgoButt[1] = XmCreateToggleButton(w->OD.meshAlgoCheck, "ODmeshAlgoButt1", arg, i); - XtManageChild(w->OD.meshAlgoButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Interactive")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.interactive?True:False); i++; - w->OD.meshAlgoButt[2] = XmCreateToggleButton(w->OD.meshAlgoCheck, "ODmeshAlgoButt2", arg, i); - XtManageChild(w->OD.meshAlgoButt[2]); - - /* Mesh - smoothing */ - - i=0; - w->OD.meshSmoothingFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshSmoothingFrame0", arg, i); - XtManageChild(w->OD.meshSmoothingFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Smoothing")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshSmoothingFrame[1] = XmCreateLabel(w->OD.meshSmoothingFrame[0], "ODmeshSmoothingFrame1", arg, i); - XtManageChild(w->OD.meshSmoothingFrame[1]); - - i=0; - w->OD.meshSmoothingRowCol = XmCreateRowColumn(w->OD.meshSmoothingFrame[0], "ODmeshSmoothingRowCol", arg, i); - XtManageChild(w->OD.meshSmoothingRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNdecimalPoints, 2); i++; - XtSetArg(arg[i], XmNvalue, CTX.mesh.nb_smoothing); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.meshSmoothingScale = XmCreateScale(w->OD.meshSmoothingRowCol, "ODmeshSmoothingScale", arg, i); - XtManageChild(w->OD.meshSmoothingScale); - - i=0; - sprintf(label, "%d", CTX.mesh.nb_smoothing); - XtSetArg(arg[i], XmNvalue, label); i++; - w->OD.meshSmoothingText = XmCreateTextField(w->OD.meshSmoothingRowCol, "ODmeshSmoothingText", arg, i); - XtManageChild(w->OD.meshSmoothingText); - - /* Mesh - Visible */ - - i=0; - w->OD.meshVisibleFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshVisibleFrame0", arg, i); - XtManageChild(w->OD.meshVisibleFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Global Visibility")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshVisibleFrame[1] = XmCreateLabel(w->OD.meshVisibleFrame[0], "ODmeshVisibleFrame1", arg, i); - XtManageChild(w->OD.meshVisibleFrame[1]); - - i=0; - w->OD.meshVisibleRowCol = XmCreateRowColumn(w->OD.meshVisibleFrame[0], "ODmeshVisibleRowCol", arg, i); - XtManageChild(w->OD.meshVisibleRowCol); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.meshVisibleCheck = XmCreateSimpleCheckBox(w->OD.meshVisibleRowCol, "ODmeshVisibleCheck", arg, i); - XtManageChild(w->OD.meshVisibleCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Points")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.points?True:False); i++; - w->OD.meshVisibleButt[0] = XmCreateToggleButton(w->OD.meshVisibleCheck, "ODmeshVisibleButt0", arg, i); - XtManageChild(w->OD.meshVisibleButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Lines")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.lines?True:False); i++; - w->OD.meshVisibleButt[1] = XmCreateToggleButton(w->OD.meshVisibleCheck, "ODmeshVisibleButt1", arg, i); - XtManageChild(w->OD.meshVisibleButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Surfaces")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.surfaces?True:False); i++; - w->OD.meshVisibleButt[2] = XmCreateToggleButton(w->OD.meshVisibleCheck, "ODmeshVisibleButt2", arg, i); - XtManageChild(w->OD.meshVisibleButt[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Volumes")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.volumes?True:False); i++; - w->OD.meshVisibleButt[3] = XmCreateToggleButton(w->OD.meshVisibleCheck, "ODmeshVisibleButt3", arg, i); - XtManageChild(w->OD.meshVisibleButt[3]); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.meshVisibleTypeCheck = XmCreateRadioBox(w->OD.meshVisibleRowCol, "ODmeshVisibleTypeCheck", arg, i); - XtManageChild(w->OD.meshVisibleTypeCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Entities")); i++; - XtSetArg(arg[i], XmNset, True); i++; - w->OD.meshVisibleTypeButt[0] = XmCreateToggleButton(w->OD.meshVisibleTypeCheck, "ODmeshVisibleTypeButt0", arg, i); - XtManageChild(w->OD.meshVisibleTypeButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Labels")); i++; - XtSetArg(arg[i], XmNset, False); i++; - w->OD.meshVisibleTypeButt[1] = XmCreateToggleButton(w->OD.meshVisibleTypeCheck, "ODmeshVisibleTypeButt1", arg, i); - XtManageChild(w->OD.meshVisibleTypeButt[1]); - - - /* Mesh - Visible by Number */ - - i=0; - w->OD.meshVisibleByNumFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshVisibleByNumFrame0", arg, i); - XtManageChild(w->OD.meshVisibleByNumFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Visibility")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshVisibleByNumFrame[1] = XmCreateLabel(w->OD.meshVisibleByNumFrame[0], "ODmeshVisibleByNumFrame1", arg, i); - XtManageChild(w->OD.meshVisibleByNumFrame[1]); - - i=0; - w->OD.meshVisibleByNumRowCol = XmCreateRowColumn(w->OD.meshVisibleByNumFrame[0], "ODmeshVisibleByNumRowCol", arg, i); - XtManageChild(w->OD.meshVisibleByNumRowCol); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.meshVisibleByNumCheck = XmCreateRadioBox(w->OD.meshVisibleByNumRowCol, "ODmeshVisibleByNumCheck", arg, i); - XtManageChild(w->OD.meshVisibleByNumCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("By Entity")); i++; - XtSetArg(arg[i], XmNset, True); i++; - w->OD.meshVisibleByNumButt[0] = XmCreateToggleButton(w->OD.meshVisibleByNumCheck, "ODmeshVisibleByNumButt0", arg, i); - XtManageChild(w->OD.meshVisibleByNumButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("By Quality")); i++; - XtSetArg(arg[i], XmNset, False); i++; - w->OD.meshVisibleByNumButt[1] = XmCreateToggleButton(w->OD.meshVisibleByNumCheck, "ODmeshVisibleByNumButt1", arg, i); - XtManageChild(w->OD.meshVisibleByNumButt[1]); - - i=0; - XtSetArg(arg[i], XmNvalue, "*"); i++; - w->OD.meshVisibleByNumText = XmCreateTextField(w->OD.meshVisibleByNumRowCol, "ODmeshVisibleByNumText", arg, i); - XtManageChild(w->OD.meshVisibleByNumText); - - /* Mesh - aspect */ - - i=0; - w->OD.meshAspectFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshAspectFrame0", arg, i); - XtManageChild(w->OD.meshAspectFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Aspect")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshAspectFrame[1] = XmCreateLabel(w->OD.meshAspectFrame[0], "ODmeshAspectFrame1", arg, i); - XtManageChild(w->OD.meshAspectFrame[1]); - - i=0; - w->OD.meshAspectCheck = XmCreateRadioBox(w->OD.meshAspectFrame[0], "ODmeshAspectCheck", arg, i); - XtManageChild(w->OD.meshAspectCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Wireframe")); i++; - XtSetArg(arg[i], XmNset, (!CTX.mesh.hidden)?True:False); i++; - w->OD.meshAspectButt[0] = XmCreateToggleButton(w->OD.meshAspectCheck, "ODmeshAspectButt0", arg, i); - XtManageChild(w->OD.meshAspectButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Hidden Lines")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.hidden?True:False); i++; - w->OD.meshAspectButt[1] = XmCreateToggleButton(w->OD.meshAspectCheck, "ODmeshAspectButt1", arg, i); - XtManageChild(w->OD.meshAspectButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Solid")); i++; - XtSetArg(arg[i], XmNset, CTX.mesh.shade?True:False); i++; - w->OD.meshAspectButt[2] = XmCreateToggleButton(w->OD.meshAspectCheck, "ODmeshAspectButt2", arg, i); - XtManageChild(w->OD.meshAspectButt[2]); - - /* Mesh - explode */ - - i=0; - w->OD.meshExplodeFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshExplodeFrame0", arg, i); - XtManageChild(w->OD.meshExplodeFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Explode")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshExplodeFrame[1] = XmCreateLabel(w->OD.meshExplodeFrame[0], "ODmeshExplodeFrame1", arg, i); - XtManageChild(w->OD.meshExplodeFrame[1]); - - i=0; - w->OD.meshExplodeRowCol = XmCreateRowColumn(w->OD.meshExplodeFrame[0], "ODmeshExplodeRowCol", arg, i); - XtManageChild(w->OD.meshExplodeRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNdecimalPoints, 2); i++; - XtSetArg(arg[i], XmNvalue, (int)100*CTX.mesh.explode); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.meshExplodeScale = XmCreateScale(w->OD.meshExplodeRowCol, "ODmeshExplodeScale", arg, i); - XtManageChild(w->OD.meshExplodeScale); - - i=0; - sprintf(label, "%g", CTX.mesh.explode); - XtSetArg(arg[i], XmNvalue, label); i++; - w->OD.meshExplodeText = XmCreateTextField(w->OD.meshExplodeRowCol, "ODmeshExplodeText", arg, i); - XtManageChild(w->OD.meshExplodeText); - - /* Mesh - normals */ - - i=0; - w->OD.meshNormalsFrame[0] = XmCreateFrame(w->OD.meshRowCol, "ODmeshNormalsFrame0", arg, i); - XtManageChild(w->OD.meshNormalsFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Normals")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.meshNormalsFrame[1] = XmCreateLabel(w->OD.meshNormalsFrame[0], "ODmeshNormalsFrame1", arg, i); - XtManageChild(w->OD.meshNormalsFrame[1]); - - i=0; - w->OD.meshNormalsRowCol = XmCreateRowColumn(w->OD.meshNormalsFrame[0], "ODmeshNormalsRowCol", arg, i); - XtManageChild(w->OD.meshNormalsRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNdecimalPoints, 0); i++; - XtSetArg(arg[i], XmNvalue, CTX.mesh.normals); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.meshNormalsScale = XmCreateScale(w->OD.meshNormalsRowCol, "ODmeshNormalsScale", arg, i); - XtManageChild(w->OD.meshNormalsScale); - - i=0; - sprintf(label, "%g", CTX.mesh.normals); - XtSetArg(arg[i], XmNvalue, label); i++; - w->OD.meshNormalsText = XmCreateTextField(w->OD.meshNormalsRowCol, "ODmeshNormalsText", arg, i); - XtManageChild(w->OD.meshNormalsText); - - - /* Post */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Post Options")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->OD.postDialog = XmCreateTemplateDialog(w->M.shell, "ODpostDialog", arg, i); - XtUnmanageChild(w->OD.postDialog); - - i=0; - w->OD.postRowCol = XmCreateRowColumn(w->OD.postDialog, "ODpostRowCol", arg, i); - XtManageChild(w->OD.postRowCol); - - /* Post - link */ - - i=0; - w->OD.postLinkFrame[0] = XmCreateFrame(w->OD.postRowCol, "ODpostLinkFrame0", arg, i); - XtManageChild(w->OD.postLinkFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Links")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.postLinkFrame[1] = XmCreateLabel(w->OD.postLinkFrame[0], "ODpostLinkFrame1", arg, i); - XtManageChild(w->OD.postLinkFrame[1]); - - i=0; - w->OD.postLinkRowCol = XmCreateRowColumn(w->OD.postLinkFrame[0], "ODpostLinkRowCol", arg, i); - XtManageChild(w->OD.postLinkRowCol); - - i=0; - w->OD.postLinkCheck = XmCreateRadioBox(w->OD.postLinkRowCol, "ODpostLinkCheck", arg, i); - XtManageChild(w->OD.postLinkCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("No Links")); i++; - XtSetArg(arg[i], XmNset, CTX.post.link?False:True); i++; - w->OD.postLinkButt[0] = XmCreateToggleButton(w->OD.postLinkCheck, "ODpostLinkButt0", arg, i); - XtManageChild(w->OD.postLinkButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Link Visible Views")); i++; - XtSetArg(arg[i], XmNset, (CTX.post.link==1)?True:False); i++; - w->OD.postLinkButt[1] = XmCreateToggleButton(w->OD.postLinkCheck, "ODpostLinkButt1", arg, i); - XtManageChild(w->OD.postLinkButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Link All Views")); i++; - XtSetArg(arg[i], XmNset, (CTX.post.link==2)?True:False); i++; - w->OD.postLinkButt[2] = XmCreateToggleButton(w->OD.postLinkCheck, "ODpostLinkButt2", arg, i); - XtManageChild(w->OD.postLinkButt[2]); - - /* post - anim */ - i=0; - w->OD.postAnimFrame[0] = XmCreateFrame(w->OD.postRowCol, "ODpostAnimFrame0", arg, i); - XtManageChild(w->OD.postAnimFrame[0]); - - i=0; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Animation Delay")); i++; - w->OD.postAnimFrame[1] = XmCreateLabel(w->OD.postAnimFrame[0], "ODpostAnimFrame1", arg, i); - XtManageChild(w->OD.postAnimFrame[1]); - - i=0; - w->OD.postAnimFrameRowCol = XmCreateRowColumn(w->OD.postAnimFrame[0], "ODpostAnimFrameRowCol", arg, i); - XtManageChild(w->OD.postAnimFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 10); i++; - XtSetArg(arg[i], XmNdecimalPoints, 1); i++; - XtSetArg(arg[i], XmNshowValue, True); i++; - XtSetArg(arg[i], XmNvalue, CTX.post.anim_delay); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.postAnimScale = XmCreateScale(w->OD.postAnimFrameRowCol, "ODpostAnimScale", arg, i); - XtManageChild(w->OD.postAnimScale); - - - /* Miscellaneous */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("General Options")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->OD.miscDialog = XmCreateTemplateDialog(w->M.shell, "ODmiscDialog", arg, i); - XtUnmanageChild(w->OD.miscDialog); - - i=0; - w->OD.miscRowCol = XmCreateRowColumn(w->OD.miscDialog, "ODmiscRowCol", arg, i); - XtManageChild(w->OD.miscRowCol); - - /* misc - Misc */ - - i=0; - w->OD.miscMiscFrame[0] = XmCreateFrame(w->OD.miscRowCol, "ODmiscMiscFrame0", arg, i); - XtManageChild(w->OD.miscMiscFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Miscellaneous")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.miscMiscFrame[1] = XmCreateLabel(w->OD.miscMiscFrame[0], "ODmiscMiscFrame1", arg, i); - XtManageChild(w->OD.miscMiscFrame[1]); - - i=0; - w->OD.miscMiscCheck = XmCreateSimpleCheckBox(w->OD.miscMiscFrame[0], "ODmiscMiscCheck", arg, i); - XtManageChild(w->OD.miscMiscCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Show Moving Axes")); i++; - XtSetArg(arg[i], XmNset, CTX.axes?True:False); i++; - w->OD.miscMiscButt[0] = XmCreateToggleButton(w->OD.miscMiscCheck, "ODmiscMiscButt0", arg, i); - XtManageChild(w->OD.miscMiscButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Show Small Axes")); i++; - XtSetArg(arg[i], XmNset, CTX.small_axes?True:False); i++; - w->OD.miscMiscButt[1] = XmCreateToggleButton(w->OD.miscMiscCheck, "ODmiscMiscButt1", arg, i); - XtManageChild(w->OD.miscMiscButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Enable Fast Redraw")); i++; - XtSetArg(arg[i], XmNset, CTX.fast?True:False); i++; - w->OD.miscMiscButt[2] = XmCreateToggleButton(w->OD.miscMiscCheck, "ODmiscMiscButt2", arg, i); - XtManageChild(w->OD.miscMiscButt[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Use Display Lists")); i++; - XtSetArg(arg[i], XmNset, CTX.display_lists?True:False); i++; - w->OD.miscMiscButt[3] = XmCreateToggleButton(w->OD.miscMiscCheck, "ODmiscMiscButt3", arg, i); - XtManageChild(w->OD.miscMiscButt[3]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Enable Alpha Blending")); i++; - XtSetArg(arg[i], XmNset, CTX.alpha?True:False); i++; - w->OD.miscMiscButt[4] = XmCreateToggleButton(w->OD.miscMiscCheck, "ODmiscMiscButt4", arg, i); - XtManageChild(w->OD.miscMiscButt[4]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Trackball Rotation Mode")); i++; - XtSetArg(arg[i], XmNset, CTX.useTrackball?True:False); i++; - w->OD.miscMiscButt[5] = XmCreateToggleButton(w->OD.miscMiscCheck, "ODmiscMiscButt5", arg, i); - XtManageChild(w->OD.miscMiscButt[5]); - - /* misc - colorscheme */ - - i=0; - w->OD.miscColorSchemeFrame[0] = XmCreateFrame(w->OD.miscRowCol, "ODmiscColorSchemeFrame0", arg, i); - XtManageChild(w->OD.miscColorSchemeFrame[0]); - - i=0; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Predefined Color Schemes")); i++; - w->OD.miscColorSchemeFrame[1] = XmCreateLabel(w->OD.miscColorSchemeFrame[0], "ODmiscColorSchemeFrame1", arg, i); - XtManageChild(w->OD.miscColorSchemeFrame[1]); - - i=0; - w->OD.miscColorSchemeFrameRowCol = XmCreateRowColumn(w->OD.miscColorSchemeFrame[0], "ODmiscColorSchemeFrameRowCol", arg, i); - XtManageChild(w->OD.miscColorSchemeFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 2); i++; - XtSetArg(arg[i], XmNdecimalPoints, 0); i++; - XtSetArg(arg[i], XmNshowValue, True); i++; - XtSetArg(arg[i], XmNvalue, CTX.color_scheme); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.miscColorSchemeScale = XmCreateScale(w->OD.miscColorSchemeFrameRowCol, "ODmiscColorSchemeScale", arg, i); - XtManageChild(w->OD.miscColorSchemeScale); - - /* misc - projection */ - - i=0; - w->OD.miscProjFrame[0] = XmCreateFrame(w->OD.miscRowCol, "ODmiscProjFrame0", arg, i); - XtManageChild(w->OD.miscProjFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Projection")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.miscProjFrame[1] = XmCreateLabel(w->OD.miscProjFrame[0], "ODmiscProjFrame1", arg, i); - XtManageChild(w->OD.miscProjFrame[1]); - - i=0; - w->OD.miscProjCheck = XmCreateRadioBox(w->OD.miscProjFrame[0], "ODmiscProjCheck", arg, i); - XtManageChild(w->OD.miscProjCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Orthographic")); i++; - XtSetArg(arg[i], XmNset, CTX.ortho?True:False); i++; - w->OD.miscProjButt[0] = XmCreateToggleButton(w->OD.miscProjCheck, "ODmiscProjButt0", arg, i); - XtManageChild(w->OD.miscProjButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Perspective")); i++; - XtSetArg(arg[i], XmNset, CTX.ortho?False:True); i++; - w->OD.miscProjButt[1] = XmCreateToggleButton(w->OD.miscProjCheck, "ODmiscProjButt1", arg, i); - XtManageChild(w->OD.miscProjButt[1]); - - - /* misc - light position */ - i=0; - w->OD.miscLightFrame[0] = XmCreateFrame(w->OD.miscRowCol, "ODmiscLightFrame0", arg, i); - XtManageChild(w->OD.miscLightFrame[0]); - - i=0; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Light Position")); i++; - w->OD.miscLightFrame[1] = XmCreateLabel(w->OD.miscLightFrame[0], "ODmiscLightFrame1", arg, i); - XtManageChild(w->OD.miscLightFrame[1]); - - i=0; - w->OD.miscLightFrameRowCol = XmCreateRowColumn(w->OD.miscLightFrame[0], "ODmiscLightFrameRowCol", arg, i); - XtManageChild(w->OD.miscLightFrameRowCol); - - for(n=0 ; n<3 ; n++){ - i=0; - XtSetArg(arg[i], XmNminimum, -25); i++; - XtSetArg(arg[i], XmNmaximum, 25); i++; - XtSetArg(arg[i], XmNdecimalPoints, 0); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNvalue, (int)25*CTX.light_position[0][n]); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.miscLightScale[n] = XmCreateScale(w->OD.miscLightFrameRowCol, "ODmiscLightScalen", arg, i); - XtManageChild(w->OD.miscLightScale[n]); - } - - /* misc - shininess */ - i=0; - w->OD.miscShineFrame[0] = XmCreateFrame(w->OD.miscRowCol, "ODmiscShineFrame0", arg, i); - XtManageChild(w->OD.miscShineFrame[0]); - - i=0; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Shininess")); i++; - w->OD.miscShineFrame[1] = XmCreateLabel(w->OD.miscShineFrame[0], "ODmiscShineFrame1", arg, i); - XtManageChild(w->OD.miscShineFrame[1]); - - i=0; - w->OD.miscShineFrameRowCol = XmCreateRowColumn(w->OD.miscShineFrame[0], "ODmiscShineFrameRowCol", arg, i); - XtManageChild(w->OD.miscShineFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 25); i++; - XtSetArg(arg[i], XmNdecimalPoints, 0); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNvalue, (int)25*CTX.shine); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->OD.miscShineScale = XmCreateScale(w->OD.miscShineFrameRowCol, "ODmiscShineScale", arg, i); - XtManageChild(w->OD.miscShineScale); - - /* Viewport */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Viewport")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->OD.viewportDialog = XmCreateTemplateDialog(w->M.shell, "ODviewportDialog", arg, i); - XtUnmanageChild(w->OD.viewportDialog); - - i=0; - w->OD.viewportRowCol = XmCreateRowColumn(w->OD.viewportDialog, "ODviewportRowCol", arg, i); - XtManageChild(w->OD.viewportRowCol); - - /* viewport - rotate */ - - i=0; - w->OD.viewportFrame[0][0] = XmCreateFrame(w->OD.viewportRowCol, "ODviewportFrame00", arg, i); - XtManageChild(w->OD.viewportFrame[0][0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Rotation")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.viewportFrame[1][0] = XmCreateLabel(w->OD.viewportFrame[0][0], "ODviewportFrame10", arg, i); - XtManageChild(w->OD.viewportFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNpacking, XmPACK_COLUMN); i++; - XtSetArg(arg[i], XmNnumColumns, 3); i++; - w->OD.viewportFrameRowCol[0] = XmCreateRowColumn(w->OD.viewportFrame[0][0], "ODviewportFrameRowCol0", arg, i); - XtManageChild(w->OD.viewportFrameRowCol[0]); - - i=0; - sprintf(label, "%g", CTX.r[0]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[0][0] = XmCreateTextField(w->OD.viewportFrameRowCol[0], "ODviewportText00", arg, i); - XtManageChild(w->OD.viewportText[0][0]); - i=0; - XtSetArg(arg[i], XmNset, CTX.rlock[0]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("x-lock")); i++; - w->OD.viewportLockButt[0][0] = XmCreateToggleButton(w->OD.viewportFrameRowCol[0], "ODviewportLockButt00", arg, i); - XtManageChild(w->OD.viewportLockButt[0][0]); - - i=0; - sprintf(label, "%g", CTX.r[1]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[0][1] = XmCreateTextField(w->OD.viewportFrameRowCol[0], "ODviewportText01", arg, i); - XtManageChild(w->OD.viewportText[0][1]); - i=0; - XtSetArg(arg[i], XmNset, CTX.rlock[1]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("y-lock")); i++; - w->OD.viewportLockButt[0][1] = XmCreateToggleButton(w->OD.viewportFrameRowCol[0], "ODviewportLockButt00", arg, i); - XtManageChild(w->OD.viewportLockButt[0][1]); - - i=0; - sprintf(label, "%g", CTX.r[2]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[0][2] = XmCreateTextField(w->OD.viewportFrameRowCol[0], "ODviewportText02", arg, i); - XtManageChild(w->OD.viewportText[0][2]); - i=0; - XtSetArg(arg[i], XmNset, CTX.rlock[2]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("z-lock")); i++; - w->OD.viewportLockButt[0][2] = XmCreateToggleButton(w->OD.viewportFrameRowCol[0], "ODviewportLockButt02", arg, i); - XtManageChild(w->OD.viewportLockButt[0][2]); - - - /* viewport - translate */ - - i=0; - w->OD.viewportFrame[0][1] = XmCreateFrame(w->OD.viewportRowCol, "ODviewportFrame01", arg, i); - XtManageChild(w->OD.viewportFrame[0][1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Translation")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.viewportFrame[1][1] = XmCreateLabel(w->OD.viewportFrame[0][1], "ODviewportFrame11", arg, i); - XtManageChild(w->OD.viewportFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNpacking, XmPACK_COLUMN); i++; - XtSetArg(arg[i], XmNnumColumns, 3); i++; - w->OD.viewportFrameRowCol[1] = XmCreateRowColumn(w->OD.viewportFrame[0][1], "ODviewportFrameRowCol1", arg, i); - XtManageChild(w->OD.viewportFrameRowCol[1]); - - i=0; - sprintf(label, "%g", CTX.t[0]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[1][0] = XmCreateTextField(w->OD.viewportFrameRowCol[1], "ODviewportText10", arg, i); - XtManageChild(w->OD.viewportText[1][0]); - i=0; - XtSetArg(arg[i], XmNset, CTX.tlock[0]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("x-lock")); i++; - w->OD.viewportLockButt[1][0] = XmCreateToggleButton(w->OD.viewportFrameRowCol[1], "ODviewportLockButt10", arg, i); - XtManageChild(w->OD.viewportLockButt[1][0]); - - i=0; - sprintf(label, "%g", CTX.t[1]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[1][1] = XmCreateTextField(w->OD.viewportFrameRowCol[1], "ODviewportText11", arg, i); - XtManageChild(w->OD.viewportText[1][1]); - i=0; - XtSetArg(arg[i], XmNset, CTX.tlock[1]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("y-lock")); i++; - w->OD.viewportLockButt[1][1] = XmCreateToggleButton(w->OD.viewportFrameRowCol[1], "ODviewportLockButt00", arg, i); - XtManageChild(w->OD.viewportLockButt[1][1]); - - i=0; - sprintf(label, "%g", CTX.t[2]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[1][2] = XmCreateTextField(w->OD.viewportFrameRowCol[1], "ODviewportText12", arg, i); - XtManageChild(w->OD.viewportText[1][2]); - i=0; - XtSetArg(arg[i], XmNset, CTX.tlock[2]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("z-lock")); i++; - w->OD.viewportLockButt[1][2] = XmCreateToggleButton(w->OD.viewportFrameRowCol[1], "ODviewportLockButt12", arg, i); - XtManageChild(w->OD.viewportLockButt[1][2]); - - - /* viewport - scale */ - - i=0; - w->OD.viewportFrame[0][2] = XmCreateFrame(w->OD.viewportRowCol, "ODviewportFrame02", arg, i); - XtManageChild(w->OD.viewportFrame[0][2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Scale")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.viewportFrame[1][2] = XmCreateLabel(w->OD.viewportFrame[0][2], "ODviewportFrame12", arg, i); - XtManageChild(w->OD.viewportFrame[1][2]); - - i=0; - XtSetArg(arg[i], XmNpacking, XmPACK_COLUMN); i++; - XtSetArg(arg[i], XmNnumColumns, 3); i++; - w->OD.viewportFrameRowCol[2] = XmCreateRowColumn(w->OD.viewportFrame[0][2], "ODviewportFrameRowCol2", arg, i); - XtManageChild(w->OD.viewportFrameRowCol[2]); - - i=0; - sprintf(label, "%g", CTX.s[0]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[2][0] = XmCreateTextField(w->OD.viewportFrameRowCol[2], "ODviewportText20", arg, i); - XtManageChild(w->OD.viewportText[2][0]); - i=0; - XtSetArg(arg[i], XmNset, CTX.slock[0]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("x-lock")); i++; - w->OD.viewportLockButt[2][0] = XmCreateToggleButton(w->OD.viewportFrameRowCol[2], "ODviewportLockButt20", arg, i); - XtManageChild(w->OD.viewportLockButt[2][0]); - - i=0; - sprintf(label, "%g", CTX.s[1]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[2][1] = XmCreateTextField(w->OD.viewportFrameRowCol[2], "ODviewportText21", arg, i); - XtManageChild(w->OD.viewportText[2][1]); - i=0; - XtSetArg(arg[i], XmNset, CTX.slock[1]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("y-lock")); i++; - w->OD.viewportLockButt[2][1] = XmCreateToggleButton(w->OD.viewportFrameRowCol[2], "ODviewportLockButt20", arg, i); - XtManageChild(w->OD.viewportLockButt[2][1]); - - i=0; - sprintf(label, "%g", CTX.s[2]); - XtSetArg(arg[i], XmNvalue, label); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->OD.viewportText[2][2] = XmCreateTextField(w->OD.viewportFrameRowCol[2], "ODviewportText22", arg, i); - XtManageChild(w->OD.viewportText[2][2]); - i=0; - XtSetArg(arg[i], XmNset, CTX.slock[2]); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("z-lock")); i++; - w->OD.viewportLockButt[2][2] = XmCreateToggleButton(w->OD.viewportFrameRowCol[2], "ODviewportLockButt22", arg, i); - XtManageChild(w->OD.viewportLockButt[2][2]); - - /* Info */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Statistics")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Update")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->OD.infoDialog = XmCreateTemplateDialog(w->M.shell, "ODinfoDialog", arg, i); - XtUnmanageChild(w->OD.infoDialog); - - i=0; - w->OD.infoRowCol = XmCreateRowColumn(w->OD.infoDialog, "ODinfoRowCol", arg, i); - XtManageChild(w->OD.infoRowCol); - - /* info - geom */ - - i=0; - w->OD.infoFrame[0][0] = XmCreateFrame(w->OD.infoRowCol, "ODinfoFrame00", arg, i); - XtManageChild(w->OD.infoFrame[0][0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Geometry")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.infoFrame[1][0] = XmCreateLabel(w->OD.infoFrame[0][0], "ODinfoFrame10", arg, i); - XtManageChild(w->OD.infoFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNpacking, XmPACK_COLUMN); i++; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.infoFrameRowCol[0] = XmCreateRowColumn(w->OD.infoFrame[0][0], "ODinfoFrameRowCol0", arg, i); - XtManageChild(w->OD.infoFrameRowCol[0]); - - for(n=0 ; n<NB_INFO_GEOM ; n++){ - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(txt_info[n])); i++; - w->OD.infoKeyLabel[n] = XmCreateLabel(w->OD.infoFrameRowCol[0], "ODinfoKeyLabel", arg, i); - XtManageChild(w->OD.infoKeyLabel[n]); - } - for(n=0 ; n<NB_INFO_GEOM ; n++){ - i=0; - w->OD.infoValueLabel[n] = XmCreateLabel(w->OD.infoFrameRowCol[0], "ODinfoValueLabel", arg, i); - XtManageChild(w->OD.infoValueLabel[n]); - } - - /* info - mesh */ - - i=0; - w->OD.infoFrame[0][1] = XmCreateFrame(w->OD.infoRowCol, "ODinfoFrame01", arg, i); - XtManageChild(w->OD.infoFrame[0][1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Mesh")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.infoFrame[1][1] = XmCreateLabel(w->OD.infoFrame[0][1], "ODinfoFrame11", arg, i); - XtManageChild(w->OD.infoFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNpacking, XmPACK_COLUMN); i++; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.infoFrameRowCol[1] = XmCreateRowColumn(w->OD.infoFrame[0][1], "ODinfoFrameRowCol1", arg, i); - XtManageChild(w->OD.infoFrameRowCol[1]); - - for(n=NB_INFO_GEOM ; n<NB_INFO_GEOM+NB_INFO_MESH ; n++){ - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(txt_info[n])); i++; - w->OD.infoKeyLabel[n] = XmCreateLabel(w->OD.infoFrameRowCol[1], "ODinfoKeyLabel", arg, i); - XtManageChild(w->OD.infoKeyLabel[n]); - } - for(n=NB_INFO_GEOM ; n<NB_INFO_GEOM+NB_INFO_MESH ; n++){ - i=0; - w->OD.infoValueLabel[n] = XmCreateLabel(w->OD.infoFrameRowCol[1], "ODinfoValueLabel", arg, i); - XtManageChild(w->OD.infoValueLabel[n]); - } - - /* info - post */ - - i=0; - w->OD.infoFrame[0][2] = XmCreateFrame(w->OD.infoRowCol, "ODinfoFrame02", arg, i); - XtManageChild(w->OD.infoFrame[0][2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Post Processing")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->OD.infoFrame[1][2] = XmCreateLabel(w->OD.infoFrame[0][2], "ODinfoFrame12", arg, i); - XtManageChild(w->OD.infoFrame[1][2]); - - i=0; - XtSetArg(arg[i], XmNpacking, XmPACK_COLUMN); i++; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->OD.infoFrameRowCol[2] = XmCreateRowColumn(w->OD.infoFrame[0][2], "ODinfoFrameRowCol2", arg, i); - XtManageChild(w->OD.infoFrameRowCol[2]); - - for(n=NB_INFO_GEOM+NB_INFO_MESH ; n<NB_INFO_MAX ; n++){ - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple(txt_info[n])); i++; - w->OD.infoKeyLabel[n] = XmCreateLabel(w->OD.infoFrameRowCol[2], "ODinfoKeyLabel", arg, i); - XtManageChild(w->OD.infoKeyLabel[n]); - } - for(n=NB_INFO_GEOM+NB_INFO_MESH ; n<NB_INFO_MAX ; n++){ - i=0; - w->OD.infoValueLabel[n] = XmCreateLabel(w->OD.infoFrameRowCol[2], "ODinfoValueLabel", arg, i); - XtManageChild(w->OD.infoValueLabel[n]); - } - -} - - -/* ------------------------------------------------------------------------ - HELP DIALOGS - ------------------------------------------------------------------------ */ - -char TextAbout[1024]; - -void CreateWidgets_HD(Widgets_T *w){ - int i; - Arg arg[10]; - Widget tmp ; - - /* keys */ - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Short Help")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->HD.keysDialog = XmCreateTemplateDialog(w->M.shell, "HDkeysDialog", arg, i); - XtUnmanageChild(w->HD.keysDialog); - - i=0; - XtSetArg(arg[i], XmNeditable, False); i++; - XtSetArg(arg[i], XmNeditMode, XmMULTI_LINE_EDIT); i++; - XtSetArg(arg[i], XmNcolumns, 66); i++; - XtSetArg(arg[i], XmNrows, 25); i++; - XtSetArg(arg[i], XmNvalue, txt_help); i++; - w->HD.keysText = XmCreateScrolledText(w->HD.keysDialog, "HDkeysText", arg, i); - XtManageChild(w->HD.keysText); - - - /* about */ - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("About Gmsh")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - XtSetArg(arg[i], XmNmessageString, XmStringCreateLtoR(TextAbout,XmFONTLIST_DEFAULT_TAG)); i++; - w->HD.aboutDialog = XmCreateInformationDialog(w->M.shell, "HDaboutDialog", arg, i); - XtUnmanageChild(w->HD.aboutDialog); - - tmp = XmMessageBoxGetChild(w->HD.aboutDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - tmp = XmMessageBoxGetChild(w->HD.aboutDialog, XmDIALOG_CANCEL_BUTTON); - XtUnmanageChild(tmp); - -} - -/* ------------------------------------------------------------------------ - GEOMETRY DIALOGS - ------------------------------------------------------------------------ */ - -void CreateWidgets_GD(Widgets_T *w){ - int i; - Arg arg[10]; - - /* Parameter */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Add Parameter")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Add")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->GD.paramDialog = XmCreateTemplateDialog(w->M.shell, "GDparamDialog", arg, i); - XtUnmanageChild(w->GD.paramDialog); - - i=0; - w->GD.paramRowCol = XmCreateRowColumn(w->GD.paramDialog, "ODparamRowCol", arg, i); - XtManageChild(w->GD.paramRowCol); - - /* param - name */ - - i=0; - w->GD.paramFrame[0][0] = XmCreateFrame(w->GD.paramRowCol, "GDparamFrame00", arg, i); - XtManageChild(w->GD.paramFrame[0][0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Name")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.paramFrame[1][0] = XmCreateLabel(w->GD.paramFrame[0][0], "GDparamFrame10", arg, i); - XtManageChild(w->GD.paramFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.paramFrameRowCol[0] = XmCreateRowColumn(w->GD.paramFrame[0][0], "ODparamFrameRowCol0", arg, i); - XtManageChild(w->GD.paramFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - w->GD.paramText[0] = XmCreateTextField(w->GD.paramFrameRowCol[0], "GDparamText0", arg, i); - XtManageChild(w->GD.paramText[0]); - - /* param - value */ - - i=0; - w->GD.paramFrame[0][1] = XmCreateFrame(w->GD.paramRowCol, "GDparamFrame01", arg, i); - XtManageChild(w->GD.paramFrame[0][1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Value")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.paramFrame[1][1] = XmCreateLabel(w->GD.paramFrame[0][1], "GDparamFrame11", arg, i); - XtManageChild(w->GD.paramFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.paramFrameRowCol[1] = XmCreateRowColumn(w->GD.paramFrame[0][1], "ODparamFrameRowCol1", arg, i); - XtManageChild(w->GD.paramFrameRowCol[1]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - w->GD.paramText[1] = XmCreateTextField(w->GD.paramFrameRowCol[1], "GDparamText1", arg, i); - XtManageChild(w->GD.paramText[1]); - - - /* Point */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Add Point")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Add")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->GD.pointDialog = XmCreateTemplateDialog(w->M.shell, "GDpointDialog", arg, i); - XtUnmanageChild(w->GD.pointDialog); - - i=0; - w->GD.pointRowCol = XmCreateRowColumn(w->GD.pointDialog, "ODpointRowCol", arg, i); - XtManageChild(w->GD.pointRowCol); - - /* point - coords */ - - i=0; - w->GD.pointFrame[0][0] = XmCreateFrame(w->GD.pointRowCol, "GDpointFrame00", arg, i); - XtManageChild(w->GD.pointFrame[0][0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Coordinates")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.pointFrame[1][0] = XmCreateLabel(w->GD.pointFrame[0][0], "GDpointFrame10", arg, i); - XtManageChild(w->GD.pointFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.pointFrameRowCol[0] = XmCreateRowColumn(w->GD.pointFrame[0][0], "ODpointFrameRowCol0", arg, i); - XtManageChild(w->GD.pointFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.pointText[0] = XmCreateTextField(w->GD.pointFrameRowCol[0], "GDpointText0", arg, i); - XtManageChild(w->GD.pointText[0]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.pointText[1] = XmCreateTextField(w->GD.pointFrameRowCol[0], "GDpointText1", arg, i); - XtManageChild(w->GD.pointText[1]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.pointText[2] = XmCreateTextField(w->GD.pointFrameRowCol[0], "GDpointText2", arg, i); - XtManageChild(w->GD.pointText[2]); - - /* point - char length */ - - i=0; - w->GD.pointFrame[0][1] = XmCreateFrame(w->GD.pointRowCol, "GDpointFrame01", arg, i); - XtManageChild(w->GD.pointFrame[0][1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Characteristc Length")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.pointFrame[1][1] = XmCreateLabel(w->GD.pointFrame[0][1], "GDpointFrame11", arg, i); - XtManageChild(w->GD.pointFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.pointFrameRowCol[1] = XmCreateRowColumn(w->GD.pointFrame[0][1], "ODpointFrameRowCol1", arg, i); - XtManageChild(w->GD.pointFrameRowCol[1]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.pointText[3] = XmCreateTextField(w->GD.pointFrameRowCol[1], "GDpointText3", arg, i); - XtManageChild(w->GD.pointText[3]); - - - /* Rotation */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Current Rotation")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->GD.rotDialog = XmCreateTemplateDialog(w->M.shell, "GDrotDialog", arg, i); - XtUnmanageChild(w->GD.rotDialog); - - i=0; - w->GD.rotRowCol = XmCreateRowColumn(w->GD.rotDialog, "ODrotRowCol", arg, i); - XtManageChild(w->GD.rotRowCol); - - /* rot - axis point */ - - i=0; - w->GD.rotFrame[0][0] = XmCreateFrame(w->GD.rotRowCol, "GDrotFrame00", arg, i); - XtManageChild(w->GD.rotFrame[0][0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Axis Point")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.rotFrame[1][0] = XmCreateLabel(w->GD.rotFrame[0][0], "GDrotFrame10", arg, i); - XtManageChild(w->GD.rotFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.rotFrameRowCol[0] = XmCreateRowColumn(w->GD.rotFrame[0][0], "ODrotFrameRowCol0", arg, i); - XtManageChild(w->GD.rotFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[0] = XmCreateTextField(w->GD.rotFrameRowCol[0], "GDrotText0", arg, i); - XtManageChild(w->GD.rotText[0]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[1] = XmCreateTextField(w->GD.rotFrameRowCol[0], "GDrotText1", arg, i); - XtManageChild(w->GD.rotText[1]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[2] = XmCreateTextField(w->GD.rotFrameRowCol[0], "GDrotText2", arg, i); - XtManageChild(w->GD.rotText[2]); - - /* rot - direction */ - - i=0; - w->GD.rotFrame[0][1] = XmCreateFrame(w->GD.rotRowCol, "GDrotFrame01", arg, i); - XtManageChild(w->GD.rotFrame[0][1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Direction")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.rotFrame[1][1] = XmCreateLabel(w->GD.rotFrame[0][1], "GDrotFrame11", arg, i); - XtManageChild(w->GD.rotFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.rotFrameRowCol[1] = XmCreateRowColumn(w->GD.rotFrame[0][1], "ODrotFrameRowCol1", arg, i); - XtManageChild(w->GD.rotFrameRowCol[1]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[3] = XmCreateTextField(w->GD.rotFrameRowCol[1], "GDrotText3", arg, i); - XtManageChild(w->GD.rotText[3]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[4] = XmCreateTextField(w->GD.rotFrameRowCol[1], "GDrotText4", arg, i); - XtManageChild(w->GD.rotText[4]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[5] = XmCreateTextField(w->GD.rotFrameRowCol[1], "GDrotText5", arg, i); - XtManageChild(w->GD.rotText[5]); - - /* rot - angle */ - - i=0; - w->GD.rotFrame[0][2] = XmCreateFrame(w->GD.rotRowCol, "GDrotFrame02", arg, i); - XtManageChild(w->GD.rotFrame[0][2]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Angle")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.rotFrame[1][2] = XmCreateLabel(w->GD.rotFrame[0][2], "GDrotFrame12", arg, i); - XtManageChild(w->GD.rotFrame[1][2]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.rotFrameRowCol[2] = XmCreateRowColumn(w->GD.rotFrame[0][2], "ODrotFrameRowCol2", arg, i); - XtManageChild(w->GD.rotFrameRowCol[2]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.rotText[6] = XmCreateTextField(w->GD.rotFrameRowCol[2], "GDrotText6", arg, i); - XtManageChild(w->GD.rotText[6]); - - - /* Translation */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Current Translation")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->GD.tranDialog = XmCreateTemplateDialog(w->M.shell, "GDtranDialog", arg, i); - XtUnmanageChild(w->GD.tranDialog); - - i=0; - w->GD.tranFrame[0] = XmCreateFrame(w->GD.tranDialog, "GDtranFrame0", arg, i); - XtManageChild(w->GD.tranFrame[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Vector")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.tranFrame[1] = XmCreateLabel(w->GD.tranFrame[0], "GDtranFrame1", arg, i); - XtManageChild(w->GD.tranFrame[1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.tranFrameRowCol = XmCreateRowColumn(w->GD.tranFrame[0], "ODtranFrameRowCol", arg, i); - XtManageChild(w->GD.tranFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.tranText[0] = XmCreateTextField(w->GD.tranFrameRowCol, "GDtranText0", arg, i); - XtManageChild(w->GD.tranText[0]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.tranText[1] = XmCreateTextField(w->GD.tranFrameRowCol, "GDtranText1", arg, i); - XtManageChild(w->GD.tranText[1]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.tranText[2] = XmCreateTextField(w->GD.tranFrameRowCol, "GDtranText2", arg, i); - XtManageChild(w->GD.tranText[2]); - - - /* Dilatation */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Current Dilatation")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->GD.dilatDialog = XmCreateTemplateDialog(w->M.shell, "GDdilatDialog", arg, i); - XtUnmanageChild(w->GD.dilatDialog); - - i=0; - w->GD.dilatRowCol = XmCreateRowColumn(w->GD.dilatDialog, "ODdilatRowCol", arg, i); - XtManageChild(w->GD.dilatRowCol); - - /* dilat - coords */ - - i=0; - w->GD.dilatFrame[0][0] = XmCreateFrame(w->GD.dilatRowCol, "GDdilatFrame00", arg, i); - XtManageChild(w->GD.dilatFrame[0][0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Vector")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.dilatFrame[1][0] = XmCreateLabel(w->GD.dilatFrame[0][0], "GDdilatFrame10", arg, i); - XtManageChild(w->GD.dilatFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.dilatFrameRowCol[0] = XmCreateRowColumn(w->GD.dilatFrame[0][0], "ODdilatFrameRowCol0", arg, i); - XtManageChild(w->GD.dilatFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.dilatText[0] = XmCreateTextField(w->GD.dilatFrameRowCol[0], "GDdilatText0", arg, i); - XtManageChild(w->GD.dilatText[0]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.dilatText[1] = XmCreateTextField(w->GD.dilatFrameRowCol[0], "GDdilatText1", arg, i); - XtManageChild(w->GD.dilatText[1]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.dilatText[2] = XmCreateTextField(w->GD.dilatFrameRowCol[0], "GDdilatText2", arg, i); - XtManageChild(w->GD.dilatText[2]); - - /* dilat - factor */ - - i=0; - w->GD.dilatFrame[0][1] = XmCreateFrame(w->GD.dilatRowCol, "GDdilatFrame01", arg, i); - XtManageChild(w->GD.dilatFrame[0][1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Factor")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.dilatFrame[1][1] = XmCreateLabel(w->GD.dilatFrame[0][1], "GDdilatFrame11", arg, i); - XtManageChild(w->GD.dilatFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.dilatFrameRowCol[1] = XmCreateRowColumn(w->GD.dilatFrame[0][1], "ODdilatFrameRowCol1", arg, i); - XtManageChild(w->GD.dilatFrameRowCol[1]); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.dilatText[3] = XmCreateTextField(w->GD.dilatFrameRowCol[1], "GDdilatText3", arg, i); - XtManageChild(w->GD.dilatText[3]); - - /* Symmetry */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Current Symmetry")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->GD.symmDialog = XmCreateTemplateDialog(w->M.shell, "GDsymmDialog", arg, i); - XtUnmanageChild(w->GD.symmDialog); - - i=0; - w->GD.symmFrame[0] = XmCreateFrame(w->GD.symmDialog, "GDsymmFrame0", arg, i); - XtManageChild(w->GD.symmFrame[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Plane")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->GD.symmFrame[1] = XmCreateLabel(w->GD.symmFrame[0], "GDsymmFrame1", arg, i); - XtManageChild(w->GD.symmFrame[1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->GD.symmFrameRowCol = XmCreateRowColumn(w->GD.symmFrame[0], "ODsymmFrameRowCol", arg, i); - XtManageChild(w->GD.symmFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.symmText[0] = XmCreateTextField(w->GD.symmFrameRowCol, "GDsymmText0", arg, i); - XtManageChild(w->GD.symmText[0]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.symmText[1] = XmCreateTextField(w->GD.symmFrameRowCol, "GDsymmText1", arg, i); - XtManageChild(w->GD.symmText[1]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.symmText[2] = XmCreateTextField(w->GD.symmFrameRowCol, "GDsymmText2", arg, i); - XtManageChild(w->GD.symmText[2]); - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - XtSetArg(arg[i], XmNcolumns, 10); i++; - w->GD.symmText[3] = XmCreateTextField(w->GD.symmFrameRowCol, "GDsymmText3", arg, i); - XtManageChild(w->GD.symmText[3]); - -} - -/* ------------------------------------------------------------------------ - MESH DIALOGS - ------------------------------------------------------------------------ */ - -void CreateWidgets_MD(Widgets_T *w){ - int i; - Arg arg[10]; - - /* Characteristic length */ - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Characteristic Length")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->MD.charLengthDialog = XmCreateTemplateDialog(w->M.shell, "MDcharLengthDialog", arg, i); - XtUnmanageChild(w->MD.charLengthDialog); - - i=0; - w->MD.charLengthFrame[0] = XmCreateFrame(w->MD.charLengthDialog, "MDcharLengthFrame0", arg, i); - XtManageChild(w->MD.charLengthFrame[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Value")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->MD.charLengthFrame[1] = XmCreateLabel(w->MD.charLengthFrame[0], "MDcharLengthFrame1", arg, i); - XtManageChild(w->MD.charLengthFrame[1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->MD.charLengthFrameRowCol = XmCreateRowColumn(w->MD.charLengthFrame[0], "MDcharLengthFrameRowCol", arg, i); - XtManageChild(w->MD.charLengthFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - w->MD.charLengthText = XmCreateTextField(w->MD.charLengthFrameRowCol, "MDcharLengthText", arg, i); - XtManageChild(w->MD.charLengthText); - - /* Transfinite Line */ - - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Transfinite Line")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->MD.trsfLineDialog = XmCreateTemplateDialog(w->M.shell, "MDtrsfLineDialog", arg, i); - XtUnmanageChild(w->MD.trsfLineDialog); - - i=0; - w->MD.trsfLineRowCol = XmCreateRowColumn(w->MD.trsfLineDialog, "MDtrsfLineRowCol", arg, i); - XtManageChild(w->MD.trsfLineRowCol); - - /* trsf line - type */ - - i=0; - w->MD.trsfLineFrame[0][0] = XmCreateFrame(w->MD.trsfLineRowCol, "MDtrsfLineFrame00", arg, i); - XtManageChild(w->MD.trsfLineFrame[0][0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Type")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->MD.trsfLineFrame[1][0] = XmCreateLabel(w->MD.trsfLineFrame[0][0], "MDtrsfLineFrame10", arg, i); - XtManageChild(w->MD.trsfLineFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->MD.trsfLineFrameRowCol[0] = XmCreateRowColumn(w->MD.trsfLineFrame[0][0], "MDtrsfLineFrameRowCol0", arg, i); - XtManageChild(w->MD.trsfLineFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNvalue, "Power 1.0"); i++; - w->MD.trsfLineText[0] = XmCreateTextField(w->MD.trsfLineFrameRowCol[0], "MDtrsfLineText0", arg, i); - XtManageChild(w->MD.trsfLineText[0]); - - /* trsf line - nb pts */ - - i=0; - w->MD.trsfLineFrame[0][1] = XmCreateFrame(w->MD.trsfLineRowCol, "MDtrsfLineFrame01", arg, i); - XtManageChild(w->MD.trsfLineFrame[0][1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Number of Points")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->MD.trsfLineFrame[1][1] = XmCreateLabel(w->MD.trsfLineFrame[0][1], "MDtrsfLineFrame11", arg, i); - XtManageChild(w->MD.trsfLineFrame[1][1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->MD.trsfLineFrameRowCol[1] = XmCreateRowColumn(w->MD.trsfLineFrame[0][1], "MDtrsfLineFrameRowCol1", arg, i); - XtManageChild(w->MD.trsfLineFrameRowCol[1]); - - i=0; - XtSetArg(arg[i], XmNvalue, "2"); i++; - w->MD.trsfLineText[1] = XmCreateTextField(w->MD.trsfLineFrameRowCol[1], "MDtrsfLineText1", arg, i); - XtManageChild(w->MD.trsfLineText[1]); - - /* Transfinite Volume */ - i=0; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Transfinite Volume")); i++; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Ok")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->MD.trsfVolumeDialog = XmCreateTemplateDialog(w->M.shell, "MDtrsfVolumeDialog", arg, i); - XtUnmanageChild(w->MD.trsfVolumeDialog); - - i=0; - w->MD.trsfVolumeFrame[0] = XmCreateFrame(w->MD.trsfVolumeDialog, "MDtrsfVolumeFrame0", arg, i); - XtManageChild(w->MD.trsfVolumeFrame[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Number")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->MD.trsfVolumeFrame[1] = XmCreateLabel(w->MD.trsfVolumeFrame[0], "MDtrsfVolumeFrame1", arg, i); - XtManageChild(w->MD.trsfVolumeFrame[1]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->MD.trsfVolumeFrameRowCol = XmCreateRowColumn(w->MD.trsfVolumeFrame[0], "MDtrsfVolumeFrameRowCol", arg, i); - XtManageChild(w->MD.trsfVolumeFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNvalue, ""); i++; - w->MD.trsfVolumeText = XmCreateTextField(w->MD.trsfVolumeFrameRowCol, "MDtrsfVolumeText", arg, i); - XtManageChild(w->MD.trsfVolumeText); - -} - -/* ------------------------------------------------------------------------ - POST PROCESSING DIALOGS - ------------------------------------------------------------------------ */ - -void CreateWidgets_PD(Widgets_T *w){ - int i, n; - Arg arg[10]; - Widget tmp; - - /* Offset */ - i=0; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->PD.offsetDialog = XmCreateTemplateDialog(w->M.shell, "PDoffsetDialog", arg, i); - XtUnmanageChild(w->PD.offsetDialog); - - i=0; - w->PD.offsetRowCol = XmCreateRowColumn(w->PD.offsetDialog, "PDoffsetRowCol", arg, i); - XtManageChild(w->PD.offsetRowCol); - - - /* Offset mode */ - i=0; - w->PD.offsetFrame[0][0] = XmCreateFrame(w->PD.offsetRowCol, "ODoffsetFrame00", arg, i); - XtManageChild(w->PD.offsetFrame[0][0]); - - i=0; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Offset Mode")); i++; - w->PD.offsetFrame[1][0] = XmCreateLabel(w->PD.offsetFrame[0][0], "PDoffsetFrame10", arg, i); - XtManageChild(w->PD.offsetFrame[1][0]); - - i=0; - w->PD.offsetFrameRowCol[0] = XmCreateRowColumn(w->PD.offsetFrame[0][0], "PDoffsetFrameRowCol0", arg, i); - XtManageChild(w->PD.offsetFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->PD.offsetModeCheck = XmCreateRadioBox(w->PD.offsetFrameRowCol[0], "PDoffsetModeCheck", arg, i); - XtManageChild(w->PD.offsetModeCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Translation")); i++; - w->PD.offsetModeButt[0] = XmCreateToggleButton(w->PD.offsetModeCheck, "PDoffsetModeButt0", arg, i); - XtManageChild(w->PD.offsetModeButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Raise")); i++; - w->PD.offsetModeButt[1] = XmCreateToggleButton(w->PD.offsetModeCheck, "PDoffsetModeButt1", arg, i); - XtManageChild(w->PD.offsetModeButt[1]); - - /* Offset sliders and text fields */ - - for(n=1 ; n<4 ; n++){ - i=0; - w->PD.offsetFrame[0][n] = XmCreateFrame(w->PD.offsetRowCol, "ODoffsetFrame0n", arg, i); - XtManageChild(w->PD.offsetFrame[0][n]); - - i=0; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.offsetFrame[1][n] = XmCreateLabel(w->PD.offsetFrame[0][n], "PDoffsetFrame1n", arg, i); - XtManageChild(w->PD.offsetFrame[1][n]); - - i=0; - w->PD.offsetFrameRowCol[n] = XmCreateRowColumn(w->PD.offsetFrame[0][n], "PDoffsetFrameRowColn", arg, i); - XtManageChild(w->PD.offsetFrameRowCol[n]); - - i=0; - XtSetArg(arg[i], XmNminimum, -100); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNdecimalPoints, 2); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->PD.offsetScale[n-1] = XmCreateScale(w->PD.offsetFrameRowCol[n], "PDoffsetScalen", arg, i); - XtManageChild(w->PD.offsetScale[n-1]); - - i=0; - w->PD.offsetText[n-1] = XmCreateTextField(w->PD.offsetFrameRowCol[n], "PDoffsetTextn", arg, i); - XtManageChild(w->PD.offsetText[n-1]); - } - - XtVaSetValues(w->PD.offsetFrame[1][1], XmNlabelString, XmStringCreateSimple("X"), NULL); - XtVaSetValues(w->PD.offsetFrame[1][2], XmNlabelString, XmStringCreateSimple("Y"), NULL); - XtVaSetValues(w->PD.offsetFrame[1][3], XmNlabelString, XmStringCreateSimple("Z"), NULL); - - - /* TimeStep */ - i=0; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->PD.timeStepDialog = XmCreateTemplateDialog(w->M.shell, "PDtimeStepDialog", arg, i); - XtUnmanageChild(w->PD.timeStepDialog); - - i=0; - w->PD.timeStepFrame[0] = XmCreateFrame(w->PD.timeStepDialog, "ODtimeStepFrame0", arg, i); - XtManageChild(w->PD.timeStepFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Time Step")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.timeStepFrame[1] = XmCreateLabel(w->PD.timeStepFrame[0], "PDtimeStepFrame1", arg, i); - XtManageChild(w->PD.timeStepFrame[1]); - - i=0; - w->PD.timeStepFrameRowCol = XmCreateRowColumn(w->PD.timeStepFrame[0], "PDtimeStepRowCol", arg, i); - XtManageChild(w->PD.timeStepFrameRowCol); - - i=0; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->PD.timeStepScale = XmCreateScale(w->PD.timeStepFrameRowCol, "PDtimeStepScale", arg, i); - XtManageChild(w->PD.timeStepScale); - - i=0; - w->PD.timeStepText = XmCreateTextField(w->PD.timeStepFrameRowCol, "PDtimeStepText", arg, i); - XtManageChild(w->PD.timeStepText); - - /* Scale */ - i=0; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->PD.scaleDialog = XmCreateTemplateDialog(w->M.shell, "PDscaleDialog", arg, i); - XtUnmanageChild(w->PD.scaleDialog); - - i=0; - w->PD.scaleRowCol = XmCreateRowColumn(w->PD.scaleDialog, "PDscaleRowCol", arg, i); - XtManageChild(w->PD.scaleRowCol); - - /* Scale - bar */ - i=0; - w->PD.scaleFrame[0][0] = XmCreateFrame(w->PD.scaleRowCol, "ODscaleFrame00", arg, i); - XtManageChild(w->PD.scaleFrame[0][0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Scale Bar")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.scaleFrame[1][0] = XmCreateLabel(w->PD.scaleFrame[0][0], "PDscaleFrame10", arg, i); - XtManageChild(w->PD.scaleFrame[1][0]); - - i=0; - w->PD.scaleFrameRowCol[0] = XmCreateRowColumn(w->PD.scaleFrame[0][0], "PDscaleFrameRowCol0", arg, i); - XtManageChild(w->PD.scaleFrameRowCol[0]); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->PD.scaleCheck = XmCreateSimpleCheckBox(w->PD.scaleFrameRowCol[0], "PDscaleCheck", arg, i); - XtManageChild(w->PD.scaleCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Show")); i++; - w->PD.scaleShowButt = XmCreateToggleButton(w->PD.scaleCheck, "PDscaleShowButt", arg, i); - XtManageChild(w->PD.scaleShowButt); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Transparency")); i++; - w->PD.scaleTransButt = XmCreateToggleButton(w->PD.scaleCheck, "PDscaleTransButt", arg, i); - XtManageChild(w->PD.scaleTransButt); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Time Display")); i++; - w->PD.scaleTimeButt = XmCreateToggleButton(w->PD.scaleCheck, "PDscaleTimeButt", arg, i); - XtManageChild(w->PD.scaleTimeButt); - - for(n=0 ; n<2 ; n++){ - i=0; - XtSetArg(arg[i], XmNvalue, "0.00000000000000000001e-1"); i++; /* lesstif bug */ - w->PD.scaleText[n] = XmCreateTextField(w->PD.scaleFrameRowCol[0], "PDscaleTextn", arg, i); - XtManageChild(w->PD.scaleText[n]); - } - - /* Scale - range */ - i=0; - w->PD.scaleFrame[0][1] = XmCreateFrame(w->PD.scaleRowCol, "ODscaleFrame01", arg, i); - XtManageChild(w->PD.scaleFrame[0][1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Value Range")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.scaleFrame[1][1] = XmCreateLabel(w->PD.scaleFrame[0][1], "PDscaleFrame11", arg, i); - XtManageChild(w->PD.scaleFrame[1][1]); - - i=0; - w->PD.scaleFrameRowCol[1] = XmCreateRowColumn(w->PD.scaleFrame[0][1], "PDscaleFrameRowCol1", arg, i); - XtManageChild(w->PD.scaleFrameRowCol[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Custom")); i++; - w->PD.scaleRangeButt = XmCreateToggleButton(w->PD.scaleFrameRowCol[1], "PDscaleRangeButt", arg, i); - XtManageChild(w->PD.scaleRangeButt); - - for(n=0 ; n<2 ; n++){ - i=0; - XtSetArg(arg[i], XmNvalue, "0.00000000000000000001e-1"); i++; /* lesstif bug */ - w->PD.scaleRangeText[n] = XmCreateTextField(w->PD.scaleFrameRowCol[1], "PDscaleRangeTextn", arg, i); - XtManageChild(w->PD.scaleRangeText[n]); - } - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->PD.scaleTypeCheck = XmCreateRadioBox(w->PD.scaleFrameRowCol[1], "PDscaleTypeCheck", arg, i); - XtManageChild(w->PD.scaleTypeCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Linear")); i++; - w->PD.scaleTypeButt[0] = XmCreateToggleButton(w->PD.scaleTypeCheck, "PDscaleTypeButt0", arg, i); - XtManageChild(w->PD.scaleTypeButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Logarithmic")); i++; - w->PD.scaleTypeButt[1] = XmCreateToggleButton(w->PD.scaleTypeCheck, "PDscaleTypeButt1", arg, i); - XtManageChild(w->PD.scaleTypeButt[1]); - - - /* Scale - intervals */ - i=0; - w->PD.scaleFrame[0][2] = XmCreateFrame(w->PD.scaleRowCol, "ODscaleFrame02", arg, i); - XtManageChild(w->PD.scaleFrame[0][2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Intervals")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.scaleFrame[1][2] = XmCreateLabel(w->PD.scaleFrame[0][2], "PDscaleFrame12", arg, i); - XtManageChild(w->PD.scaleFrame[1][2]); - - i=0; - w->PD.scaleFrameRowCol[2] = XmCreateRowColumn(w->PD.scaleFrame[0][2], "PDscaleFrameRowCol2", arg, i); - XtManageChild(w->PD.scaleFrameRowCol[2]); - - i=0; - XtSetArg(arg[i], XmNminimum, 1); i++; - XtSetArg(arg[i], XmNmaximum, 100); i++; - XtSetArg(arg[i], XmNvalue, 15); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->PD.scaleIntervalsScale = XmCreateScale(w->PD.scaleFrameRowCol[2], "PDscaleIntervalsScale", arg, i); - XtManageChild(w->PD.scaleIntervalsScale); - - i=0; - w->PD.scaleIntervalsText = XmCreateTextField(w->PD.scaleFrameRowCol[2], "PDscaleIntervalsText", arg, i); - XtManageChild(w->PD.scaleIntervalsText); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->PD.scaleIntervalsCheck = XmCreateRadioBox(w->PD.scaleFrameRowCol[2], "PDscaleIntervalsCheck", arg, i); - XtManageChild(w->PD.scaleIntervalsCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Iso")); i++; - w->PD.scaleIntervalsButt[0] = XmCreateToggleButton(w->PD.scaleIntervalsCheck, "PDscaleIntervalsButt0", arg, i); - XtManageChild(w->PD.scaleIntervalsButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Filled Iso")); i++; - w->PD.scaleIntervalsButt[1] = XmCreateToggleButton(w->PD.scaleIntervalsCheck, "PDscaleIntervalsButt1", arg, i); - XtManageChild(w->PD.scaleIntervalsButt[1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Continous")); i++; - w->PD.scaleIntervalsButt[2] = XmCreateToggleButton(w->PD.scaleIntervalsCheck, "PDscaleIntervalsButt2", arg, i); - XtManageChild(w->PD.scaleIntervalsButt[2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Numeric")); i++; - w->PD.scaleIntervalsButt[3] = XmCreateToggleButton(w->PD.scaleIntervalsCheck, "PDscaleIntervalsButt3", arg, i); - XtManageChild(w->PD.scaleIntervalsButt[3]); - - /* Color */ - i=0; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->PD.colorDialog = XmCreateTemplateDialog(w->M.shell, "PDcolorDialog", arg, i); - XtUnmanageChild(w->PD.colorDialog); - - i=0; - w->PD.colorFrame[0][0] = XmCreateFrame(w->PD.colorDialog, "ODcolorFrame00", arg, i); - XtManageChild(w->PD.colorFrame[0][0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Colors")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.colorFrame[1][0] = XmCreateLabel(w->PD.colorFrame[0][0], "PDcolorFrame10", arg, i); - XtManageChild(w->PD.colorFrame[1][0]); - - i=0; - /* hardcoded this one, since its is required for the motion handling */ - XtSetArg(arg[i], XmNtranslations, XtParseTranslationTable(DrawingAreaTranslations)); i++; - w->PD.colorDrawingArea = XmCreateDrawingArea(w->PD.colorFrame[0][0], "PDcolorDrawingArea", arg, i); - XtManageChild(w->PD.colorDrawingArea); - - - /* Vectors */ - i=0; - XtSetArg(arg[i], XmNokLabelString, XmStringCreateSimple("Apply")); i++; - XtSetArg(arg[i], XmNcancelLabelString, XmStringCreateSimple("Cancel")); i++; - XtSetArg(arg[i], XmNautoUnmanage, False); i++; - w->PD.vectorDialog = XmCreateTemplateDialog(w->M.shell, "PDvectorDialog", arg, i); - XtUnmanageChild(w->PD.vectorDialog); - - i=0; - w->PD.vectorRowCol = XmCreateRowColumn(w->PD.vectorDialog, "PDvectorRowCol", arg, i); - XtManageChild(w->PD.vectorRowCol); - - /* vector - type */ - - i=0; - w->PD.vectorFrame[0][0] = XmCreateFrame(w->PD.vectorRowCol, "ODvectorFrame00", arg, i); - XtManageChild(w->PD.vectorFrame[0][0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Vector Display Type")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.vectorFrame[1][0] = XmCreateLabel(w->PD.vectorFrame[0][0], "PDvectorFrame10", arg, i); - XtManageChild(w->PD.vectorFrame[1][0]); - - i=0; - XtSetArg(arg[i], XmNnumColumns, 2); i++; - w->PD.vectorTypeCheck = XmCreateRadioBox(w->PD.vectorFrame[0][0], "PDvectorTypeCheck", arg, i); - XtManageChild(w->PD.vectorTypeCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Line")); i++; - w->PD.vectorTypeButt[0] = XmCreateToggleButton(w->PD.vectorTypeCheck, "PDvectorTypeButt0", arg, i); - XtManageChild(w->PD.vectorTypeButt[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Arrow")); i++; - w->PD.vectorTypeButt[1] = XmCreateToggleButton(w->PD.vectorTypeCheck, "PDvectorTypeButt1", arg, i); - XtManageChild(w->PD.vectorTypeButt[1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Pyramid")); i++; - w->PD.vectorTypeButt[2] = XmCreateToggleButton(w->PD.vectorTypeCheck, "PDvectorTypeButt2", arg, i); - XtManageChild(w->PD.vectorTypeButt[2]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Cone")); i++; - w->PD.vectorTypeButt[3] = XmCreateToggleButton(w->PD.vectorTypeCheck, "PDvectorTypeButt3", arg, i); - XtManageChild(w->PD.vectorTypeButt[3]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Displacement")); i++; - w->PD.vectorTypeButt[4] = XmCreateToggleButton(w->PD.vectorTypeCheck, "PDvectorTypeButt4", arg, i); - XtManageChild(w->PD.vectorTypeButt[4]); - - /* vector - scale */ - - i=0; - w->PD.vectorFrame[0][1] = XmCreateFrame(w->PD.vectorRowCol, "ODvectorFrame01", arg, i); - XtManageChild(w->PD.vectorFrame[0][1]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Scale")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.vectorFrame[1][1] = XmCreateLabel(w->PD.vectorFrame[0][1], "PDvectorFrame11", arg, i); - XtManageChild(w->PD.vectorFrame[1][1]); - - i=0; - w->PD.vectorScaleRowCol = XmCreateRowColumn(w->PD.vectorFrame[0][1], "PDvectorFrameRowCol1", arg, i); - XtManageChild(w->PD.vectorScaleRowCol); - - i=0; - XtSetArg(arg[i], XmNminimum, 0); i++; - XtSetArg(arg[i], XmNmaximum, 500); i++; - XtSetArg(arg[i], XmNdecimalPoints, 2); i++; - XtSetArg(arg[i], XmNshowValue, False); i++; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->PD.vectorScaleScale = XmCreateScale(w->PD.vectorScaleRowCol, "PDvectorScaleScale", arg, i); - XtManageChild(w->PD.vectorScaleScale); - - i=0; - w->PD.vectorScaleText = XmCreateTextField(w->PD.vectorScaleRowCol, "PDvectorScaleText", arg, i); - XtManageChild(w->PD.vectorScaleText); - - /* vector - location */ - - i=0; - w->PD.vectorFrame[0][2] = XmCreateFrame(w->PD.vectorRowCol, "ODvectorFrame02", arg, i); - XtManageChild(w->PD.vectorFrame[0][2]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Location")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.vectorFrame[1][2] = XmCreateLabel(w->PD.vectorFrame[0][2], "PDvectorFrame12", arg, i); - XtManageChild(w->PD.vectorFrame[1][2]); - - i=0; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - w->PD.vectorLocationCheck = XmCreateRadioBox(w->PD.vectorFrame[0][2], "PDvectorLocationCheck", arg, i); - XtManageChild(w->PD.vectorLocationCheck); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("COG")); i++; - w->PD.vectorLocationButt[0] = XmCreateToggleButton(w->PD.vectorLocationCheck, "PDvectorLocationButt0", arg, i); - XtManageChild(w->PD.vectorLocationButt[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Vertex")); i++; - w->PD.vectorLocationButt[1] = XmCreateToggleButton(w->PD.vectorLocationCheck, "PDvectorLocationButt1", arg, i); - XtManageChild(w->PD.vectorLocationButt[1]); - - - /* export BGM */ - i=0 ; - XtSetArg(arg[i], XmNdialogTitle, XmStringCreateSimple("Export BGM")); i++; - XtSetArg(arg[i], XmNnoMatchString, XmStringCreateSimple("[ NONE ]")); i++; - XtSetArg(arg[i], XmNdirMask, XmStringCreateSimple("*")); i++; - XtSetArg(arg[i], XmNautoUnmanage, True); i++; - w->PD.exportBGMDialog = XmCreateFileSelectionDialog(w->M.shell, "FDexportBGMDialog", arg, i); - XtUnmanageChild(w->PD.exportBGMDialog); - - tmp = XmFileSelectionBoxGetChild(w->PD.exportBGMDialog, XmDIALOG_HELP_BUTTON); - XtUnmanageChild(tmp); - - i=0; - w->PD.exportBGMFrame[0] = XmCreateFrame(w->PD.exportBGMDialog, "FDexportBGMFrame0", arg, i); - XtManageChild(w->PD.exportBGMFrame[0]); - - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("Options")); i++; - XtSetArg(arg[i], XmNchildType, XmFRAME_TITLE_CHILD); i++; - w->PD.exportBGMFrame[1] = XmCreateLabel(w->PD.exportBGMFrame[0], "FDexportBGMFrame1", arg, i); - XtManageChild(w->PD.exportBGMFrame[1]); - - i=0 ; - XtSetArg(arg[i], XmNorientation, XmHORIZONTAL); i++; - XtSetArg(arg[i], XmNspacing, 0); i++; - w->PD.exportBGMRowCol = XmCreateRowColumn(w->PD.exportBGMFrame[0], "FDexportBGMRowCol", arg, i); - XtManageChild(w->PD.exportBGMRowCol); - - /* export BGM - method */ - i=0; - w->PD.exportBGMPane = XmCreatePulldownMenu(w->PD.exportBGMRowCol, "FDexportBGMPane", arg, i); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("h: error (%)")); i++; - w->PD.exportBGMButt[0] = XmCreatePushButton(w->PD.exportBGMPane, "MexportBGMButt0", arg, i); - XtManageChild(w->PD.exportBGMButt[0]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("h: elements")); i++; - w->PD.exportBGMButt[1] = XmCreatePushButton(w->PD.exportBGMPane, "MexportBGMButt1", arg, i); - XtManageChild(w->PD.exportBGMButt[1]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("p: error (%)")); i++; - w->PD.exportBGMButt[2] = XmCreatePushButton(w->PD.exportBGMPane, "MexportBGMButt2", arg, i); - XtManageChild(w->PD.exportBGMButt[2]); - i=0; - XtSetArg(arg[i], XmNlabelString, XmStringCreateSimple("p: elements")); i++; - w->PD.exportBGMButt[3] = XmCreatePushButton(w->PD.exportBGMPane, "MexportBGMButt3", arg, i); - XtManageChild(w->PD.exportBGMButt[3]); - i=0; - XtSetArg(arg[i], XmNsubMenuId, w->PD.exportBGMPane); i++; - XtSetArg(arg[i], XmNspacing, 0); i++; - w->PD.exportBGMMenu = XmCreateOptionMenu(w->PD.exportBGMRowCol, "FDexportBGMMenu", arg, i); - XtManageChild(w->PD.exportBGMMenu); - - /* export BGM - constraint */ - i=0; - w->PD.exportBGMText = XmCreateTextField(w->PD.exportBGMRowCol, "FDexportBGMText", arg, i); - XtManageChild(w->PD.exportBGMText); - - -} - - - -/* ------------------------------------------------------------------------ - C r e a t e W i d g e t s - ------------------------------------------------------------------------ */ - -void CreateWidgets (Widgets_T *w){ - CreateWidgets_M(w); /* menu win */ - CreateWidgets_G(w); /* graphic win */ - if(CTX.command_win) CreateWidgets_C(w); /* command win */ - - CreateWidgets_ED(w); /* error dialogs */ - CreateWidgets_FD(w); /* file dialogs */ - CreateWidgets_OD(w); /* option dialogs */ - CreateWidgets_HD(w); /* help dialogs */ - CreateWidgets_GD(w); /* geometry dialogs */ - CreateWidgets_MD(w); /* mesh dialogs */ - CreateWidgets_PD(w); /* post dialogs */ -} - - diff --git a/Motif/Widgets.h b/Motif/Widgets.h deleted file mode 100644 index aa03ed0bde0074fefc9bf23a69ff74679f099478..0000000000000000000000000000000000000000 --- a/Motif/Widgets.h +++ /dev/null @@ -1,237 +0,0 @@ -#ifndef _WIDGETS_H_ -#define _WIDGETS_H_ - -#define NB_BUTT_MAX 50 - -/* check Info.h */ -#define NB_INFO_GEOM 4 -#define NB_INFO_MESH 15 -#define NB_INFO_POST 5 -#define NB_INFO_MAX 24 - -/* Holder for all Widgets */ - -typedef struct { - - /* menu window */ - - struct { - Widget shell, containerWin ; - Widget menuBar ; - Widget fileCascade, filePane, fileButt[10], fileSep[3] ; - Widget moduleCascade, modulePane, moduleButt[3] ; - Widget optionCascade, optionPane, optionButt[6], optionSep[2] ; - Widget helpCascade, helpPane, helpButt[2], helpSep[1] ; - Widget menuFrame, menuForm ; - Widget modButt, modPop, geomButt, meshButt, postButt ; - Widget navigButt[2]; - Widget defaultButt ; - Widget pushButt [NB_BUTT_MAX] ; - Widget toggleButt [NB_BUTT_MAX] ; - Widget popMenu [NB_BUTT_MAX] ; - Widget popSep [3][NB_BUTT_MAX] ; - Widget lightButt [NB_BUTT_MAX] ; - Widget elementButt [NB_BUTT_MAX] ; - Widget offsetButt [NB_BUTT_MAX] ; - Widget timeStepButt [NB_BUTT_MAX] ; - Widget scaleButt [NB_BUTT_MAX] ; - Widget colorButt [NB_BUTT_MAX] ; - Widget vectorButt [NB_BUTT_MAX] ; - Widget exportBGMButt[NB_BUTT_MAX] ; - Widget applyBGMButt [NB_BUTT_MAX] ; - Widget reloadButt [NB_BUTT_MAX] ; - Widget removeButt [NB_BUTT_MAX] ; - Widget duplicateButt[NB_BUTT_MAX] ; - } M; - - /* graphic window */ - - struct { - Widget shell, containerForm ; - Widget glw, glo ; - Widget bottomForm ; - Widget Butt[7] ; - Widget textForm, infoLabel, selectLabel, statusLabel ; - } G; - - /* command window */ - - struct { - Widget shell ; - Widget command, commandList, commandText ; - } C; - - - /* error dialogs */ - - struct { - Widget saveAsDialog ; - } ED; - - /* file dialogs */ - - struct { - Widget openDialog ; - Widget mergeDialog ; - Widget saveAsDialog ; - Widget saveAsFrame[2], saveAsRowCol ; - Widget saveAsPane[3], saveAsButt[20], saveAsMenu[3] ; - Widget saveOptionsAsDialog ; - } FD; - - /* options dialogs */ - - struct { - Widget geomDialog, geomRowCol ; - Widget geomVisibleFrame[2], geomVisibleRowCol ; - Widget geomVisibleTypeCheck, geomVisibleTypeButt[2] ; - Widget geomVisibleCheck, geomVisibleButt[4] ; - Widget geomVisibleByNumFrame[2], geomVisibleByNumRowCol ; - Widget geomVisibleByNumText ; - Widget geomNormalsFrame[2], geomNormalsRowCol ; - Widget geomNormalsScale, geomNormalsText ; - Widget geomTangentsFrame[2], geomTangentsRowCol ; - Widget geomTangentsScale, geomTangentsText ; - - Widget meshDialog, meshRowCol; - Widget meshAlgoFrame[2], meshAlgoRowCol ; - Widget meshAlgoCheck, meshAlgoButt[4] ; - Widget meshSmoothingFrame[2], meshSmoothingRowCol ; - Widget meshSmoothingScale, meshSmoothingText ; - Widget meshVisibleFrame[2], meshVisibleRowCol ; - Widget meshVisibleTypeCheck, meshVisibleTypeButt[2] ; - Widget meshVisibleCheck, meshVisibleButt[4] ; - Widget meshVisibleByNumFrame[2], meshVisibleByNumRowCol ; - Widget meshVisibleByNumCheck, meshVisibleByNumButt[4]; - Widget meshVisibleByNumText ; - Widget meshAspectFrame[2] ; - Widget meshAspectCheck, meshAspectButt[3] ; - Widget meshExplodeFrame[2], meshExplodeRowCol ; - Widget meshExplodeScale, meshExplodeText ; - Widget meshNormalsFrame[2], meshNormalsRowCol ; - Widget meshNormalsScale, meshNormalsText ; - - Widget postDialog, postRowCol; - Widget postLinkFrame[2], postLinkRowCol ; - Widget postLinkCheck, postLinkButt[3] ; - Widget postAnimFrame[2] ; - Widget postAnimFrameRowCol, postAnimScale ; - - Widget miscDialog, miscRowCol ; - Widget miscMiscFrame[2] ; - Widget miscMiscCheck, miscMiscButt[6] ; - Widget miscColorSchemeFrame[2] ; - Widget miscColorSchemeFrameRowCol, miscColorSchemeScale ; - Widget miscProjFrame[2] ; - Widget miscProjCheck, miscProjButt[2] ; - Widget miscLightFrame[2] ; - Widget miscLightFrameRowCol, miscLightScale[3] ; - Widget miscShineFrame[2] ; - Widget miscShineFrameRowCol, miscShineScale ; - - Widget viewportDialog, viewportRowCol ; - Widget viewportFrame[2][3], viewportFrameRowCol[3] ; - Widget viewportText[3][3], viewportLockButt[3][3] ; - - Widget infoDialog, infoRowCol ; - Widget infoFrame[2][3], infoFrameRowCol[3] ; - Widget infoKeyLabel[NB_INFO_MAX], infoValueLabel[NB_INFO_MAX] ; - - } OD; - - /* help dialogs */ - - struct { - Widget keysDialog, keysText ; - - Widget aboutDialog ; - } HD; - - /* geometry dialogs */ - - struct { - Widget paramDialog, paramRowCol ; - Widget paramFrame[2][2], paramFrameRowCol[2], paramText[2] ; - - Widget pointDialog, pointRowCol ; - Widget pointFrame[2][2], pointFrameRowCol[2], pointText[4] ; - - Widget rotDialog, rotRowCol ; - Widget rotFrame[2][3], rotFrameRowCol[3], rotText[7] ; - - Widget tranDialog ; - Widget tranFrame[2], tranFrameRowCol, tranText[3] ; - - Widget dilatDialog, dilatRowCol ; - Widget dilatFrame[2][2], dilatFrameRowCol[2], dilatText[4] ; - - Widget symmDialog, symmRowCol ; - Widget symmFrame[2], symmFrameRowCol, symmText[4] ; - } GD; - - /* mesh dialogs */ - - struct { - Widget charLengthDialog ; - Widget charLengthFrame[2], charLengthFrameRowCol, charLengthText ; - - Widget trsfLineDialog, trsfLineRowCol ; - Widget trsfLineFrame[2][2], trsfLineFrameRowCol[2], trsfLineText[2] ; - - Widget trsfVolumeDialog ; - Widget trsfVolumeFrame[2], trsfVolumeFrameRowCol, trsfVolumeText ; - } MD; - - /* post dialogs */ - - struct { - Widget offsetDialog, offsetRowCol ; - Widget offsetFrame[2][4], offsetFrameRowCol[4] ; - Widget /* 1 */ offsetModeCheck, offsetModeButt[2] ; - Widget /* 2 */ offsetText[3], offsetScale[3] ; - - Widget timeStepDialog ; - Widget timeStepFrame[2], timeStepFrameRowCol ; - Widget timeStepText, timeStepScale ; - - Widget scaleDialog, scaleRowCol ; - Widget scaleFrame[2][4], scaleFrameRowCol[4] ; - Widget /* 1 */ scaleCheck, scaleShowButt, scaleTransButt, scaleTimeButt, scaleText[2] ; - Widget /* 2 */ scaleRangeButt, scaleRangeText[2], scaleTypeCheck, - scaleTypeButt[2] ; - Widget /* 3 */ scaleIntervalsCheck, scaleIntervalsButt[4], - scaleIntervalsScale, scaleIntervalsText ; - - Widget colorDialog, colorRowCol ; - Widget colorFrame[2][4] ; - Widget /* 1 */ colorDrawingArea ; - - Widget vectorDialog, vectorRowCol ; - Widget vectorFrame[2][3]; - Widget /* 1 */ vectorTypeCheck, vectorTypeButt[5]; - Widget /* 2 */ vectorScaleRowCol, vectorScaleScale, vectorScaleText ; - Widget /* 3 */ vectorLocationCheck, vectorLocationButt[2]; - - Widget exportBGMDialog ; - Widget exportBGMFrame[2], exportBGMRowCol ; - Widget exportBGMPane, exportBGMButt[4], exportBGMMenu ; - Widget exportBGMText ; - } PD; - - - /* tooltips */ - - struct { - Widget shell; - Widget tooltip_lbl; - } tooltip; - - -} Widgets_T; - - - -void CreateWidgets(Widgets_T *w); - -#endif - diff --git a/Motif/XColors.cpp b/Motif/XColors.cpp deleted file mode 100644 index 655f1ad05083e399ad7038d2176d0d5da96834cb..0000000000000000000000000000000000000000 --- a/Motif/XColors.cpp +++ /dev/null @@ -1,246 +0,0 @@ -// $Id: XColors.cpp,v 1.2 2001-01-10 08:50:31 geuzaine Exp $ - -/* - Attention. Toutes les couleurs sont crees a partir de la colormap de - l'interface : XCTX.gui.colormap -*/ - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include "Gmsh.h" -#include "GmshUI.h" -#include "XContext.h" - -extern XContext_T XCTX ; - -#define PF_TRUECOLOR 0 -#define PF_XALLOC 1 -#define PF_8BIT 2 - -static int pixelformat; -static unsigned long ctable8[5][9][5]; /* Only for PF_8BIT */ -static unsigned long rtable[256], gtable[256], btable[256]; /* PF_TRUECOLOR */ - -/* - * Replacement for XAllocColor. This function should never fail - * to allocate a color. When XAllocColor fails we return the nearest - * matching color. - */ - -#define DISTANCE(r1,g1,b1,r2,g2,b2) ( ((r2)-(r1)) * ((r2)-(r1)) + \ - ((g2)-(g1)) * ((g2)-(g1)) + ((b2)-(b1)) * ((b2)-(b1)) ) - -Status New_XAllocColor( Display *dpy, Colormap cmap, int cmap_size, - XColor *color ) -{ - int p, bestmatch; - double dist, mindist; /* 3*2^16^2 exceeds long int precision */ - static XColor *allcolors = NULL; - XColor *acptr; - - if (!XAllocColor(dpy, cmap, color)) { - /* query whole colormap if not yet done */ - if (!allcolors) { - allcolors = (XColor *) malloc( cmap_size * sizeof(XColor) ); - for (p = 0; p < cmap_size; p++) - allcolors[p].pixel = p; - XQueryColors (dpy, cmap, allcolors, cmap_size); - } - - /* find best match */ - bestmatch = -1; - mindist = 0.0; - p = cmap_size; - while (p--) { - acptr = allcolors + p; - dist = DISTANCE( (double)color->red, (double)color->green, - (double)color->blue, (double)acptr->red, - (double)acptr->green, (double)acptr->blue); - if (bestmatch < 0 || dist < mindist) - mindist = dist, bestmatch = p; - } - color->red = allcolors[bestmatch].red; - color->green = allcolors[bestmatch].green; - color->blue = allcolors[bestmatch].blue; - if (!XAllocColor( dpy, cmap, color )) { - /* this is a real hack but should be good enough */ - color->pixel = bestmatch; - /*printf("code problem in lui.c\n");*/ - } - } - return 1; -} - -#undef DISTANCE - - - - -/* - * Given an RGB color, return the corresponding pixel value. - * Input; r, g, b - red, green, and blue in [0,255] - * Return: a pixel value - */ -unsigned long AllocateColorInt( int r, int g, int b ) -{ - XColor xcol; - - switch (pixelformat) { - case PF_TRUECOLOR: - return rtable[r] | gtable[g] | btable[b]; - case PF_8BIT: - return ctable8[r/52][g/31][b/52]; - case PF_XALLOC: - xcol.red = r << 8; - xcol.green = g << 8; - xcol.blue = b << 8; - New_XAllocColor( XCTX.display, XCTX.gui.colormap, XCTX.gui.visual->map_entries, - &xcol ); - return xcol.pixel; - default: - Msg(GERROR, "Error in AllocateColorInt %d", pixelformat); - exit(0); - } - return 0; -} - - - - -/* - * Allocate a color specified by red, green, and blue and return a pixel - * value. If the color allocation fails, the white pixel will be returned. - * Input: red, green, blue - values in [0,1] - * Return: a pixel value - */ -unsigned long AllocateColor( float red, float green, float blue ) -{ - return AllocateColorInt( (int) (red*255.0), (int) (green*255.0), - (int) (blue*255.0) ); -} - - -void XColorInitialize(void) { - XSetWindowAttributes attr; - XGCValues gcv; - unsigned long gc_mask; - static int initialized = 0; - static Window DummyWindow; - - if (initialized) - return; - else - initialized = 1; - -#if defined(__cplusplus) || defined(c_plusplus) - if (XCTX.gui.visual->c_class==TrueColor || XCTX.gui.visual->c_class==DirectColor) { -#else - if (XCTX.gui.visual->class==TrueColor || XCTX.gui.visual->class==DirectColor) { -#endif - - XColor xcol; - int i; - xcol.green = 0; - xcol.blue = 0; - for (i=0;i<256;i++) { - xcol.red = i * 0xffff / 0xff; - XAllocColor( XCTX.display, XCTX.gui.colormap, &xcol ); - rtable[i] = xcol.pixel; - } - xcol.red = 0; - xcol.blue = 0; - for (i=0;i<256;i++) { - xcol.green = i * 0xffff / 0xff; - XAllocColor( XCTX.display, XCTX.gui.colormap, &xcol ); - gtable[i] = xcol.pixel; - } - xcol.red = 0; - xcol.green = 0; - for (i=0;i<256;i++) { - xcol.blue = i * 0xffff / 0xff; - XAllocColor( XCTX.display, XCTX.gui.colormap, &xcol ); - btable[i] = xcol.pixel; - } - pixelformat = PF_TRUECOLOR; - } - -#if defined(__cplusplus) || defined(c_plusplus) - else if (XCTX.gui.visual->c_class==PseudoColor) { -#else - else if (XCTX.gui.visual->class==PseudoColor) { -#endif - /* Note: the color allocation scheme must be the same as what's used */ - /* in Mesa to allow colormap sharing! */ - int r, g, b; - for (r=0;r<5;r++) { - for (g=0;g<9;g++) { - for (b=0;b<5;b++) { - XColor xcol; - xcol.red = r * 65535 / 4; - xcol.green = g * 65535 / 8; - xcol.blue = b * 65535 / 4; - New_XAllocColor( XCTX.display, XCTX.gui.colormap, - XCTX.gui.visual->map_entries, &xcol ); - ctable8[r][g][b] = xcol.pixel; - } - } - } - pixelformat = PF_8BIT; - } - - else { - pixelformat = PF_XALLOC; - } - - - /* Create a dummy window. This is needed because XCreateGC needs a - drawable of the type which we'll be using in LUI. Unfortunately, - the RootWindow may not have the visual we want. For example, - on the SGI PI, the default root window is pseudo color but we want - LUI to use TrueColor if it's available. In this case using RootWindow - in XCreateGC will make a GC of the wrong type. */ - attr.border_pixel = 0; - attr.background_pixel = 255; - attr.colormap = XCTX.gui.colormap; - DummyWindow = XCreateWindow( XCTX.display, DefaultRootWindow(XCTX.display), - 0, 0, 10, 10, 1, - XCTX.depth, InputOutput, XCTX.gui.visual, - CWBorderPixel | CWBackPixel | CWColormap, - &attr ); - - /*** The basic GC ***/ - gc_mask = GCForeground | GCBackground | GCFont | GCArcMode; - gcv.font = XCTX.xfont.fixed->fid; - gcv.arc_mode = ArcChord; - XCTX.xgc.xgc = XCreateGC(XCTX.display, DummyWindow, gc_mask, &gcv); - - /*** Black ***/ - XCTX.xcolor.black = AllocateColor( 0.0, 0.0, 0.0 ); - gcv.foreground = XCTX.xcolor.black; - XCTX.xgc.black = XCreateGC(XCTX.display, DummyWindow, gc_mask, &gcv); - - /*** White ***/ - XCTX.xcolor.white = AllocateColor( 1.0, 1.0, 1.0 ); - gcv.foreground = XCTX.xcolor.white; - XCTX.xgc.white = XCreateGC(XCTX.display, DummyWindow, gc_mask, &gcv); - - /*** Red (black on monochrome) ***/ - XCTX.xcolor.red = AllocateColor( 1.0, 0.0, 0.0 ); - if (XCTX.xcolor.red == XCTX.xcolor.white) { - XCTX.xcolor.red = XCTX.xcolor.black; - } - gcv.foreground = XCTX.xcolor.red; - XCTX.xgc.red = XCreateGC(XCTX.display, DummyWindow, gc_mask, &gcv); - - /*** Green ***/ - XCTX.xcolor.green = AllocateColor( 0.0, 1.0, 0.0 ); - gcv.foreground = XCTX.xcolor.green; - XCTX.xgc.green = XCreateGC( XCTX.display, DummyWindow, gc_mask, &gcv ); - - /*** Blue ***/ - XCTX.xcolor.blue = AllocateColor( 0.0, 0.5, 1.0 ); - gcv.foreground = XCTX.xcolor.blue; - XCTX.xgc.blue = XCreateGC( XCTX.display, DummyWindow, gc_mask, &gcv ); - -} - diff --git a/Motif/XColors.h b/Motif/XColors.h deleted file mode 100644 index 2a8088dd489eac01fc35595778d51ef58431e4f4..0000000000000000000000000000000000000000 --- a/Motif/XColors.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _XCOLORS_H_ -#define _XCOLORS_H_ - -void XColorInitialize(void); -unsigned long AllocateColorInt( int r, int g, int b ); -unsigned long AllocateColor( float red, float green, float blue ); - -#endif - diff --git a/Motif/XContext.h b/Motif/XContext.h deleted file mode 100644 index 9ce7d6cdc13a9f9142a877322971771f00ba5c3a..0000000000000000000000000000000000000000 --- a/Motif/XContext.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _XCONTEXT_H_ -#define _XCONTEXT_H_ - -/* - X/GLX context -*/ - -typedef struct { - Display *display; /* the X display */ - int scrnum, depth; /* the X screen number and depth */ - XtAppContext AppContext; - - struct { - XVisualInfo *visinfo ; - GLXContext context ; - Colormap colormap ; - } glw ; - - struct { - XVisualInfo *visinfo ; - GLXContext context ; - Colormap colormap ; - } glo ; - - struct { - Visual *visual ; - Colormap colormap ; - } gui ; - - struct { - XFontStruct *helve, *fixed ; - int helve_h, helve_a, helve_w ; - int fixed_h, fixed_a, fixed_w ; - } xfont ; - - struct { - unsigned long black, white ; - unsigned long red, green, blue ; - unsigned long ovblack, ovwhite ; - } xcolor ; - - struct { - GC xgc; - GC black, white ; - GC red, green, blue ; - } xgc ; - -} XContext_T ; - -#define EV_MASK KeyPressMask|KeyReleaseMask|\ - ButtonPressMask|ButtonReleaseMask|ButtonMotionMask|\ - PointerMotionMask|ExposureMask|ResizeRedirectMask|\ - EnterWindowMask|LeaveWindowMask|ShiftMask|ControlMask|Mod1Mask - - -#endif diff --git a/Motif/XCursor.cpp b/Motif/XCursor.cpp deleted file mode 100644 index e138d6f84b0b2707efb79e2e653af18c5e4742d4..0000000000000000000000000000000000000000 --- a/Motif/XCursor.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id: XCursor.cpp,v 1.1 2001-01-08 08:20:11 geuzaine Exp $ - -#include <X11/cursorfont.h> - -#include "xcontext.h" - -extern XContext_T XCTX ; - -#define MAIN_CURSOR 0 -#define DIAL_CURSOR 1 -#define DIAL_CW_CURSOR 2 -#define DIAL_CCW_CURSOR 3 -#define DIAL_RES_CURSOR 4 -#define QUESTION_CURSOR 5 -#define DOWN_CURSOR 6 -#define UP_CURSOR 7 -#define UP_DOWN_CURSOR 8 -#define CLOCK_CURSOR 9 -#define PENCIL_CURSOR 10 -#define ARROW_HAND_CURSOR 11 - -static Cursor CursorTable[32]; - -void SetCursor(Window window, int cursor){ - static int init = 0; - - if (!init) { - init = 1; - CursorTable[MAIN_CURSOR] = XCreateFontCursor(XCTX.display,XC_top_left_arrow); - CursorTable[DIAL_CURSOR] = XCreateFontCursor(XCTX.display,XC_draft_small); - CursorTable[DIAL_CW_CURSOR] = XCreateFontCursor(XCTX.display,XC_exchange); - CursorTable[DIAL_CCW_CURSOR] = XCreateFontCursor(XCTX.display,XC_exchange); - CursorTable[DIAL_RES_CURSOR] = XCreateFontCursor(XCTX.display,XC_circle); - CursorTable[QUESTION_CURSOR] = XCreateFontCursor(XCTX.display,XC_question_arrow); - CursorTable[DOWN_CURSOR] = XCreateFontCursor(XCTX.display,XC_sb_down_arrow); - CursorTable[UP_CURSOR] = XCreateFontCursor(XCTX.display,XC_sb_up_arrow); - CursorTable[UP_DOWN_CURSOR] = XCreateFontCursor(XCTX.display,XC_sb_v_double_arrow); - CursorTable[CLOCK_CURSOR] = XCreateFontCursor(XCTX.display,XC_watch); - CursorTable[PENCIL_CURSOR] = XCreateFontCursor(XCTX.display,XC_pencil); - CursorTable[ARROW_HAND_CURSOR]= XCreateFontCursor(XCTX.display,XC_draft_large); - } - - XDefineCursor(XCTX.display, window, CursorTable[cursor]); -} - diff --git a/Motif/XRessources.h b/Motif/XRessources.h deleted file mode 100644 index 0901139af98da9b585249913fbbe4651b30b2c58..0000000000000000000000000000000000000000 --- a/Motif/XRessources.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - Les resources ci-dessous sont prises en compte par defaut. Toutre - resource definie dans ~/.gmshrc ou dans APP_DEFAULTS/.gmshrc est - prioritaire - - Palette I-DEAS R G B - background 42 71 94 - foreground 255 232 148 - highlight 42 71 95 - topshadow 84 127 158 - bottomshadow 8 12 28 - - Palette netscape - background gray70 - foreground black - highlightColor gray71 - XmTextField*background MistyRose3 - XmList*background MistyRose3 - ArrowBack*foreground MistyRose3 -*/ - -String FallbackResources[] = { - - /* couleurs */ - "gmshGW*background: Grey75", - "gmshGW*borderColor: Grey75", - "gmshGW*foreground: Black", - "gmshGW*highlightColor: Grey76", - - "gmshMW*background: Grey75", - "gmshMW*borderColor: Grey75", - "gmshMW*foreground: Black", - "gmshMW*XmText*background: White", - "gmshMW*XmText*foreground: Black", - "gmshMW*XmTextField*background: White", - "gmshMW*XmList*background: White", - "gmshMW*selectColor: Yellow", - "gmshMW*highlightColor: DarkOrchid", - - "gmshCW*background: Grey75", - "gmshCW*foreground: Black", - "gmshCW*borderColor: Gray75", - "gmshCW*XmTextField*background: Gray75", - "gmshCW*XmList*background: Gray75", - "gmshCW*highlightColor: Grey76", - - /* fontes */ - "*fontList: -*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*", - "*XmTextField*fontList: -*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*", - "*XmList*fontList: -*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*", - "gmshMW*HDkeysText*fontList: fixed", - "gmshMW*HDkeysText*XmPushButton*fontList: -*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*", - "gmshMW*HDaboutDialog*fontList: fixed", - - /* geometrie */ - //"gmshGW*geometry: 700x525+20+30", Dont't force the dimension this way !!! - "gmshGW*geometry: +20+30", - "gmshMW*geometry: x420+800+80", - "gmshCW*geometry: 440x130+30+570", - - /* sizes -> compact layout */ - - "*XmCascadeButton*marginWidth: 2", - - NULL }; - -/* - *toolbar*XmPushButton.baseTranslations: #override\n\ - : CustomShadows(on) Arm()\n\ - : CustomShadows(on) Enter()\n\ - : CustomShadows(off) Leave()\n\ - : MapCheck() - - *toolbar*XmToggleButton.baseTranslations: #override\n\ - : CustomShadows(on) Arm()\n\ - : Select() Disarm() CustomShadows(check)\n\ - : CustomShadows(on) Enter()\n\ - : CustomShadows(off) Leave()\n\ - : MapCheck() - */ diff --git a/Motif/XStatic.h b/Motif/XStatic.h deleted file mode 100644 index ad1ecb04947395e8fe9dcbb1a8d78f0e6f701856..0000000000000000000000000000000000000000 --- a/Motif/XStatic.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _XSTATIC_H_ -#define _XSTATIC_H_ - -/* Fenetre OpenGL principale : visual RGBA, simple ou double buffer */ - -int glw_attrib_sb[] = { - GLX_RGBA, - GLX_DEPTH_SIZE, 16, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - None }; - -int glw_attrib_db[] = { - GLX_RGBA, - GLX_DOUBLEBUFFER, - GLX_DEPTH_SIZE, 16, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - None }; - -/* Fenetre OpenGL overlay : visual INDEXE, simple buffer */ - -int glo_attrib[] = { GLX_LEVEL, 1, None }; - -/* variables globales */ - -XContext_T XCTX ; -Widgets_T WID ; -Pixmaps_T PIX ; - -#endif