[vtkusers] How to bring an object to the coordinate's origin

nuno.jf nunofernandes7 at gmail.com
Fri Apr 1 10:22:29 EDT 2011


Hi David,
(For now) I am using Paraview to delete the points that I don't want. After
removing all these points, I save the file using Paraview as a legacy vtk
file. As output I get an Unstructured Grid vtk file.
I successfuly tested the example you had suggested me 
(http://www.vtk.org/Wiki/VTK/Examples/Cxx#Surface_reconstruction) reading a
structured VTK file, by changing some lines in the code.
The problem is that I want to use this code to read an unstructured grid vtk
file, so I added/changed the following in order to convert from unstructured
grid to polydata:

#include 
#include 
#include 

// read unstructured grid
   vtkUnstructuredGridReader *reader = vtkUnstructuredGridReader::New();
   reader->SetFileName(argv[1]);
   reader->Update();
// create object
   vtkUnstructuredGrid * unstructured= vtkUnstructuredGrid::New();
   unstructured = reader ->GetOutput();
   unstructured ->Update();
    
//convert to polydata
   vtkUnstructuredGridToPolyDataFilter *teste =
vtkUnstructuredGridToPolyDataFilter::New();
   teste->SetInput(unstructured);
   teste->Update();

Then, I get the following error:

 "error C2440: 'initializing' : cannot convert from 'vtkAlgorithm *' to
'vtkUnstructuredGridToPolyDataFilter *' "

What am I doing wrong here? 
Any help would be greatly appreciated.
Best regards


--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-bring-an-object-to-the-coordinate-s-origin-tp4243261p4275614.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list