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_GlCore11.hxx>
22 #include <InterfaceGraphic_Graphic3d.hxx> /* pour CALL_DEF_STRUCTURE */
23 #include <InterfaceGraphic_Aspect.hxx> /* pour CALL_DEF_VIEW */
24 #include <InterfaceGraphic_Visual3d.hxx>
26 #include <OpenGl_transform_persistence.hxx>
28 #include <OpenGl_Workspace.hxx>
29 #include <OpenGl_View.hxx>
30 #include <OpenGl_Trihedron.hxx>
32 static const OpenGl_TextParam THE_LABEL_PARAMS =
34 16, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM
37 static const CALL_DEF_CONTEXTLINE myDefaultContextLine =
41 { 1.F, 1.F, 1.F }, //Color
42 Aspect_TOL_SOLID, //LineType
46 static const CALL_DEF_CONTEXTTEXT myDefaultContextText =
53 { 1.F, 1.F, 1.F }, //Color
54 Aspect_TOST_NORMAL, //Style
55 Aspect_TODT_NORMAL, //DisplayType
56 { 1.F, 1.F, 1.F }, //ColorSubTitle
59 Font_FA_Regular //TextFontAspect
62 /*----------------------------------------------------------------------*/
67 /* Default parameters for ZBUFFER triheron */
68 static TEL_COLOUR theXColor = {{ 1.F, 0.F, 0.F, 0.6F }};
69 static TEL_COLOUR theYColor = {{ 0.F, 1.F, 0.F, 0.6F }};
70 static TEL_COLOUR theZColor = {{ 0.F, 0.F, 1.F, 0.6F }};
71 static float theRatio = 0.8f;
72 static float theDiameter = 0.05f;
73 static int theNbFacettes = 12;
75 /*----------------------------------------------------------------------*/
78 * affichage d'un triedre non zoomable a partir des index dans les tables
79 * des structures non zoomables.
81 * Triedre = Objet non Zoomable :
82 * on recalcule ses dimensions et son origine en fonction de la taille
83 * de la fenetre; on positionne selon le choix de l'init;
84 * et on inhibe seulement les translations.
88 //call_triedron_redraw
89 void OpenGl_Trihedron::redraw (const Handle(OpenGl_Workspace)& theWorkspace) const
91 const Standard_Real U = theWorkspace->ActiveView()->Height();
92 const Standard_Real V = theWorkspace->ActiveView()->Width();
94 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
95 /* de la dimension la plus petite de la window. */
96 const GLdouble L = ( U < V ? U : V ) * myScale;
99 * On inhibe les translations; on conserve les autres transformations.
102 /* on lit les matrices de transformation et de projection de la vue */
103 /* pour annuler les translations (dernieres colonnes des matrices). */
104 GLdouble modelMatrix[4][4];
105 glGetDoublev( GL_MODELVIEW_MATRIX, (GLdouble *) modelMatrix );
106 GLdouble projMatrix[4][4];
107 glGetDoublev( GL_PROJECTION_MATRIX, (GLdouble *) projMatrix );
109 /* on annule la translation qui peut etre affectee a la vue */
110 modelMatrix[3][0] = 0.;
111 modelMatrix[3][1] = 0.;
112 modelMatrix[3][2] = 0.;
114 projMatrix[0][0] = 2.0 / U;
115 projMatrix[0][1] = 0.0;
116 projMatrix[0][2] = 0.0;
117 projMatrix[0][3] = 0.0;
119 projMatrix[1][0] = 0.0;
120 projMatrix[1][1] = 2.0 / V;
121 projMatrix[1][2] = 0.0;
122 projMatrix[1][3] = 0.0;
124 projMatrix[2][0] = 0.0;
125 projMatrix[2][1] = 0.0;
126 projMatrix[2][2] = -2.0 * 1e-7;
127 projMatrix[2][3] = 0.0;
129 projMatrix[3][0] = 0.0;
130 projMatrix[3][1] = 0.0;
131 projMatrix[3][2] = 0.0;
132 projMatrix[3][3] = 1.0;
134 /* sauvegarde du contexte des matrices avant chargement */
135 glMatrixMode (GL_MODELVIEW);
137 glLoadMatrixd( (GLdouble *) modelMatrix );
138 glMatrixMode ( GL_PROJECTION );
140 glLoadMatrixd( (GLdouble *) projMatrix );
143 * Positionnement de l'origine du triedre selon le choix de l'init
146 /* on fait uniquement une translation de l'origine du Triedre */
150 case Aspect_TOTP_LEFT_LOWER :
151 glTranslated( -0.5*U + L , -0.5*V + L , 0. );
154 case Aspect_TOTP_LEFT_UPPER :
155 glTranslated( -0.5*U + L , +0.5*V - L -L/3., 0. );
158 case Aspect_TOTP_RIGHT_LOWER :
159 glTranslated( 0.5*U - L -L/3. , -0.5*V + L , 0. );
162 case Aspect_TOTP_RIGHT_UPPER :
163 glTranslated( 0.5*U - L -L/3. , +0.5*V - L -L/3. , 0. );
166 //case Aspect_TOTP_CENTER :
172 * Creation du triedre
175 /* Fotis Sioutis 2007-11-14 15:06
176 I have also seen in previous posts that the view trihedron in V3d_WIREFRAME mode
177 changes colors depending on the state of the view. This behaviour can be easily
178 corrected by altering call_triedron_redraw function in OpenGl_triedron.c of TKOpengl.
179 The only change needed is to erase glDisable(GL_LIGHTING) that is called before the
180 Axis name drawing and move this function call just before the initial axis drawing.
181 Below is the code portion with the modification.I don't know if this is considered to
182 be a bug but anyway i believe it might help some of you out there.*/
183 glDisable(GL_LIGHTING);
185 /* Position de l'origine */
186 const GLdouble TriedronOrigin[3] = { 0.0, 0.0, 0.0 };
188 /* Position des Axes */
189 GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
190 GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
191 GLdouble TriedronAxeZ[3] = { 0.0, 0.0, 1.0 };
192 TriedronAxeX[0] = L ;
193 TriedronAxeY[1] = L ;
194 TriedronAxeZ[2] = L ;
196 /* dessin des axes */
198 glVertex3dv( TriedronOrigin );
199 glVertex3dv( TriedronAxeX );
201 glVertex3dv( TriedronOrigin );
202 glVertex3dv( TriedronAxeY );
204 glVertex3dv( TriedronOrigin );
205 glVertex3dv( TriedronAxeZ );
208 /* fleches au bout des axes (= cones de la couleur demandee) */
209 const GLdouble l = 0.75*L; /* distance a l'origine */
210 const GLdouble rayon = L/30. ; /* rayon de la base du cone */
211 const int NbFacettes = 12; /* le cone sera compose de 12 facettes triangulaires */
212 const double Angle = 2. * M_PI/ NbFacettes;
215 GLdouble TriedronCoord[3] = { 1.0, 0.0, 0.0 };
217 /* solution FILAIRE des cones au bout des axes : une seule ligne */
218 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
219 /* (la couleur est deja initialisee dans AspectLine) */
220 /* FIN de la solution FILAIRE CHOISIE pour les cones des axes */
223 glBegin(GL_TRIANGLE_FAN);
224 glVertex3dv( TriedronAxeX );
225 TriedronCoord[0] = l;
228 TriedronCoord[1] = rayon * sin(ii * Angle);
229 TriedronCoord[2] = rayon * cos(ii * Angle);
230 glVertex3dv( TriedronCoord );
236 glBegin(GL_TRIANGLE_FAN);
237 glVertex3dv( TriedronAxeY );
238 TriedronCoord[1] = l;
241 TriedronCoord[0] = rayon * cos(ii * Angle);
242 TriedronCoord[2] = rayon * sin(ii * Angle);
243 glVertex3dv( TriedronCoord );
249 glBegin(GL_TRIANGLE_FAN);
250 glVertex3dv( TriedronAxeZ );
251 TriedronCoord[2] = l;
254 TriedronCoord[0] = rayon * sin(ii * Angle);
255 TriedronCoord[1] = rayon * cos(ii * Angle);
256 glVertex3dv( TriedronCoord );
261 /* dessin de l'origine */
262 TriedronCoord[2] = 0.0 ;
264 const double Angle1 = 2. * M_PI/ ii;
265 glBegin(GL_LINE_LOOP);
267 TriedronCoord[0] = rayon * sin(ii * Angle1);
268 TriedronCoord[1] = rayon * cos(ii * Angle1);
269 glVertex3dv( TriedronCoord );
275 myLabelX.SetPosition (OpenGl_Vec3(float(L + rayon), 0.0f, float(-rayon)));
276 myLabelY.SetPosition (OpenGl_Vec3(float(rayon), float(L + 3.0 * rayon), float(2.0 * rayon)));
277 myLabelZ.SetPosition (OpenGl_Vec3(float(-2.0 * rayon), float(0.5 * rayon), float(L + 3.0 * rayon)));
278 myLabelX.Render (theWorkspace);
279 myLabelY.Render (theWorkspace);
280 myLabelZ.Render (theWorkspace);
283 * restauration du contexte des matrices
285 glMatrixMode (GL_PROJECTION);
287 glMatrixMode (GL_MODELVIEW);
292 /*******************************************************
293 * Draws ZBUFFER trihedron mode
294 *******************************************************/
295 //call_zbuffer_triedron_redraw
296 void OpenGl_Trihedron::redrawZBuffer (const Handle(OpenGl_Workspace)& theWorkspace) const
298 const Standard_Real U = theWorkspace->ActiveView()->Height();
299 const Standard_Real V = theWorkspace->ActiveView()->Width();
301 GLdouble modelMatrix[4][4];
302 glGetDoublev( GL_MODELVIEW_MATRIX, (GLdouble *) modelMatrix );
303 GLdouble projMatrix[4][4];
304 glGetDoublev( GL_PROJECTION_MATRIX, (GLdouble *) projMatrix );
306 /* Check position in the ViewPort */
308 /* Simple code modification recommended by Fotis Sioutis and Peter Dolbey */
309 /* to remove the irritating default behaviour of triedrons using V3d_ZBUFFER */
310 /* which causes the glyph to jump around the screen when the origin moves offscreen. */
311 GLboolean isWithinView = GL_FALSE;
313 /* la taille des axes est 1 proportion (fixee a l'init du triedre) */
314 /* de la dimension la plus petite de la window. */
315 GLdouble L = ( U < V ? U : V ) * myScale;
319 /* Annulate translation matrix */
320 modelMatrix[3][0] = 0.;
321 modelMatrix[3][1] = 0.;
322 modelMatrix[3][2] = 0.;
324 projMatrix[0][0] = 2.0 / U;
325 projMatrix[0][1] = 0.0;
326 projMatrix[0][2] = 0.0;
327 projMatrix[0][3] = 0.0;
329 projMatrix[1][0] = 0.0;
330 projMatrix[1][1] = 2.0 / V;
331 projMatrix[1][2] = 0.0;
332 projMatrix[1][3] = 0.0;
334 projMatrix[2][0] = 0.0;
335 projMatrix[2][1] = 0.0;
336 projMatrix[2][2] = -2.0 * 1e-7;
337 projMatrix[2][3] = 0.0;
339 projMatrix[3][0] = 0.0;
340 projMatrix[3][1] = 0.0;
341 projMatrix[3][2] = 0.0;
342 projMatrix[3][3] = 1.0;
345 glMatrixMode (GL_MODELVIEW);
348 glLoadMatrixd( (GLdouble *) modelMatrix);
349 glMatrixMode ( GL_PROJECTION );
352 glLoadMatrixd( (GLdouble *) projMatrix);
355 * Define position in the view
359 case Aspect_TOTP_LEFT_LOWER :
360 glTranslated( -0.5*U + L , -0.5*V + L , 0. );
363 case Aspect_TOTP_LEFT_UPPER :
364 glTranslated( -0.5*U + L , +0.5*V - L -L/3. , 0. );
367 case Aspect_TOTP_RIGHT_LOWER :
368 glTranslated( 0.5*U - L -L/3. , -0.5*V + L , 0. );
371 case Aspect_TOTP_RIGHT_UPPER :
372 glTranslated( 0.5*U - L -L/3. , +0.5*V - L -L/3. , 0. );
375 //case Aspect_TOTP_CENTER :
382 const OpenGl_AspectLine *AspectLine = theWorkspace->AspectLine( Standard_True );
383 const TEL_COLOUR &aLineColor = AspectLine->Color();
386 * Creation the trihedron
388 #define CYLINDER_LENGTH 0.75f
390 const GLuint startList = glGenLists(4);
391 GLUquadricObj* aQuadric = gluNewQuadric();
393 const GLboolean aIsDepthEnabled = glIsEnabled(GL_DEPTH_TEST);
395 GLboolean aIsDepthMaskEnabled;
397 /* GL_DEPTH_WRITEMASK is not a valid argument to glIsEnabled, the */
398 /* original code is shown to be broken when run under an OpenGL debugger */
399 /* like GLIntercept. This is the correct way to retrieve the mask value. */
400 glGetBooleanv(GL_DEPTH_WRITEMASK, &aIsDepthMaskEnabled);
402 const GLdouble aCylinderLength = L * CYLINDER_LENGTH;
403 const GLdouble aCylinderDiametr = L * myDiameter;
404 const GLdouble aConeDiametr = aCylinderDiametr * 2.;
405 const GLdouble aConeLength = L * (1 - CYLINDER_LENGTH);
406 /* Correct for owerlapping */
407 /* aCylinderLength += aConeLength - 1.2*aCylinderDiametr*aConeLength/aConeDiametr;*/
409 /* Create cylinder for axis */
410 gluQuadricDrawStyle(aQuadric, GLU_FILL); /* smooth shaded */
411 gluQuadricNormals(aQuadric, GLU_FLAT);
413 glNewList(startList, GL_COMPILE);
414 gluCylinder(aQuadric, aCylinderDiametr, aCylinderDiametr, aCylinderLength, myNbFacettes, 1);
417 glNewList(startList + 1, GL_COMPILE);
418 gluCylinder(aQuadric, aConeDiametr, 0., aConeLength, myNbFacettes, 1);
421 glNewList(startList + 2, GL_COMPILE);
422 gluSphere(aQuadric, aCylinderDiametr * 2., myNbFacettes, myNbFacettes);
425 gluQuadricOrientation(aQuadric,GLU_INSIDE); /*szv*/
426 glNewList(startList + 3, GL_COMPILE);
427 gluDisk(aQuadric, aCylinderDiametr, aConeDiametr, myNbFacettes, 1/*szv:2*/);
430 /* Store previous attributes */
431 glPushAttrib(GL_LIGHTING_BIT | GL_POLYGON_BIT);
432 glEnable(GL_LIGHTING);
435 glEnable(GL_CULL_FACE);
437 /*Fotis Sioutis | 2008-01-21 10:55
438 In the function call_zbuffer_triedron_redraw of TKOpengl,
439 the z buffered trihedron changes colors in case there
440 is an object in the scene that has an explicit material
441 attached to it.In the trihedron display loop,
442 GL_COLOR_MATERIAL is enabled, but only the GL_DIFFUSE
443 parameter is utilized in glColorMaterial(...).
444 This causes the last ambient,specular and emission values
445 used, to stay at the stack and applied to the trihedron
446 (which causes the color change).
447 A fix is proposed , to change GL_DIFFUSE to
448 GL_AMBIENT_AND_DIFFUSE in glColorMaterial call in
449 line 946.The above of course will leave unchanged
450 the SPECULAR and EMISSION values.
451 Another proposal which would fix 100% the problem
452 is to use glMaterial instead of glColor on the trihedron
454 const GLfloat aNULLColor[] = { 0.f, 0.f, 0.f, 0.f }; /* FS 21/01/08 */
455 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, aNULLColor);
456 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, aNULLColor);
457 glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, aNULLColor);
458 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 0.f);
460 glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
461 glEnable(GL_COLOR_MATERIAL);
463 if (!aIsDepthEnabled) {
464 glEnable(GL_DEPTH_TEST);
465 glClear(GL_DEPTH_BUFFER_BIT);
468 if (!aIsDepthMaskEnabled) {
469 /* This is how the depthmask needs to be re-enabled...*/
470 glDepthMask(GL_TRUE);
471 /* ...and not this stuff below */
474 /* Position des Axes */
475 GLdouble TriedronAxeX[3] = { 1.0, 0.0, 0.0 };
476 GLdouble TriedronAxeY[3] = { 0.0, 1.0, 0.0 };
480 glMatrixMode(GL_MODELVIEW);
484 glGetIntegerv (GL_DEPTH_FUNC, &df);
487 for (i = 0; i < 2; i++) /* PCD 11/02/08 Two pass method */
489 if (i == 0) /* First pass */
491 glDepthFunc(GL_ALWAYS);
495 glDepthFunc(GL_LEQUAL);
502 glColor3fv(aLineColor.rgb);
503 glCallList(startList+2);
506 glColor4fv(myZColor.rgb);
507 glCallList(startList);
508 glTranslated(0, 0, L * CYLINDER_LENGTH);
509 glCallList(startList + 3);
510 glCallList(startList + 1);
514 glRotated(90.0, TriedronAxeY[0], TriedronAxeY[1], TriedronAxeY[2]);
515 glColor4fv(myXColor.rgb);
516 glCallList(startList);
517 glTranslated(0, 0, L * CYLINDER_LENGTH);
518 glCallList(startList + 3);
519 glCallList(startList + 1);
523 glRotated(-90.0, TriedronAxeX[0], TriedronAxeX[1], TriedronAxeX[2]);
524 glColor4fv(myYColor.rgb);
525 glCallList(startList);
526 glTranslated(0, 0, L * CYLINDER_LENGTH);
527 glCallList(startList + 3);
528 glCallList(startList + 1);
532 if (!aIsDepthEnabled)
533 glDisable(GL_DEPTH_TEST);
535 if (!aIsDepthMaskEnabled)
536 glDepthMask(GL_FALSE);
538 glDisable(GL_CULL_FACE);
539 glDisable(GL_COLOR_MATERIAL);
541 gluDeleteQuadric(aQuadric);
542 glColor3fv (aLineColor.rgb);
544 /* Always write the text */
545 glDepthFunc(GL_ALWAYS);
549 /* fleches au bout des axes (= cones de la couleur demandee) */
550 //const GLdouble l = 0.75*L; /* distance a l'origine */
551 const GLdouble rayon = L/30. ; /* rayon de la base du cone */
552 //const double Angle = 2. * M_PI/ myNbFacettes;
554 glDeleteLists(startList, 4);
556 glDisable(GL_LIGHTING);
559 myLabelX.SetPosition (OpenGl_Vec3(float(L + rayon), 0.0f, float(-rayon)));
560 myLabelY.SetPosition (OpenGl_Vec3(float(rayon), float(L + 3.0 * rayon), float(2.0 * rayon)));
561 myLabelZ.SetPosition (OpenGl_Vec3(float(-2.0 * rayon), float(0.5 * rayon), float(L + 3.0 * rayon)));
562 myLabelX.Render (theWorkspace);
563 myLabelY.Render (theWorkspace);
564 myLabelZ.Render (theWorkspace);
569 if (!isWithinView) { /* restore matrix */
570 glMatrixMode (GL_PROJECTION);
572 glMatrixMode (GL_MODELVIEW);
578 /*----------------------------------------------------------------------*/
580 /*----------------------------------------------------------------------*/
582 * Fonctions publiques
587 * initialisation d'un triedre non zoomable dans une vue.
588 * ou modification des valeurs deja initialisees.
592 OpenGl_Trihedron::OpenGl_Trihedron (const Aspect_TypeOfTriedronPosition thePosition,
593 const Quantity_NameOfColor theColor,
594 const Standard_Real theScale,
595 const Standard_Boolean theAsWireframe)
596 : myPos (thePosition),
598 myIsWireframe (theAsWireframe),
599 myLabelX ("X", OpenGl_Vec3(1.0f, 0.0f, 0.0f), THE_LABEL_PARAMS),
600 myLabelY ("Y", OpenGl_Vec3(0.0f, 1.0f, 0.0f), THE_LABEL_PARAMS),
601 myLabelZ ("Z", OpenGl_Vec3(0.0f, 0.0f, 1.0f), THE_LABEL_PARAMS)
604 Quantity_Color aColor (theColor);
605 aColor.Values (R, G, B, Quantity_TOC_RGB);
607 CALL_DEF_CONTEXTLINE aLineAspect = myDefaultContextLine;
608 aLineAspect.Color.r = (float)R;
609 aLineAspect.Color.g = (float)G;
610 aLineAspect.Color.b = (float)B;
611 myAspectLine.SetAspect (aLineAspect);
613 CALL_DEF_CONTEXTTEXT aTextAspect = myDefaultContextText;
614 aTextAspect.Color.r = (float)R;
615 aTextAspect.Color.g = (float)G;
616 aTextAspect.Color.b = (float)B;
617 myAspectText.SetAspect (aTextAspect);
619 myXColor = theXColor;
620 myYColor = theYColor;
621 myZColor = theZColor;
624 myDiameter = theDiameter;
625 myNbFacettes = theNbFacettes;
628 /*----------------------------------------------------------------------*/
631 * destruction du triedre non zoomable d'une vue.
634 //call_triedron_erase
635 OpenGl_Trihedron::~OpenGl_Trihedron()
639 // =======================================================================
640 // function : Release
642 // =======================================================================
643 void OpenGl_Trihedron::Release (const Handle(OpenGl_Context)& theCtx)
645 myLabelX.Release (theCtx);
646 myLabelY.Release (theCtx);
647 myLabelZ.Release (theCtx);
648 myAspectLine.Release (theCtx);
649 myAspectText.Release (theCtx);
652 /*----------------------------------------------------------------------*/
655 * affichage d'un triedre non zoomable dans la wks awsid
657 * Triedre = Objet non Zoomable;
658 * on cree cette fonction pour pouvoir travailler par les structures
659 * utilisees par les fonctions Tsm* et TEL_VIEW_REP
663 //call_triedron_redraw_from_wsid
664 void OpenGl_Trihedron::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
666 const OpenGl_AspectLine* aPrevAspectLine = theWorkspace->SetAspectLine (&myAspectLine);
667 const OpenGl_AspectText* aPrevAspectText = theWorkspace->SetAspectText (&myAspectText);
669 /* check if GL_LIGHTING should be disabled
670 no enabling 'cause it will be done (if necessary: kinda Polygon types )
671 during redrawing structures
673 if (!theWorkspace->UseGLLight())
675 glDisable (GL_LIGHTING);
678 const Handle(OpenGl_Texture) aPrevTexture = theWorkspace->DisableTexture();
680 /* affichage du Triedre Non Zoomable */
681 theWorkspace->ActiveView()->EndTransformPersistence (theWorkspace->GetGlContext());
685 redraw (theWorkspace);
689 redrawZBuffer (theWorkspace);
693 if (!aPrevTexture.IsNull())
695 theWorkspace->EnableTexture (aPrevTexture);
698 theWorkspace->SetAspectText (aPrevAspectText);
699 theWorkspace->SetAspectLine (aPrevAspectLine);
702 /*----------------------------------------------------------------------*/
703 //call_ztriedron_setup
704 void OpenGl_Trihedron::Setup (const Quantity_NameOfColor XColor, const Quantity_NameOfColor YColor, const Quantity_NameOfColor ZColor,
705 const Standard_Real SizeRatio, const Standard_Real AxisDiametr, const Standard_Integer NbFacettes)
709 Quantity_Color(XColor).Values(R, G, B, Quantity_TOC_RGB);
710 theXColor.rgb[0] = float (R);
711 theXColor.rgb[1] = float (G);
712 theXColor.rgb[2] = float (B);
714 Quantity_Color(YColor).Values(R, G, B, Quantity_TOC_RGB);
715 theYColor.rgb[0] = float (R);
716 theYColor.rgb[1] = float (G);
717 theYColor.rgb[2] = float (B);
719 Quantity_Color(ZColor).Values(R, G, B, Quantity_TOC_RGB);
720 theZColor.rgb[0] = float (R);
721 theZColor.rgb[1] = float (G);
722 theZColor.rgb[2] = float (B);
724 theRatio = float (SizeRatio);
725 theDiameter = float (AxisDiametr);
726 theNbFacettes = NbFacettes;