<div dir="ltr">Many VTK objects have a ShallowCopy method that does what you want. You can shallow copy the entire datasets (which just copies pointers to data into a new dataset container), or selectively copy e.g. points.<div><br></div><div>Datasets can easily share components. For instance, if you have two grids that have the same points, you can do something like:</div><div><br></div><div>grid1->SetPoints(grid2->GetPoints());</div><div><br></div><div>and both grids will share the same vtkPoints object and its associated memory buffers.</div><div><br></div><div>HTH,</div><div>Dave</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 1, 2016 at 12:47 PM, Straub, Alexander <span dir="ltr"><<a href="mailto:inf76340@stud.uni-stuttgart.de" target="_blank">inf76340@stud.uni-stuttgart.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<p style="padding:0;margin:0"><span id="m_-8876091435458645012_mce_caret"><span style="font-size:10pt;font-family:tahoma,arial,helvetica,sans-serif">Good day,<br><br>I am currently developping a bunch of plugins (filters) for Paraview in the following setup:</span></span></p><p style="padding:0;margin:0"><span style="font-size:10pt;font-family:tahoma,arial,helvetica,sans-serif"><br></span></p><p style="padding:0;margin:0"><span id="m_-8876091435458645012_mce_caret"><span style="font-size:10pt;font-family:tahoma,arial,helvetica,sans-serif">I have input data as a rectilinear grid, including an array of scalar values per cell (volume-of-fluid data (vof)). On this data I now want to perform some calculations. First, a plugin calculates the gradient. Then, another plugin takes the grid with the vof-data and the gradients to calculate other vectors. This goes on for a few plugins.<br><br>The problem I get is that every time another filter is applied onto the last one, I copy all the data and add another array with the filter's own results. Thus, the second filter stores its own calculation and the source data, the third filter stores its own calculation, the calculation of the previous plugin and the source data.<br><br>You can see, that this results in a huge increase of memory usage.<br><br>Now to my question: Is there a possibility or method which passes along a pointer, or a copy pointing to the input of the plugin to which I then only need to add another array? Additionally I might add that the grid itself always stays the same, only each filter appends another array.<br><br>I hope you can help me, or at least quickly tell me if it is not possible at all.<br><br>Kind regards,<br>Alexander Straub<br></span></span></p>
</div>
<br>______________________________<wbr>_________________<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/<wbr>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/<wbr>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=<wbr>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/<wbr>mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>