[GRASS-SVN] r46833 - in grass/trunk: gui/wxpython/gui_modules
visualization/nviz2/cmd
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 29 03:35:57 EDT 2011
Author: annakrat
Date: 2011-06-29 00:35:57 -0700 (Wed, 29 Jun 2011)
New Revision: 46833
Modified:
grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
grass/trunk/visualization/nviz2/cmd/args.c
grass/trunk/visualization/nviz2/cmd/local_proto.h
grass/trunk/visualization/nviz2/cmd/main.c
Log:
nviz_cmd: focus parameter added
Modified: grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py 2011-06-29 05:34:15 UTC (rev 46832)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_mapdisp.py 2011-06-29 07:35:57 UTC (rev 46833)
@@ -964,6 +964,8 @@
subkey = ('twist', 'value'))
self._display.LookAtCenter()
+ focus = self.iview['focus']
+ focus['x'], focus['y'], focus['z'] = self._display.GetFocus()
event = wxUpdateView(zExag = False)
wx.PostEvent(self, event)
Modified: grass/trunk/gui/wxpython/gui_modules/nviz_tools.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/nviz_tools.py 2011-06-29 05:34:15 UTC (rev 46832)
+++ grass/trunk/gui/wxpython/gui_modules/nviz_tools.py 2011-06-29 07:35:57 UTC (rev 46833)
@@ -239,7 +239,6 @@
# position
posSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- self.win['view']['lookFrom'] = {}
self._createCompass(panel = panel, sizer = posSizer, type = 'view')
view = ViewPositionWindow(panel, size = (175, 175),
@@ -1504,7 +1503,6 @@
gridSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
posSizer = wx.GridBagSizer(vgap = 3, hgap = 3)
- self.win['light']['lookFrom'] = {}
self._createCompass(panel = panel, sizer = posSizer, type = 'light')
pos = LightPositionWindow(panel, id = wx.ID_ANY, size = (175, 175),
@@ -2071,6 +2069,8 @@
name = self.FindWindowById(event.GetId()).GetName()
if name == 'center':
self._display.LookAtCenter()
+ focus = self.mapWindow.iview['focus']
+ focus['x'], focus['y'], focus['z'] = self._display.GetFocus()
self.mapWindow.Refresh(False)
elif name == 'top':
self.mapWindow.view['position']['x'] = 0.5
Modified: grass/trunk/visualization/nviz2/cmd/args.c
===================================================================
--- grass/trunk/visualization/nviz2/cmd/args.c 2011-06-29 05:34:15 UTC (rev 46832)
+++ grass/trunk/visualization/nviz2/cmd/args.c 2011-06-29 07:35:57 UTC (rev 46833)
@@ -525,6 +525,16 @@
params->exag->multiple = NO;
params->exag->description = _("Vertical exaggeration");
+ /* focus */
+ params->focus = G_define_option();
+ params->focus->key = "focus";
+ params->focus->key_desc = "x,y";
+ params->focus->type = TYPE_DOUBLE;
+ params->focus->required = NO;
+ params->focus->multiple = NO;
+ params->focus->description = _("Focus to point on surface (from SW corner in map units)");
+ params->focus->guisection = _("Viewpoint");
+
return;
}
@@ -651,7 +661,7 @@
params->cplane_pos->type = TYPE_DOUBLE;
params->cplane_pos->required = NO;
params->cplane_pos->multiple = YES;
- params->cplane_pos->description = _("Cutting plane x,y coordinates");
+ params->cplane_pos->description = _("Cutting plane x,y,z coordinates");
params->cplane_pos->guisection = _("Cutting planes");
params->cplane_pos->answer = "0,0,0";
Modified: grass/trunk/visualization/nviz2/cmd/local_proto.h
===================================================================
--- grass/trunk/visualization/nviz2/cmd/local_proto.h 2011-06-29 05:34:15 UTC (rev 46832)
+++ grass/trunk/visualization/nviz2/cmd/local_proto.h 2011-06-29 07:35:57 UTC (rev 46833)
@@ -27,7 +27,7 @@
/* cutting planes */
*cplane, *cplane_pos, *cplane_rot, *cplane_tilt, *cplane_shading,
/* viewpoint */
- *pos, *height, *persp, *twist,
+ *pos, *height, *persp, *twist, *focus,
/* output */
*output, *format, *size,
/* lighting */
Modified: grass/trunk/visualization/nviz2/cmd/main.c
===================================================================
--- grass/trunk/visualization/nviz2/cmd/main.c 2011-06-29 05:34:15 UTC (rev 46832)
+++ grass/trunk/visualization/nviz2/cmd/main.c 2011-06-29 07:35:57 UTC (rev 46833)
@@ -150,6 +150,10 @@
atof(params->pos->answers[1]));
Nviz_set_viewpoint_twist(atoi(params->twist->answer));
Nviz_set_viewpoint_persp(atoi(params->persp->answer));
+ if (params->focus->answer) {
+ Nviz_set_focus(&data, atof(params->focus->answers[0]),
+ atof(params->focus->answers[1]), 0);
+ }
/* set lights */
Nviz_set_light_position(&data, 1,
More information about the grass-commit
mailing list