1 // Created on: 2011-09-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <OpenGl_Trihedron.hxx>
18 #include <OpenGl_GlCore11.hxx>
20 #include <OpenGl_View.hxx>
21 #include <OpenGl_Workspace.hxx>
23 static const OpenGl_TextParam THE_LABEL_PARAMS =
25 16, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM
28 static const CALL_DEF_CONTEXTLINE myDefaultContextLine =
32 { 1.F, 1.F, 1.F }, //Color
33 Aspect_TOL_SOLID, //LineType
37 static const CALL_DEF_CONTEXTTEXT myDefaultContextText =
44 { 1.F, 1.F, 1.F }, //Color
45 Aspect_TOST_NORMAL, //Style
46 Aspect_TODT_NORMAL, //DisplayType
47 { 1.F, 1.F, 1.F }, //ColorSubTitle
50 Font_FA_Regular //TextFontAspect
53 static TEL_COLOUR theXColor = {{ 1.F, 0.F, 0.F, 0.6F }};
54 static TEL_COLOUR theYColor = {{ 0.F, 1.F, 0.F, 0.6F }};
55 static TEL_COLOUR theZColor = {{ 0.F, 0.F, 1.F, 0.6F }};
56 static float theRatio = 0.8f;
57 static float theDiameter = 0.05f;
58 static int theNbFacettes = 12;
60 // =======================================================================
63 // =======================================================================
64 void OpenGl_Trihedron::redraw (const Handle(OpenGl_Workspace)& theWorkspace) const
66 #if !defined(GL_ES_VERSION_2_0)
67 const Standard_Real U = theWorkspace->ActiveView()->Height();
68 const Standard_Real V = theWorkspace->ActiveView()->Width();
70 Handle(OpenGl_Context) aContext = theWorkspace->GetGlContext();
72 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
73 /* de la dimension la plus petite de la window. */
74 const GLdouble L = ( U < V ? U : V ) * myScale;
77 * On inhibe les translations; on conserve les autres transformations.
80 aContext->WorldViewState.Push();
81 aContext->ProjectionState.Push();
83 /* on lit les matrices de transformation et de projection de la vue */
84 /* pour annuler les translations (dernieres colonnes des matrices). */
85 OpenGl_Mat4d aModelMatrix;
86 aModelMatrix.Convert (aContext->WorldViewState.Current());
88 OpenGl_Mat4d aProjMatrix;
90 /* on annule la translation qui peut etre affectee a la vue */
91 aModelMatrix.ChangeValue (0, 3) = 0.0;
92 aModelMatrix.ChangeValue (1, 3) = 0.0;
93 aModelMatrix.ChangeValue (2, 3) = 0.0;
95 aProjMatrix.ChangeValue (0, 0) = 2.0 / U;
96 aProjMatrix.ChangeValue (1, 0) = 0.0;
97 aProjMatrix.ChangeValue (2, 0) = 0.0;
98 aProjMatrix.ChangeValue (3, 0) = 0.0;
100 aProjMatrix.ChangeValue (0, 1) = 0.0;
101 aProjMatrix.ChangeValue (1, 1) = 2.0 / V;
102 aProjMatrix.ChangeValue (2, 1) = 0.0;
103 aProjMatrix.ChangeValue (3, 1) = 0.0;
105 aProjMatrix.ChangeValue (0, 2) = 0.0;
106 aProjMatrix.ChangeValue (1, 2) = 0.0;
107 aProjMatrix.ChangeValue (2, 2) = -2.0 * 1e-7;
108 aProjMatrix.ChangeValue (3, 2) = 0.0;
110 aProjMatrix.ChangeValue (0, 3) = 0.0;
111 aProjMatrix.ChangeValue (1, 3) = 0.0;
112 aProjMatrix.ChangeValue (2, 3) = 0.0;
113 aProjMatrix.ChangeValue (3, 3) = 1.0;
116 * Positionnement de l'origine du triedre selon le choix de l'init
119 /* on fait uniquement une translation de l'origine du Triedre */
123 case Aspect_TOTP_LEFT_LOWER :
125 OpenGl_Utils::Translate (aProjMatrix,
126 -0.5 * U + L, -0.5 * V + L, 0.0);
130 case Aspect_TOTP_LEFT_UPPER :
132 OpenGl_Utils::Translate (aProjMatrix,
133 -0.5 * U + L, 0.5 * V - L - L/3.0, 0.0);
137 case Aspect_TOTP_RIGHT_LOWER :
139 OpenGl_Utils::Translate (aProjMatrix,
140 0.5 * U - L - L/3.0, -0.5 * V + L, 0.0);
144 case Aspect_TOTP_RIGHT_UPPER :
146 OpenGl_Utils::Translate (aProjMatrix,
147 0.5 * U - L - L/3.0, 0.5 * V - L - L/3.0, 0.0);
151 //case Aspect_TOTP_CENTER :
156 aContext->ProjectionState.SetCurrent<Standard_Real> (aProjMatrix);
157 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelMatrix);
158 aContext->ApplyProjectionMatrix();
159 aContext->ApplyWorldViewMatrix();
162 * Creation du triedre
165 /* Fotis Sioutis 2007-11-14 15:06
166 I have also seen in previous posts that the view trihedron in V3d_WIREFRAME mode
167 changes colors depending on the state of the view. This behaviour can be easily
168 corrected by altering call_triedron_redraw function in OpenGl_triedron.c of TKOpengl.
169 The only change needed is to erase glDisable(GL_LIGHTING) that is called before the
170 Axis name drawing and move this function call just before the initial axis drawing.
171 Below is the code portion with the modification.I don't know if this is considered to
172 be a bug but anyway i believe it might help some of you out there.*/
173 glDisable(GL_LIGHTING);
175 /* Position de l'origine */
176 const GLdouble TriedronOrigin[3] = { 0.0, 0.0, 0.0 };
178 /* Position des Axes */
179 GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
180 GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
181 GLdouble TriedronAxeZ[3] = { 0.0, 0.0, 1.0 };
182 TriedronAxeX[0] = L ;
183 TriedronAxeY[1] = L ;
184 TriedronAxeZ[2] = L ;
186 /* dessin des axes */
188 glVertex3dv( TriedronOrigin );
189 glVertex3dv( TriedronAxeX );
191 glVertex3dv( TriedronOrigin );
192 glVertex3dv( TriedronAxeY );
194 glVertex3dv( TriedronOrigin );
195 glVertex3dv( TriedronAxeZ );
198 /* fleches au bout des axes (= cones de la couleur demandee) */
199 const GLdouble l = 0.75*L; /* distance a l'origine */
200 const GLdouble rayon = L/30. ; /* rayon de la base du cone */
201 const int NbFacettes = 12; /* le cone sera compose de 12 facettes triangulaires */
202 const double Angle = 2. * M_PI/ NbFacettes;
205 GLdouble TriedronCoord[3] = { 1.0, 0.0, 0.0 };
207 /* solution FILAIRE des cones au bout des axes : une seule ligne */
208 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
209 /* (la couleur est deja initialisee dans AspectLine) */
210 /* FIN de la solution FILAIRE CHOISIE pour les cones des axes */
213 glBegin(GL_TRIANGLE_FAN);
214 glVertex3dv( TriedronAxeX );
215 TriedronCoord[0] = l;
218 TriedronCoord[1] = rayon * sin(ii * Angle);
219 TriedronCoord[2] = rayon * cos(ii * Angle);
220 glVertex3dv( TriedronCoord );
226 glBegin(GL_TRIANGLE_FAN);
227 glVertex3dv( TriedronAxeY );
228 TriedronCoord[1] = l;
231 TriedronCoord[0] = rayon * cos(ii * Angle);
232 TriedronCoord[2] = rayon * sin(ii * Angle);
233 glVertex3dv( TriedronCoord );
239 glBegin(GL_TRIANGLE_FAN);
240 glVertex3dv( TriedronAxeZ );
241 TriedronCoord[2] = l;
244 TriedronCoord[0] = rayon * sin(ii * Angle);
245 TriedronCoord[1] = rayon * cos(ii * Angle);
246 glVertex3dv( TriedronCoord );
251 /* dessin de l'origine */
252 TriedronCoord[2] = 0.0 ;
254 const double Angle1 = 2. * M_PI/ ii;
255 glBegin(GL_LINE_LOOP);
257 TriedronCoord[0] = rayon * sin(ii * Angle1);
258 TriedronCoord[1] = rayon * cos(ii * Angle1);
259 glVertex3dv( TriedronCoord );
265 myLabelX.SetPosition (OpenGl_Vec3(float(L + rayon), 0.0f, float(-rayon)));
266 myLabelY.SetPosition (OpenGl_Vec3(float(rayon), float(L + 3.0 * rayon), float(2.0 * rayon)));
267 myLabelZ.SetPosition (OpenGl_Vec3(float(-2.0 * rayon), float(0.5 * rayon), float(L + 3.0 * rayon)));
268 myLabelX.Render (theWorkspace);
269 myLabelY.Render (theWorkspace);
270 myLabelZ.Render (theWorkspace);
273 * restauration du contexte des matrices
276 aContext->WorldViewState.Pop();
277 aContext->ProjectionState.Pop();
278 aContext->ApplyProjectionMatrix();
282 // =======================================================================
283 // function : redrawZBuffer
285 // =======================================================================
286 void OpenGl_Trihedron::redrawZBuffer (const Handle(OpenGl_Workspace)& theWorkspace) const
288 Handle(OpenGl_Context) aContext = theWorkspace->GetGlContext();
289 const Handle(OpenGl_View)& aView = theWorkspace->ActiveView();
291 OpenGl_Mat4d aModelMatrix, aProjMatrix;
292 aContext->WorldViewState.Push();
293 aContext->ProjectionState.Push();
294 aModelMatrix.Convert (aContext->WorldViewState.Current());
298 if (aView->Height() < aView->Width())
300 V = aView->Width() / aView->Height();
304 U = aView->Height() / aView->Width();
307 GLdouble aScale = myScale;
309 // Annulate translation matrix
310 aModelMatrix.ChangeValue (0, 3) = 0.0;
311 aModelMatrix.ChangeValue (1, 3) = 0.0;
312 aModelMatrix.ChangeValue (2, 3) = 0.0;
314 aProjMatrix.ChangeValue (0, 0) = 2.0 / U;
315 aProjMatrix.ChangeValue (1, 0) = 0.0;
316 aProjMatrix.ChangeValue (2, 0) = 0.0;
317 aProjMatrix.ChangeValue (3, 0) = 0.0;
319 aProjMatrix.ChangeValue (0, 1) = 0.0;
320 aProjMatrix.ChangeValue (1, 1) = 2.0 / V;
321 aProjMatrix.ChangeValue (2, 1) = 0.0;
322 aProjMatrix.ChangeValue (3, 1) = 0.0;
324 aProjMatrix.ChangeValue (0, 2) = 0.0;
325 aProjMatrix.ChangeValue (1, 2) = 0.0;
326 aProjMatrix.ChangeValue (2, 2) = -2.0 * 1e-2;
327 aProjMatrix.ChangeValue (3, 2) = 0.0;
329 aProjMatrix.ChangeValue (0, 3) = 0.0;
330 aProjMatrix.ChangeValue (1, 3) = 0.0;
331 aProjMatrix.ChangeValue (2, 3) = 0.0;
332 aProjMatrix.ChangeValue (3, 3) = 1.0;
334 // Define position in the view
337 case Aspect_TOTP_LEFT_LOWER:
339 OpenGl_Utils::Translate<Standard_Real> (aProjMatrix,
340 -0.5 * U + aScale, -0.5 * V + aScale, 0.0);
343 case Aspect_TOTP_LEFT_UPPER:
345 OpenGl_Utils::Translate<Standard_Real> (aProjMatrix,
346 -0.5 * U + aScale, 0.5 * V - aScale - aScale / 3.0, 0.0);
349 case Aspect_TOTP_RIGHT_LOWER:
351 OpenGl_Utils::Translate<Standard_Real> (aProjMatrix,
352 0.5 * U - aScale - aScale / 3.0, -0.5 * V + aScale, 0.0);
355 case Aspect_TOTP_RIGHT_UPPER:
357 OpenGl_Utils::Translate<Standard_Real> (aProjMatrix,
358 0.5 * U - aScale - aScale / 3.0, 0.5 * V - aScale - aScale / 3.0, 0.0);
361 //case Aspect_TOTP_CENTER:
367 aContext->ProjectionState.SetCurrent<Standard_Real> (aProjMatrix);
368 aContext->ApplyProjectionMatrix();
370 const OpenGl_AspectLine* anAspectLine = theWorkspace->AspectLine (Standard_True);
371 const TEL_COLOUR& aLineColor = anAspectLine->Color();
373 // Create the trihedron
374 const Standard_Real THE_CYLINDER_LENGTH = 0.75;
375 const GLdouble aCylinderLength = aScale * THE_CYLINDER_LENGTH;
376 const GLdouble aCylinderDiametr = aScale * myDiameter;
377 const GLdouble aConeDiametr = aCylinderDiametr * 2.0;
378 const GLdouble aConeLength = aScale * (1.0 - THE_CYLINDER_LENGTH);
381 GLdouble aTriedronAxeX[3] = { aScale, 0.0, 0.0 };
382 GLdouble aTriedronAxeY[3] = { 0.0, aScale, 0.0 };
383 if (!myDisk.IsDefined())
385 myDisk.Init (static_cast<GLfloat> (aCylinderDiametr),
386 static_cast<GLfloat> (aConeDiametr),
390 if (!mySphere.IsDefined())
392 mySphere.Init (static_cast<GLfloat> (aCylinderDiametr * 2.0), myNbFacettes, myNbFacettes);
395 if (!myCone.IsDefined())
397 myCone.Init (static_cast<GLfloat> (aConeDiametr), 0.0f, static_cast<GLfloat> (aConeLength), myNbFacettes, 1);
400 if (!myCylinder.IsDefined())
402 myCylinder.Init (static_cast<GLfloat> (aCylinderDiametr),
403 static_cast<GLfloat> (aCylinderDiametr),
404 static_cast<GLfloat> (aCylinderLength),
408 GLboolean wasDepthMaskEnabled = GL_FALSE;
409 GLint aDepthFuncBack = 0, aCullFaceModeBack = GL_BACK;
410 const GLboolean wasDepthEnabled = aContext->core11fwd->glIsEnabled (GL_DEPTH_TEST);
411 const GLboolean wasCullFaceEnabled = aContext->core11fwd->glIsEnabled (GL_CULL_FACE);
412 aContext->core11fwd->glGetIntegerv (GL_DEPTH_FUNC, &aDepthFuncBack);
413 aContext->core11fwd->glGetIntegerv (GL_CULL_FACE_MODE, &aCullFaceModeBack);
414 aContext->core11fwd->glGetBooleanv (GL_DEPTH_WRITEMASK, &wasDepthMaskEnabled);
415 if (!wasDepthEnabled)
417 aContext->core11fwd->glEnable (GL_DEPTH_TEST);
418 aContext->core11fwd->glClear (GL_DEPTH_BUFFER_BIT);
420 if (!wasDepthMaskEnabled)
422 aContext->core11fwd->glDepthMask (GL_TRUE);
424 aContext->core11fwd->glCullFace (GL_BACK);
425 if (!wasCullFaceEnabled)
427 aContext->core11fwd->glEnable (GL_CULL_FACE);
430 OpenGl_AspectFace anAspectC;
431 OpenGl_AspectFace anAspectX;
432 OpenGl_AspectFace anAspectY;
433 OpenGl_AspectFace anAspectZ;
434 memcpy (anAspectX.ChangeIntFront().matcol.rgb, myXColor.rgb, sizeof (TEL_COLOUR));
435 memcpy (anAspectY.ChangeIntFront().matcol.rgb, myYColor.rgb, sizeof (TEL_COLOUR));
436 memcpy (anAspectZ.ChangeIntFront().matcol.rgb, myZColor.rgb, sizeof (TEL_COLOUR));
437 memcpy (anAspectC.ChangeIntFront().matcol.rgb, aLineColor.rgb, sizeof (TEL_COLOUR));
438 for (Standard_Integer aPass = 0; aPass < 2; ++aPass)
440 OpenGl_Mat4d aModelViewX (aModelMatrix);
441 OpenGl_Mat4d aModelViewY (aModelMatrix);
442 OpenGl_Mat4d aModelViewZ (aModelMatrix);
443 aContext->core11fwd->glDepthFunc (aPass == 0 ? GL_ALWAYS : GL_LEQUAL);
445 const OpenGl_AspectFace* anOldAspect = theWorkspace->SetAspectFace (&anAspectC);
448 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelMatrix);
449 aContext->ApplyWorldViewMatrix();
450 mySphere.Render (theWorkspace);
453 theWorkspace->SetAspectFace (&anAspectZ);
454 myCylinder.Render (theWorkspace);
455 OpenGl_Utils::Translate (aModelViewZ, 0.0, 0.0, aScale * THE_CYLINDER_LENGTH);
456 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelViewZ);
457 aContext->ApplyWorldViewMatrix();
458 myDisk.Render (theWorkspace);
459 myCone.Render (theWorkspace);
462 theWorkspace->SetAspectFace (&anAspectX);
463 OpenGl_Utils::Rotate (aModelViewX, 90.0, aTriedronAxeY[0], aTriedronAxeY[1], aTriedronAxeY[2]);
464 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelViewX);
465 aContext->ApplyWorldViewMatrix();
466 myCylinder.Render (theWorkspace);
467 OpenGl_Utils::Translate (aModelViewX, 0.0, 0.0, aScale * THE_CYLINDER_LENGTH);
468 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelViewX);
469 aContext->ApplyWorldViewMatrix();
470 myDisk.Render (theWorkspace);
471 myCone.Render (theWorkspace);
474 theWorkspace->SetAspectFace (&anAspectY);
475 OpenGl_Utils::Rotate (aModelViewY, -90.0, aTriedronAxeX[0], aTriedronAxeX[1], aTriedronAxeX[2]);
476 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelViewY);
477 aContext->ApplyWorldViewMatrix();
478 myCylinder.Render (theWorkspace);
479 OpenGl_Utils::Translate (aModelViewY, 0.0, 0.0, aScale * THE_CYLINDER_LENGTH);
480 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelViewY);
481 aContext->ApplyWorldViewMatrix();
482 myDisk.Render (theWorkspace);
483 myCone.Render (theWorkspace);
485 theWorkspace->SetAspectFace (anOldAspect);
488 if (!wasDepthEnabled)
490 aContext->core11fwd->glDisable (GL_DEPTH_TEST);
492 if (!wasDepthMaskEnabled)
494 aContext->core11fwd->glDepthMask (GL_FALSE);
496 if (!wasCullFaceEnabled)
498 aContext->core11fwd->glDisable (GL_CULL_FACE);
500 aContext->core11fwd->glCullFace (aCullFaceModeBack);
502 // Always write the text
503 aContext->core11fwd->glDepthFunc (GL_ALWAYS);
506 const GLdouble rayon = aScale / 30.0;
507 myLabelX.SetPosition (OpenGl_Vec3(float(aScale + 2.0 * rayon), 0.0f, float(-rayon)));
508 myLabelY.SetPosition (OpenGl_Vec3(float(rayon), float(aScale + 3.0 * rayon), float(2.0 * rayon)));
509 myLabelZ.SetPosition (OpenGl_Vec3(float(-2.0 * rayon), float(0.5 * rayon), float(aScale + 3.0 * rayon)));
510 aContext->WorldViewState.SetCurrent<Standard_Real> (aModelMatrix);
511 aContext->ApplyWorldViewMatrix();
512 myLabelX.Render (theWorkspace);
513 myLabelY.Render (theWorkspace);
514 myLabelZ.Render (theWorkspace);
516 aContext->core11fwd->glDepthFunc (aDepthFuncBack);
518 aContext->WorldViewState.Pop();
519 aContext->ProjectionState.Pop();
520 aContext->ApplyProjectionMatrix();
523 // =======================================================================
524 // function : OpenGl_Trihedron
526 // =======================================================================
527 OpenGl_Trihedron::OpenGl_Trihedron (const Aspect_TypeOfTriedronPosition thePosition,
528 const Quantity_NameOfColor theColor,
529 const Standard_Real theScale,
530 const Standard_Boolean theAsWireframe)
531 : myPos (thePosition),
533 myIsWireframe (theAsWireframe),
534 myLabelX ("X", OpenGl_Vec3(1.0f, 0.0f, 0.0f), THE_LABEL_PARAMS),
535 myLabelY ("Y", OpenGl_Vec3(0.0f, 1.0f, 0.0f), THE_LABEL_PARAMS),
536 myLabelZ ("Z", OpenGl_Vec3(0.0f, 0.0f, 1.0f), THE_LABEL_PARAMS)
539 Quantity_Color aColor (theColor);
540 aColor.Values (R, G, B, Quantity_TOC_RGB);
542 CALL_DEF_CONTEXTLINE aLineAspect = myDefaultContextLine;
543 aLineAspect.Color.r = (float)R;
544 aLineAspect.Color.g = (float)G;
545 aLineAspect.Color.b = (float)B;
546 myAspectLine.SetAspect (aLineAspect);
548 CALL_DEF_CONTEXTTEXT aTextAspect = myDefaultContextText;
549 aTextAspect.Color.r = (float)R;
550 aTextAspect.Color.g = (float)G;
551 aTextAspect.Color.b = (float)B;
552 myAspectText.SetAspect (aTextAspect);
554 myXColor = theXColor;
555 myYColor = theYColor;
556 myZColor = theZColor;
559 myDiameter = theDiameter;
560 myNbFacettes = theNbFacettes;
563 // =======================================================================
564 // function : ~OpenGl_Trihedron
566 // =======================================================================
567 OpenGl_Trihedron::~OpenGl_Trihedron()
571 // =======================================================================
572 // function : Release
574 // =======================================================================
575 void OpenGl_Trihedron::Release (OpenGl_Context* theCtx)
577 myLabelX.Release (theCtx);
578 myLabelY.Release (theCtx);
579 myLabelZ.Release (theCtx);
580 myAspectLine.Release (theCtx);
581 myAspectText.Release (theCtx);
582 myCone .Release (theCtx);
583 myDisk .Release (theCtx);
584 mySphere .Release (theCtx);
585 myCylinder.Release (theCtx);
588 // =======================================================================
591 // =======================================================================
592 void OpenGl_Trihedron::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
594 const OpenGl_AspectLine* aPrevAspectLine = theWorkspace->SetAspectLine (&myAspectLine);
595 const OpenGl_AspectText* aPrevAspectText = theWorkspace->SetAspectText (&myAspectText);
597 /* check if GL_LIGHTING should be disabled
598 no enabling 'cause it will be done (if necessary: kinda Polygon types )
599 during redrawing structures
601 if (!theWorkspace->UseGLLight())
603 #if !defined(GL_ES_VERSION_2_0)
604 glDisable (GL_LIGHTING);
608 const Handle(OpenGl_Texture) aPrevTexture = theWorkspace->DisableTexture();
609 theWorkspace->ActiveView()->EndTransformPersistence (theWorkspace->GetGlContext());
610 theWorkspace->GetGlContext()->ApplyModelViewMatrix();
614 redraw (theWorkspace);
618 redrawZBuffer (theWorkspace);
622 if (!aPrevTexture.IsNull())
624 theWorkspace->EnableTexture (aPrevTexture);
627 theWorkspace->SetAspectText (aPrevAspectText);
628 theWorkspace->SetAspectLine (aPrevAspectLine);
631 /*----------------------------------------------------------------------*/
632 //call_ztriedron_setup
633 void OpenGl_Trihedron::Setup (const Quantity_NameOfColor XColor, const Quantity_NameOfColor YColor, const Quantity_NameOfColor ZColor,
634 const Standard_Real SizeRatio, const Standard_Real AxisDiametr, const Standard_Integer NbFacettes)
638 Quantity_Color(XColor).Values(R, G, B, Quantity_TOC_RGB);
639 theXColor.rgb[0] = float (R);
640 theXColor.rgb[1] = float (G);
641 theXColor.rgb[2] = float (B);
643 Quantity_Color(YColor).Values(R, G, B, Quantity_TOC_RGB);
644 theYColor.rgb[0] = float (R);
645 theYColor.rgb[1] = float (G);
646 theYColor.rgb[2] = float (B);
648 Quantity_Color(ZColor).Values(R, G, B, Quantity_TOC_RGB);
649 theZColor.rgb[0] = float (R);
650 theZColor.rgb[1] = float (G);
651 theZColor.rgb[2] = float (B);
653 theRatio = float (SizeRatio);
654 theDiameter = float (AxisDiametr);
655 theNbFacettes = NbFacettes;