<br><div class="gmail_quote"><br>Hi ,<span lang="en"><span>When</span> <span>I run the</span> <span>following code</span><span>,</span> <span>the following</span> <span>error</span> <span>occurs<br>
</span></span><br><span lang="en"><span><span lang="en"><span>The input</span> <span>file</span> <span>is</span> <span>attached to</span> <span>e-mail.<br>
</span></span>How to solve this error?thanks a lot!<br></span></span><br><br>#include <vtkSmartPointer.h><br>#include <vtkPolyDataMapper.h><br>#include <vtkStructuredGridReader.h><br>#include <<div>
vtkStructuredGridGeometryFilter.h><br>
#include <vtkRenderWindow.h><br>#include <vtkRenderWindowInteractor.h><br>#include <vtkRenderer.h><br>#include <vtkImageData.h><br>int main(int argc, char* argv[])<br>{<br>// // Verify input arguments<br>
// /*if ( argc != 2 )<br>// {<br>// std::cout << "Usage: " << argv[0]<br>// << " Filename(.vtk)" << std::endl;<br>// return EXIT_FAILURE;<br>// }*/<br>
<br> std::string inputFilename = "C:\\VTK\\VTKData\\Data\\tooth.vtk";<br><br> <br> vtkSmartPointer<vtkStructuredGridReader> reader =<br> vtkSmartPointer<vtkStructuredGridReader>::New();<br> reader->SetFileName(inputFilename.c_str());<br>
reader->Update();<br>// <br> vtkSmartPointer<vtkStructuredGridGeometryFilter> geometryFilter =<br> vtkSmartPointer<vtkStructuredGridGeometryFilter>::New();<br> geometryFilter->SetInputConnection(reader->GetOutputPort());<br>
geometryFilter->Update();<br> <br> // Visualize<br> vtkSmartPointer<vtkPolyDataMapper> mapper =<br> vtkSmartPointer<vtkPolyDataMapper>::New();<br> mapper->SetInputConnection(geometryFilter->GetOutputPort());<br>
<br> vtkSmartPointer<vtkActor> actor =<br> vtkSmartPointer<vtkActor>::New();<br> actor->SetMapper(mapper);<br> <br> vtkSmartPointer<vtkRenderer> renderer =<br> vtkSmartPointer<vtkRenderer>::New();<br>
vtkSmartPointer<vtkRenderWindow> renderWindow =<br> vtkSmartPointer<vtkRenderWindow>::New();<br> renderWindow->AddRenderer(renderer);<br> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br>
vtkSmartPointer<vtkRenderWindowInteractor>::New();<br> renderWindowInteractor->SetRenderWindow(renderWindow);<br> <br> renderer->AddActor(actor);<br> renderer->SetBackground(.3, .6, .3); // Background color green<br>
<br> renderWindow->Render();<br> renderWindowInteractor->Start();<br> <br> return EXIT_SUCCESS;<br>}<br><br><br>ERROR: In ..\..\VTK\IO\vtkStructuredGridReader.cxx, line 103<br>vtkStructuredGridReader (00000000025B4890): Cannot read dataset type: structured_points<br>
<br>ERROR: In ..\..\VTK\IO\vtkStructuredGridReader.cxx, line 198<br>vtkStructuredGridReader (00000000025B4890): Cannot read dataset type: structured_points</div>
</div><br>