[vtkusers] Saving a vtp file from vtkPolyData

Sam Raby rabysam28 at gmail.com
Fri May 9 16:55:40 EDT 2014


In the following VTK example:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface

after the surface of sphere is generated, I am trying to simply save the
surface as a vtp file using the following code, but I can not, that is, the
saved file does not show anything. Can anyone help why this happens?
Thanks.


    vtkPolyData *myvtkPolyData = vtkPolyData::SafeDownCast(
surfaceMapper->GetInputAsDataSet() );
    vtkSmartPointer<vtkXMLPolyDataWriter> writer =
vtkSmartPointer<vtkXMLPolyDataWriter>::New();
    writer->SetFileName("/home/surface.vtp");
    writer->SetInputData( myvtkPolyData );
    writer->SetDataModeToBinary();
    writer->Write();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140509/7c39e22a/attachment.html>


More information about the vtkusers mailing list