[vtkusers] vtkDataObject vs. vtkPointSet
Amy Squillacote
amy.squillacote at kitware.com
Tue Nov 29 16:37:38 EST 2005
At 04:27 PM 11/29/2005, David Lee Lambert wrote:
>On Tuesday 22 November 2005 04:28 pm, Mathieu Malaterre wrote:
> > > demo2.cpp: In function 'int main(int, char**)':
> > > demo2.cpp:73: error: invalid conversion from 'vtkDataObject*' to
> > > 'vtkPointSet*'
> > >
> > > What might I doing wrong?
> >
> > When all else fail, read the instructions:
>...
> >
>http://www.vtk.org/Wiki/VTK_FAQ#The_C.2B.2B_compiler_cannot_convert_some_pointer_type_to_another_pointer_type_in_my_little_program
>
>
>I head read that, but I don't see how that could be the problem. The
>offending line of my code is:
>
> vtkPointSet *point_set = vtkPointSet::New();
>
>The version of vtk I'm using is 4.4.2, and I noticed that vtkPointSet has no
>New() member function, unless I misunderstand the macros used in the
>headers; could the problem be that New() is being inappropriately inherited
>from the superclass?
vtkPointSet should not have a New() method. It is the abstract
superclass of vtkPolyData, vtkStructuredGrid, and
vtkUnstructuredGrid. The New() method is valid for any of these 3
subclasses. Try creating a vtkPolyData instead of a
vtkPointSet. Also, if you're trying to render this data, you'll need
to create a vertex cell for each point in your vtkPolyData. You'll
also need #include "vtkPolyData.h" in your source code where you're
creating this vtkPolyData.
- Amy
>--
>DLL
>
>GPG key at http://www.cse.msu.edu/~lamber45/pgp-key.txt
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list