[GRASS5] embedding GRASS display into my app

David Piasecki piasecda at nv.doe.gov
Tue Apr 6 19:45:52 EDT 2004


The paper I found is at 
http://geomatica.ing.unico.it/workbooks2/n1/articoli/mv.pdf, but now 
I'm thinking it's rather old. I read something online about BLT? All I 
want to do is to have the user interact with the GRASS display within 
the confines of my own desktop application.

I had thought I would have to do this using Tcl/Tk, but from your 
description, it sounds like I can use anything I like so long as I 
interface with the XDRIVER for GRASS. Could use Qt instead of Tcl/Tk? 
Since GRASS already uses Tcl/Tk, wouldn't it be easier to use what's 
already available, or is it simple enough to do in any toolkit? Do you 
know of where I can get more information and possibly some 
documentation on how to write widgets like this?

David


On Apr 6, 2004, at 4:17 PM, Thierry Laronde wrote:

> Hello,
>
> Since you do not specify which paper you've found, I answer since I 
> have
> written that I was rewriting XDRIVER and I don't know if you refer to
> this.
>
> I don't know either what is the status with Tcl/Tk but I will give you
> some tips about the display stuff.
>
> The XDRIVER by itself does _just_ the display. Commands are passed from
> the applications to the driver (IPC) using a GRASS defined protocol
> requesting for drawing on the hardware (for X). The commands are
> "interpreted" by a SWITCHER (SWITCHER.c) which calls the matching
> commands implemented to drive the hardware (here hardware is indeed X11
> server, a small Xlib only client being part of XDRIVER).
>
> For the most important, the applications don't deal directly with the
> X11 colormap, but with a GRASS colormap which indirectly points to
> entries in X11 colormap (a GRASS colormap index gives a X11 pixel which
> is itself an index in the X11 colormap).
>
> The X11 color accepts 2^48 colors. A X11 colormap can handle a
> number of colors depending on the depth, red, green and blue being
> not automatically evenly treated (with a 8 bits depth on a visual class
> that is TrueColor or DirectColor, you have 8 shades of red, 8 shades
> of green but 4 shades of blue). And the "hard" hardware (the monitor)
> handles another plage of colors (a subset of the theorical 2^48).
>
> XDRIVER and the GRASS "internal" colormap accept 2^24 colors evenly
> distributed. (as of the original code; may have changed now).
>
> To extend further the XDRIVER (and treat it more like a classic X11
> client) you have to throw upon it a widget (there comes the decision
> about what toolkit to use).
>
> FWIW, I have rewritten the XDRIVER (in CWEB --- this is NOT, for the
> ones who don't know what it is, a kind of Internet, C#, .NET, Java...;
> nothing to do with "the Web" or other. This is pure C (could be C++,
> but I stick to C since it's God's own programming language) + TeX for
> the documentation  --- and this is simply great!).
>
> And I have changed the colors handling in (KerGIS), and the default
> colors (to match ISO 6429 extensions in xterm) etc...
> And the toolkit chosen is Motif (for the future).
>
> But since it's not what you are looking for, I hope the explanations
> above will give you some hints.
>
>
> Cheers,
> -- 
> Thierry Laronde (Alceste) <tlaronde at polynum.org>
> http://www.kergis.org/  |  http://www.kergis.com/
> Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C





More information about the grass-dev mailing list