Write a plane to a VTP file
From KitwarePublic
Revision as of 13:10, 11 April 2009 by Daviddoria (talk | contribs) (New page: <source lang="cpp"> #include <vtkPlaneSource.h> void WritePlane(const string &OutputFilename) { vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New(); plane->S...)
<source lang="cpp">
- include <vtkPlaneSource.h>
void WritePlane(const string &OutputFilename) {
vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New(); plane->SetCenter(1.0, 0.0, 0.0); plane->SetNormal(1.0, 0.0, 0.0);
vtkSmartPointer<vtkPolyData> pdata = plane->GetOutput();
//write the file vtkSmartPointer<vtkXMLPolyDataWriter> writer = vtkSmartPointer<vtkXMLPolyDataWriter>::New(); writer->SetInput(pdata);
writer->SetFileName(OutputFilename.c_str()); writer->Write();
} </source>