<div dir="ltr"><div><div><div>Thanks for the correction David. <br></div>One more question, if Array1 happens to have 3 components (Array1.SetNumberofComponents(3) but Array2 only 1 component) would I still be using AddArray like above?<br>
<br></div>That is on Viewport 1 I want to display a vector and Viewport 2 should be a scalar.<br><br></div><div>Thanks,<br></div>Bhanu<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 12:03 PM, David E DeMarle <span dir="ltr">&lt;<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>You want TWO threshold filters, but otherwise yes that is the idea. See edits to the pseudocode below.</div>
<div class="im"><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div>Array1.Setname(&quot;array1&quot;);<br>myUnstructuredGrid.AddArray(Array1);<br><br>Array2.Setname(&quot;array2&quot;);<br>myUnstructuredGrid.AddArray(Array2);<br>
<br><br>Thresholdfilter.SetInput(myUnstructuredGrid);<br><br>//Viewport 1<br>==============<br><br>arrayname = &quot;array1&quot;;<br><div>Thresholdfilter-&gt;SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, arrayname );<br>



</div><div>//Set Mapper1 and Actor1 etc.<br>Viewport1 -&gt; Render();<br><br></div></div></div></blockquote><div><br></div></div><div>ThresholdFilter2 = vtkThresholdFilter::New();</div>Thresholdfilter2-&gt;SetInput(myUnstructuredGrid);<div class="im">
<br>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>//Viewport 2<br>

</div>===========<br>arrayname = &quot;array2&quot;;<br></div></div></blockquote><div> </div></div><div>/*</div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div dir="ltr"><div>Thresholdfilter-&gt;SetInputArrayToProcess(1, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, arrayname );</div></div></blockquote></div><div>*/</div><div><br></div><div>Thresholdfilter2-&gt;SetInputArrayToProcess(1, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, arrayname );</div>
<div><div class="h5">

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>
//Set Mapper2 and Actor2 etc.</div><div>Viewport2 -&gt; Render();</div><br></div></div><div><br></div><div>Thanks,<br></div>Bhanu<br><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">


On Mon, Nov 25, 2013 at 11:45 AM, David E DeMarle <span dir="ltr">&lt;<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Instead of calling data-&gt;SetScalars() to put the array choice on the data call filter-&gt;SetInputArrayToProcess() to put the array choice onto each filter.<div>



<div><div><div><br></div></div></div></div>

</div><div class="gmail_extra"><div><br clear="all"><div>David E DeMarle<br>Kitware, Inc.<br>R&amp;D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div>




<br><br></div><div><div><div class="gmail_quote">On Mon, Nov 25, 2013 at 9:31 AM, Bhanu Hariharan <span dir="ltr">&lt;<a href="mailto:bhanu@petrotel.com" target="_blank">bhanu@petrotel.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div><div><div><div>Thanks David for the suggestion of Branching pipeline. Are there any vtk examples for branching a pipeline.<br><br></div>I had previously attempted to do something like this<br><br>//Viewport 1<br>






myUnstructuredGrid.SetScalars(Array1);<br><br>Thresholdfilter1.SetInput(myUnstructuredGrid);<br></div>//Set Mapper1 and Actor1 etc.<br></div>Viewport1 -&gt; Render();<br><br></div>//Viewport 2<br><div><div>myUnstructuredGrid.SetScalars(Array2);</div>






<br><div><div><div><div><div>Thresholdfilter2.SetInput(myUnstructuredGrid);<br></div><div>//Set Mapper2 and Actor2 etc.</div><div>Viewport2 -&gt; Render();</div><div><br>But I ended up getting same rendering in both - i.e. Array2 in both viewports. Should I have seen different in both viewports? But if I made a deep copy of myUnstructuredGrid and used that for Thresholdfilter2, then I got Array 1 in Viewport 1 and Array 2 in viewport 2. Obviously I do not want to make a copy of myUnstructuredGrid as it can be  huge.<br>






<br></div><div>Did you mean to suggest something different?<br></div><div><br></div>Thanks, <br>Bhanu<br><br></div><div><div><div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 7:56 AM, David E DeMarle <span dir="ltr">&lt;<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">The number of inputs that the threshold filter accepts cannot be changed, without rewriting it that is.<div>






<br></div><div>Instead, think about making a branching pipeline, that is sending your unstructured grid into multiple threshold filters, the output of each is to be rendered independently.<br>

<div><br></div></div></div><div class="gmail_extra"><br clear="all"><div>David E DeMarle<br>Kitware, Inc.<br>R&amp;D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div>







<br><br><div class="gmail_quote"><div><div>On Thu, Nov 21, 2013 at 3:22 PM, Bhanu Hariharan <span dir="ltr">&lt;<a href="mailto:bhanu@petrotel.com" target="_blank">bhanu@petrotel.com</a>&gt;</span> wrote:<br></div>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div>

<div dir="ltr"><div><div><div><div><div><div><div><div>Dear vtk-users,<br><br></div>I am trying to do set up multiple Input Ports for a vtkThreshold type of filter.<br></div>Input to the threshold filter is a vtkUnstructuredGrid.<br>









<br></div><div>My code looks like<br><br></div><div>myThresholdfilter.SetInput(port0, myUnstructuredGrid);<br>myThresholdfilter.SetInput(port1, myUnstructuredGrid);<br><br><br></div>I would like to setup multiple viewports in my rendering window and in each viewport I would like a different grid property rendered. The grid property is a scalar array added to myUnstructuredGrid.<br>









</div><div><br>(I thought I can render different image in different viewports this way - I may be wrong here to begin with so if anyone wants to correct me here please feel free).<br></div><div><br>At run time as soon as the debugger hits the line <br>









myThresholdfilter.SetInput(port1, myUnstructuredGrid);<br></div>it complaints that I attempted to use port index 1 when number of ports is 1.<br><br></div>I can&#39;t even seem to do <br>myThresholdfilter.SetNumberofInputPorts(); <br>









</div><div>as this is a protected method.<br></div><div><br></div>How do I set up multiple input ports for a vtkThreshold filter. Please if anyone can shed some light on it, it would be a great help as I have spent a lot of time on it trying this and that without any luck.<br>









<br></div>Thanks in advance,<br></div>Bhanu<br></div>

<br>
</div></div><div><hr></div><font size="1"><span style="color:rgb(31,73,125)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span>This e-mail and any files transmitted with it (&quot;Message&quot;) is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL  or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font><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>
</blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div><div><div>

<br>
<div><hr></div><font size="1"><span style="color:rgb(31,73,125)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span>This e-mail and any files transmitted with it (&quot;Message&quot;) is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL  or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font></div>





</div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>

<br>
<div><hr></div><font size="1"><span style="color:rgb(31,73,125)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span>This e-mail and any files transmitted with it (&quot;Message&quot;) is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL  or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font></div>


</div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>

<br>
<div><hr></div><font size="1"><span style="color:rgb(31,73,125);background-color:rgb(255,255,255)"><b>DISCLAIMER</b>: </span><font color="#1f497d"><span style="background-color:rgb(255,255,255)">This e-mail and any files transmitted with it (&quot;Message&quot;) is intended only for the use of the recipient(s) named above and may contain confidential information. You are hereby notified that the taking of any action in reliance upon, or any review, retransmission, dissemination, distribution, printing or copying of this Message or any part thereof by anyone other than the intended recipient(s) is strictly prohibited. If you have received this Message in error, you should delete this Message immediately and advise the sender by return e-mail. Opinions, conclusions and other information in this Message that do not relate to the official business of PETROTEL  or its affiliated Companies shall be understood as neither given nor endorsed by PETROTEL or any of its affiliated companies.</span></font></font>