Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

How to draw interactive contours

This is a multipart message in MIME format.
--=_alternative 004B9085C1256B27_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"

Hello,
my purpose is to plot some set of points on a 3D display, and once the=20
scene is rendered, to interactively draw some contours around some=20
interesting area, with the mouse. At the present time, I'm able to get the

coordinate mouse, to display some set of cross shapes, to draw lines=20
between these shapes. But I was not able to make theses shapes moveable=20
with, for example, the use of DirectManipulationRendererJ3D.

* The first solution I tried was to addReference, after the initial scene=20
is rendered. The code looks like:

private void makeVisibleCrossShape (double dx, double dy) throws=20
VisADException, RemoteException {
    // a cross is displayed at the current mouse coordinate
    RealTuple point=5Fcoord=5Ftuple =3D new RealTuple (xyzshapeType, new=20
double[] {dx, dy, 0, 0});
    DataReferenceImpl point=5Fref =3D new DataReferenceImpl ("pointRef" +=20
pointCount);
    point=5Fref.setData (point=5Fcoord=5Ftuple);

    // interactive behavior added
    DirectManipulationRendererJ3D point=5Fhandler =3D new=20
DirectManipulationRendererJ3D ();
    dpy.addReferences (point=5Fhandler, point=5Fref, pointColor);

    System.out.println ("new cross in (" + dx + ", " + dy + ")");
    pointCount++;
}=20

The reason why it doesn't work is probably that I don't have the right to=20
use addReference, once the scene has been displayed. Is it correct ?

* The second solution, I had in mind, was to create a DataReferenceImpl,=20
before the scene is rendered, that contains an array of cross shapes=20
coordinates. By extending this array, I could add some shapes on the=20
display. Something like:
(Gridded1DSet) -> (x, y, z, shape}
But as soon as I add a DirectManipulationRendererJ3D to display this=20
reference, nothing appears (while with a classic Display#addreference=20
call, everything is normally displayed).


Any help on this topic ?

Renaud DA=CFAN
--=_alternative 004B9085C1256B27_
Content-Transfer-Encoding: quoted-printable


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690