<div dir="ltr"><div><div>Hi Steven, once again, thank you for your reply. <br>Is there any plan of incorporating a thread-safe version of vtkCutter into VTK? I mean, something equivalent to Paraview's vtkThreeSliceFilter? <br><br></div> Thank you<br><br></div> Luca<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 15, 2017 at 10:40 AM, Luca Pallozzi Lavorante <span dir="ltr"><<a href="mailto:lplavorante@gmail.com" target="_blank">lplavorante@gmail.com</a>></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><div>I understand. I don't know if this is a silly question, but will this class be incorporated into VTK?<br><br></div> Thank you<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"> Luca<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 15, 2017 at 9:46 AM, Hahn, Steven E. <span dir="ltr"><<a href="mailto:hahnse@ornl.gov" target="_blank">hahnse@ornl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Luca,<br>
</p>
<p><br>
</p>
<p>Yes, ParaView's vtkThreeSliceF<wbr>ilter does multiple cuts in different threads.<br>
<br>
</p>
<div style="color:rgb(33,33,33)"><a href="https://gitlab.kitware.com/paraview/paraview/merge_requests/1273" target="_blank">https://gitlab.kitware.com/par<wbr>aview/paraview/merge_requests/<wbr>1273
</a></div>
<div style="color:rgb(33,33,33)"><br>
</div>
<div style="color:rgb(33,33,33)">Steven<br>
<br>
<hr style="display:inline-block;width:98%">
<div id="m_-5450434039331838318m_8390438813693955599divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Luca Pallozzi Lavorante <<a href="mailto:lplavorante@gmail.com" target="_blank">lplavorante@gmail.com</a>><br>
<b>Sent:</b> Wednesday, March 15, 2017 7:41 AM<br>
<b>To:</b> Hahn, Steven E.<br>
<b>Cc:</b> vtk<br>
<b>Subject:</b> Re: [vtkusers] Is vtkCutter thread-safe?</font>
<div> </div>
</div><div><div class="m_-5450434039331838318h5">
<div>
<div dir="ltr">
<div>
<div>
<div>Hi Steven, thank you for your reply.<br>
</div>
I am using VTK 7.0. Are you using vtkCutter in different threads with the same input data? This is my case.<br>
<br>
</div>
Thank you<br>
<br>
</div>
Luca<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Mar 14, 2017 at 6:08 PM, Hahn, Steven E. <span dir="ltr">
<<a href="mailto:hahnse@ornl.gov" target="_blank">hahnse@ornl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="white" lang="EN-US">
<div class="m_-5450434039331838318m_8390438813693955599m_-5741933321825498830WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Hi Luca,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Are you using master? Last week I added a merge request making vtkCutter thread-safe.<br>
<br>
<a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/2541" target="_blank">https://gitlab.kitware.com/vtk<wbr>/vtk/merge_requests/2541</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Steven<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">vtkusers <<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>> on behalf of Luca Pallozzi Lavorante <<a href="mailto:lplavorante@gmail.com" target="_blank">lplavorante@gmail.com</a>><br>
<b>Date: </b>Tuesday, March 14, 2017 at 2:47 PM<br>
<b>To: </b>vtk <<a href="mailto:vtkusers@vtk.org" title="mailto:vtkusers@vtk.org
Cmd+Click or tap to follow the link" target="_blank">vtkusers@vtk.org</a>><br>
<b>Subject: </b>[vtkusers] Is vtkCutter thread-safe?<u></u><u></u></span></p>
</div>
<div>
<div class="m_-5450434039331838318m_8390438813693955599h5">
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi vtkusers,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I have tried to generate N slices from a vtkUnstructuredGrid using vtkCutter and OpenMP. The code I used is below. slicePosition and sliceNormals are arrays of planes' positions and normals, whereas polys is
an array of vtkPolyData used to store each cut for a later append operation using vtkAppendPolyData.<br>
<br>
#pragma omp parallel for<br>
for (size_t i = 0; i < numSlices; ++i) {<br>
vtkSmartPointer<vtkPlane> slice = vtkSmartPointer<vtkPlane>::New<wbr>();<br>
slice->SetOrigin(slicePosition<wbr>[i].x(), slicePosition[i].y(), slicePosition[i].z());<br>
slice->SetNormal(sliceNormal[i<wbr>].x(), sliceNormal[i].y(), sliceNormal[i].z());<br>
slice->Modified();<br>
<br>
vtkSmartPointer<vtkCutter> cutter = vtkSmartPointer<vtkCutter>::Ne<wbr>w();<br>
cutter->SetInputData(m_data);<br>
cutter->GenerateTrianglesOff()<wbr>;<br>
cutter->ReleaseDataFlagOn();<br>
cutter->SetCutFunction(slice);<br>
cutter->Update();<br>
<br>
vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::<wbr>New();<br>
poly->DeepCopy(cutter->GetOutp<wbr>ut());<br>
poly->Modified();<br>
polys[i] = poly;<br>
}<br>
<br>
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">This code generates segmentation faults and I would like to know whether it is safe to create and deal with a different instance of vtkCutter in different threads, as I am trying to do with the macro '#pragma omp parallel for'. What I am
trying to do is to slice my dataset using a set of parallel planes.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Thank you in advance for any help.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> Luca Pallozzi Lavorante<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>