Changeset 31935
- Timestamp:
- Jul 1, 2008, 1:02:21 PM (16 years ago)
- Location:
- grass/trunk
- Files:
-
- 4 added
- 8 edited
- 28 copied
-
gui/wxpython/Makefile (modified) (2 diffs)
-
gui/wxpython/gui_modules/mapdisp.py (modified) (12 diffs)
-
gui/wxpython/gui_modules/preferences.py (modified) (10 diffs)
-
gui/wxpython/gui_modules/toolbars.py (modified) (6 diffs)
-
gui/wxpython/gui_modules/wxgui_utils.py (modified) (7 diffs)
-
gui/wxpython/nviz (added)
-
gui/wxpython/nviz/Makefile (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/Makefile ) (1 diff)
-
gui/wxpython/nviz/change_view.cpp (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/change_view.cpp )
-
gui/wxpython/nviz/dig_types.i (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/dig_types.i )
-
gui/wxpython/nviz/draw.cpp (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/draw.cpp )
-
gui/wxpython/nviz/init.cpp (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/init.cpp )
-
gui/wxpython/nviz/lights.cpp (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/lights.cpp )
-
gui/wxpython/nviz/load.cpp (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/load.cpp )
-
gui/wxpython/nviz/nviz.h (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/nviz.h )
-
gui/wxpython/nviz/nviz.i (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/nviz.i )
-
gui/wxpython/nviz/surface.cpp (copied) (copied from grass-addons/visualization/nviz2/wxpython/nviz/surface.cpp )
-
include/Make/Grass.make.in (modified) (3 diffs)
-
include/nviz.h (copied) (copied from grass-addons/visualization/nviz2/lib/nviz.h )
-
lib/Makefile (modified) (1 diff)
-
lib/nviz (added)
-
lib/nviz/Makefile (copied) (copied from grass-addons/visualization/nviz2/lib/Makefile ) (1 diff)
-
lib/nviz/change_view.c (copied) (copied from grass-addons/visualization/nviz2/lib/change_view.c )
-
lib/nviz/cplanes_obj.c (copied) (copied from grass-addons/visualization/nviz2/lib/cplanes_obj.c )
-
lib/nviz/draw.c (copied) (copied from grass-addons/visualization/nviz2/lib/draw.c )
-
lib/nviz/exag.c (copied) (copied from grass-addons/visualization/nviz2/lib/exag.c )
-
lib/nviz/lights.c (copied) (copied from grass-addons/visualization/nviz2/lib/lights.c )
-
lib/nviz/map_obj.c (copied) (copied from grass-addons/visualization/nviz2/lib/map_obj.c )
-
lib/nviz/nviz.c (copied) (copied from grass-addons/visualization/nviz2/lib/nviz.c )
-
lib/nviz/position.c (copied) (copied from grass-addons/visualization/nviz2/lib/position.c )
-
lib/nviz/render.c (copied) (copied from grass-addons/visualization/nviz2/lib/render.c )
-
lib/nviz/render.h (copied) (copied from grass-addons/visualization/nviz2/lib/render.h )
-
visualization/Makefile (modified) (1 diff)
-
visualization/nviz2 (added)
-
visualization/nviz2/cmd (added)
-
visualization/nviz2/cmd/Makefile (copied) (copied from grass-addons/visualization/nviz2/cmd/Makefile )
-
visualization/nviz2/cmd/args.c (copied) (copied from grass-addons/visualization/nviz2/cmd/args.c )
-
visualization/nviz2/cmd/description.html (copied) (copied from grass-addons/visualization/nviz2/cmd/description.html )
-
visualization/nviz2/cmd/local_proto.h (copied) (copied from grass-addons/visualization/nviz2/cmd/local_proto.h )
-
visualization/nviz2/cmd/main.c (copied) (copied from grass-addons/visualization/nviz2/cmd/main.c ) (1 diff)
-
visualization/nviz2/cmd/write_img.c (copied) (copied from grass-addons/visualization/nviz2/cmd/write_img.c )
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/gui/wxpython/Makefile
r31213 r31935 5 5 include $(MODULE_TOPDIR)/include/Make/Platform.make 6 6 7 #compile if wxWidgets, Python, CXX present 7 8 ifneq ($(USE_WXWIDGETS),) 8 9 ifneq ($(USE_PYTHON),) 9 10 ifneq ($(strip $(CXX)),) 10 11 SUBDIRS += vdigit 12 #compile if OpenGL present 13 ifneq ($(strip $(OPENGLLIB)),) 14 SUBDIRS += nviz 15 endif 11 16 endif 12 17 endif … … 21 26 22 27 install_scripts: 23 $(MKDIR) $(ETCDIR) $(ETCDIR)/compat $(ETCDIR)/gui_modules $(ETCDIR)/icons $(ETCDIR)/icons/silk $(ETCDIR)/images $(ETCDIR)/scripts $(ETCDIR)/vdigit $(ETCDIR)/xml 28 $(MKDIR) $(ETCDIR) $(ETCDIR)/compat $(ETCDIR)/gui_modules $(ETCDIR)/icons $(ETCDIR)/icons/silk $(ETCDIR)/images $(ETCDIR)/scripts $(ETCDIR)/vdigit $(ETCDIR)/xml $(ETCDIR)/nviz 24 29 $(INSTALL_DATA) compat/* $(ETCDIR)/compat/ 25 30 $(INSTALL_DATA) gui_modules/* $(ETCDIR)/gui_modules/ -
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
r31701 r31935 4 4 CLASSES: 5 5 - Command 6 - MapWindow 6 7 - BufferedWindow 7 8 - MapFrame … … 122 123 sys.exit() 123 124 124 class BufferedWindow(wx.Window): 125 class MapWindow(object): 126 """Abstract map window class 127 128 Parent for BufferedWindow class (2D display mode) and 129 GLWindow (3D display mode) 130 """ 131 def __init__(self, parent, id, 132 pos=wx.DefaultPosition, 133 size=wx.DefaultSize, 134 style=wx.NO_FULL_REPAINT_ON_RESIZE, 135 Map=None, tree=None, gismgr=None): 136 pass 137 138 def EraseMap(self): 139 """ 140 Erase the canvas (virtual method) 141 """ 142 pass 143 144 def UpdateMap(self): 145 """ 146 Updates the canvas anytime there is a change to the 147 underlaying images or to the geometry of the canvas. 148 """ 149 pass 150 151 def OnLeftDown(self, event): 152 pass 153 154 def OnLeftUp(self, event): 155 pass 156 157 def OnMouseMotion(self, event): 158 pass 159 160 def ZoomToMap(self, event): 161 pass 162 163 def GetSelectedLayer(self, nviz=False, index=False): 164 """Get selected layer from layer tree 165 166 @param nviz get nviz properties instead 167 168 @return map layer instance 169 @return None on failure 170 """ 171 # get currently selected map layer 172 if not self.tree or not self.tree.GetSelection(): 173 return None 174 175 item = self.tree.GetSelection() 176 try: 177 if nviz: 178 layer = self.tree.GetPyData(item)[0]['nviz'] 179 else: 180 layer = self.tree.GetPyData(item)[0]['maplayer'] 181 except: 182 layer = None 183 184 return layer 185 186 class BufferedWindow(MapWindow, wx.Window): 125 187 """ 126 188 A Buffered window class. … … 138 200 Map=None, tree=None, gismgr=None): 139 201 202 MapWindow.__init__(self, parent, id, pos, size, style, 203 Map, tree, gismgr) 140 204 wx.Window.__init__(self, parent, id, pos, size, style) 205 141 206 self.parent = parent 142 207 self.Map = Map … … 540 605 def UpdateMap(self, render=True, renderVector=True): 541 606 """ 542 Updates the canvas anytime there is a change to the underlaying images543 or to the geometry of the canvas.607 Updates the canvas anytime there is a change to the 608 underlaying images or to the geometry of the canvas. 544 609 545 610 @param render re-render map composition 546 611 @param renderVector re-render vector map layer enabled for editing (used for digitizer) 547 612 """ 548 549 613 start = time.clock() 550 614 … … 712 776 def EraseMap(self): 713 777 """ 714 Erase the map display778 Erase the canvas 715 779 """ 716 780 self.Draw(self.pdc, pdctype='clear') … … 2038 2102 zoomreg = {} 2039 2103 2040 # find selected map 2041 if not self.tree or not self.tree.GetSelection(): 2042 return 2043 2044 item = self.tree.GetSelection() 2045 try: 2046 layer = self.tree.GetPyData(item)[0]['maplayer'] 2047 except: 2048 layer = None 2104 layer = self.GetSelectedLayer() 2049 2105 2050 2106 if layer is None: … … 2309 2365 self.toolbars = { 'map' : None, 2310 2366 'vdigit' : None, 2311 'georect' : None } 2367 'georect' : None, 2368 'nviz' : None } 2312 2369 for toolb in toolbars: 2313 2370 self.AddToolbar(toolb) … … 2369 2426 # Init map display (buffered DC & set default cursor) 2370 2427 # 2371 self.MapWindow = BufferedWindow(self, id=wx.ID_ANY, Map=self.Map, tree=self.tree, gismgr=self.gismanager) 2428 self.MapWindow2D = BufferedWindow(self, id=wx.ID_ANY, 2429 Map=self.Map, tree=self.tree, gismgr=self.gismanager) 2430 # default is 2D display mode 2431 self.MapWindow = self.MapWindow2D 2372 2432 self.MapWindow.Bind(wx.EVT_MOTION, self.OnMotion) 2373 2433 self.MapWindow.SetCursor(self.cursors["default"]) 2434 # used by Nviz (3D display mode) 2435 self.MapWindow3D = None 2374 2436 2375 2437 # … … 2435 2497 - digit vector digitizer 2436 2498 - georect georectifier 2437 """ 2499 """ 2500 # default toolbar 2438 2501 if name == "map": 2439 2502 self.toolbars['map'] = toolbars.MapToolbar(self, self.Map) … … 2446 2509 BottomDockable(False).TopDockable(True). 2447 2510 CloseButton(False).Layer(2)) 2448 2449 if name == "digit":2511 # vector digitizer 2512 elif name == "vdigit": 2450 2513 self.toolbars['vdigit'] = toolbars.VDigitToolbar(self, self.Map, self.tree) 2451 2514 … … 2464 2527 self.MapWindow.pen = wx.Pen(colour='red', width=2, style=wx.SOLID) 2465 2528 self.MapWindow.polypen = wx.Pen(colour='green', width=2, style=wx.SOLID) 2466 2467 if name == "georect":2529 # georectifier 2530 elif name == "georect": 2468 2531 self.toolbars['georect'] = toolbars.GRToolbar(self, self.Map) 2469 2532 2470 2533 self._mgr.AddPane(self.toolbars['georect'].toolbar, 2471 2534 wx.aui.AuiPaneInfo(). 2472 Name("georecttoolbar").Caption(_("Georectification Toolbar")).2535 Name("georecttoolbar").Caption(_("Georectification toolbar")). 2473 2536 ToolbarPane().Top(). 2474 2537 LeftDockable(False).RightDockable(False). 2475 2538 BottomDockable(False).TopDockable(True). 2476 2539 CloseButton(False).Layer(2)) 2477 2540 # nviz 2541 elif name == "nviz": 2542 import nviz 2543 # check for GLCanvas and OpenGL 2544 msg = None 2545 if not nviz.haveGLCanvas: 2546 msg = _("Unable to start Nviz. The GLCanvas class has not been included with this build " 2547 "of wxPython! Switching back to 2D display mode.") 2548 if not nviz.haveOpenGL: 2549 msg = _("Unable to start Nviz. The OpenGL package was not found. You can get it " 2550 "at http://PyOpenGL.sourceforge.net. Switching back to 2D display mode.") 2551 if not nviz.haveNviz: 2552 msg = _("Unable to start Nviz. Python extension for Nviz was not found. " 2553 "Switching back to 2D display mode.") 2554 2555 if msg: 2556 wx.MessageBox(parent=self, 2557 message=msg, 2558 caption=_("Error")) 2559 return 2560 2561 # 2562 # create GL window & NVIZ toolbar 2563 # 2564 if not self.MapWindow3D: 2565 self.MapWindow3D = nviz.GLWindow(self, id=wx.ID_ANY, 2566 Map=self.Map, tree=self.tree, gismgr=self.gismanager) 2567 self.nvizToolWin = nviz.NvizToolWindow(self, id=wx.ID_ANY, 2568 mapWindow=self.MapWindow3D) 2569 2570 # 2571 # add Nviz toolbar and disable 2D display mode tools 2572 # 2573 self.toolbars['nviz'] = toolbars.NvizToolbar(self, self.Map) 2574 self.toolbars['map'].Enable2D(False) 2575 self.toggleStatus.Enable(False) 2576 2577 self.nvizToolWin.Show() 2578 2579 # 2580 # switch from MapWindow to MapWindowGL 2581 # add nviz toolbar 2582 # 2583 self._mgr.DetachPane(self.MapWindow2D) 2584 self.MapWindow2D.Hide() 2585 self._mgr.AddPane(self.MapWindow3D, wx.aui.AuiPaneInfo().CentrePane(). 2586 Dockable(False).BestSize((-1,-1)). 2587 CloseButton(False).DestroyOnClose(True). 2588 Layer(0)) 2589 self._mgr.AddPane(self.toolbars['nviz'].toolbar, 2590 wx.aui.AuiPaneInfo(). 2591 Name("nviztoolbar").Caption(_("Nviz toolbar")). 2592 ToolbarPane().Top().Row(1). 2593 LeftDockable(False).RightDockable(False). 2594 BottomDockable(False).TopDockable(True). 2595 CloseButton(False).Layer(2)) 2596 self.MapWindow = self.MapWindow3D 2597 2478 2598 self._mgr.Update() 2479 2599 … … 2488 2608 if name == "map": 2489 2609 return 2490 elif name == " digit":2610 elif name == "vdigit": 2491 2611 # TODO: not destroy only hide 2492 2612 for toolRow in range(0, self.toolbars['vdigit'].numOfRows): 2493 2613 self._mgr.DetachPane (self.toolbars['vdigit'].toolbar[toolRow]) 2494 2614 self.toolbars['vdigit'].toolbar[toolRow].Destroy() 2495 self.toolbars['vdigit'] = None 2496 2497 self.toolbars['map'].combo.SetValue ("Tools"); 2615 else: 2616 self._mgr.DetachPane (self.toolbars[name].toolbar) 2617 self.toolbars[name].toolbar.Destroy() 2618 2619 self.toolbars[name] = None 2620 2621 if name == 'nviz': 2622 # hide nviz tools 2623 self.nvizToolWin.Hide() 2624 # unload data 2625 self.MapWindow3D.Reset() 2626 # switch from MapWindowGL to MapWindow 2627 self._mgr.DetachPane(self.MapWindow3D) 2628 self.MapWindow3D.Hide() 2629 self.MapWindow2D.Show() 2630 self._mgr.AddPane(self.MapWindow2D, wx.aui.AuiPaneInfo().CentrePane(). 2631 Dockable(False).BestSize((-1,-1)). 2632 CloseButton(False).DestroyOnClose(True). 2633 Layer(0)) 2634 self.MapWindow = self.MapWindow2D 2635 2636 self.toolbars['map'].combo.SetValue ("Tools") 2637 self.toolbars['map'].Enable2D(True) 2638 self.toggleStatus.Enable(True) 2639 2498 2640 self._mgr.Update() 2499 2641 -
grass/trunk/gui/wxpython/gui_modules/preferences.py
r31640 r31935 197 197 }, 198 198 }, 199 'nviz' : { 200 'view' : {'persp' : { 'value' : 40, 201 'min' : 1, 202 'max' : 100, 203 'step' : 5, 204 'update' : False, 205 }, 206 'pos' : { 'x' : 0.85, 207 'y' : 0.85, 208 'update' : False, 209 }, 210 'height' : { 'value': -1, 211 'min' : -2245, # TODO: determine min/max height 212 'max' : 3695, 213 'step' : 100, 214 'update' : False, 215 }, 216 'twist' : { 'value' : 0, 217 'min' : -180, 218 'max' : 180, 219 'step' : 5, 220 'update' : False, 221 }, 222 'z-exag' : { 'value': 1.0, 223 'min' : 0.0, 224 'max' : 10, 225 'step' : 1, 226 'update' : False 227 }, 228 }, 229 'surface' : { 230 'shine': { 'map' : False, 231 'value' : 60.0, 232 }, 233 'color' : { 'map' : True, 234 'value' : (0, 0, 0, 255), # constant: black 235 }, 236 'draw' : { 237 'color' : (136, 136, 136, 255), 238 'mode' : 1, # fine 239 'style' : 1, # surface 240 'shading' : 1, # gouraud 241 'res-fine' : 6, 242 'res-coarse' : 9, 243 }, 244 'position' : { 245 'x' : 0, 246 'y' : 0, 247 'z' : 0, 248 }, 249 }, 250 }, 199 251 } 200 252 201 253 # 202 254 # user settings … … 284 336 group, key = line.split(':')[0:2] 285 337 kv = line.split(':')[2:] 338 subkeyMaster = None 339 if len(kv) % 2 != 0: # multiple (e.g. nviz) 340 subkeyMaster = kv[0] 341 del kv[0] 286 342 idx = 0 287 343 while idx < len(kv): 288 subkey = kv[idx] 344 if subkeyMaster: 345 subkey = [subkeyMaster, kv[idx]] 346 else: 347 subkey = kv[idx] 289 348 value = kv[idx+1] 290 349 if len(value) == 0: … … 302 361 try: 303 362 value = tuple(map(int, tmp)) 304 except :363 except ValueError: 305 364 value = tuple(tmp) 306 365 else: 307 366 try: 308 367 value = int(value) 309 except: 310 pass 368 except ValueError: 369 try: 370 value = float(value) 371 except ValueError: 372 pass 311 373 312 374 self.Append(settings, group, key, subkey, value) … … 338 400 file = open(filePath, "w") 339 401 for group in settings.keys(): 340 for item in settings[group].keys(): 341 file.write('%s:%s:' % (group, item)) 342 items = settings[group][item].keys() 343 for idx in range(len(items)): 344 file.write('%s:%s' % (items[idx], settings[group][item][items[idx]])) 345 if idx < len(items) - 1: 346 file.write(':') 402 for key in settings[group].keys(): 403 file.write('%s:%s:' % (group, key)) 404 subkeys = settings[group][key].keys() 405 for idx in range(len(subkeys)): 406 value = settings[group][key][subkeys[idx]] 407 if type(value) == type({}): 408 if idx > 0: 409 file.write('%s%s:%s:' % (os.linesep, group, key)) 410 file.write('%s:' % subkeys[idx]) 411 kvalues = settings[group][key][subkeys[idx]].keys() 412 srange = range(len(kvalues)) 413 for sidx in srange: 414 file.write('%s:%s' % (kvalues[sidx], 415 settings[group][key][subkeys[idx]][kvalues[sidx]])) 416 if sidx < len(kvalues) - 1: 417 file.write(':') 418 else: 419 file.write('%s:%s' % (subkeys[idx], value)) 420 if idx < len(subkeys) - 1: 421 file.write(':') 347 422 file.write('%s' % os.linesep) 348 423 except IOError, e: … … 363 438 @param key 364 439 @param subkey if not given return dict of key 365 440 @param subkey1 441 @param internal use internal settings instead 442 366 443 @return value 367 368 444 """ 369 445 if internal is True: … … 379 455 return settings[group][key] 380 456 else: 381 return settings[group][key][subkey] 457 if type(subkey) == type([]): 458 return settings[group][key][subkey[0]][subkey[1]] 459 else: 460 return settings[group][key][subkey] 461 382 462 except KeyError: 383 463 raise gcmd.SettingsError("%s %s:%s:%s." % (_("Unable to get value"), … … 391 471 @param group settings group 392 472 @param key key 393 @param subkey subkey 473 @param subkey subkey (value or list) 394 474 @param value value 475 @param internal use internal settings instead 395 476 """ 396 477 if internal is True: … … 400 481 401 482 try: 402 if not settings[group][key].has_key(subkey): 403 raise KeyError 404 settings[group][key][subkey] = value 483 if type(subkey) == type([]): 484 settings[group][key][subkey[0]][subkey[1]] = value 485 else: 486 settings[group][key][subkey] = value 405 487 except KeyError: 406 488 raise gcmd.SettingsError("%s '%s:%s:%s'" % (_("Unable to set "), group, key, subkey)) … … 414 496 @param group settings group 415 497 @param key key 416 @param subkey subkey 498 @param subkey subkey (value or list) 417 499 @param value value 418 500 """ … … 423 505 dict[group][key] = {} 424 506 425 dict[group][key][subkey] = value 507 if type(subkey) == type([]): 508 # TODO: len(subkey) > 2 509 if not dict[group][key].has_key(subkey[0]): 510 dict[group][key][subkey[0]] = {} 511 dict[group][key][subkey[0]][subkey[1]] = value 512 else: 513 dict[group][key][subkey] = value 426 514 427 515 def GetDefaultSettings(self): -
grass/trunk/gui/wxpython/gui_modules/toolbars.py
r31701 r31935 9 9 * VDigitToolbar 10 10 * ProfileToolbar 11 11 * NvizToolbar 12 12 13 PURPOSE: Toolbars for Map Display window 13 14 … … 112 113 # optional tools 113 114 self.combo = wx.ComboBox(parent=self.toolbar, id=wx.ID_ANY, value='Tools', 114 choices=['Digitize' ], style=wx.CB_READONLY, size=(90, -1))115 choices=['Digitize', 'Nviz'], style=wx.CB_READONLY, size=(90, -1)) 115 116 116 117 self.comboid = self.toolbar.AddControl(self.combo) 117 self.mapdisplay.Bind(wx.EVT_COMBOBOX, self.OnSelect , self.comboid)118 self.mapdisplay.Bind(wx.EVT_COMBOBOX, self.OnSelectTool, self.comboid) 118 119 119 120 # realize the toolbar … … 189 190 ) 190 191 191 def OnSelect (self, event):192 def OnSelectTool(self, event): 192 193 """ 193 194 Select / enable tool available in tools list … … 196 197 197 198 if tool == "Digitize" and not self.mapdisplay.toolbars['vdigit']: 198 self.mapdisplay.AddToolbar("digit") 199 self.mapdisplay.AddToolbar("vdigit") 200 201 elif tool == "Nviz" and not self.mapdisplay.toolbars['nviz']: 202 self.mapdisplay.AddToolbar("nviz") 203 204 def Enable2D(self, enabled): 205 """Enable/Disable 2D display mode specific tools""" 206 for tool in (self.pointer, 207 self.query, 208 self.pan, 209 self.zoomin, 210 self.zoomout, 211 self.zoomback, 212 self.zoommenu, 213 self.analyze, 214 self.dec, 215 self.savefile, 216 self.printmap): 217 self.toolbar.EnableTool(tool, enabled) 199 218 200 219 class GRToolbar(AbstractToolbar): … … 526 545 527 546 # disable the toolbar 528 self.parent.RemoveToolbar (" digit")547 self.parent.RemoveToolbar ("vdigit") 529 548 530 549 def OnMoveVertex(self, event): … … 988 1007 self.parent.OnQuit), 989 1008 ) 1009 1010 class NvizToolbar(AbstractToolbar): 1011 """ 1012 Nviz toolbar 1013 """ 1014 def __init__(self, parent, map): 1015 self.parent = parent 1016 self.mapcontent = map 1017 1018 self.toolbar = wx.ToolBar(parent=self.parent, id=wx.ID_ANY) 1019 1020 # self.SetToolBar(self.toolbar) 1021 self.toolbar.SetToolBitmapSize(globalvar.toolbarSize) 1022 1023 self.InitToolbar(self.parent, self.toolbar, self.ToolbarData()) 1024 1025 # realize the toolbar 1026 self.toolbar.Realize() 1027 1028 def ToolbarData(self): 1029 """Toolbar data""" 1030 1031 self.quit = wx.NewId() 1032 1033 # tool, label, bitmap, kind, shortHelp, longHelp, handler 1034 return ( 1035 (self.quit, 'quit', Icons["quit"].GetBitmap(), 1036 wx.ITEM_NORMAL, Icons["quit"].GetLabel(), Icons["quit"].GetDesc(), 1037 self.OnExit), 1038 ) 1039 1040 def OnExit (self, event=None): 1041 """Quit nviz tool (swith to 2D mode)""" 1042 1043 # disable the toolbar 1044 self.parent.RemoveToolbar ("nviz") 1045 -
grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
r31701 r31935 215 215 self.popupID9 = wx.NewId() 216 216 self.popupID10 = wx.NewId() 217 self.popupID11 = wx.NewId() # nviz 217 218 218 219 self.popupMenu = wx.Menu() … … 248 249 except: 249 250 mltype = None 250 # vector specific items 251 # 252 # vector layers (specific items) 253 # 251 254 if mltype and mltype == "vector": 252 255 self.popupMenu.AppendSeparator() … … 279 282 self.Bind (wx.EVT_MENU, self.OnMetadata, id=self.popupID7) 280 283 281 282 # raster 284 # 285 # raster layers (specific items) 286 # 283 287 elif mltype and mltype == "raster": 284 288 self.popupMenu.AppendSeparator() … … 289 293 self.popupMenu.Append(self.popupID6, _("Metadata")) 290 294 self.Bind (wx.EVT_MENU, self.OnMetadata, id=self.popupID6) 295 if self.mapdisplay.toolbars['nviz']: 296 self.popupMenu.Append(self.popupID11, _("Nviz properties")) 297 self.Bind (wx.EVT_MENU, self.OnNvizProperties, id=self.popupID11) 291 298 292 299 ## self.PopupMenu(self.popupMenu, pos) … … 446 453 self.RefreshSelected() 447 454 self.Refresh() 448 455 456 def OnNvizProperties(self, event): 457 """Nviz-related properties (raster/vector/volume) 458 459 @todo vector/volume 460 """ 461 import nviz 462 dlg = nviz.RasterPropertiesDialog(parent=self, 463 map=self.GetPyData(self.layer_selected)[0]['maplayer'].name) 464 dlg.Show() 465 449 466 def RenameLayer (self, event): 450 467 """Rename layer""" … … 603 620 'ctrl' : ctrlId, 604 621 'maplayer' : None, 622 'nviz' : None, 605 623 'prowin' : None}, 606 624 None)) … … 857 875 except: 858 876 pass 877 878 # update nviz tools 879 if self.mapdisplay.toolbars['nviz']: 880 self.mapdisplay.nvizToolWin.UpdatePage('surface') 859 881 860 882 def OnCollapseNode(self, event): -
grass/trunk/gui/wxpython/nviz/Makefile
r31934 r31935 1 # MODULE_TOPDIR = ../../.. 2 MODULE_TOPDIR = $(HOME)/src/grass6_devel 1 MODULE_TOPDIR = ../../.. 3 2 4 3 include $(MODULE_TOPDIR)/include/Make/Lib.make 5 6 # TODO7 NVIZLIB= -lgrass_nviz $(GISLIB)8 # NVIZDEP=$(ARCH_LIBDIR)/$(LIB_PREFIX)grass_nviz$(LIB_SUFFIX)9 4 10 5 LIB_NAME = grass6_wxnviz -
grass/trunk/include/Make/Grass.make.in
r31744 r31935 145 145 # NVIZ related 146 146 OGSF_LIBNAME = grass_ogsf 147 NVIZ_LIBNAME = grass_nviz 147 148 148 149 # triangulation libraries … … 248 249 # NVIZ related 249 250 OGSFLIB = -l$(OGSF_LIBNAME) $(BITMAPLIB) $(G3DLIB) $(GISLIB) $(SITESLIB) $(VECTRLIB) 251 NVIZLIB = -l$(NVIZ_LIBNAME) $(BITMAPLIB) $(G3DLIB) $(GISLIB) $(VECTRLIB) 250 252 251 253 # triangulation libraries … … 343 345 # NVIZ related 344 346 OGSFDEP = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(OGSF_LIBNAME)$(LIB_SUFFIX) 347 NVIZDEP = $(ARCH_LIBDIR)/$(LIB_PREFIX)$(NVIZ_LIBNAME)$(LIB_SUFFIX) 345 348 346 349 # triangulation libraries -
grass/trunk/lib/Makefile
r31744 r31935 39 39 include $(MODULE_TOPDIR)/include/Make/Platform.make 40 40 41 OPENGLBASED = ogsf 41 OPENGLBASED = \ 42 ogsf \ 43 nviz 42 44 43 45 #compile if OPENGLBASED present: -
grass/trunk/lib/nviz/Makefile
r31934 r31935 1 #MODULE_TOPDIR = ../../.. 2 MODULE_TOPDIR = $(HOME)/src/grass6_devel 1 MODULE_TOPDIR = ../.. 3 2 4 # LIB_NAME = $(NVIZ_LIBNAME) 5 LIB_NAME = grass_nviz 3 LIB_NAME = $(NVIZ_LIBNAME) 6 4 7 DEPENDENCIES = $( VECTDEP) $(BITMAPDEP) $(LINKMDEP) $(FORMDEP) $(DBMIDEP) $(GISDEP) $(OGSFDEP)5 DEPENDENCIES = $(BITMAPDEP) $(DBMIDEP) $(GISDEP) $(OGSFDEP) $(G3DDEP) $(VECTRDEP) 8 6 9 7 EXTRA_INC = $(VECT_INC) 10 8 EXTRA_CFLAGS = $(INC) \ 11 9 $(TIFFINCPATH) $(DSPINC) \ 12 $(VECT_CFLAGS) $(OPENGLINC) 10 $(VECT_CFLAGS) $(OPENGLINC) 13 11 EXTRA_LIBS = $(GISLIB) $(XLIBPATH) $(XMLIB) $(XTLIB) $(XLIB) $(XEXTRALIBS) $(OGSFLIB) 14 12 -
grass/trunk/visualization/Makefile
r31326 r31935 12 12 endif 13 13 14 #compile if OpenGL present 15 ifneq ($(strip $(OPENGLLIB)),) 16 SUBDIRS += nviz2 17 endif 18 14 19 #compile if Motif present: 15 20 ifneq ($(strip $(XMLIB)),) -
grass/trunk/visualization/nviz2/cmd/main.c
r31934 r31935 285 285 /* draw */ 286 286 Nviz_draw_cplane(&data, -1, -1); 287 Nviz_draw_all (&data );287 Nviz_draw_all (&data, 1); /* clear screen */ 288 288 289 289 /* write to image */
Note:
See TracChangeset
for help on using the changeset viewer.
