[GRASS-dev] [GRASS GIS] #1132: wxNviz and wxVdigit missing from 6.4svn

#1132: wxNviz and wxVdigit missing from 6.4svn
---------------------+------------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------
Hi,

wxNviz and wxVdigit are missing from 6.4svn in a build using the latest
svn. platform is debian/lenny amd64.

{{{
CFLAGS="-ggdb -march=amdfam10 -Wall -Werror-implicit-function-declaration"
\
   ./configure \
     --with-tcltk-includes=/usr/include/tcl8.5 --with-cairo \
     --with-motif --with-python=/usr/bin/python2.5-config \
     --with-readline --with-cxx --with-odbc --with-sqlite \
     --with-freetype --with-freetype-includes=/usr/include/freetype2 \
     --without-postgres --with-proj-share=/usr/share/proj \
     --enable-64bit --with-pthread \
     --with-wxwidgets=/usr/lib/wx/config/gtk2-unicode-release-2.8 \
     --with-geos \
     2>&1 | tee config_log.txt
}}}
...
{{{
   Python support: yes
   wxWidgets support: yes
}}}
...
{{{
$ make -j 8
...
--
Errors in:
No errors detected.
--
}}}
{{{
grass/svn/releasebranch_6_4$ ls dist.x86_64-unknown-linux-
gnu/etc/wxpython/
README gis_set.py icons/ scripts/ xml/
compat/ gui_modules/ images/ wxgui.py

grass/svn/releasebranch_6_4$ ls gui/wxpython/nviz/OBJ.x86_64-unknown-
linux-gnu/
_grass6_wxnviz.so* grass6_wxnviz_wrap.o load.o volume.o
change_view.o init.o surface.o
draw.o lights.o vector.o

grass/svn/releasebranch_6_4$ ls gui/wxpython/vdigit/OBJ.x86_64-unknown-
linux-gnu/
_grass6_wxvdigit.so* driver_draw.o message.o vertex.o
cats.o driver_select.o pseudodc.o
digit.o grass6_wxvdigit_wrap.o select.o
driver.o line.o undo.o
}}}

seems it isn't being installed.

?,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1132&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
---------------------+------------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by glynn):

Replying to [ticket:1132 hamish]:

> wxNviz and wxVdigit are missing from 6.4svn in a build

r42875:
{{{
Timestamp:
     07/21/10 21:10:11 (4 weeks ago)
Author:
     martinl
Message:
     vdigit + nviz disabled
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1132#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
---------------------+------------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by hamish):

Replying to [comment:1 glynn]:
> r42875:
> {{{
> Timestamp:
> 07/21/10 21:10:11 (4 weeks ago)
> Author:
> martinl
> Message:
> vdigit + nviz disabled
> }}}

I can see wanting to save nviz for a backport of the improved version, but
why was vdigit disabled? My experience with it so far on Linux has been
very good/impressive.

Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
---------------------+------------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by glynn):

Replying to [comment:2 hamish]:

> I can see wanting to save nviz for a backport of the improved version,
but why was vdigit disabled? My experience with it so far on Linux has
been very good/impressive.

If there are any problems with the vdigit or nviz modules, you lose the
whole wxGUI. You can catch an exception; you can't catch a segfault.

And there are so many plausible failure modes. Most of wxGUI will work
with any reasonably recent version of Python and wxPython, but the
compiled modules will only work with the specific versions they were built
against. The binary component is written C++, which tends to be more
fragile in terms of binary compatibility.

Finally, a release is bound to get used on a wider variety of systems than
the development versions.

Leaving them in might work out, or it might just prove the old adage about
"never use a point-zero version; wait for point-one".

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
Changes (by hamish):

  * priority: blocker => critical
  * type: defect => task
  * milestone: 6.4.0 => 6.4.1

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1132#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------

Comment(by martinl):

Replying to [comment:2 hamish]:
> I can see wanting to save nviz for a backport of the improved version,
but why was vdigit disabled? My experience with it so far on Linux has
been very good/impressive.

my motivation was to disable problematic components of wxGUI. The
components require specific version of wxPython (copy of pseudodc.cpp/h)
and swig. wxNviz has been already rewritten in Python (grass65+). Within
the next weeks I am planning to rewrite wxvdigit in Python and include it
in 6.4.1+.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: C++ | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
Changes (by hamish):

  * keywords: => C++

Comment:

Replying to [comment:5 martinl]:
> wxNviz has been already rewritten in Python (grass65+). Within
> the next weeks I am planning to rewrite wxvdigit in Python and
> include it in 6.4.1+.

just our of curiosity, I wonder the number of programmer-hours it took to
do that for wxNviz? (I guess we can apply our own mere-mortals, already
blazed trail, and python ability adjustment factors to that number to get
an idea..)

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1132#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: task | Status: new
Priority: critical | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: C++ | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------

Comment(by glynn):

Replying to [comment:6 hamish]:

> > wxNviz has been already rewritten in Python (grass65+). Within
> > the next weeks I am planning to rewrite wxvdigit in Python and
> > include it in 6.4.1+.
>
> just our of curiosity, I wonder the number of programmer-hours it took
to do that for wxNviz?

Converting nviz took me a couple of hours, but it's a much, much simpler
module than vdigit. In particular, the nviz module didn't explicitly use
wxWidgets at all; it just relied upon the OpenGL context having been set
up by the Python code.

Once the ctypes wrappers were generated for the OGSF and nviz libraries,
the conversion was a direct translation from C++ to Python.

One of the main issues for vdigit is that it's performing bulk data
processing, reading individual lines via Vlib and rendering them to a
PseudoDC. Doing that entirely in Python is likely to be slow, and I don't
see any easy way around it.

Using OpenGL would provide more choices.

One option would be a C (not C++) component which read lines via Vlib and
"rendered" them into a display list. A C component could be used from
Python via ctypes, and rendering whole display lists rather than
individual lines eliminates much of the Python overhead.

Another option would be utility functions to read large amounts of data
from Vlib into arrays, which could then be processed using NumPy and
rendered using glDrawArrays or glDrawElements, so no per-line/per-vertex
processing in Python.

Bulk data processing with NumPy is much faster than iterating in Python
(and NumPy would be an excellent candidate for acceleration via e.g.
OpenCL or CUDA; I'm surprised it hasn't happened already).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: task | Status: assigned
Priority: critical | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: C++ | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
Changes (by martinl):

* cc: grass-dev@… (added)
  * owner: grass-dev@… => martinl
  * status: new => assigned

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
----------------------+-----------------------------------------------------
Reporter: hamish | Owner: martinl
     Type: task | Status: assigned
Priority: critical | Milestone: 6.4.2
Component: wxGUI | Version: svn-releasebranch64
Keywords: C++ | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
Changes (by martinl):

  * milestone: 6.4.1 => 6.4.2

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1132: wxNviz and wxVdigit missing from 6.4svn
-----------------------+----------------------------------------------------
  Reporter: hamish | Owner: martinl
      Type: task | Status: closed
  Priority: critical | Milestone: 6.4.2
Component: wxGUI | Version: svn-releasebranch64
Resolution: wontfix | Keywords: C++
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Changes (by martinl):

  * status: assigned => closed
  * resolution: => wontfix

Comment:

Both components have been ported to Python using Ctypes.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1132#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>