<div dir="ltr"><div><div><div>Yusuf,<br><br>In the code you provide, the clip filter is never executed. You should add <span style="font-family:monospace,monospace">m_Clip->Update();</span> - for instance just after the setinputconnection.<br>Not related but you could directly plug the clip filter to the writer (no need to shallow copy the output of the clip filter):<br>just replace <span style="font-family:monospace,monospace">m_PolyDataWriter->SetInput(m_</span><span style="font-family:monospace,monospace">PolyDataSave);</span><br></div>by <span style="font-family:monospace,monospace">m_PolyDataWriter->SetInputConnection(m_</span><span style="font-family:monospace,monospace">Clip->GetOutputPort());<br></span></div><div><span style="font-family:arial,helvetica,sans-serif">If you do so, calling <span style="font-family:monospace,monospace">Write() </span>on the writer will execute the pipeline of the writer which involves the Clip filter too - so the clip filter would be called automatically even if you do not explicitly called <span style="font-family:monospace,monospace">Update() </span>on it.</span><span style="font-family:monospace,monospace"><br></span></div><div><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-12-20 17:06 GMT+01:00 Yusuf OEZBEK <span dir="ltr"><<a href="mailto:nasil122002@yahoo.de" target="_blank">nasil122002@yahoo.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:10px"><div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:10px"><div> Hello,</div><div><br></div><div dir="ltr">I want to save my polydata after clipping with vtkBoxWidget. If I run following code-block, the saved file is empty. </div><div dir="ltr">What can be my mistake here?</div><div><br></div><div dir="ltr"> m_Clip= vtkSmartPointer<vtkClipPolyData>::New();<br> m_Clip->SetClipFunction(m_Plane);<br> m_Clip->InsideOutOn();<br> m_Clip->SetInputConnection(m_Decimater->GetOutputPort());</div><div dir="ltr"><br></div><div dir="ltr"> m_PolyDataSave= vtkSmartPointer<vtkPolyData>::New();<br> m_PolyDataSave->ShallowCopy(m_Clip->GetOutput());</div><div dir="ltr"><br></div><div dir="ltr"> m_PolyDataWriter = vtkSmartPointer<vtkPolyDataWriter>::New();<br> m_PolyDataWriter->SetFileName("clippedObject.vtk");<br> m_PolyDataWriter->SetInput(m_PolyDataSave);<br> m_PolyDataWriter->SetFileTypeToASCII();</div><div dir="ltr"> m_PolyDataWriter->Write();</div><div dir="ltr"><br></div><div dir="ltr">Thank you for any help!</div></div></div></div></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>