Displaying Slices of a DisplayImplJ3D

Hi Bill

First of all I will describe the scenario:
I have a DisplayImplJ3D called display1 where I display several 
independent volumes. On the other hand, I have a 2D DisplayImpl 
called display2 created either with DisplayImplJ2D("display2") or 
DisplayImplJ3D("display2", new TwoDDisplayRendererJ3D()).

I want an arbitrary slice of display1 Z-plane to be mapped into 
display2. Changes must be reflected in display2 when I add or remove 
a volume reference in display1.

I have tried to do this by:

/*1*/ display1.addMap(RealType.ZAxis.Display.ZAxis);
/*2*/ ScalarMap mapz = 
        new ScalarMap(RealType.ZAxis,Display.SelectRange);  
/*3*/ double slice=.../*some slice*/
/*4*/ mapz.setRange(slice,slice);
/*5*/ display2.addMap(mapz);
/*6*/ display2.addMap(new ScalarMap(RealType.ZAxis,Display.RGB))

but it allways displays the same undesired slices, while if I try:

/*1*/ display1.addMap(RealType.ZAxis.Display.ZAxis);
/*2*/ ScalarMap mapc = 
        new ScalarMap(RealType.ZAxis,Display.RGB);  
/*3*/ double slice=.../*some slice*/
/*4*/ mapc.setRange(slice,slice);
/*5*/ display2.addMap(mapc);

I get the correct slice but also fills it with the maximum value of 
all the mapped volumes and surround it with the minimum.

What is the mistake? Do I have to use ScalarMap.getScale()?

Thank´s in advance


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