Aarrgghh!  Switch and Route most certainly do *not* evaluate all possible
inputs (to Switch) or outputs (of Route) - unless of course a bug has crept
in.  I just ran the net I sent out with debug tracing on; the Isosurface
module ran but the MapToPlane module did not.  I then changed the isovalue
and the selected group member and executed again, and the Isosurface module
did not run, but the MapToPlane did.

In the Route alternative, only the descendants of routed-on outputs of the
Route module will run, and Collect has the magic property that it can join
several paths descending from Route with only the routed-on paths being
required.

Greg

Chris Pelkie <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 07/24/2001
07:49:06 AM

Please respond to [email protected]

Sent by:  [EMAIL PROTECTED]


To:   "Frederick R. Phelan Jr." <[EMAIL PROTECTED]>
cc:   [email protected]
Subject:  [opendx-users] Re: [opendx-general] Need a dx box that acts as an
      "if-then"   control



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]


Reply via email to