1 /***********************************************************************/ 2 /* Open Visualization Data Explorer */ 3 /* (C) Copyright IBM Corp. 1989,1999 */ 4 /* ALL RIGHTS RESERVED */ 5 /* This code licensed under the */ 6 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */ 7 /***********************************************************************/ 8 9 #include <dxconfig.h> 10 11 12 /* 13 * Private data structures for the Cursor interactor. 14 * 15 */ 16 17 #define COORD_WIDTH 350 18 #define COORD_HEIGHT 25 19 20 #define XmCURSOR_MODE 1 21 #define XmROAM_MODE 4 22 #define XmPICK_MODE 7 23 24 #define XmSQUARE 0 25 #define Z_LEVELS 16 26 27 typedef struct 28 { 29 double Bw[4][4] ; 30 } XmBasis ; 31 32 struct pnt 33 { 34 double xcoor, ycoor, zcoor ; 35 double txcoor, tycoor, tzcoor ; 36 double pxcoor, pycoor, pzcoor, pwcoor ; 37 double sxcoor, sycoor ; 38 short visible ; 39 } ; 40 41 typedef struct 42 { 43 /* state variables */ 44 int box_state, box_change, view_state, visible ; 45 46 /* storage for bounding box */ 47 XmBasis *basis ; 48 49 /* roam, cursor, or pick mode */ 50 int mode ; 51 52 /* text coordinate feedback area, save-under, and font */ 53 long coord_llx, coord_lly, coord_urx, coord_ury ; 54 void *coord_saveunder ; 55 int font ; 56 57 /* buffer for cursor save-under */ 58 void *cursor_saveunder ; 59 60 /* active and passive cursor pixmaps, projection mark pixmap */ 61 void *ActiveSquareCursor ; 62 void *PassiveSquareCursor ; 63 void *ProjectionMark ; 64 65 /* cursor state info */ 66 int CursorNotBlank, FirstTime, FirstTimeMotion ; 67 int n_cursors, cursor_num, cursor_shape, cursor_size ; 68 69 /* coords of the 3D cursor */ 70 double X, Y, Z ; 71 /* last active cursor location (screen) */ 72 int pcx, pcy ; 73 74 /* pointer history buffer */ 75 int px, ppx, pppx, ppppx, pppppx, ppppppx, pppppppx ; 76 int py, ppy, pppy, ppppy, pppppy, ppppppy, pppppppy ; 77 /* length of pointer history buffer */ 78 int K ; 79 80 /* transformation matrices */ 81 double Wtrans[4][4] ; 82 double WItrans[4][4] ; 83 double PureWtrans[4][4] ; 84 double PureWItrans[4][4] ; 85 86 /* projection mark info */ 87 int iMark, piMark ; 88 double Xmark[3], Ymark[3], Zmark[3], pXmark[3], pYmark[3], pZmark[3] ; 89 90 /* bounding box info */ 91 double Zmax, Zmin; 92 double Ox, Oy, Oz ; 93 double FacetXmax, FacetYmax, FacetZmax, FacetXmin, FacetYmin, FacetZmin ; 94 struct pnt Face1[4], Face2[4] ; 95 96 /* arrays of screen coords for cursors */ 97 int *xbuff, *ybuff ; 98 double *zbuff; 99 100 /* arrays of cursor positions in canonical form */ 101 double *cxbuff, *cybuff, *czbuff ; 102 103 /* array of selection flags, one for each cursor */ 104 int *selected ; 105 106 /* roam cursor info */ 107 int roam_xbuff, roam_ybuff ; 108 double roam_zbuff ; 109 double roam_cxbuff, roam_cybuff, roam_czbuff ; 110 int roam_selected, roam_valid ; 111 112 /* angles of projected world coordinate axes on screen */ 113 double angle_posx, angle_posy, angle_posz ; 114 double angle_negx, angle_negy, angle_negz ; 115 116 /* cursor movement constraints */ 117 int x_movement_allowed, y_movement_allowed, z_movement_allowed ; 118 119 /* current frame buffer and display mode */ 120 int buffermode, displaymode ; 121 122 /* pick cursor info */ 123 int pick_xbuff, pick_ybuff ; 124 125 /* apply reset at next Redisplay() */ 126 int reset ; 127 } CursorData ; 128 129