NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi Doug, > Thanks for the info, Bill. I'm afraid the current behavior is a show > stopper. I poked around in the code to see if I could override > something, but the changes went a bit too deep for my comfort. Any > suggestions? > > Bottom line: I need to be able to set the current time (by value > preferably) and see my data for the nearest time samples <= the current > time. (kind of like the Price is Right :-) > > That also means that if I setCurrent to the last animation step, for > example, I should see the latest of all my Fields, no matter how old. > (see point 3 below) If I setCurrent to something before I have data for > a particular Field, then I should see nothing for that Field, though I > may have valid samples for other Fields (e.g. I'm still within the range > of the AnimationSet.) You can change this behavior by extending some classes: 1. Extend AnimationControlJ3D and override the selectSwitches() method of AVControlJ3D (note AnimationControlJ3D and ValueControlJ3D extend AVControlJ3D, and I just declared selectSwitches() as public in a release this morning), to implement the behavior you want. Although there is some complex logic dealing with Units and CoordinateSystems in selectSwitches(), you need to focus on the call: indices = set.doubleToIndex(values); near the end of the method. You need to replace it with logic that probably gets the double[][] array from set and find the index of the greatest value less than the current value (the 'value' argument to selectSwitches). You also want to change the conditions for calling: ss.swit.setWhichChild(Switch.CHILD_NONE); 2. Extend DefaultDisplayRendererJ3D or TwoDDisplayRendererJ3D and override the makeControl() method of DisplayRendererJ3D, to construct and return your extension of AnimationControlJ3D when the DisplayRealType is Display.Animation. Then use this DisplayRenderer extension when you construct your DisplayImplJ3D. If you'd like to declare your new classes in the visad.java3d package and send them to me, I'd like to add them to the distribution. Cheers, 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
visad
archives: