Parcourir la source

wx.iclass: added button for scatter plot

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57285 15284696-431f-4ddb-bdfa-cd5b030d7da7
Štěpán Turek il y a 12 ans
Parent
commit
a474a85109
2 fichiers modifiés avec 25 ajouts et 0 suppressions
  1. 20 0
      gui/wxpython/iclass/frame.py
  2. 5 0
      gui/wxpython/iclass/toolbars.py

+ 20 - 0
gui/wxpython/iclass/frame.py

@@ -1123,6 +1123,26 @@ class IClassMapFrame(DoubleMapFrame):
                     toolbar.action['id'] = -1
                     toolbar.OnTool(None)
 
+    def OnScatterplot(self, event):
+        """!Init interactive scatterplot tools
+        """
+        if self.dialogs['scatt_plot']:
+            self.dialogs['scatt_plot'].Raise()
+            return
+
+        try:
+          from scatt_plot.dialogs import ScattPlotMainDialog
+        except:
+          GError(parent  = self, message = _("The Scatter Plot Tool is not installed."))
+          return
+
+        self.dialogs['scatt_plot'] = ScattPlotMainDialog(parent=self, giface=self._giface, iclass_mapwin = self.GetFirstWindow())
+
+        scatt_mgr = self.dialogs['scatt_plot'].GetScattMgr()
+        scatt_mgr.DigitDataChanged(self.toolbars['vdigit'].mapLayer.GetName(), self.GetFirstWindow().digit)
+
+        self.dialogs['scatt_plot'].CenterOnScreen()
+        self.dialogs['scatt_plot'].Show()
 
 class MapManager:
     """! Class for managing map renderer.

+ 5 - 0
gui/wxpython/iclass/toolbars.py

@@ -47,6 +47,8 @@ iClassIcons = {
                             label = _('Import training areas from vector map')),
         'addRgb' : MetaIcon(img = 'layer-rgb-add',
                             label = _('Add RGB map layer')),
+        'scatt_plot'    : MetaIcon(img = 'layer-raster-analyze',
+                                   label = _('Open Scatter Plot Tool (EXPERIMENTAL GSoC 2013)')),
         }
         
 class IClassMapToolbar(BaseToolbar):
@@ -119,6 +121,9 @@ class IClassMapToolbar(BaseToolbar):
                                       self.parent.OnZoomBack),
                                      ("zoomToMap", icons["zoomExtent"],
                                       self.parent.OnZoomToMap),
+                                     (None, ),
+                                     ("scatt_plot", iClassIcons["scatt_plot"],
+                                      self.parent.OnScatterplot)
                                     ))
 class IClassToolbar(BaseToolbar):
     """!IClass toolbar