nviz.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 os
  15. import sys
  16. import wx
  17. try:
  18. from wx import glcanvas
  19. haveGLCanvas = True
  20. except ImportError, e:
  21. haveGLCanvas = False
  22. errorMsg = e
  23. try:
  24. from OpenGL.GL import *
  25. from OpenGL.GLUT import *
  26. haveOpenGL = True
  27. except ImportError, e:
  28. haveOpenGL = False
  29. errorMsg = e
  30. import globalvar
  31. try:
  32. sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
  33. import grass6_wxnviz as wxnviz
  34. haveNviz = True
  35. except ImportError, e:
  36. haveNviz = False
  37. errorMsg = e
  38. import nviz_mapdisp
  39. import nviz_tools
  40. GLWindow = nviz_mapdisp.GLWindow
  41. NvizToolWindow = nviz_tools.NvizToolWindow