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

Wes Turner wes.turner at kitware.com
Fri Apr 1 10:41:55 EDT 2011


vtkUnstructuredGridToPolyDataFilter is an abstract class without a concrete
implementation, so you can't actually use it in a program.  Try
vtkGeometryFilter.

- Wes

On Fri, Apr 1, 2011 at 10:22 AM, nuno.jf <nunofernandes7 at gmail.com> wrote:

> 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.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Wesley D. Turner, Ph.D.
Kitware, Inc.
Technical Leader
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4920
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110401/acb59769/attachment.htm>


More information about the vtkusers mailing list