[GRASS-dev] ctypes mystery
Markus Metz
markus.metz.giswork at googlemail.com
Wed Jun 23 07:05:20 EDT 2010
Martin Landa wrote:
> Hi all,
>
> when developing wxNviz I am facing to the strange problem with ctypes.
>
> Nviz_get_exag_height() [1] returns correct values.
>
> D1/1: Nviz_get_exag_height(): value = 805.696899 min = -2944.302979
> max = 4555.696777
>
> SetViewDefault() [2] which is calling Nviz_get_exag_height() gets
> incorrect values.
>
> GUI D1/1: Nviz::SetViewDefault(): hdef=2.000000, hmin=0.000000,
> hmax=36893488147419103232.000000
>
> Any idea what can be wrong?
>
> Thanks, Martin
>
> [1] http://trac.osgeo.org/grass/browser/grass/trunk/lib/nviz/exag.c#L63
> [2] http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/wxnviz.py#L95
Just a wild guess, try in wxnviz.py c_double() instead of c_float()
because Nviz_get_exag_height() wants double pointers, not float
pointers (confusing: python doc says python float = C double).
BTW, I get a number of compile errors in
trunk/gui/wxpython/nviz/change_view.cpp about type conversions. In
nviz.h, one error about too many arguments:
include/grass/nviz.h:134: error: too many arguments to function ‘int
Nviz_set_viewpoint_twist(int)’
No changes in my local copy, updated 1 hour ago.
Maybe this is pointing into the right direction,
Markus M
More information about the grass-dev
mailing list