[vtkusers] vtkDataObject vs. vtkPointSet

Darshan Pai darshanpai at gmail.com
Wed Nov 23 00:14:42 EST 2005


Just include vtkPointSet in your Header Declaration . THat might be the
problem

On 11/21/05, David Lee Lambert <lamber45 at cse.msu.edu> wrote:
>
> (sorry about the resend; plain text this time...)
>
> I'm trying to figure out how to use vtkXYPlotActor to display simple 2-D
> data
> I've generated myself.  I can see that it has a method
> "AddDataObjectInput"
> which takes a "vtkDataObject *".  I've also found the class
> vtkPointSet,  one of
> its subclasses.  However,  I get an error when I try to compile my simple
> program.  In one part of the program I read data from a file as follows:
>
>       while (2==fscanf(f,"%lg%lg",&x,&y)) {
>
>          points->InsertNextPoint(x,y,0.0);
>
>       }
>
> In another place,  I try to display that data:
>
>               // "point set"
>    vtkDataObject *point_set = vtkPointSet::New();
>    point_set->SetPoints( demo_data->getPoints() );
>
>                 // actor
>    vtkXYPlotActor *plot_actor = vtkXYPlotActor::New();
>    plot_actor->AddDataObjectInput( point_set );
>
> However,  I get an error during compilation:
>
> demo2.cpp: In function 'int main(int, char**)':
> demo2.cpp:74: error: 'class vtkDataObject' has no member named 'SetPoints'
>
> That makes sense,  because vtkPointSet is a subclass os vtkDataObject.
> However,  when I originally tried it with a more specific type for
> /point_set/,
> I got a different error:
>
> demo2.cpp: In function 'int main(int, char**)':
> demo2.cpp:73: error: invalid conversion from 'vtkDataObject*' to
> 'vtkPointSet*'
>
> What might I doing wrong?
>
>
>
>
> _______________________________________________
> 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051123/eac33dbb/attachment.htm>


More information about the vtkusers mailing list