]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Implementation of the "21046: EDF 1610 GUI: To be able to change the width of the...
authorrnv <rnv@opencascade.com>
Tue, 14 Feb 2012 12:08:05 +0000 (12:08 +0000)
committerrnv <rnv@opencascade.com>
Tue, 14 Feb 2012 12:08:05 +0000 (12:08 +0000)
resources/SalomeApp.xml.in
src/OBJECT/SMESH_Actor.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.cxx

index cbeffbd36e7450f0f5cf8d6f1ddc5e41c2233874..ed12aa583693e0ac1ae6c8d75b773642653f7f52 100644 (file)
@@ -48,8 +48,6 @@
     <parameter name="selection_precision_element"  value="0.005"/>
     <parameter name="selection_precision_node"     value="0.005"/>
     <parameter name="selection_precision_object"   value="0.005"/>
-    <parameter name="selection_width"              value="5"/>
-    <parameter name="highlight_width"              value="5"/>
     <parameter name="controls_precision"           value="0"/>
     <parameter name="equal_nodes_tolerance"        value="1e-7"/>
     <parameter name="scalar_bar_horizontal_height" value="0.08"/>
index b0af3e9e33bf2847772442e45aec7a6970213a03..7d1ab09d15a1b5d46a879dd14e0630bb1b377c1a 100644 (file)
@@ -376,7 +376,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myBaseActor->SetStoreGemetryMapping(true);
   myBaseActor->GetProperty()->SetOpacity(0.0);
   myPickableActor = myBaseActor;
-
+  
   myHighlightProp = vtkProperty::New();
   myHighlightProp->SetAmbient(1.0);
   myHighlightProp->SetDiffuse(0.0);
@@ -384,6 +384,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
   myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
   myHighlightProp->SetPointSize(aElem0DSize); // ??
+  myHighlightProp->SetLineWidth(aLineWidth);
   myHighlightProp->SetRepresentation(1);
 
   myOutLineProp = vtkProperty::New();
@@ -393,6 +394,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   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->SetLineWidth(aLineWidth);
   myOutLineProp->SetRepresentation(1);
 
   myPreselectProp = vtkProperty::New();
@@ -402,6 +404,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
   myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
   myPreselectProp->SetPointSize(aElem0DSize); // ??
+  myPreselectProp->SetLineWidth(aLineWidth);
   myPreselectProp->SetRepresentation(1);
 
   myHighlitableActor = SMESH_DeviceActor::New();
@@ -1812,8 +1815,11 @@ void SMESH_ActorDef::SetLineWidth(vtkFloatingPointType theVal){
   myEdgeProp->SetLineWidth(theVal);
 
   my1DProp->SetLineWidth(theVal + aLineWidthInc);
-  my1DExtProp->SetLineWidth(theVal + aLineWidthInc);
-
+  my1DExtProp->SetLineWidth(theVal + aLineWidthInc);    
+  my2DExtProp->SetLineWidth(theVal + aLineWidthInc);
+  myOutLineProp->SetLineWidth(theVal);
+  myHighlightProp->SetLineWidth(theVal);
+  myPreselectProp->SetLineWidth(theVal);
   Modified();
 }
 
index e76fb856455ecc8ad81856a36caa52ae9253681d..5cf67129484c401bdbd601910ba1700f7df80448 100644 (file)
@@ -4699,19 +4699,11 @@ void SMESHGUI::createPreferences()
 
   addPreference( tr( "PREF_OBJECT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_object_color" );
   addPreference( tr( "PREF_ELEMENT_COLOR" ), selGroup, LightApp_Preferences::Color, "SMESH", "selection_element_color" );
-  int selW = addPreference( tr( "PREF_WIDTH" ), selGroup, LightApp_Preferences::IntSpin, "SMESH", "selection_width" );
-
-  setPreferenceProperty( selW, "min", 1 );
-  setPreferenceProperty( selW, "max", 5 );
 
   int preGroup = addPreference( tr( "PREF_GROUP_PRESELECTION" ), selTab );
   setPreferenceProperty( preGroup, "columns", 2 );
 
   addPreference( tr( "PREF_HIGHLIGHT_COLOR" ), preGroup, LightApp_Preferences::Color, "SMESH", "highlight_color" );
-  int preW = addPreference( tr( "PREF_WIDTH" ), preGroup, LightApp_Preferences::IntSpin, "SMESH", "highlight_width" );
-
-  setPreferenceProperty( preW, "min", 1 );
-  setPreferenceProperty( preW, "max", 5 );
 
   int precSelGroup = addPreference( tr( "PREF_GROUP_PRECISION" ), selTab );
   setPreferenceProperty( precSelGroup, "columns", 2 );
@@ -4814,7 +4806,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
     std::string aWarning;
     SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
     if( name=="selection_object_color" || name=="selection_element_color" ||
-        name=="selection_width" || name=="highlight_color" || name=="highlight_width" ||
+        name=="highlight_color" ||
         name=="selection_precision_node" || name=="selection_precision_element" ||
         name=="selection_precision_object")
       SMESH::UpdateSelectionProp( this );
index 46e7e5c969cfb2efb199a4f076f8e7606fa391c6..4c9ac89fe9049c29ff1374ff2e0b923c0eae4c7f 100644 (file)
@@ -896,16 +896,11 @@ namespace SMESH
            aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
            aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
 
-    int SW = mgr->integerValue( "SMESH", "selection_width", 5 ),
-        PW = mgr->integerValue( "SMESH", "highlight_width", 5 );
-
-    // adjust highlight_width to the width of mesh entities
     int aElem0DSize = mgr->integerValue("SMESH", "elem0d_size", 5);
     int aLineWidth  = mgr->integerValue("SMESH", "element_width", 1);
     int maxSize = aElem0DSize;
     if (aElem0DSize > maxSize) maxSize = aElem0DSize;
     if (aLineWidth > maxSize) maxSize = aLineWidth;
-    if (PW < maxSize + 2) PW = maxSize + 2;
 
     double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
            SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
@@ -917,16 +912,14 @@ namespace SMESH
         // mesh element selection
         aVtkView->SetSelectionProp(aSelColor.red()/255.,
                                    aSelColor.green()/255.,
-                                   aSelColor.blue()/255.,
-                                   SW );
+                                   aSelColor.blue()/255.);
         // tolerances
         aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
 
         // pre-selection
         aVtkView->SetPreselectionProp(aPreColor.red()/255.,
                                       aPreColor.green()/255.,
-                                      aPreColor.blue()/255.,
-                                      PW);
+                                      aPreColor.blue()/255.);
         // update actors
         vtkRenderer* aRenderer = aVtkView->getRenderer();
         VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());