Browse Source

g.gui.iclass added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54394 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 years ago
parent
commit
9936023b69

+ 5 - 0
gui/wxpython/iclass/Makefile

@@ -0,0 +1,5 @@
+MODULE_TOPDIR = ../../..
+
+include $(MODULE_TOPDIR)/include/Make/GuiScript.make
+
+default: guiscript

+ 3 - 3
gui/wxpython/iclass/frame.py

@@ -69,7 +69,7 @@ class IClassMapFrame(DoubleMapFrame):
     
     It is wxGUI counterpart of old i.class module.
     """
-    def __init__(self, parent = None, giface = None, title = _("Supervised Classification Tool"),
+    def __init__(self, parent = None, giface = None, title = _("GRASS GIS Supervised Classification Tool"),
                  toolbars = ["iClassMisc", "iClassMap", "vdigit", "iClass"],
                  size = (875, 600), name = 'IClassWindow', **kwargs):
         """!
@@ -279,8 +279,8 @@ class IClassMapFrame(DoubleMapFrame):
                               BestSize((self.toolbars[name].GetBestSize())))
 
         if name == "vdigit":
-            self.toolbars[name] = VDigitToolbar(self, MapWindow = self.GetFirstWindow(),
-                                                digitClass = IClassVDigit,
+            self.toolbars[name] = VDigitToolbar(parent = self, MapWindow = self.GetFirstWindow(),
+                                                digitClass = IClassVDigit, giface = self._giface,
                                                 tools = ['addArea', 'moveVertex', 'addVertex',
                                                          'removeVertex', 'editLine',
                                                          'moveLine', 'deleteArea', 'undo', 'redo'])

gui/wxpython/docs/wxGUI.IClass.html → gui/wxpython/iclass/g.gui.iclass.html


+ 63 - 0
gui/wxpython/iclass/g.gui.iclass.py

@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE:    g.gui.iclass
+# AUTHOR(S): Anna Kratochvilova, Vaclav Petras
+# PURPOSE:   The Map Swipe is a wxGUI component which allows the user to
+#            interactively compare two maps  
+# COPYRIGHT: (C) 2012 by Anna Kratochvilova, and the GRASS Development Team
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+############################################################################
+
+#%module
+#% label: Tool for supervised classification of imagery data.
+#% description: Generates spectral signatures for an image by allowing the user to outline regions of interest.
+#%end
+
+import os
+import sys
+
+import  wx
+import gettext
+
+import grass.script as grass
+
+if __name__ == '__main__':
+    sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+
+from core.settings  import UserSettings
+from core.giface    import StandaloneGrassInterface
+from iclass.frame   import IClassMapFrame
+
+def main():
+    # define display driver
+    driver = UserSettings.Get(group = 'display', key = 'driver', subkey = 'type')
+    if driver == 'png':
+        os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
+    else:
+        os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'
+    
+    # launch application
+    app = wx.PySimpleApp()
+    wx.InitAllImageHandlers()
+    
+    # show main frame
+    frame = IClassMapFrame(parent = None, giface = StandaloneGrassInterface())
+    frame.Show()
+    
+    app.MainLoop()
+    
+if __name__ == '__main__':
+    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
+    options, flags = grass.parser()
+    main()

+ 4 - 4
gui/wxpython/vdigit/g.gui.vdigit.html

@@ -3,15 +3,15 @@
 <h2>DESCRIPTION</h2>
 
 <b>Vector digitizer</b> is a <em><a href="wxGUI.html">wxGUI</a></em>
-component intended for interactive editing vector maps
+component intended for interactive editing and digitizing vector maps
 (see <em><a href="v.edit.html">v.edit</a></em> for non-interactive
 vector editing GRASS capabilities).
 
 <p>
-The digitizer supports editing of 2D vector features (points, lines, centroids,
-boundaries, and area).
+The digitizer supports editing of 2D vector features (points, lines,
+centroids, boundaries, and areas).
 
-Vector features can be selected using mouse or by query (e.g. minimal
+Vector features can be selected by mouse or by query (e.g. minimal
 vector line length). Vector features can be selected by bounding box
 or simply by mouse click (based on 'Settings&rarr;General&rarr;Select
 threshold' value).