From 400f77084f86d26f2c01777f45d88064b980ff8d Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 12 Dec 2005 15:59:16 +0000 Subject: [PATCH] PAL10868: No Shading possible in animation. Add Shading in Post-Pro preferences. --- src/VISUGUI/VISU_msg_en.po | 15 ++++++ src/VISUGUI/VisuGUI.cxx | 98 ++++++++++++++++++++++++---------- src/VISU_I/VISU_ScalarMap_i.cc | 3 ++ 3 files changed, 89 insertions(+), 27 deletions(-) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index a4c8815c..e25236e9 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -101,6 +101,9 @@ msgstr "Width:" msgid "VISU_HEIGHT" msgstr "Height:" +msgid "VISU_PREF_SECOND_TAB" +msgstr "Scalar range, Sweep, MED import, Shading" + msgid "VISU_SCALAR_RANGE" msgstr "Scalar range" @@ -146,6 +149,18 @@ msgstr "Number of cycles" msgid "VISU_NB_STEPS" msgstr "Number of steps" +msgid "VISU_PREF_MED_IMPORT" +msgstr "MED files import" + +msgid "VISU_PREF_MED_FULL_LOAD" +msgstr "Full MED loading" + +msgid "VISU_PREF_REPRESENT_PROPS" +msgstr "Representation properties" + +msgid "VISU_PREF_SHADING" +msgstr "Use Shading" + #: VisuGUI.cxx msgid "VisuGUI::MEN_IMPORT_FROM_FILE" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 13ec0762..cbcd659a 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2838,21 +2838,30 @@ extern "C" { } } */ + void VisuGUI::createPreferences() { + // TAB: "Scalar Bar" int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) ); + // group: "Font" int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab ); - int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" ); - addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" ); - int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" ); - addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" ); + int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, + LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" ); + addPreference( tr( "VISU_TITLE" ), fontGr, + LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" ); + int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, + LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" ); + addPreference( tr( "VISU_LABELS" ), fontGr, + LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" ); QStringList fam; fam.append( tr( "VISU_FONT_ARIAL" ) ); fam.append( tr( "VISU_FONT_COURIER" ) ); fam.append( tr( "VISU_FONT_TIMES" ) ); - int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) ); + int wflag = ( QtxListResourceEdit::FontItem::All & + ( ~( QtxListResourceEdit::FontItem::Size | + QtxListResourceEdit::FontItem::UserSize ) ) ); setPreferenceProperty( tfont, "families", fam ); setPreferenceProperty( tfont, "system", false ); @@ -2861,18 +2870,23 @@ void VisuGUI::createPreferences() setPreferenceProperty( lfont, "system", false ); setPreferenceProperty( lfont, "widget_flags", wflag ); + // group: "Colors & Labels" int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab ); - int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" ); + int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, + LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" ); setPreferenceProperty( numcol, "min", 2 ); setPreferenceProperty( numcol, "max", 64 ); - int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" ); + int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, + LightApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" ); setPreferenceProperty( numlab, "min", 2 ); setPreferenceProperty( numlab, "max", 65 ); + // group: "Orientation" int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab ); - int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" ); + int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, + LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" ); QStringList orients; orients.append( tr( "VISU_VERTICAL" ) ); orients.append( tr( "VISU_HORIZONTAL" ) ); @@ -2882,11 +2896,16 @@ void VisuGUI::createPreferences() setPreferenceProperty( orient, "strings", orients ); setPreferenceProperty( orient, "indexes", indices ); + // group: "Origin & Size Vertical" int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab ); - int xv = addPreference( tr( "VISU_X" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" ); - int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" ); - int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" ); - int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" ); + int xv = addPreference( tr( "VISU_X" ), posVSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" ); + int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" ); + int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" ); + int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" ); setPreferenceProperty( xv, "step", 0.1 ); setPreferenceProperty( yv, "step", 0.1 ); setPreferenceProperty( wv, "step", 0.1 ); @@ -2900,11 +2919,16 @@ void VisuGUI::createPreferences() setPreferenceProperty( wv, "max", 1.0 ); setPreferenceProperty( hv, "max", 1.0 ); + // group: "Origin & Size Horizontal" int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab ); - int xh = addPreference( tr( "VISU_X" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" ); - int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" ); - int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" ); - int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" ); + int xh = addPreference( tr( "VISU_X" ), posHSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" ); + int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" ); + int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" ); + int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" ); setPreferenceProperty( xh, "step", 0.1 ); setPreferenceProperty( yh, "step", 0.1 ); setPreferenceProperty( wh, "step", 0.1 ); @@ -2918,12 +2942,16 @@ void VisuGUI::createPreferences() setPreferenceProperty( wh, "max", 1.0 ); setPreferenceProperty( hh, "max", 1.0 ); - int srangeTab = addPreference( tr( "Scalar range, Sweep, MED import" ) ); + // TAB: "Scalar range, Sweep, MED import, Shading" + int srangeTab = addPreference( tr( "VISU_PREF_SECOND_TAB" ) ); + + // group: "Scalar range" int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), srangeTab ); setPreferenceProperty( rangeGr, "columns", 1 ); - int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" ); + int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, + LightApp_Preferences::Selector, "VISU", "scalar_bar_mode" ); QStringList modes; modes.append( tr( "VISU_MODULUS" ) ); modes.append( tr( "VISU_COMPONENT" ) + tr("1") ); @@ -2937,9 +2965,11 @@ void VisuGUI::createPreferences() setPreferenceProperty( mode, "strings", modes ); setPreferenceProperty( mode, "indexes", indices ); - addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" ); + addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, + LightApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" ); - int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, LightApp_Preferences::Selector, "VISU", "scalar_range_type" ); + int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, + LightApp_Preferences::Selector, "VISU", "scalar_range_type" ); QStringList types; types.append( tr( "VISU_FIELD_RANGE" ) ); types.append( tr( "VISU_IMPOSED_RANGE" ) ); @@ -2949,27 +2979,41 @@ void VisuGUI::createPreferences() setPreferenceProperty( rangetype, "strings", types ); setPreferenceProperty( rangetype, "indexes", indices ); + // group: "Min and max for imposed range" int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), srangeTab ); - int min = addPreference( tr( "VISU_MIN" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" ); - int max = addPreference( tr( "VISU_MAX" ), imposedGr, LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" ); + int min = addPreference( tr( "VISU_MIN" ), imposedGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_range_min" ); + int max = addPreference( tr( "VISU_MAX" ), imposedGr, + LightApp_Preferences::DblSpin, "VISU", "scalar_range_max" ); setPreferenceProperty( min, "step", 0.1 ); setPreferenceProperty( max, "step", 0.1 ); + // group: "Sweeping preferences" int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab ); setPreferenceProperty( sweepGr, "columns", 1 ); - int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" ); - int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" ); - int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr, LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" ); + int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, + LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" ); + int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, + LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" ); + int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr, + LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" ); setPreferenceProperty( timestep, "min", 0.1 ); setPreferenceProperty( timestep, "step", 0.1 ); setPreferenceProperty( timestep, "max", 1000 ); setPreferenceProperty( nbcycles, "max", 100 ); setPreferenceProperty( nbsteps, "max", 200 ); - int importGr = addPreference( tr( "MED files import" ), srangeTab ); - addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" ); + // group: "MED files import" + int importGr = addPreference( tr( "VISU_PREF_MED_IMPORT" ), srangeTab ); + addPreference( tr( "VISU_PREF_MED_FULL_LOAD" ), importGr, + LightApp_Preferences::Bool, "VISU", "full_med_loading" ); + + // group: "Representation properties" + int representGr = addPreference( tr( "VISU_PREF_REPRESENT_PROPS" ), srangeTab ); + addPreference( tr( "VISU_PREF_SHADING" ), representGr, + LightApp_Preferences::Bool, "VISU", "represent_shading" ); } void VisuGUI::preferencesChanged( const QString&, const QString& ) diff --git a/src/VISU_I/VISU_ScalarMap_i.cc b/src/VISU_I/VISU_ScalarMap_i.cc index ebd818ed..bb96b541 100644 --- a/src/VISU_I/VISU_ScalarMap_i.cc +++ b/src/VISU_I/VISU_ScalarMap_i.cc @@ -495,6 +495,9 @@ VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject VISU::Prs3d_i::CreateActor(anActor,theIO); anActor->SetBarVisibility(true); anActor->SetRepresentation(2); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false); + anActor->SetShading(toUseShading); UpdateActor(anActor); }catch(...){ anActor->Delete(); -- 2.39.2