From f07c1d15ebada8f454cef88d0d441afd5769f215 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 31 Oct 2014 18:49:21 +0300 Subject: [PATCH] IPAL22837: TC 6.4.0: Auto Color does not reset color of group of edges --- src/GEOMGUI/GeometryGUI.cxx | 2 +- src/GEOMToolsGUI/GEOMToolsGUI_1.cxx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index c7e69aec2..bd6b572ab 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -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(); diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index 4c8d4c7d8..d3cdf6095 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -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(), 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 ); } -- 2.39.2