From: dmv Date: Wed, 9 Jul 2008 12:56:10 +0000 (+0000) Subject: Bug IPAL20086 4.x: Colors for the "Labels" and "Title" set in preferences isn't set... X-Git-Tag: V4_1_0_maintainance_20080710 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1eca60fe0c77453d9abbc894cc55a5af475209d3;p=modules%2Fvisu.git Bug IPAL20086 4.x: Colors for the "Labels" and "Title" set in preferences isn't set in "Text Properties" dlg. --- diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index ff95629b..8ab2fb39 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -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(), diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx index 38db647f..56d0a148 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx @@ -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); diff --git a/src/VISUGUI/VisuGUI_Table3dDlg.cxx b/src/VISUGUI/VisuGUI_Table3dDlg.cxx index d5b5b556..8c951285 100644 --- a/src/VISUGUI/VisuGUI_Table3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Table3dDlg.cxx @@ -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(), diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 5d2b629d..e0eb4188 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -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; } diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 50177693..9046637c 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -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 diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 72064cb4..79281b6e 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -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(); diff --git a/src/VISU_I/VISU_PointMap3d_i.cc b/src/VISU_I/VISU_PointMap3d_i.cc index 616a2a50..40b346a2 100644 --- a/src/VISU_I/VISU_PointMap3d_i.cc +++ b/src/VISU_I/VISU_PointMap3d_i.cc @@ -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]; } //---------------------------------------------------------------------------- diff --git a/src/VISU_I/VISU_PointMap3d_i.hh b/src/VISU_I/VISU_PointMap3d_i.hh index aa7c0af3..340e60b6 100644 --- a/src/VISU_I/VISU_PointMap3d_i.hh +++ b/src/VISU_I/VISU_PointMap3d_i.hh @@ -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); diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index 99d5a996..b191ea12 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -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();