Data structuring for a mesh of convex polygons

Hi All,

I am having performance problems with displaying a mesh, and am
not sure if I have modelled it properly. Perhaps some detail will make
this clearer... (please bear with me... :-))

--------------------------------------------------------------------------

I have been trying to create an application that can draw a mesh of
'nodes', where the nodes are convex polygons, that are defined by corner
points, each having an x and a y coordinate.

It would look something like,

----------------------   
|  |2 /  |   | 7/     |
|1 | /   |   | /   8  |
|  |/ 3  | 4  /-------|
|--|---------/      
|      \     |
|  5    \  6 |
-------------| , say, for a mesh with 8 nodes.

What is required is to draw an outline of the node, and also to fill 
the node with colour. This has been done already, using Gridded2DSets 
to draw the outline of the node, and Irregular2DSets for filling the node
with colour. For the outline, I have a FlatField, with the Gridded2DSet as
the domain, and range mapping to RGB, then a FieldImpl with domain a
simple index, and range having all the FlatFields, like 
(index -> ((x,y) -> (r,g,b))), where the index indicates the node being
dealt with.

-----------------------------------------------------------------------------

So, the question really boils down to whether modelling this problem 
in this way is the best possible. I have been having considerable
performance problems by modelling a large number of nodes like this, since
there are many data references which get added to the display (one for
each node), and the rendering is very slow. Bill has been gracious to give
me some suggestions for speeding things up, for instance to call the
disableAction() method on the display, before adding data references, and
then enabling it again. However, the performance is still quite poor.

Having had a look at the example Simple.java, with the images.nc file
as input (in /visad/examples), I am amazed at how quickly this renders,
and can only draw the conclusion that it's due to the fixed
rectangular grid, with single data reference, that allows such quick
rendering (without any outline). I am tempted to create a rectangular
mesh, of very fine granularity, over my arbitrarily defined mesh, in order
to make my data fit the same pattern, as found in the images.nc netCDF
file. This would mean that each of my nodes would be composed of several
reactangular or square regions. 

However, something tells me that this is not a good approach in order to
speed things up. Surely there is a faster way to draw a mesh in
VisAD, given corners which define nodes ?

Also, I'd appreciate a comment on the applicability of this problem to
VisAD. Perhaps the API was not designed to do this type of thing in
particular ?

I'll be most grateful for any ideas/comments ! :-)

Thanks,
Ajay Laloo


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