]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Implementation of the issue 21285: EDF 1877 SMESH: Color of groups is only visible...
authorrnv <rnv@opencascade.com>
Mon, 26 Sep 2011 10:41:06 +0000 (10:41 +0000)
committerrnv <rnv@opencascade.com>
Mon, 26 Sep 2011 10:41:06 +0000 (10:41 +0000)
14 files changed:
doc/salome/gui/SMESH/images/colors_size.png
doc/salome/gui/SMESH/input/colors_size.doc
resources/SalomeApp.xml.in
src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_Actor.h
src/OBJECT/SMESH_ActorDef.h
src/OBJECT/SMESH_ActorUtils.cxx
src/OBJECT/SMESH_ActorUtils.h
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESH_msg_en.ts

index 53b14620cb6e6fe19d7f8b27ca50cc2a9dd3d66c..83121a791a0864c1e08ba574b4322c6b848aa407 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/colors_size.png and b/doc/salome/gui/SMESH/images/colors_size.png differ
index aa244579b009598d679252f86a5a5355c27f407f..33c673363a042e66d2c0d44b21533f41fa4585e0 100644 (file)
@@ -9,8 +9,9 @@ parameters:
 <ul>
 <li><b>Elements</b></li>
 <ul>
-<li><b>Fill</b> - color of surface of elements (seen in Shading mode).</li>
-<li><b>Back Face</b> - color of interior surface of elements.</li>
+<li><b>Surface color</b> - color of surface of elements (seen in Shading mode).</li>
+<li><b>Back surface color</b> - color of interior surface of elements. Use slider to select this color. This color 
+generated on base of the <b>Surface color</b> by changing it's brightness and saturation.</li>
 <li><b>Outline</b> - color of borders of elements.</li>
 <li><b>0D slements</b> - color of 0D elements.</li>
 <li><b>Size of 0D slements</b> - size of 0D elements.</li>
index 664c824b5917249d68a91a918a4b1fdde3fd9454..bc565c375444683a17c9863d1493e3d8938d26a2 100644 (file)
@@ -29,9 +29,8 @@
     <parameter name="version" value="@VERSION@"/>
     <!-- Other module preferences -->
     <parameter name="node_color"                   value="255, 0,   0"/>
-    <parameter name="fill_color"                   value="0, 170, 255"/>
+    <parameter name="fill_color"                   value="0, 170, 255|-100"/>
     <parameter name="outline_color"                value="0, 170, 255"/>
-    <parameter name="backface_color"               value="0, 0,   255"/>
     <parameter name="elem0d_color"                 value="0, 255,   0"/>
     <parameter name="highlight_color"              value="0, 255, 255"/>
     <parameter name="group_name_color"             value="255, 255, 255"/>
index e867630dce94d839c4e4e98f7840da09cda967f6..e32067023f854bbfc09fd47e91325f47a9abc011 100644 (file)
@@ -40,6 +40,8 @@
 #include "SUIT_Session.h"
 #include "SUIT_ResourceMgr.h"
 
+#include <Qtx.h>
+
 #ifndef DISABLE_PLOT2DVIEWER
 #include <SPlot2d_Histogram.h>
 #endif
@@ -146,12 +148,15 @@ SMESH_ActorDef::SMESH_ActorDef()
   //-----------------------------------------
   vtkFloatingPointType anRGB[3] = {1,1,1};
   mySurfaceProp = vtkProperty::New();
-  SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
-  mySurfaceProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
+  QColor ffc, bfc;
+  int delta;
+  SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "0,170,255|-100" ) ;
+  mySurfaceProp->SetColor( ffc.red() / 255. , ffc.green() / 255. , ffc.blue() / 255. );
+  myDeltaBrightness = delta;
 
   myBackSurfaceProp = vtkProperty::New();
-  SMESH::GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
-  myBackSurfaceProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
+  bfc = Qtx::mainColorToSecondary(ffc, delta);
+  myBackSurfaceProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
 
   my2DActor = SMESH_DeviceActor::New();
   my2DActor->SetUserMatrix(aMatrix);
@@ -1749,27 +1754,23 @@ vtkFloatingPointType SMESH_ActorDef::GetOpacity(){
 }
 
 
-void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
+void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b, int delta){
   mySurfaceProp->SetColor(r,g,b);
   if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
     if( aGroupObj->GetElementType() == SMDSAbs_Face ||
         aGroupObj->GetElementType() == SMDSAbs_Volume )
       myNameActor->SetBackgroundColor(r,g,b);
+  
+  myDeltaBrightness = delta;
+  QColor bfc = Qtx::mainColorToSecondary(QColor(int(r*255),int(g*255),int(b*255)), delta);
+  myBackSurfaceProp->SetColor( bfc.red() / 255. , bfc.green() / 255. , bfc.blue() / 255. );
   Modified();
 }
 
-void SMESH_ActorDef::GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
+void SMESH_ActorDef::GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b, int& delta){
   ::GetColor(mySurfaceProp,r,g,b);
   my2DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
-}
-
-void SMESH_ActorDef::SetBackSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
-  myBackSurfaceProp->SetColor(r,g,b);
-  Modified();
-}
-
-void SMESH_ActorDef::GetBackSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
-  ::GetColor(myBackSurfaceProp,r,g,b);
+  delta = myDeltaBrightness;
 }
 
 void SMESH_ActorDef::SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
index 202541bb1da95c5954cfbd6ca5e773485c923616..cdd4b3e447e9c2e4be6cc577040938551570fb2e 100644 (file)
@@ -61,12 +61,9 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
                           const char* theName,
                           int theIsClear);
   
-  virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
-  virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
-  
-  virtual void SetBackSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
-  virtual void GetBackSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
-  
+  virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b, int delta ) = 0;
+  virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b, int& delta ) = 0;
+    
   virtual void SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
   virtual void GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
 
index 6827480071398c7cb1187e4d38bc464b6b3d5e5a..5cac53691d42bfb43bc2ba4974c7f829d5806019 100644 (file)
@@ -104,11 +104,8 @@ class SMESH_ActorDef : public SMESH_Actor
   virtual void SetOpacity(vtkFloatingPointType theValue);
   virtual vtkFloatingPointType GetOpacity();
 
-  virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
-  virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
-
-  virtual void SetBackSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
-  virtual void GetBackSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
+  virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b, int delta );
+  virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b, int& delta);
 
   virtual void SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
   virtual void GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
@@ -293,6 +290,8 @@ class SMESH_ActorDef : public SMESH_Actor
 #endif
 
   bool myIsFacesOriented;
+  
+  int myDeltaBrightness;
 
   VTK::MarkerTexture myMarkerTexture;
 
index 3ddfdc5905280883220e7c23aaae38496d91aeb6..ee0a31efddfba1066958a292e2c63f91e5214bc3 100644 (file)
@@ -35,6 +35,8 @@
 #include <Plot2d_ViewManager.h>
 #endif
 
+#include <Qtx.h>
+
 
 #include "utilities.h"
 
@@ -137,6 +139,23 @@ namespace SMESH
     b = ib / 255.;
   }
 
+
+  void
+  GetColor(  const QString& theSect, 
+            const QString& theName, 
+            QColor& color,
+            int& delta,
+            QString def) 
+  {
+    
+    SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+    if ( mgr ) {
+      QString str = mgr->stringValue( theSect, theName, def );
+      Qtx::stringToBiColor(str,color,delta);
+    }
+  }
+
+
 #ifndef DISABLE_PLOT2DVIEWER
   //=======================================================================
   /**
index 29ce4618dc5d6a73a2c8da9fe150f4823747e066..e98d0f5deeb3bc1eebe6a82a5107705813c1c768 100644 (file)
@@ -67,6 +67,14 @@ SMESHOBJECT_EXPORT
             vtkFloatingPointType&, 
             const QColor& = QColor() );
 
+ SMESHOBJECT_EXPORT
+   void
+   GetColor(  const QString& theSect, 
+             const QString& theName, 
+             QColor& color,
+             int& delta,
+             QString def);
+   
 SMESHOBJECT_EXPORT
   void 
   WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, 
index 2fab514646611a79430b7039cc7a35be58c86885..7e69c5680c4af1d640df4fa661c78bb0aae3a055 100644 (file)
             anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
           else if( aGroupObject->GetType() == SMESH::ELEM0D )
             anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
-          else
-            anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+          else {
+           QColor c;
+           int delta;
+           SMESH::GetColor("SMESH", "fill_color", c, delta, "0,170,255|-100");
+            anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta );
+         }
         }
       }
     }
       }
       case 1132:{
         QColor c, e, b, n, c0D, o;
+       int delta;
         int size0D = 0;
         int Edgewidth = 0;
         vtkFloatingPointType Shrink = 0.0;
           if(IObject->hasEntry()){
             if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
               vtkFloatingPointType color[3];
-              anActor->GetSufaceColor(color[0], color[1], color[2]);
+              anActor->GetSufaceColor(color[0], color[1], color[2],delta);
               int c0 = int (color[0] * 255);
               int c1 = int (color[1] * 255);
               int c2 = int (color[2] * 255);
               c2 = int (edgecolor[2] * 255);
               e.setRgb(c0, c1, c2);
 
-              vtkFloatingPointType backfacecolor[3];
-              anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
-              c0 = int (backfacecolor[0] * 255);
-              c1 = int (backfacecolor[1] * 255);
-              c2 = int (backfacecolor[2] * 255);
-              b.setRgb(c0, c1, c2);
-
               vtkFloatingPointType nodecolor[3];
               anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
               c0 = int (nodecolor[0] * 255);
         aDlg->SetColor(1, c);
         aDlg->SetColor(2, e);
         aDlg->SetColor(3, n);
-        aDlg->SetColor(4, b);
+       aDlg->SetDeltaBrightness(delta);
         aDlg->SetColor(5, c0D);
         aDlg->SetColor(6, o);
         aDlg->SetIntValue(1, Edgewidth);
           QColor backfacecolor = aDlg->GetColor(4);
           QColor color0D = aDlg->GetColor(5);
           QColor faces_orientation_color = aDlg->GetColor(6);
+         int delta = aDlg->GetDeltaBrightness();
 
           /* Point marker */
           theMarkerMap[ aStudy->StudyId() ] = aDlg->getCustomMarkerMap();
                 /* actor color and backface color */
                 anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
                                         vtkFloatingPointType (color.green()) / 255.,
-                                        vtkFloatingPointType (color.blue()) / 255.);
-                anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
-                                            vtkFloatingPointType (backfacecolor.green()) / 255.,
-                                            vtkFloatingPointType (backfacecolor.blue()) / 255.);
-
+                                        vtkFloatingPointType (color.blue()) / 255.,
+                                       delta);
                 /* edge color */
                 anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
                                       vtkFloatingPointType (edgecolor.green()) / 255.,
@@ -4505,11 +4501,13 @@ void SMESHGUI::createPreferences()
   int elemGroup = addPreference( tr( "PREF_GROUP_ELEMENTS" ), meshTab );
   setPreferenceProperty( elemGroup, "columns", 2 );
 
-  addPreference( tr( "PREF_FILL"     ), elemGroup, LightApp_Preferences::Color, "SMESH", "fill_color" );
+  int ColorId = addPreference( tr( "PREF_FILL"     ), elemGroup, LightApp_Preferences::BiColor, "SMESH", "fill_color" );
   addPreference( tr( "PREF_OUTLINE"  ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
-  addPreference( tr( "PREF_BACKFACE" ), elemGroup, LightApp_Preferences::Color, "SMESH", "backface_color" );
   addPreference( tr( "PREF_COLOR_0D" ), elemGroup, LightApp_Preferences::Color, "SMESH", "elem0d_color" );
 
+  
+  setPreferenceProperty( ColorId, "text", tr("PREF_BACKFACE") );
+
   int grpGroup = addPreference( tr( "PREF_GROUP_GROUPS" ), meshTab );
   setPreferenceProperty( grpGroup, "columns", 2 );
 
@@ -5086,18 +5084,17 @@ void SMESHGUI::storeVisualParameters (int savePoint)
 
                   // Colors (surface:edge:)
                   vtkFloatingPointType r, g, b;
-
-                  aSmeshActor->GetSufaceColor(r, g, b);
+                 int delta;
+                 
+                  aSmeshActor->GetSufaceColor(r, g, b, delta);
                   QString colorStr ("surface");
                   colorStr += gDigitsSep; colorStr += QString::number(r);
                   colorStr += gDigitsSep; colorStr += QString::number(g);
                   colorStr += gDigitsSep; colorStr += QString::number(b);
 
-                  aSmeshActor->GetBackSufaceColor(r, g, b);
-                  colorStr += gDigitsSep; colorStr += "backsurface";
-                  colorStr += gDigitsSep; colorStr += QString::number(r);
-                  colorStr += gDigitsSep; colorStr += QString::number(g);
-                  colorStr += gDigitsSep; colorStr += QString::number(b);
+                 colorStr += gDigitsSep; colorStr += "backsurface";
+                 colorStr += gDigitsSep; colorStr += QString::number(delta);
+                                     
 
                   aSmeshActor->GetEdgeColor(r, g, b);
                   colorStr += gDigitsSep; colorStr += "edge";
@@ -5462,17 +5459,42 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
             // Colors
             else if (paramNameStr == "Colors") {
               QStringList colors = val.split(gDigitsSep, QString::SkipEmptyParts);
-              if (colors.count() == 16) {
+              if (colors.count() == 16 || colors.count() == 14 ) {
                 if (colors[0] != "surface" || colors[4]  != "backsurface" ||
-                    colors[8] != "edge"    || colors[12] != "node") {
+                    (colors[8] != "edge" && colors[6] != "edge" )     || (colors[12] != "node" && colors[10] != "node")) {
                   MESSAGE("Invalid order of data in Colors, must be: "
-                          "surface:r:g:b:backsurface:r:g:b:edge:r:g:b:node:r:g:b");
+                          "surface:r:g:b:backsurface:r:g:b:edge:r:g:b:node:r:g:b or surface:r:g:b:backsurface:delta:edge:r:g:b:node:r:g:b");
                 }
                 else {
-                  aSmeshActor->SetSufaceColor(colors[1].toFloat(), colors[2].toFloat(), colors[3].toFloat());
-                  aSmeshActor->SetBackSufaceColor(colors[5].toFloat(), colors[6].toFloat(), colors[7].toFloat());
-                  aSmeshActor->SetEdgeColor(colors[9].toFloat(), colors[10].toFloat(), colors[11].toFloat());
-                  aSmeshActor->SetNodeColor(colors[13].toFloat(), colors[14].toFloat(), colors[15].toFloat());
+                 int delta = 0; 
+                 float er,eg,eb;
+                 float nr,ng,nb;
+                 //Old case backsurface color is independent
+                 if( colors.count() == 16 ) {
+                   QColor ffc;
+                   SMESH::GetColor( "SMESH", "fill_color", ffc, delta, "0,170,255|-100" ) ;              
+                   er = colors[9].toFloat();
+                   eg = colors[10].toFloat();
+                   eb = colors[11].toFloat();
+                   
+                   nr = colors[13].toFloat();
+                   ng = colors[14].toFloat();
+                   nb = colors[15].toFloat();
+                 } else {
+                   //New case backsurface color depends on surface color
+                   delta = colors[5].toInt();
+
+                   er = colors[7].toFloat();
+                   eg = colors[8].toFloat();
+                   eb = colors[9].toFloat();
+                   
+                   nr = colors[11].toFloat();
+                   ng = colors[12].toFloat();
+                   nb = colors[13].toFloat();
+                 }
+                  aSmeshActor->SetSufaceColor(colors[1].toFloat(), colors[2].toFloat(), colors[3].toFloat(), delta);
+                  aSmeshActor->SetEdgeColor(er,eg,eb);
+                  aSmeshActor->SetNodeColor(nr,ng,nb);
                 }
               }
             }
index d61b9397ff193b61c205f5dfb42651dab36d9888..7e40421f1800d16e19513490fc0fd135ec7ece38 100644 (file)
@@ -1121,7 +1121,13 @@ bool SMESHGUI_GroupDlg::onApply()
           case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
           case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
           case 2:
-          case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
+          case 3: 
+           {
+             QColor c;
+             int delta;
+             SMESH::GetColor("SMESH", "fill_color", c , delta, "0,170,255|-100");
+             anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta ); break;          
+           }
           }
         }
     }
index f035c5699b5f952ccc3f99d39430a51b809ee4de..e411e7049935a62c34a348f8bcb4f7693ca77cf6 100644 (file)
@@ -80,11 +80,10 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   ButtonGroup1Layout->setSpacing( SPACING );
   ButtonGroup1Layout->setMargin( MARGIN );
 
-  QLabel* TextLabel_Fill = new QLabel( tr( "Fill" ), ButtonGroup1 );
-  btnFillColor = new QtxColorButton( ButtonGroup1 );
+  QLabel* TextLabel_Fill = new QLabel( tr( "Surface color" ), ButtonGroup1 );
 
-  QLabel* TextLabel_BackFace = new QLabel( tr( "Back Face" ), ButtonGroup1 );
-  btnBackFaceColor = new QtxColorButton( ButtonGroup1 );
+  toolSurfColor = new QtxBiColorTool(ButtonGroup1);
+  toolSurfColor->setText("Back surface color");
 
   QLabel* TextLabel_Outine = new QLabel( tr( "Outline" ), ButtonGroup1 );
   btnOutlineColor = new QtxColorButton( ButtonGroup1 );
@@ -117,9 +116,7 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   SpinBox_Shrink->setButtonSymbols( QSpinBox::PlusMinus );
 
   ButtonGroup1Layout->addWidget( TextLabel_Fill,             0, 0 );
-  ButtonGroup1Layout->addWidget( btnFillColor,               0, 1 );
-  ButtonGroup1Layout->addWidget( TextLabel_BackFace,         0, 2 );
-  ButtonGroup1Layout->addWidget( btnBackFaceColor,           0, 3 );
+  ButtonGroup1Layout->addWidget( toolSurfColor,              0, 1, 1, 3 );
   ButtonGroup1Layout->addWidget( TextLabel_Outine,           1, 0 );
   ButtonGroup1Layout->addWidget( btnOutlineColor,            1, 1 );
   ButtonGroup1Layout->addWidget( TextLabel_0DElements_Color, 1, 2 );
@@ -309,10 +306,9 @@ void SMESHGUI_Preferences_ColorDlg::ActivateThisDialog()
 void SMESHGUI_Preferences_ColorDlg::SetColor( int type, const QColor& color )
 {
   switch ( type ) {
-  case 1 : btnFillColor->setColor( color );        break; // fill
+  case 1 : toolSurfColor->setMainColor( color );        break; // fill
   case 2 : btnOutlineColor->setColor( color );     break; // outline
   case 3 : btnNodeColor->setColor( color );        break; // node
-  case 4 : btnBackFaceColor->setColor( color );    break; // back face
   case 5 : btn0DElementsColor->setColor( color );  break; // 0d elements
   case 6 : btnOrientationColor->setColor( color ); break; // orientation of faces
   default: break;
@@ -327,10 +323,9 @@ QColor SMESHGUI_Preferences_ColorDlg::GetColor( int type )
 {
   QColor color;
   switch ( type ) {
-  case 1 : color = btnFillColor->color();        break; // fill
+  case 1 : color = toolSurfColor->mainColor();        break; // fill
   case 2 : color = btnOutlineColor->color();     break; // outline
   case 3 : color = btnNodeColor->color();        break; // node
-  case 4 : color = btnBackFaceColor->color();    break; // back face
   case 5 : color = btn0DElementsColor->color();  break; // 0d elements
   case 6 : color = btnOrientationColor->color(); break; // orientation of faces
   default: break;
@@ -484,6 +479,23 @@ int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID() const
   return MarkerWidget->getCustomMarkerID();
 }
 
+//=================================================================================
+// function : SetDeltaBrightness(int)
+// purpose  :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::SetDeltaBrightness(int delta) 
+{
+  toolSurfColor->setDelta(delta);
+}
+//=================================================================================
+// function : GetDeltaBrightness()
+// purpose  :
+//=================================================================================
+int SMESHGUI_Preferences_ColorDlg::GetDeltaBrightness() 
+{
+  return toolSurfColor->delta();
+}
+
 //=================================================================================
 // function : keyPressEvent()
 // purpose  :
index e34a9ed810ddb4b563a55845525bb3acc6ca4b96..05eef69248a6f0f642bd5cb778992207c55615f9 100644 (file)
@@ -32,6 +32,7 @@
 
 // SALOME GUI includes
 #include <VTKViewer_MarkerDef.h>
+#include <QtxBiColorTool.h>
 
 // Qt includes
 #include <QDialog>
@@ -63,6 +64,9 @@ public:
   void                  setCustomMarkerMap( VTK::MarkerMap );
   VTK::MarkerMap        getCustomMarkerMap();
 
+  void                  SetDeltaBrightness(int);
+  int                   GetDeltaBrightness();
+
   void                  setStandardMarker( VTK::MarkerType, VTK::MarkerScale );
   void                  setCustomMarker( int );
   VTK::MarkerType       getMarkerType() const;
@@ -82,9 +86,8 @@ private slots:
   
 private:
   SMESHGUI*             mySMESHGUI;            
-  
-  QtxColorButton*       btnFillColor;
-  QtxColorButton*       btnBackFaceColor;
+
+  QtxBiColorTool*       toolSurfColor; 
   QtxColorButton*       btnOutlineColor;
   QtxColorButton*       btn0DElementsColor;
   SalomeApp_IntSpinBox* SpinBox_0DElements_Size;
index 11b6204b02eec865b8a3a60a9345275510420978..46e7e5c969cfb2efb199a4f076f8e7606fa391c6 100644 (file)
@@ -610,14 +610,14 @@ namespace SMESH
         SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
         if(!CORBA::is_nil(aGroup) && anActor)
         {
+         QColor c;int delta;
+         SMESH::GetColor( "SMESH", "fill_color", c, delta, "0,170,255|-100"  );
           SALOMEDS::Color aColor = aGroup->GetColor();
-          if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
+          if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ))
           {
-            int r = 0, g = 0, b = 0;
-            SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
-            aColor.R = (float)r / 255.0;
-            aColor.G = (float)g / 255.0;
-            aColor.B = (float)b / 255.0;
+           aColor.R = (float)c.red() / 255.0;
+           aColor.G = (float)c.green() / 255.0;
+            aColor.B = (float)c.blue() / 255.0;
             aGroup->SetColor( aColor );
           }
           if( aGroup->GetType() == SMESH::NODE )
@@ -627,7 +627,7 @@ namespace SMESH
           else if( aGroup->GetType() == SMESH::ELEM0D )
             anActor->Set0DColor( aColor.R, aColor.G, aColor.B );
           else
-            anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+            anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B, delta );
         }
       }
     }
index 746685ceed0a3ae9a4606ac5bcdd45225ef26cb2..60db88cc7b7a880b71d8799038ea48531511d35d 100644 (file)
@@ -3550,7 +3550,7 @@ Please, create VTK viewer and try again</translation>
     </message>
     <message>
         <source>PREF_BACKFACE</source>
-        <translation>Back face</translation>
+        <translation>Back surface color</translation>
     </message>
     <message>
         <source>PREF_COLOR</source>
@@ -3594,7 +3594,7 @@ Please, create VTK viewer and try again</translation>
     </message>
     <message>
         <source>PREF_FILL</source>
-        <translation>Fill</translation>
+        <translation>Surface color</translation>
     </message>
     <message>
         <source>PREF_NOTIFY_MODE</source>