From: Alan W. I. <ir...@be...> - 2002-12-30 20:40:52
|
On Sat, 28 Dec 2002, Alan W. Irwin wrote: > As a result of the recent commits, all examples work now except for the > three examples with the full 3-D PLplot API, (x09, x15, x16). In particular > x08 works now without problems. That situation has now been greatly improved. As a result of recent commits *all* java examples work! That includes x16.java where it calls plshades using the API rather than lame (I can use that adjective since I wrote those myself) local workarounds that mimicked more-or-less the plshades functionality. There is still a bit more work to do before the new java interface is release ready. Functions with string arguments don't work quite right as of the moment, so, for example, plParseOpts has been commented out of all examples temporarily. I hope to get that all sorted out and write a bit of documentation in the next few days which should complete the java interface work that is essential to the release. For those of you anxious to try this new java interface yourselves, here is the cookbook. configure --enable-java --disable-python (and other options); make; make install. cd $prefix/lib/java/plplot/examples and follow the instructions in README.javademos. Note that for the 'make' part of the above to work, you must have java installed (see README.javademos for now although README.javaAPI will be updated as well for the release, see comment above about "bit of documentation"). Furthermore, you must have the latest version of swig which is currently 1.3.17. At their release rate of roughly one release per month over the last 6 months, I fully expect 1.3.18 to be out any day now. Hopefully, this developmental branch of swig releases is sufficiently stabilized by now, that the java interface will just continue to work for new versions of swig beyond 1.3.17. Note, the python interface currently does not work with swig-1.3.17 so that is why you must disable python above. However, I will sort that all out so that swig 1.3.17 (and above, hopefully) is what will be uniformly required for both the python and java interfaces to PLplot for those who use CVS. I emphasize, again, that swig versions should only concern CVS users. Ordinary PLplot users will not need swig since both the java and python interface files will be pre-generated for the tarball. There is one other limitation to the new raw java interface that should be added to the list below of non release-critical issues. Currently, the xg, and yg arrays to plcont, plshades, and plshade must be two dimensional for the raw interface. Single-dimensional versions of xg and yg should be overloaded as part of the user-friendly interface. Again, I don't think such an interface is critical to the release, but if somebody would like to make a start on it (which I don't know how to do), I would be willing to finish it. Alan > There are some additional limitations to this interface which I don't > believe are release critical and which, in any case, somebody else with more > than my nominal java expertise will have to deal with. I list those > limitation here so that those of you with further interest may have a chance > to tackle these issues before the release if you care to do so. > > (1) A user-friendly wrapper to the interface should be made in java to give > us a variety of different simplified argument lists similarly to the way > plplot.py wraps the plplotc extension module. If someone will show me the > way by writing such a java wrapper with just one argument list > simplification I can fill out the rest following the user-friendly > simplified argument list variations that have been implemented in plplot.py. > > (2) Each example has a rather ugly combination of two commands: > > PLStreamc plsdummy = new PLStreamc(); > plplotjavac pls = new plplotjavac(); > > The first one dynamically loads the wrapper library (with the stream stuff > commented out because the plplot API is not available to that class at the > moment), and the second one loads the plplotjavac wrapper made by swig which > then pulls in everything else that is required. Obviously, this should all > be done with one command where we refer to PLStream, the user-friendly > wrapper which in turn wraps PLStreamc, which in turn (after loading the > library) wraps plplotjavac and then finishes with the stream stuff that > Geoffrey put in for the old interface. But it is going to require somebody > (that word again....;-)) more expert in Java than me to implement this. As > I said above, I can fill out all the required argument list variations once > somebody shows me how to make just one of them. > > (3) Only the default java double-precision can be used from Java. That is > what the examples use (by default) so that is what works. I believe the way > to do this properly with swig is simply to make both single and double > precision versions of the PLplot API description, and the two possible > function calls will be overloaded. > > N.B. This java precision issue should not be confused with the double or > single precision PLplot library issue. I have been doing all my testing > with the single-precision form of the PLplot library, and all > double-precision java entities are transformed to single-precision without > problems. I assume the double-precision form of the PLplot library will work > fine as well since no transformation is required in that case, but I have > not tested it. > > (4) The callback functions should be done properly so that java methods can > be used for transformations for the full 3-D PLplot API. This approach > would be similar to the way the python interface fully implements the > callback functions (see the mypltr definition and use in xw09.py). For now, > though, the "simplified version of the full 3-D API" referred to above means > we will be taking the simplified tcl approach to the 3-d API for now rather > than the preferred complete callback approach used for the python interface. > > Alan > > email: ir...@be... > phone: 250-727-2902 FAX: 250-721-7715 > snail-mail: > Dr. Alan W. Irwin > Department of Physics and Astronomy, > University of Victoria, P.O. Box 3055, > Victoria, British Columbia, Canada, V8W 3P6 > __________________________ > > Linux-powered astrophysics > __________________________ |