1 /***********************************************************************
5 File OpenGl_triedron : gestion du triedre non zoomable.
11 o dimensions et origine du triedre sont recalcules a chaque fois, en
12 fonction de la taille (u,v = largeur-hauteur) de la fenetre =>
13 il est inutile ici de jouer sur le facteur d'echelle.
14 o on n'inhibe que les translations, car on veut conserver les
15 transformations d'orientations.
18 HISTORIQUE DES MODIFICATIONS :
19 --------------------------------
20 08-12-98 : BGN ; Creation.
23 ************************************************************************/
25 #define BUC60851 /* GG 15/03/01 Avoid to raise after the second creation
29 #define BUC61045 /* 25/10/01 SAV ; added functionality to control gl lighting
33 #define QTOCC_PATCH /* Active QtOPENCASCADE patches */
35 /*----------------------------------------------------------------------*/
40 #include <OpenGl_tgl_all.hxx>
41 #include <OpenGl_tgl_tox.hxx>
47 #include <math.h> /* pour M_PI */
49 #include <OpenGl_LightBox.hxx>
50 #include <OpenGl_TextureBox.hxx>
51 #include <OpenGl_tgl_tox.hxx>
53 #include <OpenGl_tsm_ws.hxx> /* pour TsmGetWSAttri */
54 #include <OpenGl_telem_view.hxx> /* pour tel_view_data */
55 #include <InterfaceGraphic_Graphic3d.hxx> /* pour CALL_DEF_STRUCTURE */
56 #include <InterfaceGraphic_Aspect.hxx> /* pour CALL_DEF_VIEW */
57 #include <InterfaceGraphic_Visual3d.hxx>
59 #include <OpenGl_transform_persistence.hxx>
72 #include <OpenGl_TextRender.hxx>
73 /*----------------------------------------------------------------------*/
80 #define NO_PRINT_MATRIX
83 # define M_PI 3.14159265358979323846
86 /* on trouve que 10 vues sera suffisant */
87 #define GROW_SIZE_NZ_WKS 10
89 /* pour l'instant on ne travaille que sur le triedre */
90 /* on augmentera le define quand on developpera les struc. non zoomables*/
91 #define GROW_SIZE_NZ_STRUC 1
93 /* Identificateur du Triedre Non Zommable dans la liste des structures */
94 # define TRIEDRON_ID -100
96 /*----------------------------------------------------------------------*/
111 /* donnees des structures non zoomables liees a une wks (=une vue) */
114 int NZStrucID; /* = TRIEDRON_ID ou astructure->Id de Graphic3d sinon.*/
119 CALL_DEF_STRUCTURE * astructure;
120 ZBUF_STRUCT* aZBufParam;
125 /* liste des wks (=vues) concernees par les structures non zoomables */
128 int nz_wks; /* = id de la wks */
129 int triedron_on; /* =0 si le triedre non zoomable n'est pas defini */
130 int nz_struc_count; /* nb de structures non zoomables de la vue */
132 NZ_STRUC_DATA *nz_struc;
139 } TEL_VIEW_DATA, *tel_view_data; /* Internal data stored for every view rep */
141 /*----------------------------------------------------------------------*/
143 * Variables statiques
146 static NZ_WKS *nz_wks = NULL;
147 static int nz_wks_count = 0;
148 static int nz_wks_size = 0;
150 /* Default parameters for ZBUFFER triheron */
151 static float theXColor[] = { 1.0, 0.0, 0.0 };
152 static float theYColor[] = { 0.0, 1.0, 0.0 };
153 static float theZColor[] = { 0.0, 0.0, 1.0 };
154 static float theRatio = 0.8f;
155 static float theDiametr = 0.05f;
156 static int theNBFacettes = 12;
158 /*----------------------------------------------------------------------*/
159 /*----------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------*/
168 * recherche de la wks NZWksID concernee par les structures non zoomables;
169 * creation de l'element wks s'il n'existe pas.
171 static int find_nz_wks(int NZWksID, int alloc)
175 /* recherche la wks dans la liste si elle existe */
176 for (i=0; i<nz_wks_count; i++)
177 if (nz_wks[i].nz_wks == NZWksID)
180 if (!alloc) return -1;
182 /* la wks n'existe pas => on fait de la place si il n'y en a plus */
183 if (nz_wks_count == nz_wks_size) {
185 if( nz_wks_size > 0 ) {
186 nz_wks_size += GROW_SIZE_NZ_WKS;
187 nz_wks = (NZ_WKS *) realloc(nz_wks, nz_wks_size * sizeof(NZ_WKS));
189 nz_wks_size = GROW_SIZE_NZ_WKS;
190 nz_wks = (NZ_WKS *) malloc(nz_wks_size * sizeof(NZ_WKS));
193 nz_wks_size += GROW_SIZE_NZ_WKS;
194 nz_wks = (NZ_WKS *) realloc(nz_wks, nz_wks_size * sizeof(NZ_WKS));
196 if (nz_wks == NULL) return -1;
199 nz_wks[nz_wks_count].nz_wks = NZWksID;
200 nz_wks[nz_wks_count].triedron_on = 0;
201 nz_wks[nz_wks_count].nz_struc = NULL;
202 nz_wks[nz_wks_count].nz_struc_size = 0;
203 nz_wks[nz_wks_count].nz_struc_count = 0;
205 return nz_wks_count++;
208 /*-----------------------------------------------------------------*/
210 * recherche de la structure non zoomable NZStrucID dans la liste
211 * de la wks NZWksIdx ;
212 * creation de l'element structure non zoomable s'il n'existe pas.
214 static int find_nz_struc(int NZWksIdx, int NZStrucID, int alloc)
217 NZ_STRUC_DATA *nz_struc;
220 /* recherche la structure non zoomable dans la liste de la wks */
221 nz_struc = nz_wks[NZWksIdx].nz_struc;
222 for (i=0; i<nz_wks[NZWksIdx].nz_struc_count; i++)
223 if (nz_struc[i].NZStrucID == NZStrucID)
226 if (!alloc) return -1;
228 /* la structure non zoomable n'existe pas => on la cree */
229 if (nz_wks[NZWksIdx].nz_struc_count == nz_wks[NZWksIdx].nz_struc_size) {
231 if( nz_wks[NZWksIdx].nz_struc_size > 0 ) {
232 nz_wks[NZWksIdx].nz_struc_size += GROW_SIZE_NZ_STRUC;
233 nz_wks[NZWksIdx].nz_struc =
234 (NZ_STRUC_DATA *) realloc(nz_wks[NZWksIdx].nz_struc,
235 nz_wks[NZWksIdx].nz_struc_size * sizeof(NZ_STRUC_DATA));
237 nz_wks[NZWksIdx].nz_struc_size = GROW_SIZE_NZ_STRUC;
238 nz_wks[NZWksIdx].nz_struc =
239 (NZ_STRUC_DATA *) malloc( nz_wks[NZWksIdx].nz_struc_size * sizeof(NZ_STRUC_DATA));
242 nz_wks[NZWksIdx].nz_struc_size += GROW_SIZE_NZ_STRUC;
243 nz_wks[NZWksIdx].nz_struc = (NZ_STRUC_DATA *) realloc(nz_wks[NZWksIdx].nz_struc, nz_wks[NZWksIdx].nz_struc_size * sizeof(NZ_STRUC_DATA));
245 if (nz_wks[NZWksIdx].nz_struc == NULL) return -1;
247 nz_wks[NZWksIdx].nz_struc[nz_wks[NZWksIdx].nz_struc_count].aZBufParam = NULL;
250 return nz_wks[NZWksIdx].nz_struc_count++;
254 /*----------------------------------------------------------------------*/
257 * affichage d'un triedre non zoomable a partir des index dans les tables
258 * des structures non zoomables.
260 * Triedre = Objet non Zoomable :
261 * on recalcule ses dimensions et son origine en fonction de la taille
262 * de la fenetre; on positionne selon le choix de l'init;
263 * et on inhibe seulement les translations.
270 TStatus call_triedron_redraw (
277 GLdouble modelMatrix[4][4];
278 GLdouble projMatrix[4][4];
280 GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
281 GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
282 GLdouble TriedronAxeZ[3] = { 0.0, 0.0, 1.0 };
283 GLdouble TriedronOrigin[3] = { 0.0, 0.0, 0.0 };
284 GLfloat TriedronColor[3] = { 1.0, 1.0, 1.0 }; /* def = blanc */
286 GLfloat TriedronWidth = 1.0;
287 GLfloat TriedronScale = (float)0.1 ;
288 GLint TriedronPosition = 0; /* def = Aspect_TOTP_CENTER */
290 GLdouble L, l, rayon ;
298 GLdouble TriedronCoord[3] = { 1.0, 0.0, 0.0 };
302 char AxeName[]="X\0";
304 #ifdef QTOCC_PATCH /* PCD 10/02/08 */
305 /* Fix to problem with clipping planes chopping off pieces of the triedron */
307 GLboolean* isPlaneActive;
308 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
309 isPlaneActive= new GLboolean[max_plane];
310 /* Backup the clip planes. */
311 for (ii = 0; ii < max_plane ; ii++) {
312 isPlaneActive[ii] = glIsEnabled(GL_CLIP_PLANE0 + ii);
313 glDisable(GL_CLIP_PLANE0 + ii);
318 * Lecture des Init. du Triedre
321 TriedronColor[0] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[0];
322 TriedronColor[1] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[1];
323 TriedronColor[2] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[2];
324 TriedronScale = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aScale;
325 TriedronPosition = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aPos;
329 * Calcul des axes => on inhibe le zoom.
332 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
333 /* de la dimension la plus petite de la window. */
334 if ( U < V ) minUV = U;
336 L = minUV * (double) TriedronScale ;
338 /* Position de l'origine */
339 TriedronOrigin[0]= 0.0;
340 TriedronOrigin[1]= 0.0;
341 TriedronOrigin[2]= 0.0;
343 /* Position des Axes */
344 TriedronAxeX[0] = TriedronOrigin[0] + L ;
345 TriedronAxeX[1] = TriedronOrigin[1] + 0.0;
346 TriedronAxeX[2] = TriedronOrigin[2] + 0.0;
348 TriedronAxeY[0] = TriedronOrigin[0] + 0.0;
349 TriedronAxeY[1] = TriedronOrigin[1] + L ;
350 TriedronAxeY[2] = TriedronOrigin[2] + 0.0;
352 TriedronAxeZ[0] = TriedronOrigin[0] + 0.0;
353 TriedronAxeZ[1] = TriedronOrigin[1] + 0.0;
354 TriedronAxeZ[2] = TriedronOrigin[2] + L ;
357 * On inhibe les translations; on conserve les autres transformations.
360 /* on lit les matrices de transformation et de projection de la vue */
361 /* pour annuler les translations (dernieres colonnes des matrices). */
362 glGetDoublev( GL_MODELVIEW_MATRIX, (GLdouble *) modelMatrix );
363 glGetDoublev( GL_PROJECTION_MATRIX, (GLdouble *) projMatrix );
366 printf ("\n--- call_triedron_redraw : avant transfo projMatrix= ");
367 for (ii = 0; ii<4 ; ii++) {
369 for (jj = 0; jj<4 ; jj++) {
370 printf (" %f ", projMatrix[ii][jj] );
373 printf ("\n--- call_triedron_redraw : avant transfo modelMatrix= ");
374 for (ii = 0; ii<4 ; ii++) {
376 for (jj = 0; jj<4 ; jj++) {
377 printf (" %f ", modelMatrix[ii][jj] );
383 /* on annule la translation qui peut etre affectee a la vue */
384 modelMatrix[3][0] = 0. ;
385 modelMatrix[3][1] = 0. ;
386 modelMatrix[3][2] = 0. ;
387 projMatrix[3][0] = 0. ;
388 projMatrix[3][1] = 0. ;
389 projMatrix[3][2] = 0. ;
392 /* sauvegarde du contexte des matrices avant chargement */
393 glMatrixMode (GL_MODELVIEW);
396 glLoadMatrixd( (GLdouble *) modelMatrix);
397 glMatrixMode ( GL_PROJECTION );
400 glLoadMatrixd( (GLdouble *) projMatrix);
404 printf ("\n\n\n--- call_triedron_redraw : APRES transfo projMatrix= ");
405 for (ii = 0; ii<4 ; ii++) {
407 for (jj = 0; jj<4 ; jj++) {
408 printf (" %f ", projMatrix[ii][jj] );
411 printf ("\n--- call_triedron_redraw : APRES transfo modelMatrix= ");
412 for (ii = 0; ii<4 ; ii++) {
414 for (jj = 0; jj<4 ; jj++) {
415 printf (" %f ", modelMatrix[ii][jj] );
422 * Positionnement de l'origine du triedre selon le choix de l'init
425 /* on fait uniquement une translation de l'origine du Triedre */
427 switch (TriedronPosition) {
429 case 0 : /* Aspect_TOTP_CENTER */
432 case 1 : /* Aspect_TOTP_LEFT_LOWER */
433 glTranslated( -U/2. + L , -V/2. + L , 0. );
436 case 2 : /*Aspect_TOTP_LEFT_UPPER */
437 glTranslated( -U/2. + L , +V/2. - L -L/3. , 0. );
440 case 3 : /* Aspect_TOTP_RIGHT_LOWER */
441 glTranslated( U/2. - L -L/3. , -V/2. + L , 0. );
444 case 4 : /* Aspect_TOTP_RIGHT_UPPER */
445 glTranslated( U/2. - L -L/3. , +V/2. - L -L/3. , 0. );
454 printf ("\n--- call_triedron_redraw : TriedronOrigin= %f %f %f\n",
455 TriedronOrigin[0], TriedronOrigin[1], TriedronOrigin[2]);
456 printf ("\n--- : TriedronAxeX= %f %f %f \n",
457 TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
458 printf ("\n--- : TriedronAxeY= %f %f %f \n",
459 TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2] );
460 printf ("\n--- : TriedronAxeZ= %f %f %f \n",
461 TriedronAxeZ[0], TriedronAxeZ[1], TriedronAxeZ[2]);
462 printf ("\n--- : TriedronScale= %f \n",TriedronScale);
463 printf ("\n--- : 1/echelle = ( %f %f %f %f ) \n",
464 modelMatrix[0][0],modelMatrix[1][1],modelMatrix[2][2],modelMatrix[3][3]);
469 * Creation du triedre
471 glColor3fv (TriedronColor);
473 glGetIntegerv( GL_RENDER_MODE, &mode );
476 if( mode==GL_RENDER )
477 glLineWidth( TriedronWidth );
478 else if( mode==GL_FEEDBACK )
479 gl2psLineWidth( TriedronWidth );
481 glLineWidth( TriedronWidth );
484 #ifdef QTOCC_PATCH /* Fotis Sioutis 2007-11-14 15:06
485 I have also seen in previous posts that the view trihedron in V3d_WIREFRAME mode
486 changes colors depending on the state of the view. This behaviour can be easily
487 corrected by altering call_triedron_redraw function in OpenGl_triedron.c of TKOpengl.
488 The only change needed is to erase the LightOff() function that is called before the
489 Axis name drawing and move this function call just before the initial axis drawing.
490 Below is the code portion with the modification.I don't know if this is considered to
491 be a bug but anyway i believe it might help some of you out there.*/
495 /* dessin des axes */
497 glVertex3dv( TriedronOrigin );
498 glVertex3dv( TriedronAxeX );
500 glVertex3dv( TriedronOrigin );
501 glVertex3dv( TriedronAxeY );
503 glVertex3dv( TriedronOrigin );
504 glVertex3dv( TriedronAxeZ );
508 /* fleches au bout des axes (= cones de la couleur demandee) */
509 l = L - L/4. ; /* distance a l'origine */
510 rayon = L/30. ; /* rayon de la base du cone */
511 NbFacettes = 12; /* le cone sera compose de 12 facettes triangulaires */
512 Angle = 2. * M_PI/ NbFacettes;
514 /* solution FILAIRE des cones au bout des axes : une seule ligne */
515 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
516 /* (la couleur est deja initialisee dans TriedronColor) */
517 /* FIN de la solution FILAIRE CHOISIE pour les cones des axes */
520 glBegin(GL_TRIANGLE_FAN);
521 glVertex3dv( TriedronAxeX );
522 TriedronCoord[0] = TriedronOrigin[0] + l ;
525 TriedronCoord[1] = TriedronOrigin[1] + ( rayon * sin(ii * Angle) );
526 TriedronCoord[2] = TriedronOrigin[2] + ( rayon * cos(ii * Angle) );
527 glVertex3dv( TriedronCoord );
533 glBegin(GL_TRIANGLE_FAN);
534 glVertex3dv( TriedronAxeY );
535 TriedronCoord[1] = TriedronOrigin[1] + l ;
538 TriedronCoord[0] = TriedronOrigin[0] + (rayon * cos(ii * Angle) );
539 TriedronCoord[2] = TriedronOrigin[2] + (rayon * sin(ii * Angle) );
540 glVertex3dv( TriedronCoord );
546 glBegin(GL_TRIANGLE_FAN);
547 glVertex3dv( TriedronAxeZ );
548 TriedronCoord[2] = TriedronOrigin[2] + l ;
551 TriedronCoord[0] = TriedronOrigin[0] + ( rayon * sin(ii * Angle) );
552 TriedronCoord[1] = TriedronOrigin[1] + ( rayon * cos(ii * Angle) );
553 glVertex3dv( TriedronCoord );
558 /* dessin de l'origine */
559 TriedronCoord[0] = TriedronOrigin[0] + rayon ;
560 TriedronCoord[1] = TriedronOrigin[1] + 0.0 ;
561 TriedronCoord[2] = TriedronOrigin[2] + 0.0 ;
563 Angle = 2. * M_PI/ii ;
564 glBegin(GL_LINE_LOOP);
566 TriedronCoord[0] = TriedronOrigin[0] + ( rayon * sin(ii * Angle) );
567 TriedronCoord[1] = TriedronOrigin[1] + ( rayon * cos(ii * Angle) );
568 glVertex3dv( TriedronCoord );
576 * Noms des axes et de l'origine
579 /* init de la fonte */
581 OpenGl_TextRender* textRender=OpenGl_TextRender::instance();
584 strcpy ( AxeName, "X\0" );
585 TriedronCoord[0] = TriedronOrigin[0] + ( L + rayon ) ;
586 TriedronCoord[1] = TriedronOrigin[1] + 0.0;
587 TriedronCoord[2] = TriedronOrigin[2] - rayon ;
589 textRender->RenderText(AxeName, fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2] );
591 strcpy ( AxeName, "Y\0" );
592 TriedronCoord[0] = TriedronOrigin[0] + rayon ;
593 TriedronCoord[1] = TriedronOrigin[1] + ( L + 3.0 * rayon ) ;
594 TriedronCoord[2] = TriedronOrigin[2] + ( 2.0 * rayon );
595 textRender->RenderText(AxeName, fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
597 strcpy ( AxeName, "Z\0" );
598 TriedronCoord[0] = TriedronOrigin[0] + ( - 2.0 * rayon ) ;
599 TriedronCoord[1] = TriedronOrigin[1] + rayon/2. ;
600 TriedronCoord[2] = TriedronOrigin[2] + ( L + 3.0 * rayon ) ;
602 textRender->RenderText(AxeName, fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
604 #ifdef QTOCC_PATCH /* PCD 10/02/08 */
605 /* Recover the clip planes */
606 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
607 for (ii = 0; ii <max_plane ; ii++) {
608 if (isPlaneActive[ii]) {
609 glEnable(GL_CLIP_PLANE0 + ii);
617 * restauration du contexte des matrices
619 glMatrixMode (GL_PROJECTION);
621 glMatrixMode (GL_MODELVIEW);
632 /*******************************************************
633 * Draws ZBUFFER trihedron mode
634 *******************************************************/
635 TStatus call_zbuffer_triedron_redraw (
642 GLdouble modelMatrix[4][4];
643 GLdouble projMatrix[4][4];
645 GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
646 GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
647 GLdouble TriedronAxeZ[3] = { 0.0, 0.0, 1.0 };
648 GLdouble TriedronOrigin[3] = { 0.0, 0.0, 0.0 };
649 GLfloat TriedronColor[3] = { 1.0, 1.0, 1.0 }; /* def = blanc */
651 GLfloat TriedronScale = (float)0.1 ;
652 GLint TriedronPosition = 0; /* def = Aspect_TOTP_CENTER */
654 GLdouble L, l, rayon ;
658 GLdouble TriedronCoord[3] = { 1.0, 0.0, 0.0 };
661 char AxeName[]="X\0";
664 GLUquadricObj* aQuadric;
665 GLfloat aXColor[] = { 1.0, 0.0, 0.0, 0.6f };
666 GLfloat aYColor[] = { 0.0, 1.0, 0.0, 0.6f };
667 GLfloat aZColor[] = { 0.0, 0.0, 1.0, 0.6f };
668 GLdouble aConeDiametr;
669 GLdouble aConeLength;
670 GLdouble aCylinderDiametr;
671 GLdouble aCylinderLength;
672 GLboolean aIsDepthEnabled;
674 GLboolean aIsDepthMaskEnabled;
676 GLint aViewPort[4]; /* to store view port coordinates */
677 GLdouble aWinCoord[3];
678 GLboolean isWithinView;
679 GLdouble aLengthReduce = 0.8;
680 GLdouble aAxisDiametr = 0.05;
684 GLint df; /* PCD 17/06/07 */
685 GLfloat aNULLColor[] = { 0.0, 0.0, 0.0, 0.0f }; /* FS 21/01/08 */
686 /* Fix to problem with clipping planes chopping off pieces of the triedron */
689 GLboolean* isPlaneActive;
690 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
691 isPlaneActive = new GLboolean[max_plane];
692 /* Backup the clip planes. */
693 for (i = 0; i < max_plane ; i++) {
694 isPlaneActive[i] = glIsEnabled(GL_CLIP_PLANE0 + i);
695 glDisable(GL_CLIP_PLANE0 + i);
700 * Lecture des Init. du Triedre
703 TriedronColor[0] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[0];
704 TriedronColor[1] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[1];
705 TriedronColor[2] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[2];
706 TriedronScale = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aScale;
707 TriedronPosition = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aPos;
709 if (nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam != NULL) {
710 aParam = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam;
711 aXColor[0] = aParam->aXColor[0];
712 aXColor[1] = aParam->aXColor[1];
713 aXColor[2] = aParam->aXColor[2];
715 aYColor[0] = aParam->aYColor[0];
716 aYColor[1] = aParam->aYColor[1];
717 aYColor[2] = aParam->aYColor[2];
719 aZColor[0] = aParam->aZColor[0];
720 aZColor[1] = aParam->aZColor[1];
721 aZColor[2] = aParam->aZColor[2];
723 aLengthReduce = aParam->aRatio;
724 aAxisDiametr = aParam->aDiametr;
725 NbFacettes = aParam->aNbFacettes;
729 * Calcul des axes => on inhibe le zoom.
732 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
733 /* de la dimension la plus petite de la window. */
734 if ( U < V ) minUV = U;
736 L = minUV * (double) TriedronScale ;
738 /* Position de l'origine */
739 TriedronOrigin[0]= 0.0;
740 TriedronOrigin[1]= 0.0;
741 TriedronOrigin[2]= 0.0;
743 /* Position des Axes */
744 TriedronAxeX[0] = TriedronOrigin[0] + L ;
745 TriedronAxeX[1] = TriedronOrigin[1] + 0.0;
746 TriedronAxeX[2] = TriedronOrigin[2] + 0.0;
748 TriedronAxeY[0] = TriedronOrigin[0] + 0.0;
749 TriedronAxeY[1] = TriedronOrigin[1] + L ;
750 TriedronAxeY[2] = TriedronOrigin[2] + 0.0;
752 TriedronAxeZ[0] = TriedronOrigin[0] + 0.0;
753 TriedronAxeZ[1] = TriedronOrigin[1] + 0.0;
754 TriedronAxeZ[2] = TriedronOrigin[2] + L ;
756 /* Check position in the ViewPort */
757 glGetDoublev( GL_MODELVIEW_MATRIX, (GLdouble *) modelMatrix );
758 glGetDoublev( GL_PROJECTION_MATRIX, (GLdouble *) projMatrix );
760 glGetIntegerv(GL_VIEWPORT, aViewPort);
761 gluProject(TriedronOrigin[0], TriedronOrigin[1], TriedronOrigin[2],
762 (GLdouble *)modelMatrix, (GLdouble *)projMatrix, aViewPort,
763 &aWinCoord[0], &aWinCoord[1], &aWinCoord[2]);
765 #ifdef QTOCC_PATCH /* PCD 29/09/2008 */
766 /* Simple code modification recommended by Fotis Sioutis and Peter Dolbey */
767 /* to remove the irritating default behaviour of triedrons using V3d_ZBUFFER */
768 /* which causes the glyph to jump around the screen when the origin moves offscreen. */
769 isWithinView = GL_FALSE;
772 isWithinView = !((aWinCoord[0]<aViewPort[0]) || (aWinCoord[0]>aViewPort[2]) ||
773 (aWinCoord[1]<aViewPort[1]) || (aWinCoord[1]>aViewPort[3]));
777 /* Annulate translation matrix */
778 modelMatrix[3][0] = 0. ;
779 modelMatrix[3][1] = 0. ;
780 modelMatrix[3][2] = 0. ;
781 projMatrix[3][0] = 0. ;
782 projMatrix[3][1] = 0. ;
783 projMatrix[3][2] = 0. ;
786 glMatrixMode (GL_MODELVIEW);
789 glLoadMatrixd( (GLdouble *) modelMatrix);
790 glMatrixMode ( GL_PROJECTION );
793 glLoadMatrixd( (GLdouble *) projMatrix);
797 * Define position in the view
799 switch (TriedronPosition) {
800 case 0 : /* Aspect_TOTP_CENTER */
803 case 1 : /* Aspect_TOTP_LEFT_LOWER */
804 glTranslated( -U/2. + L , -V/2. + L , 0. );
807 case 2 : /* Aspect_TOTP_LEFT_UPPER */
808 glTranslated( -U/2. + L , +V/2. - L -L/3. , 0. );
811 case 3 : /* Aspect_TOTP_RIGHT_LOWER */
812 glTranslated( U/2. - L -L/3. , -V/2. + L , 0. );
815 case 4 : /* Aspect_TOTP_RIGHT_UPPER */
816 glTranslated( U/2. - L -L/3. , +V/2. - L -L/3. , 0. );
828 * Creation the trihedron
831 #define COLOR_REDUCE 0.3f
832 #define CYLINDER_LENGTH 0.75f
834 #define ALPHA_REDUCE 0.4f
836 #define ALPHA_REDUCE 1.0f
839 startList = glGenLists(4);
840 aQuadric = gluNewQuadric();
842 aCylinderLength = L * CYLINDER_LENGTH;
843 aCylinderDiametr = L * aAxisDiametr;
844 aConeDiametr = aCylinderDiametr * 2;
845 aConeLength = L * (1 - CYLINDER_LENGTH);
846 /* Correct for owerlapping */
847 /* aCylinderLength += aConeLength - 1.2*aCylinderDiametr*aConeLength/aConeDiametr;*/
849 aIsDepthEnabled = glIsEnabled(GL_DEPTH_TEST);
852 #ifdef QTOCC_PATCH /*PCD 02/07/07 */
853 /* GL_DEPTH_WRITEMASK is not a valid argument to glIsEnabled, the */
854 /* original code is shown to be broken when run under an OpenGL debugger */
855 /* like GLIntercept. This is the correct way to retrieve the mask value. */
856 glGetBooleanv(GL_DEPTH_WRITEMASK, &aIsDepthMaskEnabled);
858 aIsDepthMaskEnabled = glIsEnabled(GL_DEPTH_WRITEMASK);
863 /* Create cylinder for axis */
864 gluQuadricDrawStyle(aQuadric, GLU_FILL); /* smooth shaded */
865 gluQuadricNormals(aQuadric, GLU_FLAT);
867 glNewList(startList, GL_COMPILE);
868 gluCylinder(aQuadric, aCylinderDiametr, aCylinderDiametr, aCylinderLength, NbFacettes, 1);
871 glNewList(startList + 1, GL_COMPILE);
872 gluCylinder(aQuadric, aConeDiametr, 0, aConeLength, NbFacettes, 1);
875 glNewList(startList + 2, GL_COMPILE);
877 gluSphere(aQuadric, aCylinderDiametr * 2, NbFacettes, NbFacettes);
879 gluSphere(aQuadric, aCylinderDiametr, NbFacettes, NbFacettes);
883 gluQuadricOrientation(aQuadric,GLU_INSIDE); /*szv*/
884 glNewList(startList + 3, GL_COMPILE);
885 gluDisk(aQuadric, aCylinderDiametr, aConeDiametr, NbFacettes, 1/*szv:2*/);
889 /* Store previous attributes */
890 glPushAttrib(GL_LIGHTING_BIT | GL_POLYGON_BIT);
895 /* Store previous attributes */
896 glPushAttrib(GL_LIGHTING_BIT | GL_POLYGON_BIT);
900 glEnable(GL_CULL_FACE);
902 #ifdef QTOCC_PATCH /*Fotis Sioutis | 2008-01-21 10:55
903 In the function call_zbuffer_triedron_redraw of TKOpengl,
904 the z buffered trihedron changes colors in case there
905 is an object in the scene that has an explicit material
906 attached to it.In the trihedron display loop,
907 GL_COLOR_MATERIAL is enabled, but only the GL_DIFFUSE
908 parameter is utilized in glColorMaterial(...).
909 This causes the last ambient,specular and emission values
910 used, to stay at the stack and applied to the trihedron
911 (which causes the color change).
912 A fix is proposed , to change GL_DIFFUSE to
913 GL_AMBIENT_AND_DIFFUSE in glColorMaterial call in
914 line 946.The above of course will leave unchanged
915 the SPECULAR and EMISSION values.
916 Another proposal which would fix 100% the problem
917 is to use glMaterial instead of glColor on the trihedron
919 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, aNULLColor);
920 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, aNULLColor);
921 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, aNULLColor);
923 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.);
926 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
927 glEnable(GL_COLOR_MATERIAL);
929 if (!aIsDepthEnabled) {
930 glEnable(GL_DEPTH_TEST);
932 glClear(GL_DEPTH_BUFFER_BIT);
936 if (!(aIsDepthEnabled && isWithinView))
937 glClear(GL_DEPTH_BUFFER_BIT);
940 if (!aIsDepthMaskEnabled) {
941 /* This is how the depthmask needs to be re-enabled...*/
942 glDepthMask(GL_TRUE);
943 /* ...and not this stuff below */
947 glMatrixMode(GL_MODELVIEW);
948 #ifdef QTOCC_PATCH /* PCD 17/06/07 */
949 glGetIntegerv (GL_DEPTH_FUNC, &df);
951 /*szv:if (isWithinView) {*/
952 glDepthFunc(GL_GREATER);
957 glColor4f(TriedronColor[0]*COLOR_REDUCE,
958 TriedronColor[1]*COLOR_REDUCE,
959 TriedronColor[2]*COLOR_REDUCE,
961 glCallList(startList+2);
964 glColor4f(aZColor[0]*COLOR_REDUCE,
965 aZColor[1]*COLOR_REDUCE,
966 aZColor[2]*COLOR_REDUCE,
968 glCallList(startList);
969 glTranslated(0, 0, L * CYLINDER_LENGTH);
970 glCallList(startList + 3);
971 glCallList(startList + 1);
975 glRotated(90.0, TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2]);
976 glColor4f(aXColor[0]*COLOR_REDUCE,
977 aXColor[1]*COLOR_REDUCE,
978 aXColor[2]*COLOR_REDUCE,
980 glCallList(startList);
981 glTranslated(0, 0, L * CYLINDER_LENGTH);
982 glCallList(startList + 3);
983 glCallList(startList + 1);
987 glRotated(-90.0, TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
988 glColor4f(aYColor[0]*COLOR_REDUCE,
989 aYColor[1]*COLOR_REDUCE,
990 aYColor[2]*COLOR_REDUCE,
992 glCallList(startList);
993 glTranslated(0, 0, L * CYLINDER_LENGTH);
994 glCallList(startList + 3);
995 glCallList(startList + 1);
998 glDepthFunc(GL_LESS);
1003 for (i = 0; i < 2; i++) /* PCD 11/02/08 Two pass method */
1005 if (i == 0) /* First pass */
1007 glDepthFunc(GL_ALWAYS);
1011 glDepthFunc(GL_LEQUAL);
1019 glColor3fv(TriedronColor);
1020 glCallList(startList+2);
1023 glColor4fv(aZColor);
1024 glCallList(startList);
1025 glTranslated(0, 0, L * CYLINDER_LENGTH);
1026 glCallList(startList + 3);
1027 glCallList(startList + 1);
1031 glRotated(90.0, TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2]);
1032 glColor4fv(aXColor);
1033 glCallList(startList);
1034 glTranslated(0, 0, L * CYLINDER_LENGTH);
1035 glCallList(startList + 3);
1036 glCallList(startList + 1);
1040 glRotated(-90.0, TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
1041 glColor4fv(aYColor);
1042 glCallList(startList);
1043 glTranslated(0, 0, L * CYLINDER_LENGTH);
1044 glCallList(startList + 3);
1045 glCallList(startList + 1);
1052 if (!aIsDepthEnabled)
1053 glDisable(GL_DEPTH_TEST);
1055 if (!aIsDepthMaskEnabled)
1057 #ifdef QTOCC_PATCH /*PCD 02/07/07 */
1058 glDepthMask(GL_FALSE);
1060 glDisable(GL_DEPTH_WRITEMASK);
1064 glDisable(GL_CULL_FACE);
1065 glDisable(GL_COLOR_MATERIAL);
1067 gluDeleteQuadric(aQuadric);
1068 glColor3fv (TriedronColor);
1070 #ifdef QTOCC_PATCH /* PCD 11/02/08 */
1071 /* Always write the text */
1072 glDepthFunc(GL_ALWAYS);
1077 /* fleches au bout des axes (= cones de la couleur demandee) */
1078 l = L - L/4. ; /* distance a l'origine */
1079 rayon = L/30. ; /* rayon de la base du cone */
1080 Angle = 2. * M_PI/ NbFacettes;
1082 glDeleteLists(startList, 4);
1092 OpenGl_TextRender* textRender=OpenGl_TextRender::instance();
1095 strcpy ( AxeName, "X\0" );
1096 TriedronCoord[0] = TriedronOrigin[0] + ( L + rayon ) ;
1097 TriedronCoord[1] = TriedronOrigin[1] + 0.0;
1098 TriedronCoord[2] = TriedronOrigin[2] - rayon ;
1100 textRender->RenderText(AxeName, fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
1103 strcpy ( AxeName, "Y\0" );
1104 TriedronCoord[0] = TriedronOrigin[0] + rayon ;
1105 TriedronCoord[1] = TriedronOrigin[1] + ( L + 3.0 * rayon ) ;
1106 TriedronCoord[2] = TriedronOrigin[2] + ( 2.0 * rayon );
1108 textRender->RenderText(AxeName, fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
1111 strcpy ( AxeName, "Z\0" );
1112 TriedronCoord[0] = TriedronOrigin[0] + ( - 2.0 * rayon ) ;
1113 TriedronCoord[1] = TriedronOrigin[1] + rayon/2. ;
1114 TriedronCoord[2] = TriedronOrigin[2] + ( L + 3.0 * rayon ) ;
1115 textRender->RenderText(AxeName, fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
1122 /* Recover the clip planes */
1123 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
1124 for (i = 0; i < max_plane ; i++) {
1125 if (isPlaneActive[i]) {
1126 glEnable(GL_CLIP_PLANE0 + i);
1129 free(isPlaneActive);
1132 if (!isWithinView) { /* restore matrix */
1133 glMatrixMode (GL_PROJECTION);
1135 glMatrixMode (GL_MODELVIEW);
1144 /*----------------------------------------------------------------------*/
1146 /*----------------------------------------------------------------------*/
1148 * Fonctions publiques
1153 * initialisation d'un triedre non zoomable dans une vue.
1154 * ou modification des valeurs deja initialisees.
1157 TStatus call_triedron_init (
1158 CALL_DEF_VIEW * aview,
1171 ZBUF_STRUCT* aParam;
1175 printf("\n----------- call_triedron_init r = %f, g = %f, b = %f",
1177 printf(", aScale = %f, aPosition = %d \n", aScale, aPosition );
1180 if (aview->WsId == -1) return(TFailure);
1181 if (aview->ViewId == -1) return(TFailure);
1183 printf(", aview->WsId=%d aview->ViewId=%d \n",aview->WsId,aview->ViewId);
1188 /* recherche du num de la liste de structures non zoomables de la wks */
1189 /* creation sinon */
1190 nz_wks_entry = find_nz_wks(aview->WsId, 1);
1191 if (nz_wks_entry == -1) return TFailure;
1193 /* recherche du Triedre s'il existe; creation sinon */
1194 nz_struc_entry = find_nz_struc(nz_wks_entry, TRIEDRON_ID, 1);
1195 if (nz_struc_entry == -1) return TFailure;
1197 /* mise a jour du Triedre */
1198 nz_wks[nz_wks_entry].triedron_on = 1;
1199 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].NZStrucID = TRIEDRON_ID;
1200 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].astructure = NULL;
1201 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aPos = aPosition;
1202 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[0] = r;
1203 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[1] = g;
1204 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[2] = b;
1205 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aScale = aScale;
1206 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].isWireframe = asWireframe;
1208 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam = new ZBUF_STRUCT();
1209 if (nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam == NULL) return TFailure;
1211 aParam = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam;
1212 aParam->aXColor[0] = theXColor[0];
1213 aParam->aXColor[1] = theXColor[1];
1214 aParam->aXColor[2] = theXColor[2];
1216 aParam->aYColor[0] = theYColor[0];
1217 aParam->aYColor[1] = theYColor[1];
1218 aParam->aYColor[2] = theYColor[2];
1220 aParam->aZColor[0] = theZColor[0];
1221 aParam->aZColor[1] = theZColor[1];
1222 aParam->aZColor[2] = theZColor[2];
1224 aParam->aRatio = theRatio;
1225 aParam->aDiametr = theDiametr;
1226 aParam->aNbFacettes = theNBFacettes;
1230 printf("nz_wks_entry=%d nz_struc_entry=%d \n",nz_wks_entry,nz_struc_entry);
1231 printf("ajout ok\n");
1237 /*----------------------------------------------------------------------*/
1240 * affichage d'un triedre non zoomable dans la wks awsid
1242 * Triedre = Objet non Zoomable;
1243 * on cree cette fonction pour pouvoir travailler par les structures
1244 * utilisees par les fonctions Tsm* et TEL_VIEW_REP
1248 TStatus call_triedron_redraw_from_wsid (
1254 TStatus status = TSuccess;
1257 int save_texture_state;
1258 GLdouble U, V ; /* largeur,hauteur de la fenetre */
1263 if ( awsid == -1) return (TFailure );
1266 /* check if GL_LIGHTING should be disabled
1267 no enabling 'cause it will be done (if necessary: kinda Polygon types )
1268 during redrawing structures
1270 TsmGetWSAttri (awsid, WSGLLight, &key );
1271 if ( key.ldata == TOff )
1272 glDisable( GL_LIGHTING );
1275 /* recherche du numero de la liste de structures non zoomables de la wks */
1277 printf("\n----------- call_triedron_redraw_from_WSID : appel find_nz_wks \n");
1279 nz_wks_entry = find_nz_wks(awsid, 0);
1280 /* si on ne l'a pas trouve, il n'y a rien a faire */
1281 if (nz_wks_entry == -1) return (TSuccess);
1283 /* recherche du Triedre */
1285 printf("\n----------- call_triedron_redraw_from_WSID : appel find_nz_struc \n");
1287 nz_struc_entry = find_nz_struc(nz_wks_entry, TRIEDRON_ID, 0);
1288 /* si on ne l'a pas trouve, il n'y a rien a faire */
1289 if (nz_struc_entry == -1) return (TSuccess);
1290 /* si il est "off" il n'y a rien a faire */
1291 if (nz_wks[nz_wks_entry].triedron_on == 0) return (TSuccess);
1294 /* recherche de la dimension de la fenetre */
1295 /* (car la taille des axes du treiedre en sera 1 proportion) */
1296 TsmGetWSAttri (awsid, WSViews, &key );
1297 vptr = (tel_view_data)key.pdata ; /* Obtain defined view data*/
1298 if ( !vptr ) return TFailure; /* no view defined yet */
1299 U = vptr->vrep.extra.map.window.xmax - vptr->vrep.extra.map.window.xmin;
1300 V = vptr->vrep.extra.map.window.ymax - vptr->vrep.extra.map.window.ymin;
1302 /* sauvegarde du contexte (on reste dans le buffer courant) */
1303 save_texture_state = IsTextureEnabled();
1306 /* affichage du Triedre Non Zoomable */
1307 transform_persistence_end();
1308 if (nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].isWireframe)
1309 status = call_triedron_redraw (nz_wks_entry, nz_struc_entry, U, V);
1311 status = call_zbuffer_triedron_redraw (nz_wks_entry, nz_struc_entry, U, V);
1313 /* restauration du contexte */
1314 if (save_texture_state) EnableTexture();
1320 /*----------------------------------------------------------------------*/
1323 * affichage d'un triedre non zoomable dans la vue aview
1325 * Triedre = Objet non Zoomable;
1326 * on cree cette fonction pour pouvoir utiliser CALL_DEF_VIEW
1330 TStatus call_triedron_redraw_from_view (
1331 CALL_DEF_VIEW * aview
1335 TStatus status = TSuccess;
1338 int save_texture_state;
1339 GLdouble U, V ; /* largeur,hauteur de la fenetre */
1343 if (aview->WsId == -1) return (TFailure );
1344 if (aview->ViewId == -1) return (TFailure);
1346 printf("\n call_triedron_redraw_from_VIEW aview->WsId=%d aview->ViewId=%d \n",aview->WsId,aview->ViewId);
1350 /* recherche du numero de la liste de structures non zoomables de la wks */
1352 printf("\n----------- call_triedron_redraw_from_VIEW : appel find_nz_wks \n");
1354 nz_wks_entry = find_nz_wks(aview->WsId, 0);
1355 /* si on ne l'a pas trouve, il n'y a rien a faire */
1356 if (nz_wks_entry == -1) return (TSuccess);
1358 /* recherche du Triedre */
1360 printf("\n----------- call_triedron_redraw_from_VIEW : appel find_nz_struc \n");
1362 nz_struc_entry = find_nz_struc(nz_wks_entry, TRIEDRON_ID, 0);
1363 /* si on ne l'a pas trouve, il n'y a rien a faire */
1364 if (nz_struc_entry == -1) return (TSuccess);
1365 /* si il est "off" il n'y a rien a faire */
1366 if (nz_wks[nz_wks_entry].triedron_on == 0) return (TSuccess);
1369 /* recherche de la dimension de la fenetre */
1370 /* (car la taille des axes du treiedre en sera 1 proportion) */
1371 U = aview->Mapping.WindowLimit.uM - aview->Mapping.WindowLimit.um ;
1372 V = aview->Mapping.WindowLimit.vM - aview->Mapping.WindowLimit.vm ;
1374 /* sauvegarde du contexte et ecriture en front buffer */
1375 save_texture_state = IsTextureEnabled();
1377 glDrawBuffer (GL_FRONT);
1379 /* affichage du Triedre Non Zoomable */
1380 transform_persistence_end();
1381 status = call_triedron_redraw (nz_wks_entry, nz_struc_entry, U, V);
1383 /* necessaire pour WNT */
1386 /* restauration du contexte */
1387 if (save_texture_state) EnableTexture();
1388 glDrawBuffer (GL_BACK);
1394 /*----------------------------------------------------------------------*/
1397 * destruction du triedre non zoomable d'une vue.
1400 TStatus call_triedron_erase (
1401 CALL_DEF_VIEW * aview
1410 printf("\n----------- call_triedron_erase " );
1413 if (aview->WsId == -1) return(TFailure);
1414 if (aview->ViewId == -1) return(TFailure);
1416 printf(", aview->WsId=%d aview->ViewId=%d \n",aview->WsId,aview->ViewId);
1420 /* recherche du num de la liste de structures non zoomables de la wks */
1421 /* si on ne l'a pas trouve, il n'y a rien a faire */
1422 nz_wks_entry = find_nz_wks(aview->WsId, 0);
1423 if (nz_wks_entry == -1) return TSuccess;
1427 * destruction du Triedre puis de toute la wks
1429 /* (aujourd'hui il n'y a pas d'autre structure graphique dans la table */
1430 /* de la wks => on detruit tout ; */
1431 /* si on ajoutait d'autres structures non zoomables, il faudrait */
1432 /* selectionner et detruire uniquement l'element Triedre en cherchant */
1433 /* s'il existe via une variable nz_struc_entry ). */
1434 for (i = 0; i < nz_wks[nz_wks_entry].nz_struc_count; i++) {
1435 if (nz_wks[nz_wks_entry].nz_struc[i].aZBufParam != NULL)
1436 free(nz_wks[nz_wks_entry].nz_struc[i].aZBufParam);
1439 if (nz_wks[nz_wks_entry].nz_struc != NULL) {
1440 free(nz_wks[nz_wks_entry].nz_struc);
1443 if (nz_wks_count == 1) {
1448 else { /* il y a au moins 2 wks definies */
1449 memcpy(&nz_wks[nz_wks_entry],
1450 &nz_wks[nz_wks_entry+1],
1451 (nz_wks_count - nz_wks_entry - 1)*sizeof(NZ_WKS));
1457 printf("nz_wks_entry=%d nz_wks_count=%d nz_wks_size=%d\n",
1458 nz_wks_entry, nz_wks_count, nz_wks_size );
1459 printf("erase ok\n");
1465 /*----------------------------------------------------------------------*/
1469 * gestion d'un echo de designation du triedre non zoomable d' une vue.
1471 TStatus call_triedron_echo (
1472 CALL_DEF_VIEW * aview,
1481 /*----------------------------------------------------------------------*/
1484 * initialisation of zbuffer trihedron
1486 extern TStatus call_ztriedron_setup (
1494 theXColor[0] = xcolor[0];
1495 theXColor[1] = xcolor[1];
1496 theXColor[2] = xcolor[2];
1498 theYColor[0] = ycolor[0];
1499 theYColor[1] = ycolor[1];
1500 theYColor[2] = ycolor[2];
1502 theZColor[0] = zcolor[0];
1503 theZColor[1] = zcolor[1];
1504 theZColor[2] = zcolor[2];
1506 theRatio = sizeratio;
1507 theDiametr = axisdiameter;
1508 theNBFacettes = nbfacettes;