Salome HOME
Implementation of the issue 20984: EDF 1566 SMESH: Better visibility of the elements...
authorrnv <rnv@opencascade.com>
Wed, 28 Sep 2011 08:43:35 +0000 (08:43 +0000)
committerrnv <rnv@opencascade.com>
Wed, 28 Sep 2011 08:43:35 +0000 (08:43 +0000)
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/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h
src/SMESHGUI/SMESH_msg_en.ts

index 83121a791a0864c1e08ba574b4322c6b848aa407..14750eb291fafbfe24150275ac6233c77fd1b49f 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 33c673363a042e66d2c0d44b21533f41fa4585e0..1eb84f0cabfd201ac63e2aa5f130da01623f4f6d 100644 (file)
@@ -12,7 +12,8 @@ parameters:
 <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>Outline color</b> - color of borders of elements.</li>
+<li><b>Wireframe color</b> - color of borders of elements in wireframe mode.</li>
 <li><b>0D slements</b> - color of 0D elements.</li>
 <li><b>Size of 0D slements</b> - size of 0D elements.</li>
 <li><b>Width</b> - width of lines (edges and borders of elements).</li>
index bc565c375444683a17c9863d1493e3d8938d26a2..6de641a3f7d9a29e1a53ccf685ad337baea2c7e2 100644 (file)
@@ -30,7 +30,8 @@
     <!-- Other module preferences -->
     <parameter name="node_color"                   value="255, 0,   0"/>
     <parameter name="fill_color"                   value="0, 170, 255|-100"/>
-    <parameter name="outline_color"                value="0, 170, 255"/>
+    <parameter name="wireframe_color"              value="0, 170, 255"/>
+    <parameter name="outline_color"                value="0,  70,   0"/>
     <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 e32067023f854bbfc09fd47e91325f47a9abc011..f9edd8cf3a622802126a84f794c9498c02bcc41d 100644 (file)
@@ -242,7 +242,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myEdgeProp->SetAmbient(1.0);
   myEdgeProp->SetDiffuse(0.0);
   myEdgeProp->SetSpecular(0.0);
-  SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+  SMESH::GetColor( "SMESH", "wireframe_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
   myEdgeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
   myEdgeProp->SetLineWidth(aLineWidth);
 
@@ -379,6 +379,15 @@ SMESH_ActorDef::SMESH_ActorDef()
   myHighlightProp->SetPointSize(aElem0DSize); // ??
   myHighlightProp->SetRepresentation(1);
 
+  myOutLineProp = vtkProperty::New();
+  myOutLineProp->SetAmbient(1.0);
+  myOutLineProp->SetDiffuse(0.0);
+  myOutLineProp->SetSpecular(0.0);
+  SMESH::GetColor( "SMESH", "outline_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 70, 0 ) );
+  myOutLineProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  myOutLineProp->SetPointSize(aElem0DSize); // ??
+  myOutLineProp->SetRepresentation(1);
+
   myPreselectProp = vtkProperty::New();
   myPreselectProp->SetAmbient(1.0);
   myPreselectProp->SetDiffuse(0.0);
@@ -1210,6 +1219,8 @@ void SMESH_ActorDef::SetShrinkFactor(vtkFloatingPointType theValue){
   my2DExtActor->SetShrinkFactor(theValue);
   my3DActor->SetShrinkFactor(theValue);
   my3DExtActor->SetShrinkFactor(theValue);
+  my3DExtActor->SetShrinkFactor(theValue);
+  myHighlitableActor->SetShrinkFactor(theValue);
 
   Modified();
 }
@@ -1226,6 +1237,7 @@ void SMESH_ActorDef::SetShrink(){
   my2DExtActor->SetShrink();
   my3DActor->SetShrink();
   my3DExtActor->SetShrink();
+  myHighlitableActor->SetShrink();
 
   myIsShrunk = true;
   Modified();
@@ -1243,6 +1255,7 @@ void SMESH_ActorDef::UnShrink(){
   my2DExtActor->UnShrink();
   my3DActor->UnShrink();
   my3DExtActor->UnShrink();
+  myHighlitableActor->UnShrink();
 
   myIsShrunk = false;
   Modified();
@@ -1613,36 +1626,44 @@ bool SMESH_ActorDef::GetPointRepresentation(){
 
 
 void SMESH_ActorDef::UpdateHighlight(){
-  myHighlitableActor->SetVisibility(false);
   myHighlitableActor->SetHighlited(false);
-
-  if(myIsHighlighted){
-    myHighlitableActor->SetProperty(myHighlightProp);
-  }else if(myIsPreselected){
-    myHighlitableActor->SetProperty(myPreselectProp);
-  }
+  myHighlitableActor->SetVisibility(false);
 
   bool anIsVisible = GetVisibility();
 
-  if(myIsHighlighted || myIsPreselected){
-    if(GetUnstructuredGrid()->GetNumberOfCells()){
-      myHighlitableActor->SetHighlited(anIsVisible);
-      myHighlitableActor->SetVisibility(anIsVisible);
-      myHighlitableActor->GetExtractUnstructuredGrid()->
-        SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
-      myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
-    }else if(myRepresentation == ePoint || GetPointRepresentation()){
-      myHighlitableActor->SetHighlited(anIsVisible);
-      myHighlitableActor->GetExtractUnstructuredGrid()->
-        SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+  switch(myRepresentation){
+  case SMESH_DeviceActor::eSurface:
+  case SMESH_DeviceActor::eWireframe:
+    {
+      if(myIsHighlighted) {
+       myHighlitableActor->SetProperty(myHighlightProp);
+      }else if(myIsPreselected){
+       myHighlitableActor->SetProperty(myPreselectProp);
+      } else if(anIsVisible){
+       (myRepresentation == eSurface) ? 
+         myHighlitableActor->SetProperty(myOutLineProp) : myHighlitableActor->SetProperty(myEdgeProp);
+      }
+      if(GetUnstructuredGrid()->GetNumberOfCells()) {
+       myHighlitableActor->SetHighlited(anIsVisible);
+       myHighlitableActor->GetExtractUnstructuredGrid()->
+         SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
+       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
+      }
       myHighlitableActor->SetVisibility(anIsVisible);
-      myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
-
-      VTK::MarkerType aMarkerType = GetMarkerType();
-      if(aMarkerType != VTK::MT_USER)
-        myHighlitableActor->SetMarkerStd(aMarkerType, GetMarkerScale());
-      else
-        myHighlitableActor->SetMarkerTexture(GetMarkerTexture(), myMarkerTexture);
+      break;
+    }
+  case SMESH_DeviceActor::ePoint:
+    {
+      if(myIsHighlighted) {
+       myNodeActor->SetProperty(myHighlightProp);
+      }else if(myIsPreselected) {
+       myNodeActor->SetProperty(myPreselectProp);
+      } else if(anIsVisible) {
+       myNodeActor->SetProperty(myNodeProp);
+      }
+      myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
+      myNodeActor->GetExtractUnstructuredGrid()->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+      break;
     }
   }
 }
@@ -1787,6 +1808,16 @@ void SMESH_ActorDef::GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType&
   ::GetColor(myEdgeProp,r,g,b);
 }
 
+void SMESH_ActorDef::SetOutlineColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
+  myOutLineProp->SetColor(r,g,b);
+  Modified();
+}
+
+void SMESH_ActorDef::GetOutlineColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
+  ::GetColor(myOutLineProp,r,g,b);
+}
+
+
 void SMESH_ActorDef::SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ 
   myNodeProp->SetColor(r,g,b);
   myNodeExtProp->SetColor(1.0-r,1.0-g,1.0-b);
index cdd4b3e447e9c2e4be6cc577040938551570fb2e..ac9ad973a900b135b61f98ea963955fa52be8848 100644 (file)
@@ -69,6 +69,9 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
 
   virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
   virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
+  
+  virtual void SetOutlineColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
+  virtual void GetOutlineColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;  
 
   virtual void Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
   virtual void Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
index 5cac53691d42bfb43bc2ba4974c7f829d5806019..5961cbd068014d208e96ee4ee10a1317e1d2e156 100644 (file)
@@ -110,6 +110,10 @@ class SMESH_ActorDef : public SMESH_Actor
   virtual void SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
   virtual void GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
 
+  virtual void SetOutlineColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
+  virtual void GetOutlineColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
+
+
   virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
   virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
 
@@ -232,7 +236,9 @@ class SMESH_ActorDef : public SMESH_Actor
   SMESH_DeviceActor* myPickableActor;
 
   vtkProperty* myHighlightProp;
+  vtkProperty* myOutLineProp;
   vtkProperty* myPreselectProp;
+          
   SMESH_DeviceActor* myHighlitableActor;
 
   eControl myControlMode;
index 7e69c5680c4af1d640df4fa661c78bb0aae3a055..3f5114ce62368b09a454f9a8f48d146220c42c56 100644 (file)
         return;
       }
       case 1132:{
-        QColor c, e, b, n, c0D, o;
+        QColor c, e, b, n, c0D, o, outl, selection, preselection;
        int delta;
         int size0D = 0;
         int Edgewidth = 0;
               c2 = int (color0D[2] * 255);
               c0D.setRgb(c0, c1, c2);
 
+              vtkFloatingPointType outlineColor[3];
+              anActor->GetOutlineColor(outlineColor[0], outlineColor[1], outlineColor[2]);
+              c0 = int (outlineColor[0] * 255);
+              c1 = int (outlineColor[1] * 255);
+              c2 = int (outlineColor[2] * 255);
+              outl.setRgb(c0, c1, c2);
+
+              vtkFloatingPointType hColor[3];
+              anActor->GetHighlightColor(hColor[0], hColor[1], hColor[2]);
+              c0 = int (hColor[0] * 255);
+              c1 = int (hColor[1] * 255);
+              c2 = int (hColor[2] * 255);
+              selection.setRgb(c0, c1, c2);
+
+              vtkFloatingPointType phColor[3];
+              anActor->GetPreHighlightColor(phColor[0], phColor[1], phColor[2]);
+              c0 = int (phColor[0] * 255);
+              c1 = int (phColor[1] * 255);
+              c2 = int (phColor[2] * 255);
+              preselection.setRgb(c0, c1, c2);
+
               size0D = (int)anActor->Get0DSize();
               if(size0D == 0)
                 size0D = 1;
         aDlg->SetColor(1, c);
         aDlg->SetColor(2, e);
         aDlg->SetColor(3, n);
+        aDlg->SetColor(4, outl);
        aDlg->SetDeltaBrightness(delta);
         aDlg->SetColor(5, c0D);
         aDlg->SetColor(6, o);
         aDlg->SetIntValue(3, size0D);
         aDlg->SetDoubleValue(1, faces_orientation_scale);
         aDlg->SetBooleanValue(1, faces_orientation_3dvectors);
+        aDlg->SetColor(7, selection);
+        aDlg->SetColor(8, preselection);
  
         aDlg->setCustomMarkerMap( theMarkerMap[ aStudy->StudyId() ] );
 
           QColor color = aDlg->GetColor(1);
           QColor edgecolor = aDlg->GetColor(2);
           QColor nodecolor = aDlg->GetColor(3);
-          QColor backfacecolor = aDlg->GetColor(4);
+          QColor outlinecolor = aDlg->GetColor(4);
           QColor color0D = aDlg->GetColor(5);
           QColor faces_orientation_color = aDlg->GetColor(6);
+         QColor selectioncolor = aDlg->GetColor(7);
+         QColor preSelectioncolor = aDlg->GetColor(8);
          int delta = aDlg->GetDeltaBrightness();
 
           /* Point marker */
                 anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
                                       vtkFloatingPointType (edgecolor.green()) / 255.,
                                       vtkFloatingPointType (edgecolor.blue()) / 255.);
+               /* edge outline */
+                anActor->SetOutlineColor(vtkFloatingPointType (outlinecolor.red()) / 255.,
+                                        vtkFloatingPointType (outlinecolor.green()) / 255.,
+                                        vtkFloatingPointType (outlinecolor.blue()) / 255.);
+
+               /* selection */
+                anActor->SetHighlightColor(vtkFloatingPointType (selectioncolor.red()) / 255.,
+                                          vtkFloatingPointType (selectioncolor.green()) / 255.,
+                                          vtkFloatingPointType (selectioncolor.blue()) / 255.);
+               /* pre-selection */
+                anActor->SetPreHighlightColor(vtkFloatingPointType (preSelectioncolor.red()) / 255.,
+                                             vtkFloatingPointType (preSelectioncolor.green()) / 255.,
+                                             vtkFloatingPointType (preSelectioncolor.blue()) / 255.);
+               
 
                 /* Shrink factor and size edges */
                 anActor->SetShrinkFactor(aDlg->GetIntValue(2) / 100.);
@@ -4502,24 +4542,25 @@ void SMESHGUI::createPreferences()
   setPreferenceProperty( elemGroup, "columns", 2 );
 
   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_COLOR_0D" ), elemGroup, LightApp_Preferences::Color, "SMESH", "elem0d_color" );
-
+  
+  addPreference( tr( "PREF_OUTLINE"  ), elemGroup, LightApp_Preferences::Color, "SMESH", "outline_color" );
+  addPreference( tr( "PREF_WIREFRAME"  ), elemGroup, LightApp_Preferences::Color, "SMESH", "wireframe_color" );
   
   setPreferenceProperty( ColorId, "text", tr("PREF_BACKFACE") );
 
+  int grpSelection = addPreference( tr( "PREF_GROUP_SELECTION" ), meshTab );
+  setPreferenceProperty( grpSelection, "columns", 2 );
+  addPreference( tr( "PREF_SELECTION"  ), grpSelection, LightApp_Preferences::Color, "SMESH", "selection_object_color" );
+  addPreference( tr( "PREF_PRE_SELECTION"  ), grpSelection, LightApp_Preferences::Color, "SMESH", "highlight_color" );
+
   int grpGroup = addPreference( tr( "PREF_GROUP_GROUPS" ), meshTab );
   setPreferenceProperty( grpGroup, "columns", 2 );
 
   addPreference( tr( "PREF_GRP_NAMES" ), grpGroup, LightApp_Preferences::Color, "SMESH", "group_name_color" );
 
-  //int sp = addPreference( "", elemGroup, LightApp_Preferences::Space );
-  //setPreferenceProperty( sp, "hstretch", 0 );
-  //setPreferenceProperty( sp, "vstretch", 0 );
-
   int size0d = addPreference(tr("PREF_SIZE_0D"), elemGroup,
                              LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
-  int sp = addPreference( "", elemGroup, LightApp_Preferences::Space );
   int elemW  = addPreference(tr("PREF_WIDTH"), elemGroup,
                              LightApp_Preferences::IntSpin, "SMESH", "element_width");
   int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup,
@@ -4528,9 +4569,6 @@ void SMESHGUI::createPreferences()
   setPreferenceProperty( size0d, "min", 1 );
   setPreferenceProperty( size0d, "max", 10 );
 
-  setPreferenceProperty( sp, "hstretch", 0 );
-  setPreferenceProperty( sp, "vstretch", 0 );
-
   setPreferenceProperty( elemW, "min", 1 );
   setPreferenceProperty( elemW, "max", 5 );
 
@@ -5102,6 +5140,12 @@ void SMESHGUI::storeVisualParameters (int savePoint)
                   colorStr += gDigitsSep; colorStr += QString::number(g);
                   colorStr += gDigitsSep; colorStr += QString::number(b);
 
+                  aSmeshActor->GetOutlineColor(r, g, b);
+                  colorStr += gDigitsSep; colorStr += "outline";
+                  colorStr += gDigitsSep; colorStr += QString::number(r);
+                  colorStr += gDigitsSep; colorStr += QString::number(g);
+                  colorStr += gDigitsSep; colorStr += QString::number(b);
+
                   aSmeshActor->GetNodeColor(r, g, b);
                   colorStr += gDigitsSep; colorStr += "node";
                   colorStr += gDigitsSep; colorStr += QString::number(r);
@@ -5459,16 +5503,17 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
             // Colors
             else if (paramNameStr == "Colors") {
               QStringList colors = val.split(gDigitsSep, QString::SkipEmptyParts);
-              if (colors.count() == 16 || colors.count() == 14 ) {
+              if (colors.count() == 16 || colors.count() == 17 ) {
                 if (colors[0] != "surface" || colors[4]  != "backsurface" ||
                     (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 or surface:r:g:b:backsurface:delta: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:outline:r:g:b");
                 }
                 else {
                  int delta = 0; 
                  float er,eg,eb;
                  float nr,ng,nb;
+                 vtkFloatingPointType otr,otg,otb;
                  //Old case backsurface color is independent
                  if( colors.count() == 16 ) {
                    QColor ffc;
@@ -5480,6 +5525,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                    nr = colors[13].toFloat();
                    ng = colors[14].toFloat();
                    nb = colors[15].toFloat();
+                   SMESH::GetColor("SMESH", "outline_color", otr, otg, otb, QColor( 0, 70, 0 ) );
                  } else {
                    //New case backsurface color depends on surface color
                    delta = colors[5].toInt();
@@ -5491,10 +5537,15 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
                    nr = colors[11].toFloat();
                    ng = colors[12].toFloat();
                    nb = colors[13].toFloat();
+
+                   otr = colors[14].toFloat();
+                   otg = colors[15].toFloat();
+                   otb = colors[16].toFloat();
                  }
                   aSmeshActor->SetSufaceColor(colors[1].toFloat(), colors[2].toFloat(), colors[3].toFloat(), delta);
                   aSmeshActor->SetEdgeColor(er,eg,eb);
                   aSmeshActor->SetNodeColor(nr,ng,nb);
+                  aSmeshActor->SetOutlineColor(otr,otg,otb);
                 }
               }
             }
index e411e7049935a62c34a348f8bcb4f7693ca77cf6..543931c3f31917cbde088ecb220c4b00c6c1f352 100644 (file)
@@ -85,9 +85,12 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   toolSurfColor = new QtxBiColorTool(ButtonGroup1);
   toolSurfColor->setText("Back surface color");
 
-  QLabel* TextLabel_Outine = new QLabel( tr( "Outline" ), ButtonGroup1 );
+  QLabel* TextLabel_Outline = new QLabel( tr( "Outline color" ), ButtonGroup1 );
   btnOutlineColor = new QtxColorButton( ButtonGroup1 );
 
+  QLabel* TextLabel_Wireframe = new QLabel( tr( "Wireframe color" ), ButtonGroup1 );
+  btnWireframeColor = new QtxColorButton( ButtonGroup1 );
+
   QLabel* TextLabel_0DElements_Color = new QLabel( tr( "0D elements" ), ButtonGroup1 );
   btn0DElementsColor = new QtxColorButton( ButtonGroup1 );
 
@@ -117,12 +120,18 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
 
   ButtonGroup1Layout->addWidget( TextLabel_Fill,             0, 0 );
   ButtonGroup1Layout->addWidget( toolSurfColor,              0, 1, 1, 3 );
-  ButtonGroup1Layout->addWidget( TextLabel_Outine,           1, 0 );
+
+  ButtonGroup1Layout->addWidget( TextLabel_Outline,          1, 0 );
   ButtonGroup1Layout->addWidget( btnOutlineColor,            1, 1 );
-  ButtonGroup1Layout->addWidget( TextLabel_0DElements_Color, 1, 2 );
-  ButtonGroup1Layout->addWidget( btn0DElementsColor,         1, 3 );
-  ButtonGroup1Layout->addWidget( TextLabel_0DElements_Size,  2, 0 );
-  ButtonGroup1Layout->addWidget( SpinBox_0DElements_Size,    2, 1 );
+  ButtonGroup1Layout->addWidget( TextLabel_Wireframe,        1, 2 );
+  ButtonGroup1Layout->addWidget( btnWireframeColor,         1, 3 );
+
+  ButtonGroup1Layout->addWidget( TextLabel_0DElements_Color, 2, 0 );
+  ButtonGroup1Layout->addWidget( btn0DElementsColor,         2, 1 );
+
+  ButtonGroup1Layout->addWidget( TextLabel_0DElements_Size,  2, 2 );
+  ButtonGroup1Layout->addWidget( SpinBox_0DElements_Size,    2, 3 );
+
   ButtonGroup1Layout->addWidget( TextLabel_Width,            3, 0 );
   ButtonGroup1Layout->addWidget( SpinBox_Width,              3, 1 );
   ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff,      3, 2 );
@@ -175,6 +184,23 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   ButtonGroup3Layout->addWidget( SpinBox_Orientation_Scale,      0, 3 );
   ButtonGroup3Layout->addWidget( CheckBox_Orientation_3DVectors, 1, 0, 1, 4 );
 
+  // -------------------------------
+  QGroupBox* ButtonGroup4 = new QGroupBox( tr( "Selection" ), this );
+  QGridLayout* ButtonGroup4Layout = new QGridLayout( ButtonGroup4 );
+  ButtonGroup3Layout->setSpacing( SPACING );
+  ButtonGroup3Layout->setMargin( MARGIN );
+  
+  QLabel* TextLabel_Selection_Color = new QLabel( tr( "Selection color" ), ButtonGroup4 );
+  btnSelectionColor = new QtxColorButton( ButtonGroup4 );
+  
+  QLabel* TextLabel_Preselection_Color = new QLabel( tr( "Pre-selection color" ), ButtonGroup4 );
+  btnPreselectionColor = new QtxColorButton( ButtonGroup4 );
+  
+  ButtonGroup4Layout->addWidget( TextLabel_Selection_Color,      0, 0 );
+  ButtonGroup4Layout->addWidget( btnSelectionColor,              0, 1 );
+  ButtonGroup4Layout->addWidget( TextLabel_Preselection_Color,   0, 2 );
+  ButtonGroup4Layout->addWidget( btnPreselectionColor,           0, 3 );
+
   // -------------------------------
   QGroupBox* GroupButtons = new QGroupBox( this );
   QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
@@ -201,6 +227,9 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   topLayout->addWidget( ButtonGroup1 );
   topLayout->addWidget( ButtonGroup2 );
   topLayout->addWidget( ButtonGroup3 );
+  //  rnv: Selection and preselection colors are defined only in the Preferences 
+  //  topLayout->addWidget( ButtonGroup4 );
+  ButtonGroup4->hide();
   topLayout->addWidget( GroupButtons );
 
   // -------------------------------
@@ -306,11 +335,14 @@ void SMESHGUI_Preferences_ColorDlg::ActivateThisDialog()
 void SMESHGUI_Preferences_ColorDlg::SetColor( int type, const QColor& color )
 {
   switch ( type ) {
-  case 1 : toolSurfColor->setMainColor( color );        break; // fill
-  case 2 : btnOutlineColor->setColor( color );     break; // outline
-  case 3 : btnNodeColor->setColor( color );        break; // node
-  case 5 : btn0DElementsColor->setColor( color );  break; // 0d elements
-  case 6 : btnOrientationColor->setColor( color ); break; // orientation of faces
+  case 1 : toolSurfColor->setMainColor( color );     break; // fill
+  case 2 : btnWireframeColor->setColor( color );     break; // wireframe
+  case 3 : btnNodeColor->setColor( color );          break; // node
+  case 4 : btnOutlineColor->setColor( color );       break; // outline
+  case 5 : btn0DElementsColor->setColor( color );    break; // 0d elements
+  case 6 : btnOrientationColor->setColor( color );   break; // orientation of faces
+  case 7 : btnSelectionColor->setColor( color );     break; // selection color
+  case 8 : btnPreselectionColor->setColor( color );  break; // pre-selection color
   default: break;
   }
 }
@@ -323,11 +355,15 @@ QColor SMESHGUI_Preferences_ColorDlg::GetColor( int type )
 {
   QColor color;
   switch ( type ) {
-  case 1 : color = toolSurfColor->mainColor();        break; // fill
-  case 2 : color = btnOutlineColor->color();     break; // outline
-  case 3 : color = btnNodeColor->color();        break; // node
-  case 5 : color = btn0DElementsColor->color();  break; // 0d elements
-  case 6 : color = btnOrientationColor->color(); break; // orientation of faces
+  case 1 : color = toolSurfColor->mainColor();    break; // fill
+  case 2 : color = btnWireframeColor->color();    break; // outline
+  case 3 : color = btnNodeColor->color();         break; // node
+  case 4 : color = btnOutlineColor->color();      break; // node
+  case 5 : color = btn0DElementsColor->color();   break; // 0d elements
+  case 6 : color = btnOrientationColor->color();  break; // orientation of faces
+  case 7 : color = btnSelectionColor->color();    break; // selection color
+  case 8 : color = btnPreselectionColor->color(); break; // pre-selection color
+
   default: break;
   }
   return color;
index 05eef69248a6f0f642bd5cb778992207c55615f9..b2675314b9f3299d1c126cd4f2aa3fe2aea15c6b 100644 (file)
@@ -88,6 +88,7 @@ private:
   SMESHGUI*             mySMESHGUI;            
 
   QtxBiColorTool*       toolSurfColor; 
+  QtxColorButton*       btnWireframeColor;
   QtxColorButton*       btnOutlineColor;
   QtxColorButton*       btn0DElementsColor;
   SalomeApp_IntSpinBox* SpinBox_0DElements_Size;
@@ -98,6 +99,8 @@ private:
   QtxColorButton*       btnOrientationColor;
   SMESHGUI_SpinBox*     SpinBox_Orientation_Scale;
   QCheckBox*            CheckBox_Orientation_3DVectors;
+  QtxColorButton*       btnPreselectionColor;
+  QtxColorButton*       btnSelectionColor;
 
   QString               myHelpFileName;
 };
index 60db88cc7b7a880b71d8799038ea48531511d35d..b10091049234ed1eec2e1247f949c3eef4dede68 100644 (file)
@@ -3552,6 +3552,22 @@ Please, create VTK viewer and try again</translation>
         <source>PREF_BACKFACE</source>
         <translation>Back surface color</translation>
     </message>
+    <message>
+        <source>PREF_WIREFRAME</source>
+        <translation>Wireframe color</translation>
+    </message>
+    <message>
+        <source>PREF_GROUP_SELECTION</source>
+        <translation>Selection</translation>
+    </message>            
+    <message>
+        <source>PREF_SELECTION</source>
+        <translation>Selection color</translation>
+    </message>
+    <message>
+        <source>PREF_PRE_SELECTION</source>
+        <translation>Pre-selection color</translation>
+    </message>    
     <message>
         <source>PREF_COLOR</source>
         <translation>Color</translation>
@@ -3706,7 +3722,7 @@ Please, create VTK viewer and try again</translation>
     </message>
     <message>
         <source>PREF_OUTLINE</source>
-        <translation>Outline</translation>
+        <translation>Outline color</translation>
     </message>
     <message>
         <source>PREF_PRECISION_USE</source>