NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: Vector based printing

Hi Rob,

I think the method you've described is about as good as
possible - its difficult in any case. I'm encouraged to
hear that you've already had some success. You may be
able to borrow some code from the render() method of
visad/java2d/VisADCanvasJ2d.java.

If you willing to contribute your code back to VisAD,
that would be great. Please let us know if you have any
other questions or problems.

Cheers,
Bill

On Thu, 8 Jul 2004, Rob Hackett wrote:

> Hi
>
>       I have a requirement to produce hardcopy charts from a visad 
> application.
> Due to the complexity of the data, the charts will likely be on A1 paper at
> a resolution way beyond what is possible using a simple raster based screen
> dump of a visad display. The only solution is to plot the components of the
> display via a vector based printing system such as postscript or CGM.
>
>       First of all, has anybody else done this already? I'd hate to reinvent 
> the
> weel.
>
>       If not, I have worked out a simple prototype of a system of doing this
> which appears to work. It goes as follows:
>
>       Prepare your data as normal and visualise using a DisplayImplJ3D.
>       When the chart is ready to plot, create a DisplayImplJ2D off-screen.
>       Use getMapVector() method of DisplayImplJ3D to get all the ScalarMaps 
> used
> in the on-screen display
>       Clone each of these ScalarMaps and add them to the off-screen display
>       Use getRenderers() method of DisplayImplJ3D to get the DataRenderers 
> from
> the on-screen display
>       From each of the DataRenderers, use getLink().getData() to get the data
> rendered on-screen
>       Create a DataReferenceImpl for each of these data items, and add to the
> off-screen display
>       Tweak the off-screen ScalarMaps and Controls so that they have suitable
> scales for an A1 image (or A4, etc)
>       Get the DisplayRendererJ2D from the off-screen display using
> getDisplayRenderer()
>       Get the root VisADGroup from the display renderer using getRoot()
>       Recursively parse this group to access its VisADAppearance children
>       From these, extract the VisADGeometryArray objects and plot them to a
> postscript file, PDF file, etc
>       Send the postscript file, PDF file, etc to the A1 printer
>
>       Does anybody have any comments on this way of printing? I have tested it
> with some success, but before I invest more time in implementing it I would
> be interested to know if anybody has any better ideas.
>
> Thanks,
>
> Rob
>
>
>
>
>


  • 2004 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: