Salome HOME
Improved fix for bug PAL12858 (EDF210 GEOM Preferences menu of GEOM: color of the...
authormzn <mzn@opencascade.com>
Tue, 29 Aug 2006 12:04:48 +0000 (12:04 +0000)
committermzn <mzn@opencascade.com>
Tue, 29 Aug 2006 12:04:48 +0000 (12:04 +0000)
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GeometryGUI.cxx

index 7176ffeb779bdfaa080eb8c24858fd7e61a2b543..23a9fb777119f54fd8b217a57f521c84a7bedcdb 100644 (file)
@@ -521,6 +521,19 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
        AISShape->SetDisplayMode( myDisplayMode );
         AISShape->SetShadingColor( myShadingColor );
 
+       // Set color for iso lines
+       SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+       QColor col = aResMgr->colorValue( "Geometry", "isos_color", QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
+       Quantity_Color aColor = SalomeApp_Tools::color( col );
+       
+       Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
+       anAspect->SetColor( aColor );
+       AISShape->Attributes()->SetUIsoAspect( anAspect );
+       
+       anAspect = AISShape->Attributes()->VIsoAspect();
+       anAspect->SetColor( aColor );
+       AISShape->Attributes()->SetVIsoAspect( anAspect );
+       
         if ( HasColor() )
         {
          AISShape->SetColor( (Quantity_NameOfColor)GetColor() );
@@ -533,35 +546,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
         }
        else
          {
-           SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-
-           // Set color for iso lines
-           QColor col = aResMgr->colorValue( "Geometry", "isos_color", QColor(int(0.5*255), int(0.5*255), int(0.5*255)) );
-           Quantity_Color aColor = SalomeApp_Tools::color( col );
-
-           Handle(Prs3d_IsoAspect) anAspect = AISShape->Attributes()->UIsoAspect();
-            anAspect->SetColor( aColor );
-            AISShape->Attributes()->SetUIsoAspect( anAspect );
-
-           anAspect = AISShape->Attributes()->VIsoAspect();
-            anAspect->SetColor( aColor );
-            AISShape->Attributes()->SetVIsoAspect( anAspect );
-           
-           if ( myShape.ShapeType() == TopAbs_FACE )
-             {
-               col = aResMgr->colorValue( "Geometry", "face_color", QColor( 0, 255, 0 ) );
-               aColor = SalomeApp_Tools::color( col );
-
-               AISShape->SetColor( aColor );
-             }
-           else if ( myShape.ShapeType() == TopAbs_EDGE || myShape.ShapeType() == TopAbs_WIRE )
-             {
-               col = aResMgr->colorValue( "Geometry", "edge_wire_color", QColor( 255, 0, 0 ) );
-               aColor = SalomeApp_Tools::color( col );
-               
-               AISShape->SetColor( aColor );
-             }
-           else if ( myShape.ShapeType() == TopAbs_VERTEX )
+           if ( myShape.ShapeType() == TopAbs_VERTEX )
              {
                col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) );
                aColor = SalomeApp_Tools::color( col );
@@ -572,10 +557,34 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs )
              }
            else
              {
+               // Set line aspect
                col = aResMgr->colorValue( "Geometry", "wireframe_color", QColor( 255, 255, 0 ) );
                aColor = SalomeApp_Tools::color( col );
                
-               AISShape->SetColor( aColor );
+               Handle(Prs3d_LineAspect) anAspect = AISShape->Attributes()->LineAspect();
+               anAspect->SetColor( aColor );
+               AISShape->Attributes()->SetLineAspect( anAspect );
+
+               // Set unfree boundaries aspect
+               anAspect = AISShape->Attributes()->UnFreeBoundaryAspect();
+               anAspect->SetColor( aColor );
+               AISShape->Attributes()->SetUnFreeBoundaryAspect( anAspect );
+
+               // Set free boundaries aspect
+               col = aResMgr->colorValue( "Geometry", "free_bound_color", QColor( 0, 255, 0 ) );
+               aColor = SalomeApp_Tools::color( col );
+               
+               anAspect = AISShape->Attributes()->FreeBoundaryAspect();
+               anAspect->SetColor( aColor );
+               AISShape->Attributes()->SetFreeBoundaryAspect( anAspect );
+               
+               // Set wire aspect
+               col = aResMgr->colorValue( "Geometry", "line_color", QColor( 255, 0, 0 ) );
+               aColor = SalomeApp_Tools::color( col );
+               
+               anAspect = AISShape->Attributes()->WireAspect();
+               anAspect->SetColor( aColor );
+               AISShape->Attributes()->SetWireAspect( anAspect );
              }
          }
 
index f49100919e0238aa1bc194c55b15ed0c50e8b704..e41898df3f6438c04cb9853c2bbe9f8984d695bc 100644 (file)
@@ -1658,11 +1658,11 @@ void GeometryGUI::createPreferences()
   addPreference( tr( "PREF_WIREFRAME_COLOR" ), genGroup,
                 LightApp_Preferences::Color, "Geometry", "wireframe_color" );
   
-  addPreference( tr( "PREF_FACE_COLOR" ), genGroup,
-                LightApp_Preferences::Color, "Geometry", "face_color" );
+  addPreference( tr( "PREF_FREE_BOUND_COLOR" ), genGroup,
+                LightApp_Preferences::Color, "Geometry", "free_bound_color" );
   
-  addPreference( tr( "PREF_EDGE_WIRE_COLOR"), genGroup,
-                LightApp_Preferences::Color, "Geometry", "edge_wire_color" );
+  addPreference( tr( "PREF_LINE_COLOR"), genGroup,
+                LightApp_Preferences::Color, "Geometry", "line_color" );
   
   addPreference( tr( "PREF_POINT_COLOR"), genGroup,
                 LightApp_Preferences::Color, "Geometry", "point_color" );