- }
-
- case 1001: // AUTOMATIC UPDATE PREFERENCES
- {
-// if (act->isOn()) {
-// mgr->setValue( "SMESH", "AutomaticUpdate", true );
-// myAutomaticUpdate = true;
-// }
-// else {
-// mgr->setValue( "SMESH", "AutomaticUpdate", false );
-// myAutomaticUpdate = false;
-// }
- break;
- }
-
- case 1003: // MESH PREFERENCES
- {
- ::SetDisplaySettings();
- break;
- }
-
- case 1005:
- {
- SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences( this );
- break;
- }
-
- case 10070:
- {
- ( new SMESHGUI_PrecisionDlg( this ) )->exec();
- break;
- }
-
- case 10071:
- {
- if (act->isOn()) {
- mgr->setValue( "SMESH", "display_entity", true );
- }
- else {
- mgr->setValue( "SMESH", "display_entity", false );
- }
- break;
- }
- case 1006:
- {
- SMESHGUI_Preferences_SelectionDlg* aDlg =
- new SMESHGUI_Preferences_SelectionDlg( this );
-
- QColor aColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
- aDlg->SetColor(1, aColor);
-
- aColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow );
- aDlg->SetColor(2, aColor);
-
- aColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white );
- aDlg->SetColor(3, aColor);
-
- aDlg->SetWidth(1, mgr->integerValue( "SMESH", "highlight_width", 5 ) );
- aDlg->SetWidth(2, mgr->integerValue( "SMESH", "selection_width", 5 ) );
- aDlg->SetPrecision(1, mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ) );
- aDlg->SetPrecision(2, mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ) );
-
- if (aDlg->exec()) {
- QColor aPreColor = aDlg->GetColor(1),
- aSelColor = aDlg->GetColor(2),
- aHiColor = aDlg->GetColor(3);
- int aPreWidth = aDlg->GetWidth(1),
- aSelWidth = aDlg->GetWidth(2);
- double aTolNodes = aDlg->GetPrecision(1),
- aTolItems = aDlg->GetPrecision(2);
-
- mgr->setValue( "SMESH", "highlight_color", aPreColor );
- mgr->setValue( "SMESH", "selection_element_color", aSelColor );
- mgr->setValue( "SMESH", "selection_object_color", aHiColor );
-
- mgr->setValue( "SMESH", "highlight_width", aPreWidth );
- mgr->setValue( "SMESH", "selection_width", aSelWidth );
- mgr->setValue( "SMESH", "selection_precision_node", aTolNodes );
- mgr->setValue( "SMESH", "selection_precision_element", aTolItems );
-
- // update current study settings
- SMESH::UpdateSelectionProp( this );
-
- if( vtkwnd ) {
- // update VTK viewer properties
- SVTK_RenderWindowInteractor* anInteractor =
- dynamic_cast<SVTK_RenderWindowInteractor*>( vtkwnd->getRWInteractor() );
- if (anInteractor) {
- anInteractor->SetSelectionProp(aSelColor.red()/255., aSelColor.green()/255.,
- aSelColor.blue()/255., aSelWidth);
- anInteractor->SetSelectionTolerance(aTolNodes, aTolItems);
- SVTK_InteractorStyle* aStyle =
- dynamic_cast<SVTK_InteractorStyle*>( anInteractor->GetInteractorStyle() );
-
- if (aStyle)
- aStyle->setPreselectionProp(aPreColor.red()/255., aPreColor.green()/255.,
- aPreColor.blue()/255., aPreWidth);
- }
- // update actors
- vtkRenderer* aRenderer = vtkwnd->getRenderer();
- vtkActorCollection *aCollection = aRenderer->GetActors();
- aCollection->InitTraversal();
- while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
- anActor->SetHighlightColor(aHiColor.red()/255., aHiColor.green()/255.,
- aHiColor.blue()/255.);
- anActor->SetPreHighlightColor(aPreColor.red()/255., aPreColor.green()/255.,
- aPreColor.blue()/255.);
- }
- }
- }
- }
-
- break;