I'm not really familiar with pre 4.0 vtk to comment about a direct translation, but could you use:<br><br>f1 -> vtkPassThrough -> g1/h1/j1 etc<br><br>?<br>Then when you want to swap f2 and f3 in, you can just change vtkPassThough's input.<br>
<br clear="all">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x109<br>
<br><br><div class="gmail_quote">On Wed, Sep 16, 2009 at 3:11 PM, John Platt <span dir="ltr"><<a href="mailto:jcplatt@dsl.pipex.com">jcplatt@dsl.pipex.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hi Dave,</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">This is the pipeline management problem I am trying
to solve</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">
g1 -> g2 -> ...</font></div>
<div><font size="2" face="Arial">f1 -> [ f2 ] -> [ f3
] -></font><font size="2" face="Arial"> h1 -> h2 ->
...</font></div>
<div><font size="2" face="Arial">
j1 -> j2 -> ...</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">where the filters in [] are optional. I want to be
able to add/remove f2 & f3 without having to find g1, h1 & j1 to reset
the input connection. I therefore create the output object for the chain f1
-> [ f2 ] -> [ f3 ] and use SetOutput() on the last filter.
This way, the input connection to filters g1, h1 & j1 only has to be set
once.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">This is a technique I used in VTK 4.2 with the
'old' pipeline architecture. Are there any other ways to achieve this
effect?</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Thanks for help.</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">John.</font></div>
<div> </div>
<div>----- Original Message ----- </div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-left: 5px; padding-right: 0px; margin-left: 5px; margin-right: 0px;"><div><div></div><div class="h5">
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 0%; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<b>From:</b>
<a title="dave.demarle@kitware.com" href="mailto:dave.demarle@kitware.com" target="_blank">David
E DeMarle</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="jcplatt@dsl.pipex.com" href="mailto:jcplatt@dsl.pipex.com" target="_blank">John Platt</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Cc:</b> <a title="vtkusers@vtk.org" href="mailto:vtkusers@vtk.org" target="_blank">vtkusers</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Wednesday, September 16, 2009 6:34
PM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> Re: [vtkusers] Error using
SetOutput()</div>
<div><br></div>Are you sure you want to SetOutput? For the most part (that is
everywhere other than within the filter which typically gets its own output
from the executive and populates it) , filter outputs shouldn't be messed with
for two reasons :<br><br>* the next time the filter updates the output will be
replaced<br><br>* more than one thing can be connected to a given filter's
output, so changing the output or its contents will cause inconsistency<br><br clear="all">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>28 Corporate
Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x109<br><br><br>
<div class="gmail_quote">On Tue, Sep 15, 2009 at 6:23 PM, John Platt <span dir="ltr"><<a href="mailto:jcplatt@dsl.pipex.com" target="_blank">jcplatt@dsl.pipex.com</a>></span>
wrote:<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div bgcolor="#ffffff">
<div><font size="2" face="Arial">Hi,<br>I am having trouble moving an output
between filters using SetOutput() as follows.</font></div>
<div><br><font size="2" face="Arial">1. Single filter, f1.<br>
vtkPolyData* myOutput = vtkPolyData::New();</font></div>
<div><font size="2" face="Arial">
<div><font size="2" face="Arial"> f1->SetOutput( myOutput
);</font></div>
<div> </div> vtkAppendPolyData* myAppend =
vtkAppendPolyData::New();</font></div>
<div><font size="2" face="Arial"> myAppend->AddInput(
myOutput );</font></div>
<div><font size="2" face="Arial"></font><font size="2" face="Arial"></font><font size="2" face="Arial"></font><br><font size="2" face="Arial">"myOutput" is
displayed correctly.</font></div><font face="Arial"></font>
<div><br><font size="2" face="Arial">2. Append filter f2 to
f1.<br> f1->SetOutput( 0 );<br>
f2->SetInputConnection( f1->GetOutputPort() );<br>
f2->SetOutput( myOutput );</font></div><font size="2" face="Arial">
<div><br>"myOutput" does not appear to see the changes made by filter
f2.<br></div>
<div>3. Remove filter f2.<br>
f 2->Delete();<br> f1->SetOutput( myOutput
);<br></div>
<div>ERROR: In
/home/john/VTK/vtk-5.4.2/VTK/Filtering/vtkStreamingDemandDrivenPipeline.cxx,
line 747<br>vtkStreamingDemandDrivenPipeline : No maximum number of pieces
has been set in the information for output port 0 on algorithm
vtkf1"<br></div>
<div>Any help on using SetOutput() would be greatly appreciated.</div>
<div> </div>
<div>Thanks.</div>
<div> </div><font color="#888888">
<div>John.</div></font></font></div><br>_______________________________________________<br>Powered
by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source
projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please
keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to
subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br></blockquote></div><br>
</div></div><p>
</p><hr><div class="im">
<p></p>_______________________________________________<br>Powered by
<a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages
on-topic and check the VTK FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to
subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></blockquote></div>
</blockquote></div><br>