1 /***********************************************************************
10 Le main TestOfDesktop.c permet de tester cette classe.
17 HISTORIQUE DES MODIFICATIONS :
18 --------------------------------
19 xx-xx-xx : xxx ; Creation.
20 07-02-96 : FMN ; Suppression code inutile:
21 - TxglLink() et TxglUnlink()
22 19-03-96 : CAL ; Ajout de la fonction subr_resize.
23 appele par togl_ratio_window
24 21-03-96 : CAL ; Dans subr_doublebuffer et subr_open_ws
25 retrait des lignes qui donnaient un background
27 01-04-96 : CAL ; Integration MINSK portage WNT
28 02-07-96 : FMN ; Suppression WSWSHeight, WSWSWidth et WSType
29 17-07-96 : FMN ; Modification de call_subr_hlhsr().
30 18-07-96 : FMN ; Ajout appel TxglWinset() pour le Resize.
31 01-08-96 : FMN ; Ajout appel reaffichage dans le resize.
32 25-11-96 : FMN ; PRO6577: Ajout WSUpdateState pour call_subr_set_background.
33 29-01-97 : FMN ; Suppression de call_subr_doublebuffer().
34 05-02-97 : FMN ; Suppression variables inutiles.
35 12-02-97 : FMN ; Suppression de call_facilities_list.DepthCueing
36 14-02-97 : FMN ; Ajout WSUpdateState pour call_subr_transparency.
37 30-06-97 : FMN ; Appel de la toolkit OpenGl_LightBox.
38 02-07-97 : FMN ; Ajout init generale par contexte.
39 (GL_POLYGON_OFFSET_EXT, glLightModelf, glHint).
40 03-07-97 : FMN ; Test Headlight.
41 08-09-97 : CAL ; subr_open_ws retourne 0 si pb. (gere par togl_view)
42 07-10-97 : FMN ; Simplification WNT
43 03-10-97 : FMN ; Meilleure gestion des EXT, ajout QueryExtension
44 17-11-97 : FMN ; Suppression redraw sur le resize.
45 05-12-97 : FMN ; Double gestion du glPolygonOffsetEXT
46 17-12-97 : FMN ; Probleme compilation SGI
47 03-03-98 : FMN ; Simplification gestion du glPolygonOffsetEXT
48 15-03-98 : FMN ; Suppression variable WSNeedsClear
49 17-03-98 : FMN ; Ajout mode animation
50 08-07-98 : FMN ; Changement du nom de la primitive call_togl_erase_immediat_mode()
51 -> call_togl_erase_animation_mode.
52 22-10-98 : FMN ; Amelioration des perfs: glHint utilise GL_FASTEST.
53 14-12-98 : BGN; Developpement (S3989, Phase "triedre")
54 29-03-01 : GG; glPolygonOffsetEXT is no more available
56 20-08-01 : GG ; Add functions call_subr_enable_polygon_offset ()
57 and call_subr_disable_polygon_offset ()
59 ************************************************************************/
62 #define BUC60579 /*GG_240999 Under WNT,resets the ws attributes for each
63 // created view-manager and not only for the first
67 #define IMP190100 /*GG Reverse the front & back depth cueing planes
71 #define RIC120302 /*GG Use TxglSetWindow instead TxglCreateWindow
72 // when a GLXContext is given
73 // Add call_subr_displayCB function
76 #define BUC61044 /* 25/10/01 SAV ; added functionality to control gl depth testing
78 #define BUC61045 /* 25/10/01 SAV ; added functionality to control gl lighting
81 #define OCC1188 /*SAV added control of the background image*/
83 /*----------------------------------------------------------------------*/
90 #include <OpenGl_tgl_all.hxx>
93 #include <InterfaceGraphic.hxx>
94 #include <InterfaceGraphic_Labels.hxx>
95 #include <InterfaceGraphic_Graphic3d.hxx>
96 #include <InterfaceGraphic_Visual3d.hxx>
98 #include <OpenGl_inquire.hxx>
100 #include <OpenGl_Extension.hxx>
102 #include <OpenGl_cmn_varargs.hxx>
103 #include <OpenGl_tsm.hxx>
104 #include <OpenGl_tsm_ws.hxx>
105 #include <OpenGl_telem_view.hxx>
106 #include <OpenGl_telem_util.hxx>
107 #include <OpenGl_telem_pick.hxx>
108 #include <OpenGl_LightBox.hxx>
109 #include <OpenGl_telem_highlight.hxx>
110 #include <OpenGl_telem_depthcue.hxx>
111 #include <OpenGl_txgl.hxx>
112 #include <OpenGl_tgl_subrvis.hxx>
113 #include <OpenGl_tgl_pick.hxx>
114 #include <OpenGl_tgl_funcs.hxx>
115 #include <OpenGl_telem_filters.hxx>
116 #include <OpenGl_tgl_tox.hxx>
117 #include <OpenGl_tgl.hxx>
118 #include <OpenGl_animation.hxx>
119 #include <OpenGl_triedron.hxx>
120 #include <OpenGl_tgl_util.hxx>
121 #include <OpenGl_Memory.hxx>
122 #include <OpenGl_graduatedtrihedron.hxx>
124 /*----------------------------------------------------------------------*/
129 static Tint attri_init = 0;
131 /*----------------------------------------------------------------------*/
134 static Bool WaitForNotify(Display *d, XEvent *e, char *arg) {
135 return (e->type == MapNotify) && (e->xmap.window == (Window)arg);
139 /*----------------------------------------------------------------------*/
141 static int offsetStatus=0;
142 #ifdef GL_EXT_polygon_offset
143 static GLfloat offsetFactor=1.0,offsetUnits=0.0;
144 #elif GL_POLYGON_OFFSET_EXT
145 static GLfloat offsetFactor=0.5,offsetUnits=0.0005;
147 void call_subr_enable_polygon_offset( )
149 if( offsetStatus < 0 ) return;
151 #ifdef GL_EXT_polygon_offset
152 if( offsetStatus == 0 ) {
153 if (QueryExtension("GL_EXT_polygon_offset")) {
155 if( call_util_osd_getenv ("CALL_OPENGL_POLYGON_OFFSET",
156 svalue,sizeof(svalue)) ) {
158 int n = sscanf(svalue,"%f %f",&v1,&v2);
159 if( n > 0 ) offsetFactor = v1;
160 if( n > 1 ) offsetUnits = v2;
161 printf(" $$$ CALL_OPENGL_POLYGON_OFFSET %f %f\n",
162 offsetFactor,offsetUnits);
170 if( offsetStatus > 0 ) {
171 #ifdef GL_POLYGON_OFFSET_FILL
172 glPolygonOffset(offsetFactor,offsetUnits);
173 glEnable(GL_POLYGON_OFFSET_FILL);
174 #elif GL_POLYGON_OFFSET_EXT
175 glPolygonOffsetEXT(offsetFactor,offsetUnits);
176 glEnable(GL_POLYGON_OFFSET_EXT);
181 #endif /* GL_EXT_polygon_offset */
185 call_subr_disable_polygon_offset( )
187 if( offsetStatus > 0 ) {
188 #ifdef GL_POLYGON_OFFSET_FILL
189 glDisable(GL_POLYGON_OFFSET_FILL);
190 #elif GL_POLYGON_OFFSET_EXT
191 glDisable(GL_POLYGON_OFFSET_EXT);
196 /*----------------------------------------------------------------------*/
199 call_subr_open_ws( CALL_DEF_VIEW * aview )
203 TEL_HIGHLIGHT hrep = { TelHLForcedColour, {{ ( float )1.0, ( float )1.0, ( float )1.0 }} };
204 TEL_DEPTHCUE dcrep = { TelDCSuppressed, {( float )0.0, ( float )1.0}, {( float )1.0, ( float )0.0}, {{( float )0.0, ( float )0.0, ( float )0.0}} };
206 Tfloat bgcolr, bgcolg, bgcolb; /* background color */
208 TSM_BG_TEXTURE bgTexture;
215 unsigned int newwidth, newheight, newbw, newdepth;
220 width = ( Tint )aview->DefWindow.dx;
221 height = ( Tint )aview->DefWindow.dy;
223 /* background color */
224 bgcolr = aview->DefWindow.Background.r,
225 bgcolg = aview->DefWindow.Background.g,
226 bgcolb = aview->DefWindow.Background.b;
229 if( aview->GContext )
230 win = TxglSetWindow( call_thedisplay, /*(HWND)*/(WINDOW)aview->DefWindow.XWindow,
231 /*(HGLRC)*/(GLCONTEXT)aview->GContext );
234 win = TxglCreateWindow( call_thedisplay, /*(HWND)*/(WINDOW)aview->DefWindow.XWindow,
235 0, 0, width, height, 0, bgcolr, bgcolg, bgcolb );
237 if( win != aview->DefWindow.XWindow ) {
238 XMapWindow( call_thedisplay, win );
239 XIfEvent(call_thedisplay, &event, WaitForNotify, (char *) win);
243 if( TxglWinset( call_thedisplay, (WINDOW) win ) == TFailure )
246 TsmRegisterWsid( aview->WsId );
247 data.ldata = (Tint) win;
248 TsmSetWSAttri( aview->WsId, WSWindow, &data );
251 call_thedisplay, win, &root,
252 &newx, &newy,&newwidth, &newheight, &newbw, &newdepth
257 GetClientRect ( win, &cr );
263 data.pdata = &bgTexture;
264 TsmSetWSAttri( aview->WsId, WSBgTexture, &data );
267 TsmSetWSAttri( aview->WsId, WSWidth, &data );
269 TsmSetWSAttri( aview->WsId, WSHeight, &data );
271 TsmSetWSAttri( aview->WsId, WSViewStid, &data );
273 TsmSetWSAttri( aview->WsId, WSDbuff, &data );
274 data.ldata = TNotDone;
275 TsmSetWSAttri( aview->WsId, WSUpdateState, &data );
277 TsmSetWSAttri( aview->WsId, WSTransparency, &data );
278 TelSetHighlightRep( aview->WsId, 0, &hrep );
279 TelSetDepthCueRep( aview->WsId, 0, &dcrep );
280 TelInitWS( aview->WsId, width, height, bgcolr, bgcolg, bgcolb );
283 /* 24/10/01 : SAV ; setting OGL depth testing enabled by default */
285 TsmSetWSAttri( aview->WsId, WSDepthTest, &data );
288 /* 24/10/01 : SAV ; setting flag to control GL_LIGHTING (used in triedron) */
290 TsmSetWSAttri( aview->WsId, WSGLLight, &data );
303 * Init generale du contexte
306 /* Eviter d'avoir les faces mal orientees en noir. */
307 /* Pourrait etre utiliser pour detecter les problemes d'orientation */
308 glLightModeli((GLenum)GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
310 /* Optimisation pour le Fog et l'antialiasing */
311 glHint( GL_FOG_HINT, GL_FASTEST );
312 glHint( GL_POINT_SMOOTH_HINT, GL_FASTEST );
313 glHint( GL_LINE_SMOOTH_HINT, GL_FASTEST );
314 glHint( GL_POLYGON_SMOOTH_HINT, GL_FASTEST );
317 call_subr_enable_polygon_offset();
324 /*----------------------------------------------------------------------*/
327 call_subr_resize (CALL_DEF_VIEW * aview)
332 Tfloat bgcolr, bgcolg, bgcolb;
333 Tint wswidth, wsheight;
335 /* Tint swap = 1;*/ /* swap buffers ? yes */
341 unsigned int newwidth, newheight, newbw, newdepth;
347 printf("call_subr_resize \n");
349 /* Recuperation de la definition precedente de la ws */
350 TsmGetWSAttri (aview->WsId, WSWidth, &data);
351 wswidth = data.ldata;
352 TsmGetWSAttri (aview->WsId, WSHeight, &data);
353 wsheight = data.ldata;
354 TsmGetWSAttri (aview->WsId, WSViewStid, &data);
355 wsviewstid = data.ldata;
357 /* S'il s'agit du togl_ratio_window initial alors on ne fait rien */
358 if (wsviewstid == -1) return;
361 * Si l'on resize une fenetre qui a la meme taille que la taille
362 * precedente alors on ne fait rien
364 if ((wswidth == (Tint) aview->DefWindow.dx) &&
365 (wsheight == (Tint) aview->DefWindow.dy)) return;
368 TsmGetWSAttri (aview->WsId, WSWindow, &data);
371 XResizeWindow (call_thedisplay, win,
372 (unsigned int) aview->DefWindow.dx,
373 (unsigned int) aview->DefWindow.dy);
375 XSync (call_thedisplay, False);
377 /* Mettre a jour ses attributs */
378 XGetGeometry (call_thedisplay, win, &root,
379 &newx, &newy,&newwidth, &newheight, &newbw, &newdepth);
383 /* background color */
384 bgcolr = aview->DefWindow.Background.r,
385 bgcolg = aview->DefWindow.Background.g,
386 bgcolb = aview->DefWindow.Background.b;
388 /* Rendre courant le Drawable et le Context */
389 if (TxglWinset (call_thedisplay, (Window) win) == TSuccess) {
392 TsmSetWSAttri (aview->WsId, WSWidth, &data);
394 TsmSetWSAttri (aview->WsId, WSHeight, &data);
395 TelInitWS (aview->WsId, width, height, bgcolr, bgcolg, bgcolb);
400 /* On detruit l'ancienne sous-fenetre de la window graphique */
401 TsmGetWSAttri (aview->WsId, WSWindow, &data);
402 win = (WINDOW) data.ldata;
404 * On recree une nouvelle sous-fenetre de la window graphique
405 * avec la nouvelle dimension
407 /* background color */
408 bgcolr = aview->DefWindow.Background.r,
409 bgcolg = aview->DefWindow.Background.g,
410 bgcolb = aview->DefWindow.Background.b;
411 /* Rendre courant le Drawable et le Context */
412 if (TxglWinset (call_thedisplay, win) == TSuccess) {
413 //if (TxglWinset (call_thedisplay, GET_GL_CONTEXT()) == TSuccess) {
414 /* Mettre a jour la sous-fenetre associee */
415 /* Mettre a jour ses attributs */
416 GetClientRect ( win, &cr );
420 TsmSetWSAttri (aview->WsId, WSWidth, &data);
422 TsmSetWSAttri (aview->WsId, WSHeight, &data);
423 TelInitWS (aview->WsId, width, height, bgcolr, bgcolg, bgcolb);
430 /*----------------------------------------------------------------------*/
433 call_subr_antialiasing( CALL_DEF_VIEW * aview, Tint tag )
436 Tint fl = tag ? TOn : TOff;
438 call_func_set_edit_mode( TEditReplace );
439 call_func_open_struct( aview->ViewId );
440 call_func_set_elem_ptr(0);
441 call_func_set_elem_ptr_label(View_LABAliasing);
442 call_func_offset_elem_ptr(1);
444 TsmAddToStructure( TelAntiAliasing, 1, &k );
445 call_func_close_struct();
449 /*----------------------------------------------------------------------*/
452 call_subr_hlhsr( CALL_DEF_VIEW * aview, int tag )
456 data.ldata = (tag ? TOn : TOff);
457 TsmSetWSAttri( aview->WsId, WSZbuffer, &data );
462 /*----------------------------------------------------------------------*/
465 call_subr_depthcueing( CALL_DEF_VIEW * aview, Tint tag )
468 # define CALL_DEF_DEPTH_CUEING_INDEX 1
472 call_func_set_edit_mode(CALL_PHIGS_EDIT_REPLACE);
473 call_func_open_struct(aview->ViewId);
474 call_func_set_elem_ptr(0);
475 call_func_set_elem_ptr_label(View_LABDepthCueing);
476 call_func_offset_elem_ptr(1);
477 call_func_appl_data(0);
478 call_func_close_struct();
482 rep.mode = CALL_PHIGS_ALLOWED;
483 rep.planes[0] = aview->Context.DepthBackPlane;
484 rep.planes[1] = aview->Context.DepthFrontPlane;
486 printf(" $$$ DepthFrontPlane %f DepthBackPlane %f FrontPlaneDistance %f BackPlaneDistance %f\n",aview->Context.DepthFrontPlane,aview->Context.DepthBackPlane,aview->Mapping.FrontPlaneDistance,aview->Mapping.BackPlaneDistance);
490 (aview->Context.DepthFrontPlane -
491 aview->Mapping.BackPlaneDistance) /
493 (aview->Mapping.FrontPlaneDistance -
494 aview->Context.DepthFrontPlane) /
496 (aview->Mapping.FrontPlaneDistance -
497 aview->Mapping.BackPlaneDistance);
501 (aview->Context.DepthBackPlane -
502 aview->Mapping.BackPlaneDistance) /
504 (aview->Mapping.FrontPlaneDistance -
505 aview->Context.DepthBackPlane) /
507 (aview->Mapping.FrontPlaneDistance -
508 aview->Mapping.BackPlaneDistance);
510 if(rep.planes[0] < 0.)
511 rep.planes[0] = ( float )0.0;
512 else if(rep.planes[0] > 1.)
513 rep.planes[0] = ( float )1.0;
514 if(rep.planes[1] < 0.)
515 rep.planes[1] = ( float )0.0;
516 else if(rep.planes[1] > 1.)
517 rep.planes[1] = ( float )1.0;
519 if(rep.planes[1] > rep.planes[0])
521 rep.planes[1] = ( float )0.0;
522 rep.planes[0] = ( float )1.0;
525 if(rep.planes[0] > rep.planes[1])
527 rep.planes[0] = ( float )0.0;
528 rep.planes[1] = ( float )1.0;
533 printf(" plane[0] %f plane[1] %f\n",rep.planes[0],rep.planes[1]);
535 rep.scales[0] = ( float )1.;
536 rep.scales[1] = ( float )0.;
537 rep.col.rgb[0] = aview->DefWindow.Background.r;
538 rep.col.rgb[1] = aview->DefWindow.Background.g;
539 rep.col.rgb[2] = aview->DefWindow.Background.b;
540 TelSetDepthCueRep(aview->WsId, CALL_DEF_DEPTH_CUEING_INDEX, &rep);
542 call_func_set_edit_mode(CALL_PHIGS_EDIT_REPLACE);
543 call_func_open_struct(aview->ViewId);
544 call_func_set_elem_ptr(0);
545 call_func_set_elem_ptr_label(View_LABDepthCueing);
546 call_func_offset_elem_ptr(1);
547 call_func_dcue_ind(CALL_DEF_DEPTH_CUEING_INDEX);
548 call_func_close_struct();
553 /*----------------------------------------------------------------------*/
556 call_subr_get_view_index( Tint stid, Tint *ind )
561 if( TsmGetStructure( stid, &num, &node ) == TSuccess )
563 for( i = 0; i < num; i++ )
565 if( node->elem.el == TelViewIndex )
567 *ind = node->elem.data.ldata;
575 /*----------------------------------------------------------------------*/
578 call_subr_pick( CALL_DEF_PICK *apick )
584 static int *listid, *listelem, *listpickid;
586 TEL_PICK_PATH path_list[CALL_MAX_DEPTH_LENGTH];
593 //cmn_freemem( listid );
595 //cmn_freemem( listelem );
597 //cmn_freemem( listpickid );
599 listid = listelem = listpickid = 0;
602 order = apick->Context.order == 0 ? PTOP_FIRST : PBOTTOM_FIRST;
604 depth = apick->Context.depth < CALL_MAX_DEPTH_LENGTH ?
605 apick->Context.depth : CALL_MAX_DEPTH_LENGTH ;
607 rep.pick_path = path_list;
609 stat = TPick( apick->WsId, apick->x, apick->y, apick->Context.aperture,
610 apick->Context.aperture, order, depth, &rep );
612 if( stat == TSuccess )
614 apick->Pick.depth = rep.depth;
617 printf( "\n\n\tPICK REPORT FOLLOWS" );
618 printf( "\n\t*******************\n" );
619 printf( "\ndepth = %d\torder = %s\n", rep.depth,
620 order == PTOP_FIRST ? "TopFirst" : "BottomFirst" );
623 //cmn_memreserve( listid, rep.depth, 0 );
624 listid = new int[rep.depth];
625 //cmn_memreserve( listelem, rep.depth, 0 );
626 listelem = new int[rep.depth];
627 //cmn_memreserve( listpickid, rep.depth, 0 );
628 listpickid = new int[rep.depth];
629 if( !listid || !listelem || !listpickid )
631 apick->Pick.listid = listid;
632 apick->Pick.listelem = listelem;
633 apick->Pick.listpickid = listpickid;
635 for( i = 0; i < rep.depth; i++ )
637 listelem[i] = path_list[i].el_num;
638 listpickid[i] = path_list[i].pick_id;
639 listid[i] = path_list[i].struct_id;
641 printf( "\n\tSTRUCTURE ID [%d] = %ld", i, listid[i] );
642 printf( "\n\tPICK ID [%d] = %ld", i, listpickid[i] );
643 printf( "\n\tELEMENT ID [%d] = %ld", i, listelem[i] );
655 /*----------------------------------------------------------------------*/
658 call_subr_set_light_src_rep( CALL_DEF_LIGHT * alight )
662 switch( alight->LightType )
664 case 0 : /* TOLS_AMBIENT */
665 rep.type = CALL_PHIGS_LIGHT_AMBIENT;
666 rep.col.rgb[0] = alight->Color.r;
667 rep.col.rgb[1] = alight->Color.g;
668 rep.col.rgb[2] = alight->Color.b;
671 case 1 : /* TOLS_DIRECTIONAL */
672 rep.type = CALL_PHIGS_LIGHT_DIRECTIONAL;
673 rep.col.rgb[0] = alight->Color.r;
674 rep.col.rgb[1] = alight->Color.g;
675 rep.col.rgb[2] = alight->Color.b;
676 rep.dir[0] = alight->Direction.x;
677 rep.dir[1] = alight->Direction.y;
678 rep.dir[2] = alight->Direction.z;
681 case 2 : /* TOLS_POSITIONAL */
682 rep.type = CALL_PHIGS_LIGHT_POSITIONAL;
683 rep.col.rgb[0] = alight->Color.r;
684 rep.col.rgb[1] = alight->Color.g;
685 rep.col.rgb[2] = alight->Color.b;
686 rep.pos[0] = alight->Position.x;
687 rep.pos[1] = alight->Position.y;
688 rep.pos[2] = alight->Position.z;
689 rep.atten[0] = alight->Attenuation[0];
690 rep.atten[1] = alight->Attenuation[1];
693 case 3 : /* TOLS_SPOT */
694 rep.type = CALL_PHIGS_LIGHT_SPOT;
695 rep.col.rgb[0] = alight->Color.r;
696 rep.col.rgb[1] = alight->Color.g;
697 rep.col.rgb[2] = alight->Color.b;
698 rep.pos[0] = alight->Position.x;
699 rep.pos[1] = alight->Position.y;
700 rep.pos[2] = alight->Position.z;
701 rep.dir[0] = alight->Direction.x;
702 rep.dir[1] = alight->Direction.y;
703 rep.dir[2] = alight->Direction.z;
704 rep.shine = alight->Concentration;
705 rep.atten[0] = alight->Attenuation[0];
706 rep.atten[1] = alight->Attenuation[1];
707 rep.angle = alight->Angle;
711 rep.HeadLight = alight->Headlight;
712 AddLight( alight->WsId, alight->LightId, &rep );
717 /*----------------------------------------------------------------------*/
720 call_subr_set_background( Tint ws, tel_colour rgb )
725 /* Mise a jour de l'update_mode */
726 key.ldata = TNotDone;
727 TsmSetWSAttri( ws, WSUpdateState, &key );
729 data.pdata = rgb->rgb;
730 TsmSetWSAttri( ws, WSBackground, &data );
734 /*----------------------------------------------------------------------*/
737 call_subr_set_gradient_background( Tint ws, Tint type, tel_colour color1, tel_colour color2 )
741 TSM_BG_GRADIENT bgGradient;
743 /* Mise a jour de l'update_mode */
744 key.ldata = TNotDone;
745 TsmSetWSAttri( ws, WSUpdateState, &key );
747 bgGradient.type = (TSM_GradientType)type;
748 bgGradient.color1 = *color1;
749 bgGradient.color2 = *color2;
750 data.pdata = &bgGradient;
751 TsmSetWSAttri( ws, WSBgGradient, &data );
756 /*----------------------------------------------------------------------*/
759 call_subr_close_ws( CALL_DEF_VIEW * aview )
763 tsm_bg_texture texture;
765 TsmGetWSAttri( aview->WsId, WSBgTexture, &key );
766 texture = (tsm_bg_texture)key.pdata;
771 if ( texture->texId != 0 )
772 glDeleteTextures( 1,(GLuint *)&(texture->texId) );
775 TsmGetWSAttri( aview->WsId, WSWindow, &key );
777 if( !aview->GContext )
779 TxglDestroyWindow( call_thedisplay, (WINDOW) key.ldata );
781 TglDeleteFiltersForWS( aview->WsId );
782 RemoveWksLight( aview->WsId );
783 call_triedron_erase (aview); /* BGN 09-12-98 */
784 call_graduatedtrihedron_erase( aview->WsId );
785 TelDeleteViewsForWS( aview->WsId );
786 TelDeleteHighlightsForWS( aview->WsId );
787 TelDeleteDepthCuesForWS( aview->WsId );
789 TsmUnregisterWsid( aview->WsId );
793 /*----------------------------------------------------------------------*/
796 call_subr_transparency (int wsid, int viewid, int tag)
801 /* Est-il necessaire de faire de la transparence ? */
802 TsmGetWSAttri( wsid, WSTransparency, &data );
803 if (data.ldata != tag)
805 data.ldata = (tag ? TOn : TOff);
806 TsmSetWSAttri( wsid, WSTransparency, &data );
808 /* Mise a jour de l'update_mode */
809 key.ldata = TNotDone;
810 TsmSetWSAttri( wsid, WSUpdateState, &key );
811 (void) call_togl_erase_animation_mode();
816 /*----------------------------------------------------------------------*/
818 call_subr_displayCB( CALL_DEF_VIEW * aview, int reason )
821 if( aview->GDisplayCB ) {
822 Aspect_GraphicCallbackStruct callData;
826 TsmGetWSAttri (aview->WsId, WSWindow, &data);
827 win = (WINDOW) data.ldata;
829 callData.reason = reason;
830 callData.display = call_thedisplay;
831 callData.window = win;
832 callData.wsID = aview->WsId;
833 callData.viewID = aview->ViewId;
834 callData.gcontext = TxglGetContext(win);
836 status = (*aview->GDisplayCB)
837 ( aview->DefWindow.XWindow, aview->GClientData, &callData );