<div dir="ltr"><div><div>Dear Jean-Michel,<br><br>Yes, use PassData(), it will shallow copy the arrays from the input to the output, then you can add new arrays to your output. DeepCopy will works too but the input arrays will be copied and the copy will be affected to the output. Use it only if you intend to change the arrays after the copy for instance, to not alter the input arrays.<br><br></div>Best,<br></div>Joachim<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><b>Joachim Pouderoux</b><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><i>PhD, Technical Expert</i></font><br><b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</div></div></div>
<br><div class="gmail_quote">2015-11-12 11:36 GMT+01:00 Jean-Michel Lucas <span dir="ltr"><<a href="mailto:jm.lucas@gantha.com" target="_blank">jm.lucas@gantha.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">








<div link="blue" vlink="purple" lang="FR">

<div>

<p class="MsoNormal"><span lang="EN-US">Thank you for your answers, both methods
work fine.<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US">I am also adding new variables to the
output, so if I understood Dennis' answer correctly, I should be using
DeepCopy() ? However, using PassData(), it seems to me the new variable is only
added to the output. <u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal">Jean-Michel<u></u><u></u></p>

<p class="MsoNormal"><u></u> <u></u></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">From: Dennis Conklin
<<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a>><u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">To: Berk Geveci <<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>><u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Cc: "Paraview \(<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>\)"
<<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>><u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Subject: Re: [Paraview] [EXT] Re: Customize
programmable filters: copy<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">                arrays<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Message-ID:<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">                <<a href="mailto:SN1PR0701MB20295E1986716DD199DFBCF59F140@SN1PR0701MB2029.namprd07.prod.outlook.com" target="_blank">SN1PR0701MB20295E1986716DD199DFBCF59F140@SN1PR0701MB2029.namprd07.prod.outlook.com</a>><u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">                <u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Content-Type: text/plain; charset="utf-8"<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Berk,<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">I generally want to add some new variables to the
output ? if I don?t DeepCopy, then these new variables get added to the input
which violates the vtk rule that a filter can?t change the input.<u></u><u></u></span></p><span class="">

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">This is the main reason that I advocate adding the
capability for PointData and CellData to be partially DeepCopy (new variables
added in Filter)  and partially ShallowCopy (input variables just along for the
ride).<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">I suspect most filters are going to generate new
variables, so DeepCopy seems to be appropriate.     Please correct me if I
misunderstand this.<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Dennis<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">From: Berk Geveci [mailto:<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>]<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Sent:
Tuesday, November 10, 2015 3:40 PM<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">To: Dennis Conklin <<a href="mailto:dennis_conklin@goodyear.com" target="_blank">dennis_conklin@goodyear.com</a>><u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Cc: Paraview (<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>)
<<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>><u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Subject: [EXT] Re: [Paraview] Customize programmable
filters: copy arrays<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Don't use DeepCopy() unless you intend to change the
values of the output arrays. Use ShallowCopy() instead. You don't need
CopyStructure() by the way. Alternatively, you can use PassData(). Something
like this:<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">output.GetPointData().PassData(inputs[0].GetPointData())<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">output.GeCellData().PassData(inputs[0].GetCellData())<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Best,<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">-berk<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

</span><span class=""><p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">On Tue, Nov 10, 2015 at 1:49 PM, Dennis Conklin <</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="mailto:dennis_conklin@goodyear.com%3cmailto:dennis_conklin@goodyear.com" target="_blank"><span lang="EN-US">dennis_conklin@goodyear.com<mailto:dennis_conklin@goodyear.com</span></a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">>>
wrote:<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Jean-Michel,<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">I normally just add the following two statements within
my Filter:<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">output.CopyStructure(inputs[0].VTKObject)<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">output.DeepCopy(inputs[0].VTKObject)<u></u><u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Dennis<u></u><u></u></span></p>

<p class="MsoNormal"><u></u> <u></u></p>

</span></div>

</div>


<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>