<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello everyone,</div>
<div> </div>
<div>I use the VTK version 6.3.0-55.5.</div>
<div> </div>
<div>I am trying to do the following: read a "legacy" ASCII VTK file and that file represents an example of an unstructured grid in 3D, as done in the following VTK/Cxx-examples:</div>
<div>1)To read "legacy" ASCII VTK file: <br/>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/GenericDataObjectReader<br/>
I have included vtkGenericDataObjectReader.h, vtkPolyData.h, string</div>
<div>2)To make a 3DPlot:<br/>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadPLOT3D<br/>
Here I change the vtkStructuredGridGeometryFilter.h to vtkUnstructuredGridReader.h</div>
<div>3)To read unstructured Grid:<br/>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadUnstructuredGrid<br/>
</div>
<div>When I build it, it looks as if everything was okay but when I play it, in the opening window nothing is to see.</div>
<div>Below is my code:</div>
<div><br/>
#include <vtkVersion.h><br/>
#include <vtkPolyData.h><br/>
#if VTK_MAJOR_VERSION <= 5<br/>
#include <vtkPLOT3DReader.h><br/>
#else<br/>
#include <vtkMultiBlockPLOT3DReader.h><br/>
#include <vtkMultiBlockDataSet.h><br/>
#endif<br/>
#include <vtkSmartPointer.h><br/>
#include <vtkPolyDataMapper.h><br/>
#include <vtkActor.h><br/>
#include <vtkRenderWindow.h><br/>
#include <vtkRenderer.h><br/>
#include <vtkRenderWindowInteractor.h></div>
<div>//===============================================<br/>
//Header from example GenericDataObjectReader.cxx<br/>
//===============================================<br/>
#include <vtkGenericDataObjectReader.h><br/>
#include <vtkPolyData.h><br/>
#include <string></div>
<div>//=============================================<br/>
//Header from example ReadUnstructuredGrid.cxx<br/>
//=============================================<br/>
#include <vtkUnstructuredGridReader.h><br/>
#include <vtkDataSetMapper.h></div>
<div> </div>
<div>using namespace std;</div>
<div>int main (int argc, char *argv[])<br/>
{<br/>
<br/>
//Ensure a filename was specified<br/>
if(argc != 2)<br/>
{<br/>
std::cerr << "Usage: " << argv[0] << " InputFilename(.vtk)" << endl;<br/>
return EXIT_FAILURE;<br/>
}<br/>
<br/>
//Get the filename from the command line<br/>
std::string inputFilename = argv[1];<br/>
<br/>
//Read all the data from the file<br/>
vtkSmartPointer<vtkUnstructuredGridReader> reader =<br/>
vtkSmartPointer<vtkUnstructuredGridReader>::New();<br/>
reader->SetFileName(inputFilename.c_str());<br/>
reader->Update(); <br/>
<br/>
//Visualize<br/>
vtkSmartPointer<vtkPolyDataMapper> mapper =<br/>
vtkSmartPointer<vtkPolyDataMapper>::New();<br/>
// mapper->SetInputConnection(geometryFilter->GetOutputPort());<br/>
mapper->SetInputConnection(reader->GetOutputPort());<br/>
mapper->ScalarVisibilityOff();<br/>
<br/>
vtkSmartPointer<vtkActor> actor =<br/>
vtkSmartPointer<vtkActor>::New();<br/>
actor->SetMapper(mapper);<br/>
<br/>
//Create a renderer, render window, and interactor<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/>
}</div>
<div> </div>
<div> </div>
<div> </div>
<div>What is wrong? Can anyone help?</div>
<div> </div>
<div>Thank you very much in advance.</div>
<div> </div>
<div>And here the file</div>
<div> </div>
</div></div></body></html>