<div dir="ltr">Does clipping without reconfiguring the pipeline work?<div>There are cases when the clipping plane does not intersect the data to be clipped in which case you'll get an empty dataset.</div><div><br></div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 6, 2016 at 4:23 PM, Seun Odutola <span dir="ltr"><<a href="mailto:seun@rogue-research.com" target="_blank">seun@rogue-research.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Everyone,<div> </div><div> I have a situation where I feed an input (which is an output result of a vtkProbeFilter) to a vtkClipPolyData and subsequently pass it’s output to a vtkPolyDataMapper. Basically my pipeline is as follows </div><div><br></div><div>Mesh(polydata) (M) —> A—> B —> C</div><div><br></div><div>A - vtkProbeFilter</div><div>B - vtkClipPolyData</div><div>C - vtkPolyDataMapper</div><div><br></div><div> I gathered from previous responses to my last message (see topic: How to bypass parts of vtk pipeline) that reconfiguring the pipeline as suggested in that thread was most likely the way to go about achieving that. However, I had an idea which I would like to propose. For instance in my situation as described above my application typically will not be making use of the vtkClipPolyData that often but it’s of utmost importance that I have it configured ready to go whenever the user needs to Clip, so I decided to peek at vtkClipPolyData’s RequestData function where I compare the input’s bounding box (in my case the box to my polydata result from A), if the clippolydata’s box contains M in it’s entirety then I would like the input to be the output of the clippolydata (result going into —> C) but if the clip polydata’s bounding box doesn’t contain M’s bounding box but just intersects it’s points then I would like to clip it and pass along the result to C.</div><div>Basically</div><div>1 - if B’s box contains M - skip</div><div>2 - if B doesn’t contain M but just intersects some of it’s point - then clip.</div><div> I managed to get do the bounds checking that certifies the first part of my algorithm but the 2nd part is the tricky bit when I resize my clipper (in it’s U.I) and then expect the vtkClipPolyData to Clip it empties the entire polydata of M. I believe it has something to do setting the clipScalars. I also noticed the line below in vtkClipPolyData.cxx</div><div><br></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><div style="margin:0px;line-height:normal"><span style="color:rgb(187,44,162)">for</span><span> ( i=</span><span style="color:rgb(39,42,216)">0</span><span>; i < numPts; i++ )</span></div><div style="margin:0px;line-height:normal"><span>{</span></div><div style="margin:0px;line-height:normal"><span> <span style="white-space:pre-wrap"> </span>s = </span><span style="color:rgb(187,44,162)">this</span><span>->ClipFunction->FunctionValue(inPts->GetPoint(i));</span></div><div style="margin:0px;line-height:normal"><span><span style="white-space:pre-wrap"> </span>tmpScalars->SetComponent(i,</span><span style="color:rgb(39,42,216)">0</span><span>,s);</span></div><div style="margin:0px;line-height:normal"><span>}</span></div></div></div><div><br></div><div>tends to be the bottleneck in my case, which is why I’m trying to find a way to just ignore the effect of B in the pipeline when I need not clip but process it when I need to clip. I understand from the code that when I need to clip the line above must be executed but when I don’t need to clip what could be done to replace this line because ultimately down the line the tmpScalars is set to the clipScalars which is needed for further computation. Thanks everyone</div><div><br></div><div><br></div><div>Regards,</div><div> Seun</div><div><br></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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>