JuliaGL / GLVisualize.jl

Visualization library written in Julia and OpenGL
Other
247 stars 34 forks source link

Features list for porting Mirone to Julia. #82

Open joa-quim opened 8 years ago

joa-quim commented 8 years ago

This issue is a tentative features list that will be necessary in order to port Mirone to Julia using GLVisualize, but essentially it consists in listing the basic handles graphics capabilities.

Being written in Matlab, Mirone uses the normal Ml scheme of a "figure" that is populated with Menus, buttons (push and toggle buttons), and "axes". The axes is where the images are displayed.

joa-quim commented 8 years ago

Simon, I recently learned about this

https://github.com/vurtun/nuklear

seams it could be handy to help creating all sort of menus, buttons and relatives.

SimonDanisch commented 8 years ago

that looks like a cool library :)

2016-05-23 23:45 GMT+02:00 Joaquim notifications@github.com:

Simon, I recently learned about this

https://github.com/vurtun/nuklear

seams it could be handy to help creating all sort of menus, buttons and relatives.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/JuliaGL/GLVisualize.jl/issues/82#issuecomment-221105769

joa-quim commented 8 years ago

and there is more. It derives from this lib imgui that is C++ but has a C wrapper.

SimonDanisch commented 8 years ago

Hi, I'm slowly closing in on feature completeness on master ;) Also, I'd love to port these examples to GLVisualize: https://www.soest.hawaii.edu/gmt/gmt/gmt_examples.html I must admit there is a bit of barrier in using GMT for me, so it'd be wonderful if we could tackle this together!

Concerning the features, I'll slowly post examples on vimeo: https://vimeo.com/user8202296 With blog posts and more documentation coming slowly as well ;) Let me know if, how and when you want to try things out and start prototyping this.

Best, Simon

joa-quim commented 8 years ago

Hi Simon,

Nice to hear this. Regarding the examples, I have them almost all already 'runable' in Julia in https://github.com/joa-quim/GMT.jl/blob/master/test/gallery.jl which are more than the 30 your (old) link links to (most current version is here).

Some updates tough. Between GMT5.2.1 and current SVN version there was a large improvement in the GMT machinery to support external interfaces. The current version of gallery.jl (plus the rest of master) already reflects that but to run it one needs the current GMT SVN. The GMT.jl 0.0.1 should still run but I confess that I don't maintain it anymore. I can prepare you a Windows GMT installer, which will be closer to the next to come (in a couple weeks) GMT5.3

SimonDanisch commented 8 years ago

Oh great :) Would linux be easier?

joa-quim commented 8 years ago

You mean, for you to build GMT? It certainly is because the problem of the dependencies is solved. However, I never tested it in Linux but there is no reason for not to work.

SimonDanisch commented 8 years ago

Okay great! Will try on linux then!

joa-quim commented 8 years ago

Cool, I'll be waiting for the feedback.

SimonDanisch commented 8 years ago

Almost!

[100%] Built target gshhg_version
Scanning dependencies of target gmt
[100%] Building C object src/CMakeFiles/gmt.dir/gmt.c.o
[100%] Linking C executable gmt
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_num_locks@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_current_compression@OPENSSL_1.0.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libgdal.so: undefined reference to `lzma_stream_decoder@XZ_5.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_version@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_use_certificate_file@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `BIO_int_ctrl@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ENGINE_free@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_get_id_callback@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ASN1_STRING_data@OPENSSL_1.0.0'
//usr/lib/libarpack.so.2: undefined reference to `_gfortran_transfer_real_write@GFORTRAN_1.4'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `OPENSSL_config@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_error@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_NAME_get_entry@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_use_PrivateKey_file@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_STORE_load_locations@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpoppler.so.58: undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ASN1_STRING_length@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CIPHER_get_name@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `sk_num@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpoppler.so.58: undefined reference to `TIFFFdOpen@LIBTIFF_4.0'
...

Any idea?

SimonDanisch commented 8 years ago

This looks good though:

s@s-15:~/juliastuff/gmt5-dev/build$ ldd /usr/lib/x86_64-linux-gnu/libpq.so.5
    linux-vdso.so.1 =>  (0x00007ffdbb57b000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fc982f92000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fc982b37000)
    libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fc9828ec000)
    libldap_r-2.4.so.2 => /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2 (0x00007fc98269b000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc98247e000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9820b4000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc981eb0000)
    libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fc981bde000)
    libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fc9819ae000)
    libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fc9817aa000)
    libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fc98159f000)
    liblber-2.4.so.2 => /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2 (0x00007fc98138f000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fc981174000)
    libsasl2.so.2 => /usr/lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007fc980f59000)
    libgssapi.so.3 => /usr/lib/x86_64-linux-gnu/libgssapi.so.3 (0x00007fc980d17000)
    libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fc9809e7000)
    /lib64/ld-linux-x86-64.so.2 (0x0000556e61933000)
    libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fc9807e3000)
    libheimntlm.so.0 => /usr/lib/x86_64-linux-gnu/libheimntlm.so.0 (0x00007fc9805d9000)
    libkrb5.so.26 => /usr/lib/x86_64-linux-gnu/libkrb5.so.26 (0x00007fc98034f000)
    libasn1.so.8 => /usr/lib/x86_64-linux-gnu/libasn1.so.8 (0x00007fc9800ac000)
    libhcrypto.so.4 => /usr/lib/x86_64-linux-gnu/libhcrypto.so.4 (0x00007fc97fe79000)
    libroken.so.18 => /usr/lib/x86_64-linux-gnu/libroken.so.18 (0x00007fc97fc63000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc97fa48000)
    libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fc97f7e4000)
    libidn.so.11 => /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007fc97f5b1000)
    libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fc97f39d000)
    libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007fc97f167000)
    libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007fc97ef34000)
    libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fc97ecb3000)
    libwind.so.0 => /usr/lib/x86_64-linux-gnu/libwind.so.0 (0x00007fc97ea8a000)
    libheimbase.so.1 => /usr/lib/x86_64-linux-gnu/libheimbase.so.1 (0x00007fc97e87b000)
    libhx509.so.5 => /usr/lib/x86_64-linux-gnu/libhx509.so.5 (0x00007fc97e62f000)
    libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fc97e35a000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fc97e122000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fc97df19000)
joa-quim commented 8 years ago

Sorry, no idea why you are getting all those linking errors. I very recently built GMT in WinBuntu using all standard dependencies gotten with apt-get. Except the netcdf lib, all other dependencies come via GDAL so libgdal.so should be the source of the problem. Witch Linux?

SimonDanisch commented 8 years ago

Ubuntu 16.04

SimonDanisch commented 8 years ago

Some research suggests, that things can get mixed up when anaconda is installed... But I'm not sure if that applies here... The only thing that seems to be linked from anaconda is zlib. I tried changing the zlib include folder in ConfigUser.cmake but this somehow didn't prevent it from linking the anaconda zlib...

joa-quim commented 8 years ago

From what I remember zlib is an optional GMT dependency used for PostScript compression but is also a dependency of HDF5 used by netCDF and GDAL, so that particular ConfigUser.cmake setting would probably not prevent the other libs dendencies.

joa-quim commented 8 years ago

You can put any of this in ConfigUser.cmake to reduce the number of dependencies. It may help you track the problem

set (GMT_EXCLUDE_GDAL TRUE)
set (GMT_EXCLUDE_PCRE TRUE)
set (GMT_EXCLUDE_FFTW3 TRUE)
set (GMT_EXCLUDE_LAPACK TRUE)
set (GMT_EXCLUDE_ZLIB TRUE)
SimonDanisch commented 8 years ago

Okay, so this information is more interesting:

s@s-15:~/juliastuff/gmt5-dev/build/src$ ldd libgmt.so.5
./libgmt.so.5: /home/s/anaconda3/lib/liblzma.so.5: no version information available (required by /usr/lib/libgdal.so.1)
./libgmt.so.5: /home/s/anaconda3/lib/libtiff.so.5: no version information available (required by /usr/lib/x86_64-linux-gnu/libpoppler.so.58)
./libgmt.so.5: /home/s/anaconda3/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
./libgmt.so.5: /home/s/anaconda3/lib/libssl.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libpq.so.5)
./libgmt.so.5: /home/s/anaconda3/lib/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /usr/lib/libarpack.so.2)
SimonDanisch commented 8 years ago

Hmm... After renaming the anaconda folder and removing it from all environment variables, restarting, cmake still inserts all path from anaconda -.- How is it even doing that? :D

joa-quim commented 8 years ago

Did you remove the build dir and start over? It stores things in cache. On an not useful note, I don't like anaconda that installs me a huge package in .julia to install things that I already have.

SimonDanisch commented 8 years ago

I didn't! Forgot that cmake .. doesn't start new...

SimonDanisch commented 8 years ago

okay, removing anaconda works :) Btw, that wasn't the one installed by Julia, I think...

[ 93%] Building C object src/CMakeFiles/supplib.dir/x2sys/x2sys_merge.c.o
[ 96%] Linking C shared module plugins/supplements.so
[100%] Built target supplib
SimonDanisch commented 8 years ago

Cool:

julia> Pkg.checkout("GMT")
INFO: Checking out GMT master...
INFO: Pulling GMT latest master...
INFO: No packages to install, update or remove

julia> Pkg.test("GMT")
INFO: Testing GMT
INFO: GMT tests passed

Guess I'm all setup now!

joa-quim commented 8 years ago

No wait. The Pkg.test("GMT") does nothing. Please read the header of gallery.jl, you need to set up manually the path of your GMT (SVN) installation so it can find the files needed for running the examples. There is also a gmtest.jl that really run tests by comparing the created ps's to original ones. Those are our true GMT tests but I warn you that many tests FAIL mostly due to font sizes and other figure alignments. These aren't real failures, but some of them are.

SimonDanisch commented 8 years ago

yeah figured that out :) But seems to work now:

test

joa-quim commented 8 years ago

YES.

SimonDanisch commented 8 years ago

ridge

Okay, getting somewhere :)

joa-quim commented 8 years ago

That was quick. The color issues are coming from where?

SimonDanisch commented 8 years ago

What is the color issue? Do you mean the contours? The contour lines are actually just as thick as the iso value at that point, which might look weird?

joa-quim commented 8 years ago

I mean, the deep ocean is black, the variable width white lines (the contours?). Not that you have also the Hawaiian chain N-S flipped. The brigh spot at ~22.5N is the Big Island, which is the southernmost one.

SimonDanisch commented 8 years ago

Good to know :D Well, that's the default colormap from Plots.jl.

joa-quim commented 8 years ago

I was there a month ago, in a warming up to the second GMT Summit. And that literally because I saw lava from 5 m away when it was entering the sea. I have to create a new GMT example with a picture of it.

joa-quim commented 8 years ago

Hi Simon,

If you update both GMT and GMT.jl you can now do

PS = gmt("pscoast -R-10/-3/37/44 -JM12 -W1p -Ba -P");
img = gmt("psconvert =", PS);

and get an img type whose member img.image holds a RGB band interleaved image created without any intermediate postscript file written to disk. Now, this works fine on Windows but fails on Mac because it hangs on a popen call. It would be nice to know what is the status of this on Linux.

The other thing I wanted to ask is how can we visualize such data? I know about ImageView, but it works with Tk, that version conflicts with my local Python installation and ends up installing Anaconda in my .julia, which adds up to ~1.5 Gb. And don't want to do that. Any other simpler solution, via Plots.jl perhaps?