Talk:WxPython-based GUI for GRASS

From GRASS-Wiki
Jump to: navigation, search

User's point of view

  • Multiple map display windows available
  • Each map display window has several buttons for basic functions
    • Zooming, Paning
    • Data Quering
    • Etc.
  • Each map display window will be able to fire up pop-up toolbar with more complicated and not-so-often-used display functions (substitutions for d.measure, d.profile, d.text, ...)
  • Each map display window will be able to fire up pop-up toolbar with v.digit substitution
  • Map display windows can be started from the command line and from the GIS Manager
  • Map display windows must be able to display following types of layers
    • GRASS Raster
    • GRASS Vector
    • GDAL Raster
    • GDAL Vector
    • WMS Layer from remote server
    • WCS and WFS layers too
    • Text layers
    • Graphics layers
    • Grid
    • Image layers
    • ...
  • GIS Manager is tool for
    • Map display window management and content management
    • Layer look management
    • Modules starting (from integrated command line or menu)
    • Displaying output from modules (G_message, G_warning, G_fatal_error, G_percent)
  • GIS Manager must be able to save and restore session
    • Better new XML format
    • Or old gis.m related
  • There should be default session file, which will be loaded by default ones GRASS is started with -gui parameter
  • Georectification tool should be part of new GUI. It should be special type of monitor with added GCP function
  • Map Composer should be part of the new GUI. This tool should generate configuration files for hardcopy maps. The configuration files should be either files or maybe SVG

Coder's point of view

NOTE: Has not been updated long time!; SVN code in progress. Would be better to use Python docs instead...

List of suggested classes and their purpose.

  • Layer --Raster, vector, WMS, whatever layer
    • Attributes - Attributes are depending on layer type, but there are also common attributes marked with prefix "l_" (for 'layer'):
      • l_type - vector, raster, wms, text, graph, ...
      • l_mapfile - rendered ppm file
      • l_maskfile - pgm file with layer's alpha channel
      • l_active - layer is active, will be rendered only if True
      • l_hidden - layer is hidden, will be allways rendered
      • l_opacity - layer opacity [0-1]
    • Methods
      • Render - runs d.* and similar commands for making content of l_mapfile
  • Map -- Set of layers renderd to single PNG image, ready to display in Map display frame
    • Attributes
      • Width - map width
      • Height - map height
      • Region - Region boundaries and resolution
      • Layers - Array of Layers displayed in this "map"
      • MapFile - path to resulting PNG file with rendered map
    • Methods
      • AddRasterLayer - Adds GRASS-raster layer to list of layers
      • AddVectorLayer - Adds GRASS-vector layer to list of layers
      • Add...Layer - Adds some type of layer (wms, wfs, text, ...) to list of layers
      • GetListOfLayers - Returns array of layers (active, hidden, type)
      • Render - Creates final PNG image and stores it's path to MapFile

TSW Comment: perhaps it would be simpler to have AddLayer and pass the type as a parameter. Automatic would be nice, but since it is possible for vector and raster files to have the same name, this wouldn't work. Another option to consider would be to use AddLayer as a base class AddLayerRaster, ... as subclasses. This would make things more modular and theoretically at least, easier to maintain and develop.

JC Comment: I made separate functions for raster and vector, because of their attributes are completely different. There should be also AddWMSLayer etc. functions. IMHO it does not matter, if we have general AddLayer with parameter layer_type, or separate functions for all layer types.