Re: interactive with constant maps?!

Hi Tiago,

>  I've some lines that are displayed in a world throw a unionset. To 
> "customize" this lines i created a constant map with the color and the
> height(radius) that i want them to be displayed with.
> 
>           maplinesConstantMap = new ConstantMap[4];
>           maplinesConstantMap[0] = new ConstantMap(0.0f, Display.Blue);
>           maplinesConstantMap[1] = new ConstantMap(0.0f, Display.Red);
>           maplinesConstantMap[2] = new ConstantMap(1.0f, Display.Green);
>           maplinesConstantMap[3] = new ConstantMap(1.001f, Display.Radius);
> 
>   This is working correctly but now i want to "move" the lines up and down in 
> height (radius) how can i do this? I tried to change the value
> of the constant map associated with the radius throw a variable  - 
> maplinesConstantMap[3] = new ConstantMap(height, Display.Radius); - but
> this doesn't work (obviously because the data reference doesn't change).

To change the ConstantMaps you need to removeReference()
followed by a new addReference(). However, this isn't very
interactive. Another way is to put your UnionSet in a Tuple
with MathType (radius, Set(...)) and add a ScalarMap
radius -> Radius. Then when you want to change Radius,
construct a new Tuple of an appropriate radius value and
your UnionSet, and pass it to the setData() of your
DataReference.

Good luck,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html