[GRASS-SVN] r31818 - grass-addons/visualization/nviz2/wxpython/nviz

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jun 23 05:46:09 EDT 2008


Author: martinl
Date: 2008-06-23 05:46:09 -0400 (Mon, 23 Jun 2008)
New Revision: 31818

Modified:
   grass-addons/visualization/nviz2/wxpython/nviz/init.cpp
   grass-addons/visualization/nviz2/wxpython/nviz/load.cpp
   grass-addons/visualization/nviz2/wxpython/nviz/nviz.h
Log:
nviz2: wxGUI intergration in progress

Modified: grass-addons/visualization/nviz2/wxpython/nviz/init.cpp
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/init.cpp	2008-06-23 09:28:13 UTC (rev 31817)
+++ grass-addons/visualization/nviz2/wxpython/nviz/init.cpp	2008-06-23 09:46:09 UTC (rev 31818)
@@ -39,22 +39,6 @@
 
     /* GLCanvas */
     glCanvas = NULL;
-
-    /* initialize nviz data */
-    Nviz_init_data(data);
-    /* define default attributes for map objects */
-    Nviz_set_attr_default();
-    /* set background color */
-    Nviz_set_bgcolor(data, Nviz_color_from_str("white")); /* TODO */
-
-    /* initialize view */
-    Nviz_init_view();
-
-    /* set default lighting model */
-    SetLightsDefault();
-
-    /* clear window */
-    GS_clear(data->bgcolor);
 }
 
 /*!
@@ -84,13 +68,33 @@
 	return 0;
 
     glCanvas = (wxGLCanvas *) display;
+    // glCanvas->SetCurrent();
 
-    //Nviz_create_render_window(rwind, display, width, height);
-    //Nviz_make_current_render_window(rwind);
-
     return 1;
 }
 
+void Nviz::InitView()
+{
+    /* initialize nviz data */
+    Nviz_init_data(data);
+
+    /* define default attributes for map objects */
+    Nviz_set_attr_default();
+    /* set background color */
+    Nviz_set_bgcolor(data, Nviz_color_from_str("white")); /* TODO */
+
+    /* initialize view */
+    Nviz_init_view();
+
+    /* set default lighting model */
+    SetLightsDefault();
+
+    /* clear window */
+    GS_clear(data->bgcolor);
+
+    return;
+}
+
 void swap_gl()
 {
     return;

Modified: grass-addons/visualization/nviz2/wxpython/nviz/load.cpp
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/load.cpp	2008-06-23 09:28:13 UTC (rev 31817)
+++ grass-addons/visualization/nviz2/wxpython/nviz/load.cpp	2008-06-23 09:46:09 UTC (rev 31818)
@@ -78,5 +78,8 @@
       set_default_wirecolors(data, i);
     */
 
+    /* focus on loaded data */
+    Nviz_set_focus_map(MAP_OBJ_UNDEFINED, -1);
+
     return 1;
 }

Modified: grass-addons/visualization/nviz2/wxpython/nviz/nviz.h
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/nviz.h	2008-06-23 09:28:13 UTC (rev 31817)
+++ grass-addons/visualization/nviz2/wxpython/nviz/nviz.h	2008-06-23 09:46:09 UTC (rev 31818)
@@ -46,6 +46,7 @@
     
     /* viewport */
     void SetViewportDefault();
+    void InitView();
 
     /* load data */
     int LoadRaster(const char*, const char *, const char *);



More information about the grass-commit mailing list