Just include vtkPointSet in your Header Declaration . THat might be the problem<br><br><div><span class="gmail_quote">On 11/21/05, <b class="gmail_sendername">David Lee Lambert</b> <<a href="mailto:lamber45@cse.msu.edu">
lamber45@cse.msu.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(sorry about the resend; plain text this time...)<br>
<br>I'm trying to figure out how to use vtkXYPlotActor to display simple 2-D data<br>I've generated myself. I can see that it has a method "AddDataObjectInput"<br>which takes a "vtkDataObject *". I've also found the class vtkPointSet, one of
<br>its subclasses. However, I get an error when I try to compile my simple<br>program. In one part of the program I read data from a file as follows:<br><br> while (2==fscanf(f,"%lg%lg",&x,&y)) {
<br><br> points->InsertNextPoint(x,y,0.0);<br><br> }<br><br>In another place, I try to display that data:<br><br> // "point set"<br> vtkDataObject *point_set = vtkPointSet::New();
<br> point_set->SetPoints( demo_data->getPoints() );<br><br> // actor<br> vtkXYPlotActor *plot_actor = vtkXYPlotActor::New();<br> plot_actor->AddDataObjectInput( point_set );<br><br>However, I get an error during compilation:
<br><br>demo2.cpp: In function 'int main(int, char**)':<br>demo2.cpp:74: error: 'class vtkDataObject' has no member named 'SetPoints'<br><br>That makes sense, because vtkPointSet is a subclass os vtkDataObject.<br>However, when I originally tried it with a more specific type for /point_set/,
<br>I got a different error:<br><br>demo2.cpp: In function 'int main(int, char**)':<br>demo2.cpp:73: error: invalid conversion from 'vtkDataObject*' to 'vtkPointSet*'<br><br>What might I doing wrong?<br><br><br><br><br>_______________________________________________
<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br><br><br></blockquote></div><br>