]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug IPAL20086 4.x: Colors for the "Labels" and "Title" set in preferences isn't set... V4_1_0_maintainance_20080710
authordmv <dmv@opencascade.com>
Wed, 9 Jul 2008 12:56:10 +0000 (12:56 +0000)
committerdmv <dmv@opencascade.com>
Wed, 9 Jul 2008 12:56:10 +0000 (12:56 +0000)
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_Prs3dDlg.cxx
src/VISUGUI/VisuGUI_Table3dDlg.cxx
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_PointMap3d_i.cc
src/VISU_I/VISU_PointMap3d_i.hh
src/VISU_I/VISU_ScalarMap_i.cc

index ff95629b98b8dba6ee4b4baf240d39d10bcd1ff3..8ab2fb390ebda492d769b51be061ed7648235bfc 100644 (file)
@@ -510,7 +510,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
   myTextDlg->setTitleText(QString(thePrs->GetTitle()));
 
   vtkFloatingPointType R, G, B;
-  thePrs->GetTitleColor(&R, &G, &B);
+  thePrs->GetTitleColor(R, G, B);
 
   myBarDlg->setLabelsFormat(thePrs->GetLabelsFormat());
   myBarDlg->setUnitsVisible(thePrs->IsUnitsVisible());
@@ -522,7 +522,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
                                   thePrs->IsShadowTitle());
 
   // "Labels"
-  thePrs->GetLabelColor(&R, &G, &B);
+  thePrs->GetLabelColor(R, G, B);
 
   myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
                                   thePrs->GetLblFontType(),
index 38db647fe9aa5f88760c8a88b15440a9967ea212..56d0a1486eb677ee33154723a5d4b059a1442e2f 100644 (file)
@@ -990,9 +990,6 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs)
   myTextDlg->setTitleText(aTitle.in());
   myTitle = aTitle.in();
 
-  vtkFloatingPointType R, G, B;
-  myScalarMap->GetTitleColor(&R, &G, &B);
-
   setPosAndSize( myScalarMap->GetPosX(),
                 myScalarMap->GetPosY(),
                 myScalarMap->GetWidth(),
@@ -1020,16 +1017,23 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs)
   myBarDlg->setLabelsFormat(myScalarMap->GetLabelsFormat());
   myBarDlg->setUnitsVisible(myScalarMap->IsUnitsVisible());
 
-  myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
+  vtkFloatingPointType R, G, B;
+  myScalarMap->GetTitleColor(R, G, B);
+
+  QColor aTextColor = QColor((int)(R*255.), (int)(G*255.), (int)(B*255.));
+
+  myTextDlg->myTitleFont->SetData(aTextColor,
                                   myScalarMap->GetTitFontType(),
                                   myScalarMap->IsBoldTitle(),
                                   myScalarMap->IsItalicTitle(),
                                   myScalarMap->IsShadowTitle());
 
   // "Labels"
-  myScalarMap->GetLabelColor(&R, &G, &B);
+  myScalarMap->GetLabelColor(R, G, B);
+
+  QColor aLabelColor = QColor((int)(R*255.), (int)(G*255.), (int)(B*255.));
 
-  myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
+  myTextDlg->myLabelFont->SetData(aLabelColor,
                                   myScalarMap->GetLblFontType(),
                                   myScalarMap->IsBoldLabel(),
                                   myScalarMap->IsItalicLabel(),
@@ -1268,8 +1272,8 @@ int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs) {
     myScalarMap->SetShadowTitle(isTitleShadow);
     myScalarMap->SetTitFontType(aTitleFontFamily);
     myScalarMap->SetTitleColor(aTitColor.red()/255.,
-                         aTitColor.green()/255.,
-                         aTitColor.blue()/255.);
+                              aTitColor.green()/255.,
+                              aTitColor.blue()/255.);
 
     // "Label"
     QColor aLblColor (255, 255, 255);
index d5b5b55614777d8024e7ab1d68a3a72ee6d958f6..8c951285ebfcd4f332555ca5b6eb090eb87f6dca 100644 (file)
@@ -423,7 +423,7 @@ void VisuGUI_TableScalarBarPane::initFromPrsObject(VISU::PointMap3d_i* thePrs)
   myTitle = aTitle.in();
 
   vtkFloatingPointType R, G, B;
-  myBarPrs->GetTitleColor(&R, &G, &B);
+  myBarPrs->GetTitleColor(R, G, B);
 
   setPosAndSize( myBarPrs->GetPosX(),
                 myBarPrs->GetPosY(),
@@ -449,7 +449,7 @@ void VisuGUI_TableScalarBarPane::initFromPrsObject(VISU::PointMap3d_i* thePrs)
                                   myBarPrs->IsShadowTitle());
 
   // "Labels"
-  myBarPrs->GetLabelColor(&R, &G, &B);
+  myBarPrs->GetLabelColor(R, G, B);
 
   myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
                                   myBarPrs->GetLblFontType(),
index 5d2b629da8256be9b1a08f27dedb65c5370de779..e0eb4188ef0d95d2f82f52427b6a76573ecd9c0c 100644 (file)
@@ -716,14 +716,14 @@ VISU::ColoredPrs3d_i
     SetShadowTitle(anOrigin->IsShadowTitle());
     SetTitFontType(anOrigin->GetTitFontType());
     vtkFloatingPointType r,g,b;
-    anOrigin->GetTitleColor(&r,&g,&b);
+    anOrigin->GetTitleColor(r,g,b);
     SetTitleColor(r,g,b);
     
     SetBoldLabel(anOrigin->IsBoldLabel());
     SetItalicLabel(anOrigin->IsItalicLabel());
     SetShadowLabel(anOrigin->IsShadowLabel());
     SetLblFontType(anOrigin->GetLblFontType());
-    anOrigin->GetLabelColor(&r,&g,&b);
+    anOrigin->GetLabelColor(r,g,b);
     SetLabelColor(r,g,b);
 
     myIsTimeStampFixed = anOrigin->IsTimeStampFixed();
@@ -1301,13 +1301,13 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::GetTitleColor(vtkFloatingPointType* theR, 
-               vtkFloatingPointType* theG, 
-               vtkFloatingPointType* theB)
+::GetTitleColor(vtkFloatingPointType& theR, 
+               vtkFloatingPointType& theG, 
+               vtkFloatingPointType& theB)
 {
-  *theR = myTitleColor[0]; 
-  *theG = myTitleColor[1]; 
-  *theB = myTitleColor[2];
+  theR = myTitleColor[0]; 
+  theG = myTitleColor[1]; 
+  theB = myTitleColor[2];
 }
 
 //----------------------------------------------------------------------------
@@ -1422,13 +1422,13 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::GetLabelColor(vtkFloatingPointType* theR, 
-               vtkFloatingPointType* theG, 
-               vtkFloatingPointType* theB)
+::GetLabelColor(vtkFloatingPointType& theR, 
+               vtkFloatingPointType& theG, 
+               vtkFloatingPointType& theB)
 {
-  *theR = myLabelColor[0]; 
-  *theG = myLabelColor[1]; 
-  *theB = myLabelColor[2];
+  theR = myLabelColor[0]; 
+  theG = myLabelColor[1]; 
+  theB = myLabelColor[2];
 }
 
 //----------------------------------------------------------------------------
@@ -1602,9 +1602,11 @@ VISU::ColoredPrs3d_i
 
   QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
 
-  myTitleColor[0] = aTextColor.red()   / 255;
-  myTitleColor[1] = aTextColor.green() / 255;
-  myTitleColor[2] = aTextColor.blue()  / 255;
+  SetTitleColor(aTextColor.red()/255., aTextColor.green()/255., aTextColor.blue()/255.);
+               
+  myTitleColor[0] = aTextColor.red()   / 255.;
+  myTitleColor[1] = aTextColor.green() / 255.;
+  myTitleColor[2] = aTextColor.blue()  / 255.;
 
   myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true;
   myLblFontType = VTK_ARIAL;
@@ -1625,9 +1627,11 @@ VISU::ColoredPrs3d_i
 
   QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
 
-  myLabelColor[0] = aLabelColor.red()   / 255;
-  myLabelColor[1] = aLabelColor.green() / 255;
-  myLabelColor[2] = aLabelColor.blue()  / 255;
+  SetLabelColor(aLabelColor.red()/255., aLabelColor.green()/255., aLabelColor.blue()/255.);
+
+  myLabelColor[0] = aLabelColor.red()   / 255.;
+  myLabelColor[1] = aLabelColor.green() / 255.;
+  myLabelColor[2] = aLabelColor.blue()  / 255.;
 
   return this;
 }
index 501776938a416bf0d78cea5383a142684e70c435..9046637c40d5369683d74bf5c7fc7fb0ed6a5204 100644 (file)
@@ -483,9 +483,9 @@ namespace VISU
 
     virtual 
     void
-    GetTitleColor(vtkFloatingPointType* theR, 
-                 vtkFloatingPointType* theG, 
-                 vtkFloatingPointType* theB);
+    GetTitleColor(vtkFloatingPointType& theR, 
+                 vtkFloatingPointType& theG, 
+                 vtkFloatingPointType& theB);
     
     virtual
     void
@@ -527,9 +527,9 @@ namespace VISU
 
     virtual 
     void
-    GetLabelColor(vtkFloatingPointType* theR, 
-                 vtkFloatingPointType* theG, 
-                 vtkFloatingPointType* theB);
+    GetLabelColor(vtkFloatingPointType& theR, 
+                 vtkFloatingPointType& theG, 
+                 vtkFloatingPointType& theB);
 
     virtual
     void
index 72064cb4a8fcae08c4a3eda43150faac262eefd2..79281b6e5c7a2ad2adc22e8a6ae7fee351b9eb0a 100644 (file)
@@ -892,7 +892,7 @@ VISU::GaussPoints_i
   vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
   aTitleProp->SetFontFamily(GetTitFontType());
 
-  GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+  GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
   aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
   IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
@@ -902,7 +902,7 @@ VISU::GaussPoints_i
   vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
   aLabelProp->SetFontFamily(GetLblFontType());
 
-  GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+  GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
   aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
   IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
index 616a2a50debd93e6255cb1c804755a9aeebea2f4..40b346a26f5337d1e5ae4a115e0c14f641829f25 100644 (file)
@@ -414,7 +414,7 @@ void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
     aTitleProp->SetFontFamily(GetTitFontType());
 
-    GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
     aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
@@ -424,7 +424,7 @@ void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
     aLabelProp->SetFontFamily(GetLblFontType());
 
-    GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
     aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
@@ -1069,13 +1069,13 @@ void VISU::PointMap3d_i::SetTitFontType(int theTitFontType)
 }
 
 //----------------------------------------------------------------------------
-void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType* theR, 
-                                        vtkFloatingPointType* theG, 
-                                        vtkFloatingPointType* theB)
+void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType& theR, 
+                                        vtkFloatingPointType& theG, 
+                                        vtkFloatingPointType& theB)
 {
-  *theR = myTitleColor[0]; 
-  *theG = myTitleColor[1]; 
-  *theB = myTitleColor[2];
+  theR = myTitleColor[0]; 
+  theG = myTitleColor[1]; 
+  theB = myTitleColor[2];
 }
 
 //----------------------------------------------------------------------------
@@ -1160,13 +1160,13 @@ void VISU::PointMap3d_i::SetLblFontType(int theLblFontType)
 }
 
 //----------------------------------------------------------------------------
-void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType* theR, 
-                                 vtkFloatingPointType* theG, 
-                                 vtkFloatingPointType* theB)
+void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType& theR, 
+                                 vtkFloatingPointType& theG, 
+                                 vtkFloatingPointType& theB)
 {
-  *theR = myLabelColor[0]; 
-  *theG = myLabelColor[1]; 
-  *theB = myLabelColor[2];
+  theR = myLabelColor[0]; 
+  theG = myLabelColor[1]; 
+  theB = myLabelColor[2];
 }
 
 //----------------------------------------------------------------------------
index aa7c0af32d6e6fc45ceb0adc64cf0c28c547924b..340e60b6322379d45297db4f69e9c04b38866fd4 100644 (file)
@@ -167,9 +167,9 @@ namespace VISU
     virtual void SetShadowTitle(bool isShadow);
     virtual int  GetTitFontType();
     virtual void SetTitFontType(int theType);
-    virtual void GetTitleColor(vtkFloatingPointType* theR, 
-                vtkFloatingPointType* theG, 
-                vtkFloatingPointType* theB);
+    virtual void GetTitleColor(vtkFloatingPointType& theR, 
+                vtkFloatingPointType& theG, 
+                vtkFloatingPointType& theB);
     virtual void SetTitleColor(vtkFloatingPointType theR, 
                 vtkFloatingPointType theG, 
                 vtkFloatingPointType theB);    
@@ -182,9 +182,9 @@ namespace VISU
     virtual void SetShadowLabel(bool isShadow);
     virtual int  GetLblFontType();
     virtual void SetLblFontType(int theType);
-    virtual void GetLabelColor(vtkFloatingPointType* theR, 
-                vtkFloatingPointType* theG, 
-                vtkFloatingPointType* theB);
+    virtual void GetLabelColor(vtkFloatingPointType& theR, 
+                vtkFloatingPointType& theG, 
+                vtkFloatingPointType& theB);
     virtual void SetLabelColor(vtkFloatingPointType theR, 
                 vtkFloatingPointType theG, 
                 vtkFloatingPointType theB);
index 99d5a99634b448ac38ce295af4a993b20cf0d081..b191ea12e1032ceb746e0bb440a7ffc73809f886 100644 (file)
@@ -442,7 +442,7 @@ VISU::ScalarMap_i
     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
     aTitleProp->SetFontFamily(GetTitFontType());
 
-    GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
     aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
@@ -452,7 +452,7 @@ VISU::ScalarMap_i
     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
     aLabelProp->SetFontFamily(GetLblFontType());
 
-    GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
     aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();