Salome HOME
IPAL22837: TC 6.4.0: Auto Color does not reset color of group of edges V7_5_0b1
authorvsr <vsr@opencascade.com>
Fri, 31 Oct 2014 15:49:21 +0000 (18:49 +0300)
committervsr <vsr@opencascade.com>
Fri, 31 Oct 2014 15:49:21 +0000 (18:49 +0300)
src/GEOMGUI/GeometryGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx

index c7e69aec226daf19ba5ee7a8b50e9a7ac759beaf..bd6b572aba3e73086835103996905dc5a0b6ef6a 100644 (file)
@@ -1433,7 +1433,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   QString clientOCCorOB_AndSomeVisible = clientOCCorOB + " and selcount>0 and isVisible";
 
   QString autoColorPrefix =
-    "(client='ObjectBrowser' or client='OCCViewer') and type='Shape' and selcount=1 and isOCC=true";
+    "(client='ObjectBrowser' or client='OCCViewer' or client='VTKViewer') and type='Shape' and selcount=1";
 
   QtxPopupMgr* mgr = popupMgr();
 
index 4c8d4c7d809467bf637c5b19608b90f5def46b5f..d3cdf6095c09f52b1f0a37cd6e1a227ef65d81b0 100644 (file)
@@ -187,7 +187,7 @@ void GEOMToolsGUI::OnAutoColor()
 
     SUIT_OverrideCursor();
     
-    appStudy->setObjectProperty( aMgrId, aChildObject->GetEntry(), GEOM::propertyName( GEOM::Color ), c );
+    appStudy->setObjectProperty( aMgrId, aChildObject->GetStudyEntry(), GEOM::propertyName( GEOM::Color ), c );
     Handle( SALOME_InteractiveObject ) io = new SALOME_InteractiveObject( aChildObject->GetStudyEntry(), "GEOM", "" );
     if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
   }
@@ -260,10 +260,17 @@ void GEOMToolsGUI::OnColor()
   color = QColorDialog::getColor( v.value<QColor>(), app->desktop() );
   if ( !color.isValid() ) return;
 
+  SALOMEDS::Color aSColor;
+  aSColor.R = (double)color.red() / 255.0;
+  aSColor.G = (double)color.green() / 255.0;
+  aSColor.B = (double)color.blue() / 255.0;
+
   // iterate through list of objects and assign new color
   SUIT_OverrideCursor();
   for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
     Handle( SALOME_InteractiveObject ) io = It.Value();
+    GEOM::GEOM_Object_var aObject = GEOMBase::ConvertIOinGEOMObject( io );
+    if ( !CORBA::is_nil( aObject ) ) aObject->SetColor( aSColor );
     appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::Color ), color );
     if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
   }