nviz.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. """
  2. @package nviz.py
  3. @brief Nviz extension for wxGUI
  4. This module enables to visualize data in 2.5/3D space.
  5. Map Display supports standard 2D mode ('mapdisp' module) and 2.5/3D
  6. mode ('nviz_mapdisp' module).
  7. (C) 2008 by the GRASS Development Team
  8. This program is free software under the GNU General Public
  9. License (>=v2). Read the file COPYING that comes with GRASS
  10. for details.
  11. @author Martin Landa <landa.martin gmail.com> (Google SoC 2008)
  12. """
  13. errorMsg = ''
  14. import wx
  15. try:
  16. from wx import glcanvas
  17. haveGLCanvas = True
  18. except ImportError, e:
  19. haveGLCanvas = False
  20. errorMsg = e
  21. try:
  22. from OpenGL.GL import *
  23. from OpenGL.GLUT import *
  24. haveOpenGL = True
  25. except ImportError, e:
  26. haveOpenGL = False
  27. errorMsg = e
  28. import globalvar
  29. try:
  30. sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
  31. import grass6_wxnviz as wxnviz
  32. haveNviz = True
  33. except ImportError, e:
  34. haveNviz = False
  35. errorMsg = e
  36. import nviz_mapdisp
  37. import nviz_tools
  38. GLWindow = nviz_mapdisp.GLWindow
  39. NvizToolWindow = nviz_tools.NvizToolWindow