+ myViewWindow->Repaint();
+ }
+ ValueHasChanged();
+}
+
+//=================================================================================
+// function : ValueHasChanged()
+// purpose : Called when user moves a slider
+//=================================================================================
+void SMESHGUI_TransparencyDlg::ValueHasChanged()
+{
+ ValueLab->setText( QString::number( Slider1->value() ) + "%") ;
+}
+
+//=================================================================================
+// function : onSelectionChanged()
+// purpose : Called when selection is changed
+//=================================================================================
+void SMESHGUI_TransparencyDlg::onSelectionChanged()
+{
+ if ( myViewWindow ) {
+ int opacity = 100;
+
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects( aList );
+
+ if ( aList.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
+ if ( !FirstIOS.IsNull() ) {
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
+ if ( anActor )
+ opacity = int( anActor->GetOpacity() * 100. + 0.5 );
+ }
+ }
+ else if ( aList.Extent() > 1 ) {
+ SALOME_ListIteratorOfListIO It( aList );
+ int setOp = -1;
+ for ( ; It.More(); It.Next() ) {
+ Handle(SALOME_InteractiveObject) IO = It.Value();
+ if ( !IO.IsNull() ) {
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
+ if ( anActor ) {
+ int op = int( anActor->GetOpacity() * 100. + 0.5 );
+ if ( setOp < 0 )
+ setOp = op;
+ else if ( setOp != op ) {
+ setOp = 100;
+ break;
+ }
+ }
+ }
+ }
+ if ( setOp >= 0 )
+ opacity = setOp;
+ }
+ else {
+ }
+ Slider1->setValue( 100 - opacity );
+ }
+ ValueHasChanged();
+}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void SMESHGUI_TransparencyDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();