Re: Polygon manipulation in its nodes

I tried to do it with separate DirectManipulationRenderers for each
node.
The result is really very nice and can be seen together with the code at:
http://www.jgrass.org/cgi-bin/moin.cgi/HowItIsGoingWithVisad

The problem isn't even performance, the loading is not very fast, but
once loaded it works very well. The real problem is once again memory. 
After about 3000 nodes the adding references to the display sucks more than
1.5 gigs from the pc and brings everything to freeze.

Any idea?

Cheers,
Andrea


> Yeah, that is the way it is done by the TrackManipulation example.
> I'm not sure that this could be done in a performant way with let's say
> a polygon of 15000 points. That is why I went over to the
> ManipulationRenderers. I will investigate and try it out.
> 
> Thanks,
> Andrea
> 
>  
> > One possibility:  use separate DirectManipulationRenderers
> > for each node and redraw the connecting lines as the nodes
> > are changed.
> > 
> > Tom
> > 
> > Andrea Antonello wrote:
> > 
> > >I gave a closer look into the CurveManipulationRenderer class and the
> > >regarding classes.
> > >As I understand it, the rendering is passed to the ShadowCurveSetTypeJ3D
> > >and then to the ShadowFunctionOrSetType.
> > >
> > >Using that approach I am able to modify the shapefile on the display,
> > >the problem is that it is modified not only in its nodes, but also in
> > >every point between two nodes, which it should not. I saw the same
> > >behaviour in the IDV. Even if the nodes are visualized with boxes, it is
> > >possible to modify also points between the node boxes.
> > >
> > >How I would like to have it behave is kinda similar as in the example of 
> > >the
> > >bom.TrackManipulation. 
> > >
> > >Now I need some help to get the right starting point.
> > >I would like to do the following:
> > >- have the nodes (coordinates) of the shapefile surrounded by a small
> > >shape of any kind
> > >- have the manipulation renderer to modify only the nodes through the
> > >dragging action, adapting the two lines that converge into the node so
> > >that they stay straight lines and follow their node.
> > >
> > >What exactly should I do? Extend the ShadowFunctionOrSetType and
> > >override the doTranform method inserting the drawing of the shapes?
> > >
> > >I really need some good advice.
> > >
> > >Thanks,
> > >Andrea
> > >
> > >
> > >
> > >
> > >
> > >
> > >* [A.D. 27/11/06 17:25], Andrea Antonello <andrea.antonello@xxxxxxxxx> 
> > >probably wrote:
> > > 
> > >
> > >>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
> ____________________________________________________________________________
> 

-- 
____________________________________________________________________________
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: