Ok, I added a style to my interactor in the following way:<br><br>//code<br>&nbsp;&nbsp;&nbsp; vtkRenderWindow *renderWindow = vtkRenderWindow::New();<br>&nbsp;&nbsp;&nbsp; renderWindow-&gt;SetSize(550, 450);<br>&nbsp;&nbsp;&nbsp; renderWindow-&gt;AddRenderer(renderer);<br>
&nbsp;&nbsp;&nbsp; vtkRenderWindowInteractor* inter = QVTKInteractor::New();<br>&nbsp;&nbsp;&nbsp; renderWindow-&gt;SetInteractor(inter);<br>&nbsp;&nbsp;&nbsp; vtkInteractorStyleImage* interstyle = vtkInteractorStyleImage::New();<br>&nbsp;&nbsp;&nbsp; inter-&gt;SetInteractorStyle(interstyle);<br>
&nbsp;&nbsp;&nbsp; view-&gt;SetRenderWindow(renderWindow);<br>//end code<br><br>(where view = QVTKWidget)<br><br>And, I still get the same results.&nbsp; Instead of a nice plot, I just get a blank white screen.&nbsp; Thoughts?&nbsp; Am I doing something wrong?<br>
<br>Thanks,<br><br>Justin<br><br><div class="gmail_quote">On Mon, Feb 23, 2009 at 11:20 AM, Clinton Stimpson <span dir="ltr">&lt;<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Interaction is handled by the interactor style classes.<br>
<a href="http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkInteractorStyle.html</a><br>
<br>
You can use an existing style, or make your own and give it to the interactor.<br>
<br>
Clint<br>
<br>
Justin Giles wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
I am able to create a 2d plot using a QVTKWidget, however I am unable to interact with that plot. &nbsp;I pretty much new to VTK, so I am kind of at a loss as to how to connect the vtk interactors and Qt. &nbsp;I have poked around a bit and noticed a QVTKInteractor class, but anything I do with that results in my 2d plot going away to be replaced with a blank white area. &nbsp;Below is the code that I am using. &nbsp;Just as a note, this is being done in a class that extends a QMainWindow.<br>

<br>
//snippet//<br>
<br>
<br>
 &nbsp; &nbsp;view = new QVTKWidget;<br>
 &nbsp; &nbsp;setCentralWidget(view);<br>
<br>
 &nbsp; &nbsp;int DIM = 500;<br>
 &nbsp; &nbsp;vtkDataArray *dataArray1 = vtkDataArray::CreateDataArray(VTK_FLOAT);<br>
 &nbsp; &nbsp;dataArray1-&gt;SetNumberOfTuples(DIM);<br>
<br>
 &nbsp; &nbsp;vtkDataArray *dataArray2 = vtkDataArray::CreateDataArray(VTK_FLOAT);<br>
 &nbsp; &nbsp;dataArray2-&gt;SetNumberOfTuples(DIM);<br>
<br>
 &nbsp; &nbsp;int t;<br>
 &nbsp; &nbsp;for (t = 0; t &lt; DIM; t++)<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp; &nbsp; &nbsp;float x = t;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;float y = vtkMath::Random(0.0f,1.0f);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;dataArray1-&gt;SetTuple(t, &amp;x);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;dataArray2-&gt;SetTuple(t, &amp;y);<br>
 &nbsp; &nbsp;}<br>
<br>
 &nbsp; &nbsp;vtkFieldData *fieldData = vtkFieldData::New();<br>
 &nbsp; &nbsp;fieldData-&gt;AllocateArrays(2);<br>
 &nbsp; &nbsp;fieldData-&gt;AddArray(dataArray1);<br>
 &nbsp; &nbsp;fieldData-&gt;AddArray(dataArray2);<br>
<br>
 &nbsp; &nbsp;vtkDataObject *dataObject = vtkDataObject::New();<br>
 &nbsp; &nbsp;dataObject-&gt;SetFieldData(fieldData);<br>
<br>
 &nbsp; &nbsp;vtkXYPlotActor *plot = vtkXYPlotActor::New();<br>
 &nbsp; &nbsp;plot-&gt;AddDataObjectInput(dataObject);<br>
 &nbsp; &nbsp;plot-&gt;SetTitle(&quot;Plot&quot;);<br>
 &nbsp; &nbsp;plot-&gt;SetXTitle(&quot;X-Axis&quot;);<br>
 &nbsp; &nbsp;plot-&gt;SetYTitle(&quot;Y-Axis&quot;);<br>
 &nbsp; &nbsp;plot-&gt;SetXValuesToValue();<br>
 &nbsp; &nbsp;plot-&gt;SetWidth(0.9);<br>
 &nbsp; &nbsp;plot-&gt;SetHeight(0.9);<br>
 &nbsp; &nbsp;plot-&gt;SetPosition(0.05, 0.05);<br>
 &nbsp; &nbsp;plot-&gt;LegendOn();<br>
 &nbsp; &nbsp;plot-&gt;PickableOff();<br>
 &nbsp; &nbsp;plot-&gt;PlotCurvePointsOn();<br>
 &nbsp; &nbsp;plot-&gt;PlotCurveLinesOff();<br>
<br>
 &nbsp; &nbsp;plot-&gt;SetDataObjectXComponent(0, 0);<br>
 &nbsp; &nbsp;plot-&gt;SetDataObjectYComponent(0, 1);<br>
 &nbsp; &nbsp;plot-&gt;SetPlotColor(0, 1.0, 0.0, 0.0);<br>
 &nbsp; &nbsp;plot-&gt;SetPlotLabel(0, &quot;My Label&quot;);<br>
 &nbsp; &nbsp;//plot-&gt;GetProperty()-&gt;SetColor(0.0, 0.0, 0.0);<br>
<br>
 &nbsp; &nbsp;vtkRenderer *renderer = vtkRenderer::New();<br>
 &nbsp; &nbsp;renderer-&gt;SetBackground(0, 0, 0);<br>
 &nbsp; &nbsp;renderer-&gt;AddActor2D(plot);<br>
<br>
 &nbsp; &nbsp;vtkRenderWindow *renderWindow = vtkRenderWindow::New();<br>
 &nbsp; &nbsp;renderWindow-&gt;SetSize(550, 450);<br>
 &nbsp; &nbsp;renderWindow-&gt;AddRenderer(renderer);<br>
// &nbsp; &nbsp;vtkRenderWindowInteractor* inter = QVTKInteractor::New();<br>
// &nbsp; &nbsp;renderWindow-&gt;SetInteractor(inter);<br>
 &nbsp; &nbsp;view-&gt;SetRenderWindow(renderWindow);<br>
<br>
//end-snippet//<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
 &nbsp;<br>
</blockquote>
<br>
</blockquote></div><br>