From: vsr Date: Fri, 31 Oct 2014 15:49:21 +0000 (+0300) Subject: IPAL22837: TC 6.4.0: Auto Color does not reset color of group of edges X-Git-Tag: V7_5_0b1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=51dda7a553bf03c3d213891fc1fb362dacf227e3;p=modules%2Fgeom.git IPAL22837: TC 6.4.0: Auto Color does not reset color of group of edges --- 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 ); }