[GRASS-SVN] r46805 - in grass/trunk: gui/wxpython/gui_modules include lib/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 27 15:46:18 EDT 2011


Author: annakrat
Date: 2011-06-27 12:46:18 -0700 (Mon, 27 Jun 2011)
New Revision: 46805

Modified:
   grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/wxnviz.py
   grass/trunk/include/nviz.h
   grass/trunk/lib/nviz/draw.c
   grass/trunk/lib/nviz/nviz.c
Log:
wxNviz: try to fix drawing fringes (didn't work on some computers)

Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-06-27 18:16:23 UTC (rev 46804)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py	2011-06-27 19:46:18 UTC (rev 46805)
@@ -396,8 +396,12 @@
             self._display.Draw(True, mode)
         else: # None -> reuse last rendered image
             pass # TODO
-        
+            
         self.SwapBuffers()
+        # draw fringe after SwapBuffers, otherwise it don't have to be visible
+        # on some computers
+        if self.render['quick'] is False:
+            self._display.DrawFringe()
         
         stop = time.clock()
         

Modified: grass/trunk/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2011-06-27 18:16:23 UTC (rev 46804)
+++ grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2011-06-27 19:46:18 UTC (rev 46805)
@@ -1338,6 +1338,10 @@
         if self.showLight:
             Nviz_draw_model(self.data)
 
+    def DrawFringe(self):
+        """!Draw fringe"""
+        Nviz_draw_fringe(self.data)
+        
     def SetFringe(self, sid, color, elev, nw = False, ne = False, sw = False, se = False):
         """!Set fringe
 

Modified: grass/trunk/include/nviz.h
===================================================================
--- grass/trunk/include/nviz.h	2011-06-27 18:16:23 UTC (rev 46804)
+++ grass/trunk/include/nviz.h	2011-06-27 19:46:18 UTC (rev 46805)
@@ -184,6 +184,7 @@
 				    double, int, int, int, int);
 struct fringe_data *Nviz_set_fringe(nv_data *, int, unsigned long,
 				    double, int, int, int, int);
+void Nviz_draw_fringe(nv_data *data);
 
 /* position.c */
 void Nviz_init_view(nv_data *);

Modified: grass/trunk/lib/nviz/draw.c
===================================================================
--- grass/trunk/lib/nviz/draw.c	2011-06-27 18:16:23 UTC (rev 46804)
+++ grass/trunk/lib/nviz/draw.c	2011-06-27 19:46:18 UTC (rev 46805)
@@ -232,11 +232,13 @@
 
     if (draw_vol)
 	Nviz_draw_all_vol(data);
-
+	
+    /*
     for(i = 0; i < data->num_fringes; i++) {
 	struct fringe_data * f = data->fringe[i];
 	GS_draw_fringe(f->id, f->color, f->elev, f->where);
     }
+    */
     
     GS_done_draw();
     GS_set_draw(GSD_BACK);

Modified: grass/trunk/lib/nviz/nviz.c
===================================================================
--- grass/trunk/lib/nviz/nviz.c	2011-06-27 18:16:23 UTC (rev 46804)
+++ grass/trunk/lib/nviz/nviz.c	2011-06-27 19:46:18 UTC (rev 46805)
@@ -201,3 +201,17 @@
     
     return f;
 }
+/*! Draw fringe
+
+   \param data nviz data
+ */
+void Nviz_draw_fringe(nv_data *data)
+{
+    int i;
+
+    for (i = 0; i < data->num_fringes; i++) {
+	struct fringe_data *f = data->fringe[i];
+
+	GS_draw_fringe(f->id, f->color, f->elev, f->where);
+    }
+}



More information about the grass-commit mailing list