Fix problem of change transparency operation: initial transparency is set incorrectly in the dialog box in some cases

This commit is contained in:
vsr 2011-03-09 09:33:08 +00:00
parent aaaf656e0d
commit b705a79b86
2 changed files with 4 additions and 4 deletions

View File

@ -465,7 +465,7 @@ void GEOMToolsGUI::OnChangeTransparency( bool increase )
GEOMBase* gb = new GEOMBase(); GEOMBase* gb = new GEOMBase();
Handle(GEOM_AISShape) aisShape; Handle(GEOM_AISShape) aisShape;
aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS ); aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, true );
if( aisShape.IsNull() ) if( aisShape.IsNull() )
return; return;
float transp = aisShape->Transparency(); float transp = aisShape->Transparency();
@ -482,7 +482,7 @@ void GEOMToolsGUI::OnChangeTransparency( bool increase )
return; return;
Handle(AIS_InteractiveContext) ic = vm->getAISContext(); Handle(AIS_InteractiveContext) ic = vm->getAISContext();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
aisShape = gb->ConvertIOinGEOMAISShape( It.Value() ); aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), true );
if ( !aisShape.IsNull() ) { if ( !aisShape.IsNull() ) {
ic->SetTransparency( aisShape, transp, false ); ic->SetTransparency( aisShape, transp, false );
ic->Redisplay( aisShape, Standard_False, Standard_True ); ic->Redisplay( aisShape, Standard_False, Standard_True );

View File

@ -297,7 +297,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
if ( myFirstInit ) { if ( myFirstInit ) {
mySlider->setValue(mySlider->maximum()); mySlider->setValue(mySlider->maximum());
myFirstInit = false; myFirstInit = false;
aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS ); aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, true );
if( aisShape.IsNull() ) if( aisShape.IsNull() )
return; return;
int transp = int( 100 - ( aisShape->Transparency() * 100.0 ) + 0.5); int transp = int( 100 - ( aisShape->Transparency() * 100.0 ) + 0.5);
@ -312,7 +312,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
return; return;
Handle(AIS_InteractiveContext) ic = vm->getAISContext(); Handle(AIS_InteractiveContext) ic = vm->getAISContext();
for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
aisShape = gb->ConvertIOinGEOMAISShape( It.Value() ); aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), true );
if ( !aisShape.IsNull() ) { if ( !aisShape.IsNull() ) {
ic->SetTransparency( aisShape, newValue, false ); ic->SetTransparency( aisShape, newValue, false );
ic->Redisplay( aisShape, Standard_False, Standard_True ); ic->Redisplay( aisShape, Standard_False, Standard_True );