I got it to work. Everyone's answers were a big help, THANKS!

I did it by running the second output of the selector to three different Compute's which say, e.g., (strcmp(a,'VELOCITY') == 0 ? 1:0), etc. Each Compute then goes to it's own Route which is tied to the appropriate Image Stream.

Switch did not work here. For some reason, when nothing is coming out of a Switch the downstream modules complain and "GO ORANGE" on me (not to mention the annoying beeps which I can do without).

Ok, and now one last final question. The whole thing would be entirely simpler if there was a way to make a Compute evaluate an _expression_ such as:

if strcmp(a,'VELOCITY') == 0, then 1; else if strcmp(a,'DENSITY') == 0, then 2; else 3

but I could not figure out a way to do that.

Is such a construction possible?

Thanks again,

Fred Phelan


At 07:49 AM 7/24/01 -0400, you wrote:
I just sent something to the list, but I just thought, do you mean use three Switches?

Fred
At 03:31 PM 7/23/01 -0400, you wrote:

Looks like Greg embellished my answer with the necessary Compute(a+1) that I forgot. I believe it's the case that when you data-drive Selector, the auto-generated list starts at 0 so the Compute bumps everything up one to make Switch happy. Otherwise, his answer should serve. That is, he and I think alike that the only place you really need the Switch is just before the output regardless of how much viz stuff happens between Select and Image.

You might be thinking you'd save processing time if you didn't execute unneeded branches at all. This is where Route (several) would help possibly, but not Switch. If I remember correctly, Switch branches all evaluate always. Route(0) branches do not execute. However, this does not always compute, i.e., there are some modules downstream of a terminated Route that will bitch and whine (or essentially not execute at all leaving you with no image). I fear that Switch is one.

So you might rig up some Computes of the nature (a == 1 ? 1 : 0) to pass a 1 if comp1 is chosen [and you feed this Compute's a input with the output of Selector and the prior Compute(a+1)] but 0 otherwise, to Route. This would execute that subbranch below Route if comp1, otherwise not execute. Likewise a == 2 ? 1 : 0 for choice 2. Each branch needs such a Compute and its own Route with only the 0|1 value and one selected input stream and you only use the leftmost output (the "1" valued stream; 0 value makes no output stream out of that leftmost output or any other output for that matter). So now you end up with 3 Routes, 2 of which do nothing depending on Selector. Collect, Image, season to taste.

I typically install a whole raft of Selectors and Routes (usually user-driven) to turn on/off various objects in the output, so if all you do is Collect and Image these 3 streams (one valid, two null), it should work.

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]


                                                                                Date


Frederick R. Phelan Jr., Ph.D.
Multiphase Materials Group
Polymers Division
National Institute of Standards and Technology

NIST, Bldg. 224/Rm. B108
100 Bureau Dr., STOP 8543
Gaithersburg, MD 20899-8543
301.975.6761 (VOX)
301.975.4932 (FAX)
[EMAIL PROTECTED]
http://www.nist.gov/frederick_phelan

Reply via email to