From: <ba...@ph...> - 2003-01-17 12:42:27
|
Hi, I tried to install VPython-2002-07-22.tar.gz on a debian woody machine, and ran into the following error message: g++ -I. -I./CXX/Include -I/home/abaecker/PYTHON/include/python2.3 -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -D_REENTRANT -I/usr/X11R6/include -w -c -o platlinux.o platlinux.cpp platlinux.cpp:71: `ANY' was not declared in this scope platlinux.cpp:71: parse error before `)' make: *** [platlinux.o] Error 1 cp: cannot stat `cvisualmodule.so': No such file or directory The compiler I am using is gcc version 2.95.4 20011002 (Debian prerelease) ANY ;-) help is appreciated. Arnd Baecker P.S.: g++3.2 even fails earlier: g++-3.2 -I. -I./CXX/Include -I/home/abaecker/PYTHON/include/python2.3 -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -D_REENTRANT -I/usr/X11R6/include -w -c -o arrow.o arrow.cpp In file included from pvector.h:6, from cvisual.h:6, from display.h:5, from prim.h:5, from axial.h:5, from arrow.cpp:1: CXX/Include/CXX_Objects.h:967: no class template named `random_access_iterator' in `std' CXX/Include/CXX_Objects.h:1077: no class template named `random_access_iterator ' in `std' make: *** [arrow.o] Error 1 cp: cannot stat `cvisualmodule.so': No such file or directory |
From: Andy D. <dou...@la...> - 2003-01-17 16:48:47
|
On Fri, 17 Jan 2003 ba...@ph... wrote: > I tried to install VPython-2002-07-22.tar.gz on a > debian woody machine, and ran into the following error message: > > g++ -I. -I./CXX/Include -I/home/abaecker/PYTHON/include/python2.3 > -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include > -D_REENTRANT -I/usr/X11R6/include -w -c -o platlinux.o platlinux.cpp > platlinux.cpp:71: `ANY' was not declared in this scope > platlinux.cpp:71: parse error before `)' > make: *** [platlinux.o] Error 1 I compiled it just fine on a Debian woody machine. One difference is that I used python 2.2.2, not python 2.3. I suspect the 2.3 version of python is what's causing your problem. Go back and install 2.2.2 (or something similar to that) and you should be fine. > gcc version 2.95.4 20011002 (Debian prerelease) I'm using the same one. > P.S.: g++3.2 even fails earlier: > > g++-3.2 -I. -I./CXX/Include -I/home/abaecker/PYTHON/include/python2.3 > -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include > -D_REENTRANT -I/usr/X11R6/include -w -c -o arrow.o arrow.cpp > In file included from pvector.h:6, > from cvisual.h:6, > from display.h:5, > from prim.h:5, > from axial.h:5, > from arrow.cpp:1: > CXX/Include/CXX_Objects.h:967: no class template named > `random_access_iterator' > in `std' Yes, that's been reported before, and I think there's an #ifdef somewhere in the visual sources. [poking around...] If, for some reason, you don't want to take my advice above and use python-2.2.2, then you can try getting around this particular problem by changing the line in cvisual/CXX/Include/CXX_Config.h that says #define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1 to #define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 0 and see what happens. If that doesn't work, try searching the archives of this group -- I know this problem has been reported before. More generally, this should ultimately probably be fixed in the cvisual sources, but I'm not sufficiently familiar with C++ myself to suggest a fix. Checking out the stl_iterator documentation, I find this about random_access_iterator: Defined in the standard header iterator, and in the nonstandard backward-compatibility header iterator.h. This class is no longer part of the C++ standard, although it was present in early drafts of the standard. It is retained in this implementation for backward compatibility. And the header file stl_iterator.h has these lines (at least in my version): // The base classes input_iterator, output_iterator, forward_iterator, // bidirectional_iterator, and random_access_iterator are not part of // the C++ standard. (they have been replaced by struct iterator.) // They are included for backward compatibility with the HP STL. So it looks like cvisual has run into the problem of shifting standards :-(. Anyway, using gcc-2.95 and python-2.2.2 should just work. Unless you've got a sense of adventure, I'd try that combination first :-). Hope this helps, Andy Dougherty dou...@la... Dept. of Physics Lafayette College, Easton PA 18042 |
From: <ba...@ph...> - 2003-01-19 09:55:37
|
Hi, thank you very much for your rapid response. I redid the compilation on my home machine (with Python 2.2.1c2 (#1, Apr 4 2002, 18:54:47) [GCC 2.95.4 20011006 (Debian prerelease)] on linux2 ) and had no problems. Everything seems to work fine. Unfortunately, it seems that Visual does not have all the capabilities I am looking for. Namely, I have the following issues 1.) There seems to be no possibility to use the mouse in 2D plots (visual.graph), namely to get its current position. 2.) When plotting many individual points with dots.plot(gdisplay=graph,pos=(x,y)) it seems that somehow after too many have been plotted, no further ones will be shown, Also I am a bit unsure about the speed (well, at home I have an old PII, 350MHz ... ;-) 3.) I did not figure out how to change the style and size of the plot points (but that's only a minor point to the above). Clearly, Visual is more aimed at 3D than 2D, but I haven't found a good 2D graphics display which allows for dynamic display from within python + mouse interaction/events. In particular, I really like the compactness in Visual, just three short commands do the job (gdisplay, dots=gdots, dots.plot) to get a plot. Are there any plans to realize 1.)-3.), or are they already there and I just overlooked it ?? ((Background Info: we are presently considering to use Python+Numeric together with some good graphics add-on for a course on computational physics next summer term. One crucial aspect for the choice of programming language/system is dynamic display of data + interactive aspects via mouse ... Any pointers are appreciated... )) Many thanks, Arnd On Fri, 17 Jan 2003, Andy Dougherty wrote: > On Fri, 17 Jan 2003 ba...@ph... wrote: > > > I tried to install VPython-2002-07-22.tar.gz on a > > debian woody machine, and ran into the following error message: > > > > g++ -I. -I./CXX/Include -I/home/abaecker/PYTHON/include/python2.3 > > -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include > > -D_REENTRANT -I/usr/X11R6/include -w -c -o platlinux.o platlinux.cpp > > platlinux.cpp:71: `ANY' was not declared in this scope > > platlinux.cpp:71: parse error before `)' > > make: *** [platlinux.o] Error 1 > > I compiled it just fine on a Debian woody machine. One difference is that > I used python 2.2.2, not python 2.3. I suspect the 2.3 version of python > is what's causing your problem. Go back and install 2.2.2 (or > something similar to that) and you should be fine. > > > gcc version 2.95.4 20011002 (Debian prerelease) > > I'm using the same one. > > > P.S.: g++3.2 even fails earlier: > > > > g++-3.2 -I. -I./CXX/Include -I/home/abaecker/PYTHON/include/python2.3 > > -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include > > -D_REENTRANT -I/usr/X11R6/include -w -c -o arrow.o arrow.cpp > > In file included from pvector.h:6, > > from cvisual.h:6, > > from display.h:5, > > from prim.h:5, > > from axial.h:5, > > from arrow.cpp:1: > > CXX/Include/CXX_Objects.h:967: no class template named > > `random_access_iterator' > > in `std' > > Yes, that's been reported before, and I think there's an #ifdef somewhere > in the visual sources. [poking around...] > > If, for some reason, you don't want to take my advice above and use > python-2.2.2, then you can try getting around this particular problem > by changing the line in cvisual/CXX/Include/CXX_Config.h that says > > #define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 1 > to > #define STANDARD_LIBRARY_HAS_ITERATOR_TRAITS 0 > > and see what happens. > If that doesn't work, try searching the archives of this group -- I > know this problem has been reported before. > > More generally, this should ultimately probably be fixed in the cvisual > sources, but I'm not sufficiently familiar with C++ myself to suggest > a fix. Checking out the stl_iterator documentation, I find this about > random_access_iterator: > > Defined in the standard header iterator, and in the nonstandard > backward-compatibility header iterator.h. This class is no longer part > of the C++ standard, although it was present in early drafts of the > standard. It is retained in this implementation for backward > compatibility. > > And the header file stl_iterator.h has these lines (at least in my version): > > // The base classes input_iterator, output_iterator, forward_iterator, > // bidirectional_iterator, and random_access_iterator are not part of > // the C++ standard. (they have been replaced by struct iterator.) > // They are included for backward compatibility with the HP STL. > > So it looks like cvisual has run into the problem of shifting > standards :-(. > > Anyway, using gcc-2.95 and python-2.2.2 should just work. Unless > you've got a sense of adventure, I'd try that combination first :-). > > Hope this helps, > > Andy Dougherty dou...@la... > Dept. of Physics > Lafayette College, Easton PA 18042 > > > |
From: Bruce S. <bas...@un...> - 2003-01-19 14:51:27
|
It would not be difficult to add mouse interactivity to the visual.graph module, since that module was written completely in Python (by me), and anyone (including you) could easily add the mouse functionality you usefully suggest. See the file "graph" in the visual directory. Points 2 and 3 are more difficult. I've never been happy with the only way I could plot dots in visual.graph using the existing Visual module. I'm plotting the letter "o" using a label object. This is presumably expensive in time, and I'm not terribly surprised to learn that there is some limit on the number of dots to display, although I wasn't aware of it. (I'd be interested to have a test routine that illustrates this problem, though.) I couldn't plot a circle or a disk for a data point, because the graph axes are not uniform (different in x and y), and a circle or disk object comes out elliptical. There's also the problem of positioning the "o" with its center correctly placed. Not a satisfactory situation, and you're right to point out the failings. Perhaps what is needed is to introduce into Visual some object such as "dot" that has a fixed circular form independent of scaling. It is also conceivable that one might make creative use of the faces object (which I think was introduced by Dave Scherer long after I'd originally written the graph module). It would be necessary every time the graph scaling changes to run through the list of dots and re-do the faces specifications. But getting away from using a font-based label would be good. This would also permit different shapes (e.g. squares and triangles). Bruce Sherwood ----- Original Message ----- From: <ba...@ph...> > Unfortunately, it seems that Visual does not have > all the capabilities I am looking for. > Namely, I have the following issues > 1.) There seems to be no possibility to use the mouse in 2D plots > (visual.graph), namely to get its current position. > 2.) When plotting many individual points with > dots.plot(gdisplay=graph,pos=(x,y)) > it seems that somehow > after too many have been plotted, no further ones will be shown, > Also I am a bit unsure about the speed (well, at home > I have an old PII, 350MHz ... ;-) > 3.) I did not figure out how to change the style and size > of the plot points (but that's only a minor point > to the above). > > Clearly, Visual is more aimed at 3D than 2D, but > I haven't found a good 2D graphics display > which allows for dynamic display from within python > + mouse interaction/events. > In particular, I really like the compactness in Visual, > just three short commands do the job (gdisplay, dots=gdots, dots.plot) > to get a plot. > Are there any plans to realize 1.)-3.), or are they already > there and I just overlooked it ?? > > > ((Background Info: we are presently considering > to use Python+Numeric together with some good graphics > add-on for a course on computational physics next summer term. > One crucial aspect for the choice of programming language/system > is dynamic display of data + interactive aspects via mouse ... > Any pointers are appreciated... > )) |
From: Andrew W. <an...@ph...> - 2003-01-19 15:58:52
|
>From: <ba...@ph...> >> Clearly, Visual is more aimed at 3D than 2D, but >> I haven't found a good 2D graphics display >> which allows for dynamic display from within python >> + mouse interaction/events. >> In particular, I really like the compactness in Visual, >> just three short commands do the job (gdisplay, dots=gdots, dots.plot) >> to get a plot. >> Are there any plans to realize 1.)-3.), or are they already >> there and I just overlooked it ?? You could always use graphing tools outside Visual - for example, if you're on a windows box, here's a short chunk of code that will start Excel (if it isn't running) and get it to display a graph of data you pass in a list: www.aifb.uni-karlsruhe.de/.../Artikel/ March%202000%20Feature%20Fast,%20Free%20Prototyping%20in%20Python.htm The other solution is one of the modules for graphing/plotting in Python. I assume Visual's main loop would mess with other Python GUI's in the same process, but you could write a 'graph server' program that runs seperately, and have your main Visual code communicate with it - sending the data to graph and getting commands back from the user. There's an interactive graphing interface, gracePlot, letting you fiddle with scales, axes, etc on the graph using either GUI buttons or an interactive python prompt, at: http://www.idyll.org/~n8gray/code/ (and check out the other alternatives at http://www.vex.net/parnassus/ under 'Graphics') I haven't played with either of these, I just thought I'd point out (admittedly non-ideal) alternatives to the built-in Visual graphing if you need some set of features right away... Andrew |