Re: problems with DirectManipulationRendererJ3D

Hi Tom,
you are right, it is a problem of Type.

I went a bit into the code and noticed that the method
setIsDirectManipulation(boolean) of the DataRenderer is set to false
(and throws the error I reported in the original post), if
the type of the data is not of one of the following types:
FunctionType, RealTupleType, RealType
which the Gridded2DSet is not.

I will have a closer look to the CurveManipulationRenderer class. I
already gave it a very quick look for it is a nice example of drawing.
Hopefully you are right, I could have a chance to modify it for my needs.

Thanks man,
Andrea



* [A.D. 27/11/06 10:10], Tom Rink <rink@xxxxxxxxxxxxx> probably wrote:
> Hi Andrea,
> 
> The default DirectManipulationRenderer makes certain
> assumptions about the structure of the linked data in
> order to generate new data values as a result of user
> gestures.   A polygon is too ambiguous for the default
> logic and probably a "notSimpleField" or "notRealFunction"
> exception is being thrown.  You could try using the
> CurveManipulationRenderer class in the visad.bom
> package.  I believe the folks at Unidata have done some
> work with this in the IDV.
> 
> Tom
> 
> Andrea Antonello wrote:
> 
> >I am trying to create a toolbox that is able to modify shapefiles.
> >My first approach is the existing DirectManipulationRendererJ3D, but as
> >I try it with the code below, it gives me:
> >
> >null: DirectManipulationRendererJ3D.doTransform in the lower left corner
> >of the display.
> >
> >_________________________________________________________
> >           Coordinate[] tmpCoord = coords.elementAt(i);
> >           int np = tmpCoord.length;
> >           float[][] samples = new float[2][np];
> >           for (int j = 0; j < np; j++) {
> >               samples[0][j] = (float) tmpCoord[j].x;
> >               samples[1][j] = (float) tmpCoord[j].y;
> >           }
> >
> >           // the lines
> >           Gridded2DSet tmpLines = new Gridded2DSet(earth, samples,
> >                   samples[0].length);
> >           // create a DataReference for river system
> >           DataReference rivers_ref = new DataReferenceImpl("rivers");
> >           rivers_ref.setData(tmpLines);
> >
> >           ConstantMap[] colorMapLines = { new ConstantMap(1, Display.Red),
> >                   new ConstantMap(0, Display.Green),
> >                   new ConstantMap(0, Display.Blue),
> >                   new ConstantMap(3f, Display.LineWidth) };
> >           display1.addReferences(new DirectManipulationRendererJ3D(),
> >                   rivers_ref, colorMapLines);
> >_________________________________________________________
> >
> >What am I doing wrong?
> >
> >Regards,
> >Andrea
> >                   
> >
> >==============================================================================
> >To unsubscribe visad, visit:
> >http://www.unidata.ucar.edu/mailing-list-delete-form.html
> >==============================================================================
> >
> > 
> >
> 

-- 
____________________________________________________________________________
HydroloGIS - Environmental Safety Modelling
Siemens Str. 19 via Siemens
I-39100 Bozen - Bolzano 
www.hydrologis.com

Andrea Antonello
Environmental Engineer
tel.     +39 0471 068065  
mobile:  +39 328 8497722
fax:  +39 36 328 8497722
email:   andrea.antonello@xxxxxxxxxxxxxx

"Let it be as much a great honour to take as to give learning,
if you want to be called wise."
Skuggsja' - The King's mirror - 1240 Reykjavik
____________________________________________________________________________

==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


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