0027670: Visualization - avoid duplication of structures defining primitive array...
[occt.git] / src / OpenGl / OpenGl_GraduatedTrihedron.cxx
index 82ea7ba..94dd4cb 100755 (executable)
@@ -14,7 +14,6 @@
 // commercial license or contractual agreement.
 
 #include <OpenGl_GlCore11.hxx>
-#include <InterfaceGraphic_Graphic3d.hxx>
 
 #include <OpenGl_GraduatedTrihedron.hxx>
 
@@ -112,16 +111,14 @@ void OpenGl_GraduatedTrihedron::initGlResources (const Handle(OpenGl_Context)& t
 
   myLabelValues.SetFontSize (theCtx, myData.ValuesSize());
 
-  myAspectLabels.SetFontAspect (myData.NamesFontAspect());
-  myAspectLabels.ChangeFontName() = myData.NamesFont();
+  myAspectLabels.Aspect()->SetTextFontAspect (myData.NamesFontAspect());
+  myAspectLabels.Aspect()->SetFont (myData.NamesFont());
 
-  myAspectValues.SetFontAspect (myData.ValuesFontAspect());
-  myAspectValues.ChangeFontName() = myData.ValuesFont();
+  myAspectValues.Aspect()->SetTextFontAspect (myData.ValuesFontAspect());
+  myAspectValues.Aspect()->SetFont (myData.ValuesFont());
 
   // Grid aspect
-  myGridLineAspect.ChangeColor().rgb[0] = (Standard_ShortReal) myData.GridColor().Red();
-  myGridLineAspect.ChangeColor().rgb[1] = (Standard_ShortReal) myData.GridColor().Green();
-  myGridLineAspect.ChangeColor().rgb[2] = (Standard_ShortReal) myData.GridColor().Blue();
+  myGridLineAspect.Aspect()->SetColor (myData.GridColor());
 }
 
 // =======================================================================
@@ -527,7 +524,7 @@ void OpenGl_GraduatedTrihedron::renderTickmarkLabels (const Handle(OpenGl_Worksp
 
     OpenGl_Vec3 aMiddle (theGridAxes.Ticks[theIndex] + aSizeVec * theGridAxes.Axes[theIndex] * 0.5f + aDir * (Standard_ShortReal)(theDpix * anOffset));
 
-    myAspectLabels.ChangeColor() = anAxis.NameColor;
+    myAspectLabels.Aspect()->SetColor (anAxis.NameColor);
     theWorkspace->SetAspectText (&myAspectLabels);
     anAxis.Label.SetPosition (aMiddle);
     anAxis.Label.Render (theWorkspace);
@@ -535,7 +532,7 @@ void OpenGl_GraduatedTrihedron::renderTickmarkLabels (const Handle(OpenGl_Worksp
 
   if (aCurAspect.ToDrawValues() && aCurAspect.TickmarksNumber() > 0)
   {
-    myAspectValues.ChangeColor() = anAxis.LineAspect.Color();
+    myAspectValues.Aspect()->SetColor (anAxis.LineAspect.Aspect()->Color());
     theWorkspace->SetAspectText (&myAspectValues);
     Standard_Real anOffset = aCurAspect.ValuesOffset() + aCurAspect.TickmarksLength();
 
@@ -729,14 +726,8 @@ OpenGl_GraduatedTrihedron::Axis::Axis (const Graphic3d_AxisAspect& theAspect,
   Line      (NULL),
   Arrow     (NULL)
 {
-  NameColor.rgb[0] = (Standard_ShortReal) theAspect.NameColor().Red();
-  NameColor.rgb[1] = (Standard_ShortReal) theAspect.NameColor().Green();
-  NameColor.rgb[2] = (Standard_ShortReal) theAspect.NameColor().Blue();
-  NameColor.rgb[3] = 1.0f;
-
-  LineAspect.ChangeColor().rgb[0] = (Standard_ShortReal) theAspect.Color().Red();
-  LineAspect.ChangeColor().rgb[1] = (Standard_ShortReal) theAspect.Color().Green();
-  LineAspect.ChangeColor().rgb[2] = (Standard_ShortReal) theAspect.Color().Blue();
+  NameColor = theAspect.NameColor();
+  LineAspect.Aspect()->SetColor (theAspect.Color());
 }
 
 // =======================================================================