]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Add settings for Plot2D viewer.
authormzn <mzn@opencascade.com>
Thu, 25 Aug 2005 12:46:50 +0000 (12:46 +0000)
committermzn <mzn@opencascade.com>
Thu, 25 Aug 2005 12:46:50 +0000 (12:46 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_msg_en.po

index 5a47d786bca029cd8ecd677c0475de0dfb210422..d36516b01c1f25b010da46642082a32f029ba47b 100644 (file)
@@ -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<QVariant> 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 );
index 5487e6c72a897e246a5691b642e21f4d510e5852..2fb5a5bf1e02b66e1bab5943d4b2c285c1fcb919 100644 (file)
   <section name="ObjectBrowser" >
     <parameter value="false" name="auto_size" />
   </section>
+  <section name="Plot2d" >
+    <parameter value="255, 255, 255" name="Background" />
+    <parameter value="1" name="CurveType" />
+    <parameter value="0" name="HorScaleMode" />
+    <parameter value="1" name="LegendPos" />
+    <parameter value="9" name="MarkerSize" />
+    <parameter value="true" name="ShowLegend" />
+    <parameter value="0" name="VerScaleMode" />
+  </section>
   <section name="Geometry" >
     <parameter value="10" name="SettingsGeomStep" />
     <parameter value="0"  name="display_mode" />
index 8caacf3311ef1181fa6877c77d825e61a5059d10..ad917a2ce6d4b4aed94f896b467e46f937abd0c7 100644 (file)
@@ -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"