Representing each layer as a Linear2DSet works fine for displaying
surfaces and iso-contour lines. I've developed programs similar to
Ugo's for displaying geological layers and properties. Hopefully I'll
have some demos available soon.
For iso-surfaces and fancier volume operations (like slicing), we need
to have a Linear3DSet. This requires a regualr XYZ grid. But we don't
have that grid readily available when our only data are the layers given
by Z values (and properties) on a requral xy grid. To define the grid
for Z axis, I setup a z axis to have as many values as I have z values
on my layers, and defined a mapping of its index to the sorted layer z
values. In this way, I can define a regular Linear3DSet volume and set
its elements using the layers data. Ofcourse majority of this volume
data will be missing and so its a good idea to initialize the volume
elements to -1 first.
As I was happily persuing my dreams of setting up a 3D volume (given
only layer data as above) using VisAD, I ran into memory and efficiency
problems, ofcourse. For my data, different layer z values easily add up
to thousands. Looking deeper into VisAD as to where and why, I learned
that domains are repersented as arrays even for IntegerSets! And so
memroy is used up for going through index values (like 0, 1, 2, ...).
Java's Iterators would be perfect for this. Instead of using arrays for
linear set domains, VisAD could use iterators that know the domain
boundary and step values. For a 100x100x3000 grid this could make a
big difference. For the VisAD gurus (me not being one, so this could be
all wrong:), I am talking about things like indexToValue() in
Linear3DSet and other things. So instead of:
/** convert an array of 1-D indices to an array of values in
public float indexToValue(int index)
It could be:
public Iterator indexToValue(Iterator index)
As for as I can tell, using customized iterators for representing and
indexing through linear domains will simplify and reduce memory usage.
Does this make sense? I'd be interested to hear your thoughts on this
and the volume issues.
Los Alamos National Laboratory
Distributed Computing & Viz.
CIC-8, MS B272
phone: (505) 665-4331
fax: (505) 665-6333
"William L. Hibbard" wrote:
> Hi Ugo,
> Excellent work on your DEMViewer.
> One appraoch to multiple layers would be to make each layer
> a different data object, each with a Linear2DSet domain set.
> Each data object (i.e., each layer) would be connected to the
> DisplayImplJ3D by its own addReference call which would
> include a ConstantMap array to set each layer at a different
> ZAxis value, and possibly an Alpha value for transparency.
> You could disable a layer by calling setData(null) on its
> DataReference, and enable it by calling setData(layer_data)
> where layer_data is just the data object for the layer.
> Good luck, and let us know if you have any problems or
> Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706
> whibbard@xxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738