[GRASS-SVN] r54225 - in grass/trunk/gui/wxpython: . docs psmap
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Dec 6 13:12:01 PST 2012
Author: martinl
Date: 2012-12-06 13:12:00 -0800 (Thu, 06 Dec 2012)
New Revision: 54225
Added:
grass/trunk/gui/wxpython/psmap/Makefile
grass/trunk/gui/wxpython/psmap/g.gui.psmap.html
grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
Removed:
grass/trunk/gui/wxpython/docs/wxGUI.PsMap.html
Modified:
grass/trunk/gui/wxpython/Makefile
grass/trunk/gui/wxpython/psmap/frame.py
Log:
introduce g.gui.psmap
Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile 2012-12-06 17:34:57 UTC (rev 54224)
+++ grass/trunk/gui/wxpython/Makefile 2012-12-06 21:12:00 UTC (rev 54225)
@@ -1,6 +1,6 @@
MODULE_TOPDIR = ../..
-SUBDIRS = docs animation mapswipe gmodeler rlisetup
+SUBDIRS = docs animation mapswipe gmodeler rlisetup psmap
EXTRA_CLEAN_FILES = menustrings.py build_ext.pyc
include $(MODULE_TOPDIR)/include/Make/Dir.make
Deleted: grass/trunk/gui/wxpython/docs/wxGUI.PsMap.html
===================================================================
--- grass/trunk/gui/wxpython/docs/wxGUI.PsMap.html 2012-12-06 17:34:57 UTC (rev 54224)
+++ grass/trunk/gui/wxpython/docs/wxGUI.PsMap.html 2012-12-06 21:12:00 UTC (rev 54225)
@@ -1,206 +0,0 @@
-<!-- meta page description: wxGUI Cartographic Composer -->
-<!-- meta page index: wxGUI -->
-<h2>DESCRIPTION</h2>
-
-<b>Note:</b> <em>wxGUI Cartographic Composer is currently under
-development.</em>
-
-<p>
-<b>wxGUI Cartographic Composer</b> also called <em>wx.psmap</em> is
-a <em><a href="wxGUI.html">wxGUI</a></em> extension which allows the
-user to create interactively hardcopy map outputs. This tool
-generates <em><a href="ps.map.html">ps.map</a></em> configuration file
-and then runs <em><a href="ps.map.html">ps.map</a></em> to create
-PostScript output. There are two modes - <em>Draft mode</em> for map
-composing and <em>Preview mode</em>
-(requires <a href="http://www.pythonware.com/products/pil/">Python
-Imaging Library</a>) to see how the result will look like. In draft
-mode map features (like legend or scalebar) are represented by a
-colored rectangle with a label.
-
-<p>
-Possible output files:
-<ul>
- <li> <em><a href="ps.map.html">ps.map</a></em> instructions file
- <li> PostScript/EPS file
- <li> PDF (using ps2pdf)
-</ul>
-
-<p>
-Cartographic Composer enables to load in saved instructions file. It
-works better with files created by wx.psmap (more tested).
-
-<p>
-Currently supported <em><a href="ps.map.html">ps.map</a></em> instructions:
-
-<ul>
- <li> paper
- <li> maploc
- <li> scale
- <li> border
- <li> raster
- <li> colortable
- <li> vpoints
- <li> vlines
- <li> vareas
- <li> vlegend
- <li> text
- <li> scalebar
- <li> mapinfo
- <li> point
- <li> line
- <li> rectangle
-</ul>
-
-
-<h3>CARTOGRAPHIC COMPOSER TOOLBAR</h3>
-<dl>
- <dt><img src="icons/script-save.png" alt="icon">
- <em>Generate instructions file</em></dt>
- <dd>Generates and saves text file with mapping instructions.</dd>
-
- <dt><img src="icons/script-load.png" alt="icon">
- <em>Load instructions file</em></dt>
- <dd>Load text file with mapping instructions.</dd>
-
- <dt><img src="icons/page-settings.png" alt="icon">
- <em>Page setup</em></dt>
- <dd>Specify paper size, margins and orientation.</dd>
-
- <dt><img src="icons/pointer.png" alt="icon">
- <em>Pointer</em></dt>
- <dd>Select object on the paper by clicking, drag the cursor while pressing the left mouse button to move it or resize object (currently only map frame) by clicking on a small black box in its bottom right corner. Double click to show object properties dialog</dd>
-
- <dt><img src="icons/pan.png" alt="icon">
- <em>Pan</em></dt>
- <dd>Drag the pan cursor while pressing the left mouse button to move your view. </dd>
-
-
- <dt><img src="icons/zoom-in.png" alt="icon">
- <em>Zoom in</em></dt>
- <dd>Interactive zooming with the mouse in both draft and preview mode. Drawing a box or just a left click with the mouse and zoom-in cursor causes the display to zoom in so that the area defined by the box fills the display.</dd>
-
-
- <dt><img src="icons/zoom-out.png" alt="icon">
- <em>Zoom out</em></dt>
- <dd>Interactive zooming with the mouse in both draft and preview mode. Drawing a box or just a left click with the mouse and zoom-out cursor causes the display to zoom out so that the area displayed shrinks to fill the area defined by the box.</dd>
-
- <dt><img src="icons/zoom-extent.png" alt="icon">
- <em>Zoom to page</em></dt>
- <dd>Zoom to display the entire page </dd>
-
-
- <dt><img src="icons/layer-add.png" alt="icon">
- <em>Map frame</em></dt>
- <dd>Click and drag to place map frame. If map frame is already drawn, open a dialog to set its properties. </dd>
-
- <dt><img src="icons/layer-raster-add.png" alt="icon">
- <em>Raster map</em></dt>
- <dd>Shows a dialog to add or change the raster map.</dd>
-
- <dt><img src="icons/layer-vector-add.png" alt="icon">
- <em>Vector map</em></dt>
- <dd>Shows a dialog to add or change current vector maps and their properties:
- <dl>
- <dt><em>Data selection</em></dt>
- <dd>Select data to draw:
-
- <dl>
- <dt><em>Feature type</em></dt>
- <dd> Select which data type to draw. In case of point data, points or centroids
- can be drawn, in case of line data, lines or boundaries. </dd>
- <dt><em>Layer selection</em></dt>
- <dd>Select layer and limit data by a SQL query or chose only certain categories.</dd>
- <dt><em>Mask</em></dt>
- <dd>Whether to use mask or not.</dd>
- </dl>
- </dd>
-
- <dt><em>Colors</em></dt>
- <dd>Color settings:
-
- <dl>
- <dt><em>Outline</em></dt>
- <dd> Select outline color and width in points. In case of lines, outline means highlighting.</dd>
- <dt><em>Fill</em></dt>
- <dd>Select fill color, one color for all vector elements or color from rgb column.</dd>
- </dl>
- </dd>
- <dt><em>Size and style</em></dt>
- <dd>
- Sets size, style, symbols, pattern; depends on data type:
-
- <dl>
- <dt><em>Symbology</em></dt>
- <dd> Available for point data. Choose symbol or EPS file to draw points with.</dd>
- <dt><em>Line style</em></dt>
- <dd>Available for line data. Select line style (solid, dashed, ...) and the look of the ends of the line (butt, round, ...)</dd>
- <dt><em>Pattern</em></dt>
- <dd> Available for areas. Choose pattern file and set the width of the pattern.</dd>
- <dt><em>Size</em></dt>
- <dd> Available for point data. Choose size (number of times larger than the size in the icon file) as a single value or take the size from a map table column.</dd>
- <dt><em>Rotation</em></dt>
- <dd> Available for point data. Rotate symbols counterclockwise with the given value or with the value from a map table column</dd>
- <dt><em>Width</em></dt>
- <dd> Available for line data. Set line width in points or take the value from a map table column.</dd>
- </dl>
- </dd>
-
-
- </dl>
- </dd>
-
-
- <dt><img src="icons/overlay-add.png" alt="icon">
- <em>Add map elements</em></dt>
- <dd>Add map elements: legend, scalebar, map info, text
- <dl>
- <dt><img src="icons/legend-add.png" alt="icon">
- <em>Add legend</em></dt>
- <dd>Add raster or vector legend or edit their properties.</dd>
- <dt><img src="icons/map-info.png" alt="icon">
- <em>Add map info</em></dt>
- <dd>Add information about region, grid and scale or edit map info properties.</dd>
- <dt><img src="icons/scalebar-add.png" alt="icon">
- <em>Add scalebar</em></dt>
- <dd>Add scalebar or edit its properties.</dd>
- <dt><img src="icons/text-add.png" alt="icon">
- <em>Add text</em></dt>
- <dd>Add text label.</dd>
- </dl>
- </dd>
- <dt><img src="icons/layer-remove.png" alt="icon">
- <em>Remove selected element</em></dt>
- <dd>Select an object and remove it. Pressing Delete key does the same. </dd>
-
- <dt><img src="icons/execute.png" alt="icon">
- <em>Show preview</em></dt>
- <dd> Generates output and switches to Preview mode to see the result. Be patient, it can take a while.</dd>
-
-
- <dt><img src="icons/ps-export.png" alt="icon">
- <em>Generate hardcopy map output in PS</em></dt>
- <dd> Generates hardcopy map output in PostScript/EPS file.</dd>
- <dt><img src="icons/pdf-export.png" alt="icon">
- <em>Generate hardcopy map output in PDF</em></dt>
- <dd> Generates hardcopy map output in PDF using ps2pdf.</dd>
-
-</dl>
-
-
-<h2>SEE ALSO</h2>
-
-<em>
- <a href="wxGUI.html">wxGUI</a><br>
- <a href="wxGUI.Components.html">wxGUI components</a>
-</em>
-
-<p>
-See also <a href="http://grass.osgeo.org/wiki/WxGUI_Cartographic_Composer">wiki</a> page.
-
-<h2>AUTHORS</h2>
-
-Anna Kratochvilova, Czech Technical Univesity (CTU) in Prague, Czech Republic (bachelor's final project 2011, mentor: Martin Landa)
-
-<p>
-<i>$Date$</i>
Added: grass/trunk/gui/wxpython/psmap/Makefile
===================================================================
--- grass/trunk/gui/wxpython/psmap/Makefile (rev 0)
+++ grass/trunk/gui/wxpython/psmap/Makefile 2012-12-06 21:12:00 UTC (rev 54225)
@@ -0,0 +1,5 @@
+MODULE_TOPDIR = ../../..
+
+include $(MODULE_TOPDIR)/include/Make/GuiScript.make
+
+default: guiscript
Property changes on: grass/trunk/gui/wxpython/psmap/Makefile
___________________________________________________________________
Added: svn:mime-type
+ text/x-makefile
Added: svn:eol-style
+ native
Modified: grass/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py 2012-12-06 17:34:57 UTC (rev 54224)
+++ grass/trunk/gui/wxpython/psmap/frame.py 2012-12-06 21:12:00 UTC (rev 54225)
@@ -21,9 +21,6 @@
import Queue
from math import sin, cos, pi, sqrt
-if __name__ == "__main__":
- sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
-from core import globalvar
import wx
try:
@@ -33,6 +30,7 @@
import grass.script as grass
+from core import globalvar
from gui_core.menu import Menu
from core.gconsole import CmdThread, EVT_CMD_DONE
from psmap.toolbars import PsMapToolbar
@@ -1008,11 +1006,11 @@
if self.parent and self.parent.GetName() == 'LayerManager':
log = self.parent.GetLogWindow()
log.RunCmd(['g.manual',
- 'entry=wxGUI.PsMap'])
+ 'entry=wxGUI.psmap'])
else:
RunCommand('g.manual',
quiet = True,
- entry = 'wxGUI.PsMap')
+ entry = 'wxGUI.psmap')
def OnAbout(self, event):
"""!Display About window"""
@@ -2220,17 +2218,3 @@
except: pass
return im
-
-def main():
- import gettext
- gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
-
- app = wx.PySimpleApp()
- wx.InitAllImageHandlers()
- frame = PsMapFrame()
- frame.Show()
-
- app.MainLoop()
-
-if __name__ == "__main__":
- main()
Added: grass/trunk/gui/wxpython/psmap/g.gui.psmap.html
===================================================================
--- grass/trunk/gui/wxpython/psmap/g.gui.psmap.html (rev 0)
+++ grass/trunk/gui/wxpython/psmap/g.gui.psmap.html 2012-12-06 21:12:00 UTC (rev 54225)
@@ -0,0 +1,204 @@
+<!-- meta page description: wxGUI Cartographic Composer -->
+<!-- meta page index: wxGUI -->
+<h2>DESCRIPTION</h2>
+
+<p>
+<b>wxGUI Cartographic Composer</b> also called <em>wx.psmap</em> is
+a <em><a href="wxGUI.html">wxGUI</a></em> extension which allows the
+user to create interactively hardcopy map outputs. This tool
+generates <em><a href="ps.map.html">ps.map</a></em> configuration file
+and then runs <em><a href="ps.map.html">ps.map</a></em> to create
+PostScript output. There are two modes - <em>Draft mode</em> for map
+composing and <em>Preview mode</em>
+(requires <a href="http://www.pythonware.com/products/pil/">Python
+Imaging Library</a>) to see how the result will look like. In draft
+mode map features (like legend or scalebar) are represented by a
+colored rectangle with a label.
+
+<p>
+Possible output files:
+<ul>
+ <li> <em><a href="ps.map.html">ps.map</a></em> instructions file
+ <li> PostScript/EPS file
+ <li> PDF (using ps2pdf)
+</ul>
+
+<p>
+Cartographic Composer enables to load in saved instructions file. It
+works better with files created by wx.psmap (more tested).
+
+<p>
+Currently supported <em><a href="ps.map.html">ps.map</a></em> instructions:
+
+<ul>
+ <li> paper
+ <li> maploc
+ <li> scale
+ <li> border
+ <li> raster
+ <li> colortable
+ <li> vpoints
+ <li> vlines
+ <li> vareas
+ <li> vlegend
+ <li> text
+ <li> scalebar
+ <li> mapinfo
+ <li> point
+ <li> line
+ <li> rectangle
+</ul>
+
+
+<h3>CARTOGRAPHIC COMPOSER TOOLBAR</h3>
+<dl>
+ <dt><img src="icons/script-save.png" alt="icon">
+ <em>Generate instructions file</em></dt>
+ <dd>Generates and saves text file with mapping instructions.</dd>
+
+ <dt><img src="icons/script-load.png" alt="icon">
+ <em>Load instructions file</em></dt>
+ <dd>Load text file with mapping instructions.</dd>
+
+ <dt><img src="icons/page-settings.png" alt="icon">
+ <em>Page setup</em></dt>
+ <dd>Specify paper size, margins and orientation.</dd>
+
+ <dt><img src="icons/pointer.png" alt="icon">
+ <em>Pointer</em></dt>
+ <dd>Select object on the paper by clicking, drag the cursor while pressing the left mouse button to move it or resize object (currently only map frame) by clicking on a small black box in its bottom right corner. Double click to show object properties dialog</dd>
+
+ <dt><img src="icons/pan.png" alt="icon">
+ <em>Pan</em></dt>
+ <dd>Drag the pan cursor while pressing the left mouse button to move your view. </dd>
+
+
+ <dt><img src="icons/zoom-in.png" alt="icon">
+ <em>Zoom in</em></dt>
+ <dd>Interactive zooming with the mouse in both draft and preview mode. Drawing a box or just a left click with the mouse and zoom-in cursor causes the display to zoom in so that the area defined by the box fills the display.</dd>
+
+
+ <dt><img src="icons/zoom-out.png" alt="icon">
+ <em>Zoom out</em></dt>
+ <dd>Interactive zooming with the mouse in both draft and preview mode. Drawing a box or just a left click with the mouse and zoom-out cursor causes the display to zoom out so that the area displayed shrinks to fill the area defined by the box.</dd>
+
+ <dt><img src="icons/zoom-extent.png" alt="icon">
+ <em>Zoom to page</em></dt>
+ <dd>Zoom to display the entire page </dd>
+
+
+ <dt><img src="icons/layer-add.png" alt="icon">
+ <em>Map frame</em></dt>
+ <dd>Click and drag to place map frame. If map frame is already drawn, open a dialog to set its properties. </dd>
+
+ <dt><img src="icons/layer-raster-add.png" alt="icon">
+ <em>Raster map</em></dt>
+ <dd>Shows a dialog to add or change the raster map.</dd>
+
+ <dt><img src="icons/layer-vector-add.png" alt="icon">
+ <em>Vector map</em></dt>
+ <dd>Shows a dialog to add or change current vector maps and their properties:
+ <dl>
+ <dt><em>Data selection</em></dt>
+ <dd>Select data to draw:
+
+ <dl>
+ <dt><em>Feature type</em></dt>
+ <dd> Select which data type to draw. In case of point data, points or centroids
+ can be drawn, in case of line data, lines or boundaries. </dd>
+ <dt><em>Layer selection</em></dt>
+ <dd>Select layer and limit data by a SQL query or chose only certain categories.</dd>
+ <dt><em>Mask</em></dt>
+ <dd>Whether to use mask or not.</dd>
+ </dl>
+ </dd>
+
+ <dt><em>Colors</em></dt>
+ <dd>Color settings:
+
+ <dl>
+ <dt><em>Outline</em></dt>
+ <dd> Select outline color and width in points. In case of lines, outline means highlighting.</dd>
+ <dt><em>Fill</em></dt>
+ <dd>Select fill color, one color for all vector elements or color from rgb column.</dd>
+ </dl>
+ </dd>
+ <dt><em>Size and style</em></dt>
+ <dd>
+ Sets size, style, symbols, pattern; depends on data type:
+
+ <dl>
+ <dt><em>Symbology</em></dt>
+ <dd> Available for point data. Choose symbol or EPS file to draw points with.</dd>
+ <dt><em>Line style</em></dt>
+ <dd>Available for line data. Select line style (solid, dashed, ...) and the look of the ends of the line (butt, round, ...)</dd>
+ <dt><em>Pattern</em></dt>
+ <dd> Available for areas. Choose pattern file and set the width of the pattern.</dd>
+ <dt><em>Size</em></dt>
+ <dd> Available for point data. Choose size (number of times larger than the size in the icon file) as a single value or take the size from a map table column.</dd>
+ <dt><em>Rotation</em></dt>
+ <dd> Available for point data. Rotate symbols counterclockwise with the given value or with the value from a map table column</dd>
+ <dt><em>Width</em></dt>
+ <dd> Available for line data. Set line width in points or take the value from a map table column.</dd>
+ </dl>
+ </dd>
+
+
+ </dl>
+ </dd>
+
+
+ <dt><img src="icons/overlay-add.png" alt="icon">
+ <em>Add map elements</em></dt>
+ <dd>Add map elements: legend, scalebar, map info, text
+ <dl>
+ <dt><img src="icons/legend-add.png" alt="icon">
+ <em>Add legend</em></dt>
+ <dd>Add raster or vector legend or edit their properties.</dd>
+ <dt><img src="icons/map-info.png" alt="icon">
+ <em>Add map info</em></dt>
+ <dd>Add information about region, grid and scale or edit map info properties.</dd>
+ <dt><img src="icons/scalebar-add.png" alt="icon">
+ <em>Add scalebar</em></dt>
+ <dd>Add scalebar or edit its properties.</dd>
+ <dt><img src="icons/text-add.png" alt="icon">
+ <em>Add text</em></dt>
+ <dd>Add text label.</dd>
+ </dl>
+ </dd>
+ <dt><img src="icons/layer-remove.png" alt="icon">
+ <em>Remove selected element</em></dt>
+ <dd>Select an object and remove it. Pressing Delete key does the same. </dd>
+
+ <dt><img src="icons/execute.png" alt="icon">
+ <em>Show preview</em></dt>
+ <dd> Generates output and switches to Preview mode to see the result. Be patient, it can take a while.</dd>
+
+
+ <dt><img src="icons/ps-export.png" alt="icon">
+ <em>Generate hardcopy map output in PS</em></dt>
+ <dd> Generates hardcopy map output in PostScript/EPS file.</dd>
+ <dt><img src="icons/pdf-export.png" alt="icon">
+ <em>Generate hardcopy map output in PDF</em></dt>
+ <dd> Generates hardcopy map output in PDF using ps2pdf.</dd>
+
+</dl>
+
+
+<h2>SEE ALSO</h2>
+
+<em>
+ <a href="wxGUI.html">wxGUI</a><br>
+ <a href="wxGUI.Components.html">wxGUI components</a>
+</em>
+
+<p>
+See also <a href="http://grass.osgeo.org/wiki/WxGUI_Cartographic_Composer">wiki</a> page.
+
+<h2>AUTHORS</h2>
+
+Anna Kratochvilova, Czech Technical Univesity in Prague, Czech
+Republic (bachelor's final project 2011, mentor: Martin Landa)
+
+<p>
+<i>$Date$</i>
Property changes on: grass/trunk/gui/wxpython/psmap/g.gui.psmap.html
___________________________________________________________________
Added: svn:mime-type
+ text/html
Added: svn:keywords
+ Author Date Id
Added: svn:eol-style
+ native
Added: grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/g.gui.psmap.py (rev 0)
+++ grass/trunk/gui/wxpython/psmap/g.gui.psmap.py 2012-12-06 21:12:00 UTC (rev 54225)
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE: g.gui.psmap
+# AUTHOR(S): Anna Kratochvilova <kratochanna gmail.com>
+# PURPOSE: Cartographic Composer
+# COPYRIGHT: (C) 2011-2012 by Anna Kratochvilova, and the GRASS Development Team
+#
+# This program is free software; you can 1redistribute 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
+#% description: Tool for creating hardcopy map outputs.
+#% keywords: general
+#% keywords: gui
+#% keywords: printing
+#%end
+#%option G_OPT_F_INPUT
+#% key: file
+#% label: File containing mapping instructions
+#% description: See ps.map manual for details
+#% key_desc: name
+#% required: no
+#%end
+
+import os
+import sys
+import gettext
+
+import wx
+
+import grass.script as grass
+
+sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+
+from psmap.frame import PsMapFrame
+from psmap.instructions import Instruction
+
+def main():
+ gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
+
+ app = wx.PySimpleApp()
+ wx.InitAllImageHandlers()
+ frame = PsMapFrame(parent = None)
+ if options['file']:
+ grass.fatal(_("To be implemented"))
+
+ frame.Show()
+
+ app.MainLoop()
+
+if __name__ == "__main__":
+ options, flags = grass.parser()
+ main()
Property changes on: grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/x-python
Added: svn:eol-style
+ native
More information about the grass-commit
mailing list