]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2966: Redisplay text field on preferences change
authorvsv <vsv@opencascade.com>
Thu, 25 Jul 2019 12:38:23 +0000 (15:38 +0300)
committervsv <vsv@opencascade.com>
Thu, 25 Jul 2019 12:38:23 +0000 (15:38 +0300)
src/PartSet/PartSet_FieldStepPrs.cpp
src/PartSet/PartSet_FieldStepPrs.h

index c32bec26de006472883cf6e46d0b9b26c55d62cc..8fb605186fbcc94dde02dc55aa8b6345fd4be09e 100644 (file)
@@ -73,12 +73,6 @@ PartSet_FieldStepPrs::PartSet_FieldStepPrs(FieldStepPtr theStep)
       aDrawer->SetPointAspect(
         new Prs3d_PointAspect(Aspect_TOM_POINT, Quantity_NOC_YELLOW, POINT_SIZE));
   }
-  SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
-  QColor aQColor = aResMgr->colorValue("Viewer", "scalar_bar_text_color", Qt::black);
-
-  myLabelColor = Quantity_Color(aQColor.redF(), aQColor.greenF(), aQColor.blueF(),
-    Quantity_TOC_RGB);
-
   SetMaterial(Graphic3d_NOM_PLASTIC);
 }
 
@@ -148,6 +142,10 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
   const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode)
 {
   SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
+  QColor aQColor = aResMgr->colorValue("Viewer", "scalar_bar_text_color", Qt::black);
+  Quantity_Color aLabelColor = Quantity_Color(aQColor.redF(), aQColor.greenF(), aQColor.blueF(),
+    Quantity_TOC_RGB);
+
   ModelAPI_AttributeTables::ValueType aType = dataType();
   DataPtr aData = myFeature->data();
   switch (aType) {
@@ -204,7 +202,7 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
 
         Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
         anAspectText3d->SetStyle(Aspect_TOST_ANNOTATION);
-        anAspectText3d->SetColor(myLabelColor);
+        anAspectText3d->SetColor(aLabelColor);
         aGroup->SetPrimitivesAspect(anAspectText3d);
 
         int aT = aResMgr->integerValue("Viewer", "scalar_bar_text_height", 14);
index f7711ddcdf7a086e2f4f38bb7554e236d7aee4c9..f9a386264b61bc7543526607af1baf4e74ff5c2c 100644 (file)
@@ -66,7 +66,6 @@ private:
 
   FieldStepPtr myStep;
   FeaturePtr myFeature;
-  Quantity_Color myLabelColor;
 };
 
 #endif