1 /***********************************************************************
5 File OpenGl_togl_begin_animation :
11 HISTORIQUE DES MODIFICATIONS :
12 --------------------------------
13 05-01-98 : CAL ; Creation.
14 21-01-98 : FMN ; Ajout call_togl_end_animation().
15 17-03-98 : FMN ; Ajout mode animation
16 08-07-98 : FMN ; Changement du nom de la primitive call_togl_erase_immediat_mode()
17 -> call_togl_erase_animation_mode.
18 24-08-98 : BGN ; Correction de diag de compilation sur NT :
19 Suppression de l'include OpenGl_animation.h qui
20 provoque des doubles declarations.
22 ************************************************************************/
24 #define G003 /* EUG 07-10-99 Animation management
27 #define BUC60876 /* GG 5/4/2001 Disable local display list
28 // when animation is not required
31 /*----------------------------------------------------------------------*/
36 #include <OpenGl_tgl_all.hxx>
38 #include <InterfaceGraphic_Labels.hxx>
39 #include <InterfaceGraphic_Graphic3d.hxx>
40 #include <InterfaceGraphic_Visual3d.hxx>
42 /* 24-08-98 : BGN ; include <OpenGl_animation.h> */
46 # include <OpenGl_tsm_ws.hxx>
47 void EXPORT call_togl_erase_animation_mode ( void );
50 /*----------------------------------------------------------------------*/
58 /*----------------------------------------------------------------------*/
63 /* Indique si la display-list a ete cree */
64 static GLboolean listIndexCreate = GL_FALSE;
66 /*----------------------------------------------------------------------*/
71 /* La display-list utilisee pour le mode animation */
74 /* La vue de reference pour le mode animation */
75 int listIndexView = -1;
77 /* Flag si la display-list a ete initialise*/
78 GLboolean listIndexFlag = GL_FALSE;
80 /* Flag mode animation en cours */
81 GLboolean animationFlag = GL_FALSE;
83 /* Flag si le mode animation est disponible
84 * (cf. var environnement CALL_ANIMATION) */
86 GLboolean animationUseFlag = GL_TRUE;
87 GLboolean g_fAnimation;
88 GLboolean g_fUpdateAM;
89 GLboolean g_fDegeneration;
92 GLboolean animationUseFlag = GL_FALSE;
95 /*----------------------------------------------------------------------*/
98 call_togl_begin_animation
100 CALL_DEF_VIEW * aview
104 g_fAnimation = GL_TRUE;
106 g_fDegeneration = aview -> IsDegenerates;
107 g_fUpdateAM = ( aview -> IsDegenerates ==
108 aview -> IsDegeneratesPrev
109 ) ? GL_FALSE : GL_TRUE;
110 aview -> IsDegeneratesPrev = aview -> IsDegenerates;
113 if (animationUseFlag)
115 if (!listIndexCreate)
117 listIndex = glGenLists(1);
118 listIndexCreate = GL_TRUE;
122 animationFlag = GL_FALSE;
124 animationFlag = GL_TRUE;
127 printf("call_togl_begin_animation(%d) animationFlag: %d\n", aview->WsId, animationFlag);
129 return (animationFlag);
132 /*----------------------------------------------------------------------*/
135 call_togl_end_animation
137 CALL_DEF_VIEW * aview
144 if( !g_fAnimation ) return;
146 if( !animationFlag ) return;
149 data.ldata = TNotDone;
150 TsmSetWSAttri ( aview -> WsId, WSUpdateState, &data );
151 g_fAnimation = GL_FALSE;
153 g_fUpdateAM = GL_TRUE;
155 g_fDegeneration = GL_FALSE;
159 printf("call_togl_end_animation(%d) \n", aview->WsId);
161 animationFlag = GL_FALSE;
165 /*----------------------------------------------------------------------*/
167 * Permet de terminer effectivement le mode Animation.
168 * Ceci est realise des qu'une structure a ete modifiee.
171 void EXPORT call_togl_erase_animation_mode(void)
174 printf("call_togl_erase_animation_mode \n");
177 listIndexFlag = GL_FALSE;
178 animationFlag = GL_FALSE;
180 g_fAnimation = GL_FALSE;
181 g_fUpdateAM = GL_FALSE;
182 g_fDegeneration = GL_FALSE;
187 /*----------------------------------------------------------------------*/