From 8066e2c936b665429c3c78e361d1226df5fa1cd2 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 25 Aug 2005 12:46:50 +0000 Subject: [PATCH] Add settings for Plot2D viewer. --- src/SalomeApp/SalomeApp_Application.cxx | 70 ++++++++++++++++++++- src/SalomeApp/resources/SalomeApp.xml | 9 +++ src/SalomeApp/resources/SalomeApp_msg_en.po | 51 +++++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 5a47d786b..d36516b01 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1478,8 +1478,12 @@ void SalomeApp_Application::createPreferences( SalomeApp_Preferences* pref ) int occGroup = pref->addPreference( tr( "PREF_GROUP_OCCVIEWER" ), viewTab ); int vtkGroup = pref->addPreference( tr( "PREF_GROUP_VTKVIEWER" ), viewTab ); + + int plot2dGroup = pref->addPreference( tr( "PREF_GROUP_PLOT2DVIEWER" ), viewTab ); + pref->setItemProperty( occGroup, "columns", 1 ); pref->setItemProperty( vtkGroup, "columns", 1 ); + pref->setItemProperty( plot2dGroup, "columns", 1 ); int occTS = pref->addPreference( tr( "PREF_TRIHEDRON_SIZE" ), occGroup, SalomeApp_Preferences::IntSpin, "OCCViewer", "trihedron_size" ); @@ -1507,7 +1511,71 @@ void SalomeApp_Application::createPreferences( SalomeApp_Preferences* pref ) pref->setItemProperty( vtkTS, "min", 1 ); pref->setItemProperty( vtkTS, "max", 150 ); - + + pref->addPreference( tr( "PREF_SHOW_LEGEND" ), plot2dGroup, + SalomeApp_Preferences::Bool, "Plot2d", "ShowLegend" ); + + int legendPosition = pref->addPreference( tr( "PREF_LEGEND_POSITION" ), plot2dGroup, + SalomeApp_Preferences::Selector, "Plot2d", "LegendPos" ); + QStringList aLegendPosList; + aLegendPosList.append( tr("PREF_LEFT") ); + aLegendPosList.append( tr("PREF_RIGHT") ); + aLegendPosList.append( tr("PREF_TOP") ); + aLegendPosList.append( tr("PREF_BOTTOM") ); + + QValueList anIndexesList; + anIndexesList.append(0); + anIndexesList.append(1); + anIndexesList.append(2); + anIndexesList.append(3); + + pref->setItemProperty( legendPosition, "strings", aLegendPosList ); + pref->setItemProperty( legendPosition, "indexes", anIndexesList ); + + int curveType = pref->addPreference( tr( "PREF_CURVE_TYPE" ), plot2dGroup, + SalomeApp_Preferences::Selector, "Plot2d", "CurveType" ); + QStringList aCurveTypesList; + aCurveTypesList.append( tr("PREF_POINTS") ); + aCurveTypesList.append( tr("PREF_LINES") ); + aCurveTypesList.append( tr("PREF_SPLINE") ); + + anIndexesList.clear(); + anIndexesList.append(0); + anIndexesList.append(1); + anIndexesList.append(2); + + pref->setItemProperty( curveType, "strings", aCurveTypesList ); + pref->setItemProperty( curveType, "indexes", anIndexesList ); + + int markerSize = pref->addPreference( tr( "PREF_MARKER_SIZE" ), plot2dGroup, + SalomeApp_Preferences::IntSpin, "Plot2d", "MarkerSize" ); + + pref->setItemProperty( markerSize, "min", 0 ); + pref->setItemProperty( markerSize, "max", 100 ); + + QStringList aScaleModesList; + aScaleModesList.append( tr("PREF_LINEAR") ); + aScaleModesList.append( tr("PREF_LOGARITHMIC") ); + + anIndexesList.clear(); + anIndexesList.append(0); + anIndexesList.append(1); + + int horScale = pref->addPreference( tr( "PREF_HOR_AXIS_SCALE" ), plot2dGroup, + SalomeApp_Preferences::Selector, "Plot2d", "HorScaleMode" ); + + pref->setItemProperty( horScale, "strings", aScaleModesList ); + pref->setItemProperty( horScale, "indexes", anIndexesList ); + + int verScale = pref->addPreference( tr( "PREF_VERT_AXIS_SCALE" ), plot2dGroup, + SalomeApp_Preferences::Selector, "Plot2d", "VerScaleMode" ); + + pref->setItemProperty( verScale, "strings", aScaleModesList ); + pref->setItemProperty( verScale, "indexes", anIndexesList ); + + pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), plot2dGroup, + SalomeApp_Preferences::Color, "Plot2d", "Background" ); + int dirTab = pref->addPreference( tr( "PREF_TAB_DIRECTORIES" ), salomeCat ); int dirGroup = pref->addPreference( tr( "PREF_GROUP_DIRECTORIES" ), dirTab ); pref->setItemProperty( dirGroup, "columns", 1 ); diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index 5487e6c72..2fb5a5bf1 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -76,6 +76,15 @@
+
+ + + + + + + +
diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po index 8caacf331..ad917a2ce 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.po +++ b/src/SalomeApp/resources/SalomeApp_msg_en.po @@ -140,6 +140,9 @@ msgstr "Refresh" msgid "SalomeApp_Application::MEN_OPENWITH" msgstr "Activate Module" +msgid "SalomeApp_Application::MEN_DELETE_REFERENCE" +msgstr "Delete Reference" + //======================================================================================= msgid "SalomeApp_Application::MEN_WINDOWS_NEW" @@ -234,6 +237,54 @@ msgstr "Number of isolines along V" msgid "SalomeApp_Application::PREF_TRIHEDRON_SHOW" msgstr "Show trihedron" +msgid "SalomeApp_Application::PREF_GROUP_PLOT2DVIEWER" +msgstr "Plot2d Viewer" + +msgid "SalomeApp_Application::PREF_SHOW_LEGEND" +msgstr "Show legend" + +msgid "SalomeApp_Application::PREF_LEGEND_POSITION" +msgstr "Legend position:" + +msgid "SalomeApp_Application::PREF_LEFT" +msgstr "Left" + +msgid "SalomeApp_Application::PREF_RIGHT" +msgstr "Right" + +msgid "SalomeApp_Application::PREF_TOP" +msgstr "Top" + +msgid "SalomeApp_Application::PREF_BOTTOM" +msgstr "Bottom" + +msgid "SalomeApp_Application::PREF_CURVE_TYPE" +msgstr "Curve type:" + +msgid "SalomeApp_Application::PREF_POINTS" +msgstr "Points" + +msgid "SalomeApp_Application::PREF_LINES" +msgstr "Lines" + +msgid "SalomeApp_Application::PREF_SPLINE" +msgstr "Spline" + +msgid "SalomeApp_Application::PREF_MARKER_SIZE" +msgstr "Marker size:" + +msgid "SalomeApp_Application::PREF_LINEAR" +msgstr "Linear" + +msgid "SalomeApp_Application::PREF_LOGARITHMIC" +msgstr "Logarithmic" + +msgid "SalomeApp_Application::PREF_HOR_AXIS_SCALE" +msgstr "Horizontal axis scale:" + +msgid "SalomeApp_Application::PREF_VERT_AXIS_SCALE" +msgstr "Vertical axis scale:" + msgid "SalomeApp_Application::PREF_TAB_DIRECTORIES" msgstr "Directories" -- 2.39.2