<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 2, 2014 at 2:02 PM, Wei Wu <span dir="ltr"><<a href="mailto:salad00@gmail.com" target="_blank">salad00@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div>Hi there,<br><br></div><div>I learned how to create vtk source objects, such as cubes, disks etc, in a programming way. However every time I need to run my written program to display the objects. Do we have a method to export these already created objects into a vtk or vtu file, in order to load into software like ParaView to render them later on?<br>
<br></div><div>I have tried to find the solution but unfortunately didn't get any clue. Your help will be appreciated greatly!<br></div><div><br></div><div>Many thanks for your hint in advance!<br></div><div><br></div>
Best regards,<br></div>Wei<br></div></blockquote><div><br>Wei,<br><br>You can feed your data into any one of the classes that end in *Writer and are compatible with the data type. For example, if you have a vtkPolyData (which it sounds like you do), you can give it to a vtkXMLPolyDataWriter to create a .vtp file. Here is an example:<br>
<br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP">http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP</a><br><br></div><div>And here are a few other examples:<br><br><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx#Output_2">http://www.vtk.org/Wiki/VTK/Examples/Cxx#Output_2</a><br>
<br></div><div>Good luck!<br clear="all"></div><div><div><br>David</div> </div></div></div></div>