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 };
303 #ifdef QTOCC_PATCH /* PCD 10/02/08 */
304 /* Fix to problem with clipping planes chopping off pieces of the triedron */
306 GLboolean* isPlaneActive;
307 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
308 isPlaneActive= new GLboolean[max_plane];
309 /* Backup the clip planes. */
310 for (ii = 0; ii < max_plane ; ii++) {
311 isPlaneActive[ii] = glIsEnabled(GL_CLIP_PLANE0 + ii);
312 glDisable(GL_CLIP_PLANE0 + ii);
317 * Lecture des Init. du Triedre
320 TriedronColor[0] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[0];
321 TriedronColor[1] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[1];
322 TriedronColor[2] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[2];
323 TriedronScale = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aScale;
324 TriedronPosition = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aPos;
328 * Calcul des axes => on inhibe le zoom.
331 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
332 /* de la dimension la plus petite de la window. */
333 if ( U < V ) minUV = U;
335 L = minUV * (double) TriedronScale ;
337 /* Position de l'origine */
338 TriedronOrigin[0]= 0.0;
339 TriedronOrigin[1]= 0.0;
340 TriedronOrigin[2]= 0.0;
342 /* Position des Axes */
343 TriedronAxeX[0] = TriedronOrigin[0] + L ;
344 TriedronAxeX[1] = TriedronOrigin[1] + 0.0;
345 TriedronAxeX[2] = TriedronOrigin[2] + 0.0;
347 TriedronAxeY[0] = TriedronOrigin[0] + 0.0;
348 TriedronAxeY[1] = TriedronOrigin[1] + L ;
349 TriedronAxeY[2] = TriedronOrigin[2] + 0.0;
351 TriedronAxeZ[0] = TriedronOrigin[0] + 0.0;
352 TriedronAxeZ[1] = TriedronOrigin[1] + 0.0;
353 TriedronAxeZ[2] = TriedronOrigin[2] + L ;
356 * On inhibe les translations; on conserve les autres transformations.
359 /* on lit les matrices de transformation et de projection de la vue */
360 /* pour annuler les translations (dernieres colonnes des matrices). */
361 glGetDoublev( GL_MODELVIEW_MATRIX, (GLdouble *) modelMatrix );
362 glGetDoublev( GL_PROJECTION_MATRIX, (GLdouble *) projMatrix );
365 printf ("\n--- call_triedron_redraw : avant transfo projMatrix= ");
366 for (ii = 0; ii<4 ; ii++) {
368 for (jj = 0; jj<4 ; jj++) {
369 printf (" %f ", projMatrix[ii][jj] );
372 printf ("\n--- call_triedron_redraw : avant transfo modelMatrix= ");
373 for (ii = 0; ii<4 ; ii++) {
375 for (jj = 0; jj<4 ; jj++) {
376 printf (" %f ", modelMatrix[ii][jj] );
382 /* on annule la translation qui peut etre affectee a la vue */
383 modelMatrix[3][0] = 0. ;
384 modelMatrix[3][1] = 0. ;
385 modelMatrix[3][2] = 0. ;
386 projMatrix[3][0] = 0. ;
387 projMatrix[3][1] = 0. ;
388 projMatrix[3][2] = 0. ;
391 /* sauvegarde du contexte des matrices avant chargement */
392 glMatrixMode (GL_MODELVIEW);
395 glLoadMatrixd( (GLdouble *) modelMatrix);
396 glMatrixMode ( GL_PROJECTION );
399 glLoadMatrixd( (GLdouble *) projMatrix);
403 printf ("\n\n\n--- call_triedron_redraw : APRES transfo projMatrix= ");
404 for (ii = 0; ii<4 ; ii++) {
406 for (jj = 0; jj<4 ; jj++) {
407 printf (" %f ", projMatrix[ii][jj] );
410 printf ("\n--- call_triedron_redraw : APRES transfo modelMatrix= ");
411 for (ii = 0; ii<4 ; ii++) {
413 for (jj = 0; jj<4 ; jj++) {
414 printf (" %f ", modelMatrix[ii][jj] );
421 * Positionnement de l'origine du triedre selon le choix de l'init
424 /* on fait uniquement une translation de l'origine du Triedre */
426 switch (TriedronPosition) {
428 case 0 : /* Aspect_TOTP_CENTER */
431 case 1 : /* Aspect_TOTP_LEFT_LOWER */
432 glTranslated( -U/2. + L , -V/2. + L , 0. );
435 case 2 : /*Aspect_TOTP_LEFT_UPPER */
436 glTranslated( -U/2. + L , +V/2. - L -L/3. , 0. );
439 case 3 : /* Aspect_TOTP_RIGHT_LOWER */
440 glTranslated( U/2. - L -L/3. , -V/2. + L , 0. );
443 case 4 : /* Aspect_TOTP_RIGHT_UPPER */
444 glTranslated( U/2. - L -L/3. , +V/2. - L -L/3. , 0. );
453 printf ("\n--- call_triedron_redraw : TriedronOrigin= %f %f %f\n",
454 TriedronOrigin[0], TriedronOrigin[1], TriedronOrigin[2]);
455 printf ("\n--- : TriedronAxeX= %f %f %f \n",
456 TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
457 printf ("\n--- : TriedronAxeY= %f %f %f \n",
458 TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2] );
459 printf ("\n--- : TriedronAxeZ= %f %f %f \n",
460 TriedronAxeZ[0], TriedronAxeZ[1], TriedronAxeZ[2]);
461 printf ("\n--- : TriedronScale= %f \n",TriedronScale);
462 printf ("\n--- : 1/echelle = ( %f %f %f %f ) \n",
463 modelMatrix[0][0],modelMatrix[1][1],modelMatrix[2][2],modelMatrix[3][3]);
468 * Creation du triedre
470 glColor3fv (TriedronColor);
472 glGetIntegerv( GL_RENDER_MODE, &mode );
475 if( mode==GL_RENDER )
476 glLineWidth( TriedronWidth );
477 else if( mode==GL_FEEDBACK )
478 gl2psLineWidth( TriedronWidth );
480 glLineWidth( TriedronWidth );
483 #ifdef QTOCC_PATCH /* Fotis Sioutis 2007-11-14 15:06
484 I have also seen in previous posts that the view trihedron in V3d_WIREFRAME mode
485 changes colors depending on the state of the view. This behaviour can be easily
486 corrected by altering call_triedron_redraw function in OpenGl_triedron.c of TKOpengl.
487 The only change needed is to erase the LightOff() function that is called before the
488 Axis name drawing and move this function call just before the initial axis drawing.
489 Below is the code portion with the modification.I don't know if this is considered to
490 be a bug but anyway i believe it might help some of you out there.*/
494 /* dessin des axes */
496 glVertex3dv( TriedronOrigin );
497 glVertex3dv( TriedronAxeX );
499 glVertex3dv( TriedronOrigin );
500 glVertex3dv( TriedronAxeY );
502 glVertex3dv( TriedronOrigin );
503 glVertex3dv( TriedronAxeZ );
507 /* fleches au bout des axes (= cones de la couleur demandee) */
508 l = L - L/4. ; /* distance a l'origine */
509 rayon = L/30. ; /* rayon de la base du cone */
510 NbFacettes = 12; /* le cone sera compose de 12 facettes triangulaires */
511 Angle = 2. * M_PI/ NbFacettes;
513 /* solution FILAIRE des cones au bout des axes : une seule ligne */
514 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
515 /* (la couleur est deja initialisee dans TriedronColor) */
516 /* FIN de la solution FILAIRE CHOISIE pour les cones des axes */
519 glBegin(GL_TRIANGLE_FAN);
520 glVertex3dv( TriedronAxeX );
521 TriedronCoord[0] = TriedronOrigin[0] + l ;
524 TriedronCoord[1] = TriedronOrigin[1] + ( rayon * sin(ii * Angle) );
525 TriedronCoord[2] = TriedronOrigin[2] + ( rayon * cos(ii * Angle) );
526 glVertex3dv( TriedronCoord );
532 glBegin(GL_TRIANGLE_FAN);
533 glVertex3dv( TriedronAxeY );
534 TriedronCoord[1] = TriedronOrigin[1] + l ;
537 TriedronCoord[0] = TriedronOrigin[0] + (rayon * cos(ii * Angle) );
538 TriedronCoord[2] = TriedronOrigin[2] + (rayon * sin(ii * Angle) );
539 glVertex3dv( TriedronCoord );
545 glBegin(GL_TRIANGLE_FAN);
546 glVertex3dv( TriedronAxeZ );
547 TriedronCoord[2] = TriedronOrigin[2] + l ;
550 TriedronCoord[0] = TriedronOrigin[0] + ( rayon * sin(ii * Angle) );
551 TriedronCoord[1] = TriedronOrigin[1] + ( rayon * cos(ii * Angle) );
552 glVertex3dv( TriedronCoord );
557 /* dessin de l'origine */
558 TriedronCoord[0] = TriedronOrigin[0] + rayon ;
559 TriedronCoord[1] = TriedronOrigin[1] + 0.0 ;
560 TriedronCoord[2] = TriedronOrigin[2] + 0.0 ;
562 Angle = 2. * M_PI/ii ;
563 glBegin(GL_LINE_LOOP);
565 TriedronCoord[0] = TriedronOrigin[0] + ( rayon * sin(ii * Angle) );
566 TriedronCoord[1] = TriedronOrigin[1] + ( rayon * cos(ii * Angle) );
567 glVertex3dv( TriedronCoord );
575 * Noms des axes et de l'origine
578 /* init de la fonte */
580 OpenGl_TextRender* textRender=OpenGl_TextRender::instance();
583 TriedronCoord[0] = TriedronOrigin[0] + ( L + rayon ) ;
584 TriedronCoord[1] = TriedronOrigin[1] + 0.0;
585 TriedronCoord[2] = TriedronOrigin[2] - rayon ;
586 textRender->RenderText(L"X", fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2] );
589 TriedronCoord[0] = TriedronOrigin[0] + rayon ;
590 TriedronCoord[1] = TriedronOrigin[1] + ( L + 3.0 * rayon ) ;
591 TriedronCoord[2] = TriedronOrigin[2] + ( 2.0 * rayon );
592 textRender->RenderText(L"Y", fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
595 TriedronCoord[0] = TriedronOrigin[0] + ( - 2.0 * rayon ) ;
596 TriedronCoord[1] = TriedronOrigin[1] + rayon/2. ;
597 TriedronCoord[2] = TriedronOrigin[2] + ( L + 3.0 * rayon ) ;
598 textRender->RenderText(L"Z", fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
600 #ifdef QTOCC_PATCH /* PCD 10/02/08 */
601 /* Recover the clip planes */
602 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
603 for (ii = 0; ii <max_plane ; ii++) {
604 if (isPlaneActive[ii]) {
605 glEnable(GL_CLIP_PLANE0 + ii);
613 * restauration du contexte des matrices
615 glMatrixMode (GL_PROJECTION);
617 glMatrixMode (GL_MODELVIEW);
628 /*******************************************************
629 * Draws ZBUFFER trihedron mode
630 *******************************************************/
631 TStatus call_zbuffer_triedron_redraw (
638 GLdouble modelMatrix[4][4];
639 GLdouble projMatrix[4][4];
641 GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
642 GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
643 GLdouble TriedronAxeZ[3] = { 0.0, 0.0, 1.0 };
644 GLdouble TriedronOrigin[3] = { 0.0, 0.0, 0.0 };
645 GLfloat TriedronColor[3] = { 1.0, 1.0, 1.0 }; /* def = blanc */
647 GLfloat TriedronScale = (float)0.1 ;
648 GLint TriedronPosition = 0; /* def = Aspect_TOTP_CENTER */
650 GLdouble L, l, rayon ;
654 GLdouble TriedronCoord[3] = { 1.0, 0.0, 0.0 };
659 GLUquadricObj* aQuadric;
660 GLfloat aXColor[] = { 1.0, 0.0, 0.0, 0.6f };
661 GLfloat aYColor[] = { 0.0, 1.0, 0.0, 0.6f };
662 GLfloat aZColor[] = { 0.0, 0.0, 1.0, 0.6f };
663 GLdouble aConeDiametr;
664 GLdouble aConeLength;
665 GLdouble aCylinderDiametr;
666 GLdouble aCylinderLength;
667 GLboolean aIsDepthEnabled;
669 GLboolean aIsDepthMaskEnabled;
671 GLint aViewPort[4]; /* to store view port coordinates */
672 GLdouble aWinCoord[3];
673 GLboolean isWithinView;
674 GLdouble aLengthReduce = 0.8;
675 GLdouble aAxisDiametr = 0.05;
679 GLint df; /* PCD 17/06/07 */
680 GLfloat aNULLColor[] = { 0.0, 0.0, 0.0, 0.0f }; /* FS 21/01/08 */
681 /* Fix to problem with clipping planes chopping off pieces of the triedron */
684 GLboolean* isPlaneActive;
685 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
686 isPlaneActive = new GLboolean[max_plane];
687 /* Backup the clip planes. */
688 for (i = 0; i < max_plane ; i++) {
689 isPlaneActive[i] = glIsEnabled(GL_CLIP_PLANE0 + i);
690 glDisable(GL_CLIP_PLANE0 + i);
695 * Lecture des Init. du Triedre
698 TriedronColor[0] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[0];
699 TriedronColor[1] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[1];
700 TriedronColor[2] = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[2];
701 TriedronScale = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aScale;
702 TriedronPosition = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aPos;
704 if (nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam != NULL) {
705 aParam = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam;
706 aXColor[0] = aParam->aXColor[0];
707 aXColor[1] = aParam->aXColor[1];
708 aXColor[2] = aParam->aXColor[2];
710 aYColor[0] = aParam->aYColor[0];
711 aYColor[1] = aParam->aYColor[1];
712 aYColor[2] = aParam->aYColor[2];
714 aZColor[0] = aParam->aZColor[0];
715 aZColor[1] = aParam->aZColor[1];
716 aZColor[2] = aParam->aZColor[2];
718 aLengthReduce = aParam->aRatio;
719 aAxisDiametr = aParam->aDiametr;
720 NbFacettes = aParam->aNbFacettes;
724 * Calcul des axes => on inhibe le zoom.
727 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
728 /* de la dimension la plus petite de la window. */
729 if ( U < V ) minUV = U;
731 L = minUV * (double) TriedronScale ;
733 /* Position de l'origine */
734 TriedronOrigin[0]= 0.0;
735 TriedronOrigin[1]= 0.0;
736 TriedronOrigin[2]= 0.0;
738 /* Position des Axes */
739 TriedronAxeX[0] = TriedronOrigin[0] + L ;
740 TriedronAxeX[1] = TriedronOrigin[1] + 0.0;
741 TriedronAxeX[2] = TriedronOrigin[2] + 0.0;
743 TriedronAxeY[0] = TriedronOrigin[0] + 0.0;
744 TriedronAxeY[1] = TriedronOrigin[1] + L ;
745 TriedronAxeY[2] = TriedronOrigin[2] + 0.0;
747 TriedronAxeZ[0] = TriedronOrigin[0] + 0.0;
748 TriedronAxeZ[1] = TriedronOrigin[1] + 0.0;
749 TriedronAxeZ[2] = TriedronOrigin[2] + L ;
751 /* Check position in the ViewPort */
752 glGetDoublev( GL_MODELVIEW_MATRIX, (GLdouble *) modelMatrix );
753 glGetDoublev( GL_PROJECTION_MATRIX, (GLdouble *) projMatrix );
755 glGetIntegerv(GL_VIEWPORT, aViewPort);
756 gluProject(TriedronOrigin[0], TriedronOrigin[1], TriedronOrigin[2],
757 (GLdouble *)modelMatrix, (GLdouble *)projMatrix, aViewPort,
758 &aWinCoord[0], &aWinCoord[1], &aWinCoord[2]);
760 #ifdef QTOCC_PATCH /* PCD 29/09/2008 */
761 /* Simple code modification recommended by Fotis Sioutis and Peter Dolbey */
762 /* to remove the irritating default behaviour of triedrons using V3d_ZBUFFER */
763 /* which causes the glyph to jump around the screen when the origin moves offscreen. */
764 isWithinView = GL_FALSE;
767 isWithinView = !((aWinCoord[0]<aViewPort[0]) || (aWinCoord[0]>aViewPort[2]) ||
768 (aWinCoord[1]<aViewPort[1]) || (aWinCoord[1]>aViewPort[3]));
772 /* Annulate translation matrix */
773 modelMatrix[3][0] = 0. ;
774 modelMatrix[3][1] = 0. ;
775 modelMatrix[3][2] = 0. ;
776 projMatrix[3][0] = 0. ;
777 projMatrix[3][1] = 0. ;
778 projMatrix[3][2] = 0. ;
781 glMatrixMode (GL_MODELVIEW);
784 glLoadMatrixd( (GLdouble *) modelMatrix);
785 glMatrixMode ( GL_PROJECTION );
788 glLoadMatrixd( (GLdouble *) projMatrix);
792 * Define position in the view
794 switch (TriedronPosition) {
795 case 0 : /* Aspect_TOTP_CENTER */
798 case 1 : /* Aspect_TOTP_LEFT_LOWER */
799 glTranslated( -U/2. + L , -V/2. + L , 0. );
802 case 2 : /* Aspect_TOTP_LEFT_UPPER */
803 glTranslated( -U/2. + L , +V/2. - L -L/3. , 0. );
806 case 3 : /* Aspect_TOTP_RIGHT_LOWER */
807 glTranslated( U/2. - L -L/3. , -V/2. + L , 0. );
810 case 4 : /* Aspect_TOTP_RIGHT_UPPER */
811 glTranslated( U/2. - L -L/3. , +V/2. - L -L/3. , 0. );
823 * Creation the trihedron
826 #define COLOR_REDUCE 0.3f
827 #define CYLINDER_LENGTH 0.75f
829 #define ALPHA_REDUCE 0.4f
831 #define ALPHA_REDUCE 1.0f
834 startList = glGenLists(4);
835 aQuadric = gluNewQuadric();
837 aCylinderLength = L * CYLINDER_LENGTH;
838 aCylinderDiametr = L * aAxisDiametr;
839 aConeDiametr = aCylinderDiametr * 2;
840 aConeLength = L * (1 - CYLINDER_LENGTH);
841 /* Correct for owerlapping */
842 /* aCylinderLength += aConeLength - 1.2*aCylinderDiametr*aConeLength/aConeDiametr;*/
844 aIsDepthEnabled = glIsEnabled(GL_DEPTH_TEST);
847 #ifdef QTOCC_PATCH /*PCD 02/07/07 */
848 /* GL_DEPTH_WRITEMASK is not a valid argument to glIsEnabled, the */
849 /* original code is shown to be broken when run under an OpenGL debugger */
850 /* like GLIntercept. This is the correct way to retrieve the mask value. */
851 glGetBooleanv(GL_DEPTH_WRITEMASK, &aIsDepthMaskEnabled);
853 aIsDepthMaskEnabled = glIsEnabled(GL_DEPTH_WRITEMASK);
858 /* Create cylinder for axis */
859 gluQuadricDrawStyle(aQuadric, GLU_FILL); /* smooth shaded */
860 gluQuadricNormals(aQuadric, GLU_FLAT);
862 glNewList(startList, GL_COMPILE);
863 gluCylinder(aQuadric, aCylinderDiametr, aCylinderDiametr, aCylinderLength, NbFacettes, 1);
866 glNewList(startList + 1, GL_COMPILE);
867 gluCylinder(aQuadric, aConeDiametr, 0, aConeLength, NbFacettes, 1);
870 glNewList(startList + 2, GL_COMPILE);
872 gluSphere(aQuadric, aCylinderDiametr * 2, NbFacettes, NbFacettes);
874 gluSphere(aQuadric, aCylinderDiametr, NbFacettes, NbFacettes);
878 gluQuadricOrientation(aQuadric,GLU_INSIDE); /*szv*/
879 glNewList(startList + 3, GL_COMPILE);
880 gluDisk(aQuadric, aCylinderDiametr, aConeDiametr, NbFacettes, 1/*szv:2*/);
884 /* Store previous attributes */
885 glPushAttrib(GL_LIGHTING_BIT | GL_POLYGON_BIT);
890 /* Store previous attributes */
891 glPushAttrib(GL_LIGHTING_BIT | GL_POLYGON_BIT);
895 glEnable(GL_CULL_FACE);
897 #ifdef QTOCC_PATCH /*Fotis Sioutis | 2008-01-21 10:55
898 In the function call_zbuffer_triedron_redraw of TKOpengl,
899 the z buffered trihedron changes colors in case there
900 is an object in the scene that has an explicit material
901 attached to it.In the trihedron display loop,
902 GL_COLOR_MATERIAL is enabled, but only the GL_DIFFUSE
903 parameter is utilized in glColorMaterial(...).
904 This causes the last ambient,specular and emission values
905 used, to stay at the stack and applied to the trihedron
906 (which causes the color change).
907 A fix is proposed , to change GL_DIFFUSE to
908 GL_AMBIENT_AND_DIFFUSE in glColorMaterial call in
909 line 946.The above of course will leave unchanged
910 the SPECULAR and EMISSION values.
911 Another proposal which would fix 100% the problem
912 is to use glMaterial instead of glColor on the trihedron
914 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, aNULLColor);
915 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, aNULLColor);
916 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, aNULLColor);
918 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.);
921 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
922 glEnable(GL_COLOR_MATERIAL);
924 if (!aIsDepthEnabled) {
925 glEnable(GL_DEPTH_TEST);
927 glClear(GL_DEPTH_BUFFER_BIT);
931 if (!(aIsDepthEnabled && isWithinView))
932 glClear(GL_DEPTH_BUFFER_BIT);
935 if (!aIsDepthMaskEnabled) {
936 /* This is how the depthmask needs to be re-enabled...*/
937 glDepthMask(GL_TRUE);
938 /* ...and not this stuff below */
942 glMatrixMode(GL_MODELVIEW);
943 #ifdef QTOCC_PATCH /* PCD 17/06/07 */
944 glGetIntegerv (GL_DEPTH_FUNC, &df);
946 /*szv:if (isWithinView) {*/
947 glDepthFunc(GL_GREATER);
952 glColor4f(TriedronColor[0]*COLOR_REDUCE,
953 TriedronColor[1]*COLOR_REDUCE,
954 TriedronColor[2]*COLOR_REDUCE,
956 glCallList(startList+2);
959 glColor4f(aZColor[0]*COLOR_REDUCE,
960 aZColor[1]*COLOR_REDUCE,
961 aZColor[2]*COLOR_REDUCE,
963 glCallList(startList);
964 glTranslated(0, 0, L * CYLINDER_LENGTH);
965 glCallList(startList + 3);
966 glCallList(startList + 1);
970 glRotated(90.0, TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2]);
971 glColor4f(aXColor[0]*COLOR_REDUCE,
972 aXColor[1]*COLOR_REDUCE,
973 aXColor[2]*COLOR_REDUCE,
975 glCallList(startList);
976 glTranslated(0, 0, L * CYLINDER_LENGTH);
977 glCallList(startList + 3);
978 glCallList(startList + 1);
982 glRotated(-90.0, TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
983 glColor4f(aYColor[0]*COLOR_REDUCE,
984 aYColor[1]*COLOR_REDUCE,
985 aYColor[2]*COLOR_REDUCE,
987 glCallList(startList);
988 glTranslated(0, 0, L * CYLINDER_LENGTH);
989 glCallList(startList + 3);
990 glCallList(startList + 1);
993 glDepthFunc(GL_LESS);
998 for (i = 0; i < 2; i++) /* PCD 11/02/08 Two pass method */
1000 if (i == 0) /* First pass */
1002 glDepthFunc(GL_ALWAYS);
1006 glDepthFunc(GL_LEQUAL);
1014 glColor3fv(TriedronColor);
1015 glCallList(startList+2);
1018 glColor4fv(aZColor);
1019 glCallList(startList);
1020 glTranslated(0, 0, L * CYLINDER_LENGTH);
1021 glCallList(startList + 3);
1022 glCallList(startList + 1);
1026 glRotated(90.0, TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2]);
1027 glColor4fv(aXColor);
1028 glCallList(startList);
1029 glTranslated(0, 0, L * CYLINDER_LENGTH);
1030 glCallList(startList + 3);
1031 glCallList(startList + 1);
1035 glRotated(-90.0, TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
1036 glColor4fv(aYColor);
1037 glCallList(startList);
1038 glTranslated(0, 0, L * CYLINDER_LENGTH);
1039 glCallList(startList + 3);
1040 glCallList(startList + 1);
1047 if (!aIsDepthEnabled)
1048 glDisable(GL_DEPTH_TEST);
1050 if (!aIsDepthMaskEnabled)
1052 #ifdef QTOCC_PATCH /*PCD 02/07/07 */
1053 glDepthMask(GL_FALSE);
1055 glDisable(GL_DEPTH_WRITEMASK);
1059 glDisable(GL_CULL_FACE);
1060 glDisable(GL_COLOR_MATERIAL);
1062 gluDeleteQuadric(aQuadric);
1063 glColor3fv (TriedronColor);
1065 #ifdef QTOCC_PATCH /* PCD 11/02/08 */
1066 /* Always write the text */
1067 glDepthFunc(GL_ALWAYS);
1072 /* fleches au bout des axes (= cones de la couleur demandee) */
1073 l = L - L/4. ; /* distance a l'origine */
1074 rayon = L/30. ; /* rayon de la base du cone */
1075 Angle = 2. * M_PI/ NbFacettes;
1077 glDeleteLists(startList, 4);
1087 OpenGl_TextRender* textRender=OpenGl_TextRender::instance();
1090 TriedronCoord[0] = TriedronOrigin[0] + ( L + rayon ) ;
1091 TriedronCoord[1] = TriedronOrigin[1] + 0.0;
1092 TriedronCoord[2] = TriedronOrigin[2] - rayon ;
1093 textRender->RenderText(L"X", fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
1096 TriedronCoord[0] = TriedronOrigin[0] + rayon ;
1097 TriedronCoord[1] = TriedronOrigin[1] + ( L + 3.0 * rayon ) ;
1098 TriedronCoord[2] = TriedronOrigin[2] + ( 2.0 * rayon );
1099 textRender->RenderText(L"Y", fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
1102 TriedronCoord[0] = TriedronOrigin[0] + ( - 2.0 * rayon ) ;
1103 TriedronCoord[1] = TriedronOrigin[1] + rayon/2. ;
1104 TriedronCoord[2] = TriedronOrigin[2] + ( L + 3.0 * rayon ) ;
1105 textRender->RenderText(L"Z", fontBase, 0, (float)TriedronCoord[0], (float)TriedronCoord[1], (float)TriedronCoord[2]);
1112 /* Recover the clip planes */
1113 glGetIntegerv( GL_MAX_CLIP_PLANES, &max_plane);
1114 for (i = 0; i < max_plane ; i++) {
1115 if (isPlaneActive[i]) {
1116 glEnable(GL_CLIP_PLANE0 + i);
1119 free(isPlaneActive);
1122 if (!isWithinView) { /* restore matrix */
1123 glMatrixMode (GL_PROJECTION);
1125 glMatrixMode (GL_MODELVIEW);
1134 /*----------------------------------------------------------------------*/
1136 /*----------------------------------------------------------------------*/
1138 * Fonctions publiques
1143 * initialisation d'un triedre non zoomable dans une vue.
1144 * ou modification des valeurs deja initialisees.
1147 TStatus call_triedron_init (
1148 CALL_DEF_VIEW * aview,
1161 ZBUF_STRUCT* aParam;
1165 printf("\n----------- call_triedron_init r = %f, g = %f, b = %f",
1167 printf(", aScale = %f, aPosition = %d \n", aScale, aPosition );
1170 if (aview->WsId == -1) return(TFailure);
1171 if (aview->ViewId == -1) return(TFailure);
1173 printf(", aview->WsId=%d aview->ViewId=%d \n",aview->WsId,aview->ViewId);
1178 /* recherche du num de la liste de structures non zoomables de la wks */
1179 /* creation sinon */
1180 nz_wks_entry = find_nz_wks(aview->WsId, 1);
1181 if (nz_wks_entry == -1) return TFailure;
1183 /* recherche du Triedre s'il existe; creation sinon */
1184 nz_struc_entry = find_nz_struc(nz_wks_entry, TRIEDRON_ID, 1);
1185 if (nz_struc_entry == -1) return TFailure;
1187 /* mise a jour du Triedre */
1188 nz_wks[nz_wks_entry].triedron_on = 1;
1189 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].NZStrucID = TRIEDRON_ID;
1190 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].astructure = NULL;
1191 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aPos = aPosition;
1192 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[0] = r;
1193 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[1] = g;
1194 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aColor[2] = b;
1195 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aScale = aScale;
1196 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].isWireframe = asWireframe;
1198 nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam = new ZBUF_STRUCT();
1199 if (nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam == NULL) return TFailure;
1201 aParam = nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].aZBufParam;
1202 aParam->aXColor[0] = theXColor[0];
1203 aParam->aXColor[1] = theXColor[1];
1204 aParam->aXColor[2] = theXColor[2];
1206 aParam->aYColor[0] = theYColor[0];
1207 aParam->aYColor[1] = theYColor[1];
1208 aParam->aYColor[2] = theYColor[2];
1210 aParam->aZColor[0] = theZColor[0];
1211 aParam->aZColor[1] = theZColor[1];
1212 aParam->aZColor[2] = theZColor[2];
1214 aParam->aRatio = theRatio;
1215 aParam->aDiametr = theDiametr;
1216 aParam->aNbFacettes = theNBFacettes;
1220 printf("nz_wks_entry=%d nz_struc_entry=%d \n",nz_wks_entry,nz_struc_entry);
1221 printf("ajout ok\n");
1227 /*----------------------------------------------------------------------*/
1230 * affichage d'un triedre non zoomable dans la wks awsid
1232 * Triedre = Objet non Zoomable;
1233 * on cree cette fonction pour pouvoir travailler par les structures
1234 * utilisees par les fonctions Tsm* et TEL_VIEW_REP
1238 TStatus call_triedron_redraw_from_wsid (
1244 TStatus status = TSuccess;
1247 int save_texture_state;
1248 GLdouble U, V ; /* largeur,hauteur de la fenetre */
1253 if ( awsid == -1) return (TFailure );
1256 /* check if GL_LIGHTING should be disabled
1257 no enabling 'cause it will be done (if necessary: kinda Polygon types )
1258 during redrawing structures
1260 TsmGetWSAttri (awsid, WSGLLight, &key );
1261 if ( key.ldata == TOff )
1262 glDisable( GL_LIGHTING );
1265 /* recherche du numero de la liste de structures non zoomables de la wks */
1267 printf("\n----------- call_triedron_redraw_from_WSID : appel find_nz_wks \n");
1269 nz_wks_entry = find_nz_wks(awsid, 0);
1270 /* si on ne l'a pas trouve, il n'y a rien a faire */
1271 if (nz_wks_entry == -1) return (TSuccess);
1273 /* recherche du Triedre */
1275 printf("\n----------- call_triedron_redraw_from_WSID : appel find_nz_struc \n");
1277 nz_struc_entry = find_nz_struc(nz_wks_entry, TRIEDRON_ID, 0);
1278 /* si on ne l'a pas trouve, il n'y a rien a faire */
1279 if (nz_struc_entry == -1) return (TSuccess);
1280 /* si il est "off" il n'y a rien a faire */
1281 if (nz_wks[nz_wks_entry].triedron_on == 0) return (TSuccess);
1284 /* recherche de la dimension de la fenetre */
1285 /* (car la taille des axes du treiedre en sera 1 proportion) */
1286 TsmGetWSAttri (awsid, WSViews, &key );
1287 vptr = (tel_view_data)key.pdata ; /* Obtain defined view data*/
1288 if ( !vptr ) return TFailure; /* no view defined yet */
1289 U = vptr->vrep.extra.map.window.xmax - vptr->vrep.extra.map.window.xmin;
1290 V = vptr->vrep.extra.map.window.ymax - vptr->vrep.extra.map.window.ymin;
1292 /* sauvegarde du contexte (on reste dans le buffer courant) */
1293 save_texture_state = IsTextureEnabled();
1296 /* affichage du Triedre Non Zoomable */
1297 transform_persistence_end();
1298 if (nz_wks[nz_wks_entry].nz_struc[nz_struc_entry].isWireframe)
1299 status = call_triedron_redraw (nz_wks_entry, nz_struc_entry, U, V);
1301 status = call_zbuffer_triedron_redraw (nz_wks_entry, nz_struc_entry, U, V);
1303 /* restauration du contexte */
1304 if (save_texture_state) EnableTexture();
1310 /*----------------------------------------------------------------------*/
1313 * affichage d'un triedre non zoomable dans la vue aview
1315 * Triedre = Objet non Zoomable;
1316 * on cree cette fonction pour pouvoir utiliser CALL_DEF_VIEW
1320 TStatus call_triedron_redraw_from_view (
1321 CALL_DEF_VIEW * aview
1325 TStatus status = TSuccess;
1328 int save_texture_state;
1329 GLdouble U, V ; /* largeur,hauteur de la fenetre */
1333 if (aview->WsId == -1) return (TFailure );
1334 if (aview->ViewId == -1) return (TFailure);
1336 printf("\n call_triedron_redraw_from_VIEW aview->WsId=%d aview->ViewId=%d \n",aview->WsId,aview->ViewId);
1340 /* recherche du numero de la liste de structures non zoomables de la wks */
1342 printf("\n----------- call_triedron_redraw_from_VIEW : appel find_nz_wks \n");
1344 nz_wks_entry = find_nz_wks(aview->WsId, 0);
1345 /* si on ne l'a pas trouve, il n'y a rien a faire */
1346 if (nz_wks_entry == -1) return (TSuccess);
1348 /* recherche du Triedre */
1350 printf("\n----------- call_triedron_redraw_from_VIEW : appel find_nz_struc \n");
1352 nz_struc_entry = find_nz_struc(nz_wks_entry, TRIEDRON_ID, 0);
1353 /* si on ne l'a pas trouve, il n'y a rien a faire */
1354 if (nz_struc_entry == -1) return (TSuccess);
1355 /* si il est "off" il n'y a rien a faire */
1356 if (nz_wks[nz_wks_entry].triedron_on == 0) return (TSuccess);
1359 /* recherche de la dimension de la fenetre */
1360 /* (car la taille des axes du treiedre en sera 1 proportion) */
1361 U = aview->Mapping.WindowLimit.uM - aview->Mapping.WindowLimit.um ;
1362 V = aview->Mapping.WindowLimit.vM - aview->Mapping.WindowLimit.vm ;
1364 /* sauvegarde du contexte et ecriture en front buffer */
1365 save_texture_state = IsTextureEnabled();
1367 glDrawBuffer (GL_FRONT);
1369 /* affichage du Triedre Non Zoomable */
1370 transform_persistence_end();
1371 status = call_triedron_redraw (nz_wks_entry, nz_struc_entry, U, V);
1373 /* necessaire pour WNT */
1376 /* restauration du contexte */
1377 if (save_texture_state) EnableTexture();
1378 glDrawBuffer (GL_BACK);
1384 /*----------------------------------------------------------------------*/
1387 * destruction du triedre non zoomable d'une vue.
1390 TStatus call_triedron_erase (
1391 CALL_DEF_VIEW * aview
1400 printf("\n----------- call_triedron_erase " );
1403 if (aview->WsId == -1) return(TFailure);
1404 if (aview->ViewId == -1) return(TFailure);
1406 printf(", aview->WsId=%d aview->ViewId=%d \n",aview->WsId,aview->ViewId);
1410 /* recherche du num de la liste de structures non zoomables de la wks */
1411 /* si on ne l'a pas trouve, il n'y a rien a faire */
1412 nz_wks_entry = find_nz_wks(aview->WsId, 0);
1413 if (nz_wks_entry == -1) return TSuccess;
1417 * destruction du Triedre puis de toute la wks
1419 /* (aujourd'hui il n'y a pas d'autre structure graphique dans la table */
1420 /* de la wks => on detruit tout ; */
1421 /* si on ajoutait d'autres structures non zoomables, il faudrait */
1422 /* selectionner et detruire uniquement l'element Triedre en cherchant */
1423 /* s'il existe via une variable nz_struc_entry ). */
1424 for (i = 0; i < nz_wks[nz_wks_entry].nz_struc_count; i++) {
1425 if (nz_wks[nz_wks_entry].nz_struc[i].aZBufParam != NULL)
1426 free(nz_wks[nz_wks_entry].nz_struc[i].aZBufParam);
1429 if (nz_wks[nz_wks_entry].nz_struc != NULL) {
1430 free(nz_wks[nz_wks_entry].nz_struc);
1433 if (nz_wks_count == 1) {
1438 else { /* il y a au moins 2 wks definies */
1439 memcpy(&nz_wks[nz_wks_entry],
1440 &nz_wks[nz_wks_entry+1],
1441 (nz_wks_count - nz_wks_entry - 1)*sizeof(NZ_WKS));
1447 printf("nz_wks_entry=%d nz_wks_count=%d nz_wks_size=%d\n",
1448 nz_wks_entry, nz_wks_count, nz_wks_size );
1449 printf("erase ok\n");
1455 /*----------------------------------------------------------------------*/
1459 * gestion d'un echo de designation du triedre non zoomable d' une vue.
1461 TStatus call_triedron_echo (
1462 CALL_DEF_VIEW * aview,
1471 /*----------------------------------------------------------------------*/
1474 * initialisation of zbuffer trihedron
1476 extern TStatus call_ztriedron_setup (
1484 theXColor[0] = xcolor[0];
1485 theXColor[1] = xcolor[1];
1486 theXColor[2] = xcolor[2];
1488 theYColor[0] = ycolor[0];
1489 theYColor[1] = ycolor[1];
1490 theYColor[2] = ycolor[2];
1492 theZColor[0] = zcolor[0];
1493 theZColor[1] = zcolor[1];
1494 theZColor[2] = zcolor[2];
1496 theRatio = sizeratio;
1497 theDiametr = axisdiameter;
1498 theNBFacettes = nbfacettes;