<div class="gmail_quote">On Wed, Apr 21, 2010 at 6:19 PM, da <span dir="ltr"><<a href="mailto:remywendy@gmail.com">remywendy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Thanks Eric.<div><br></div><div>I ended up doing something like this</div><div><br></div><div><div><span style="white-space:pre">        </span>vtkSmartPointer<QVTKInteractor> renderWindowInteractor = vtkSmartPointer<QVTKInteractor>::New();</div>
<div><span style="white-space:pre">        </span>renderWindowInteractor->SetRenderWindow(<b>(vtkContextView)</b>->GetRenderWindow());</div><div><span style="white-space:pre">        </span>renderWindowInteractor->Initialize();</div>
<div><br></div><div><span style="white-space:pre">        </span><b>(QVTKWidget)</b>->SetRenderWindow(<b>(vtkContextView)</b>->GetRenderWindow());</div><div><br></div></div></blockquote><div>The following should work, but I should add an example to VTK to demonstrate this (and test that it continues to compile),</div>
<div> </div><div>QVTKWidget* widget = new QVTKWidget;</div><div>vtkContextView* view = vtkContextView::New();</div><div>view->SetInteractor(widget->GetInteractor());</div><div><div>widget->SetRenderWindow(view->GetRenderWindow());</div>
</div><div><br></div><div>It follows the normal vtkRenderView issues around creating a QVTKWidget that properly contains a render view. This is the basic approach used in ParaView (hidden in a few proxies).</div><div><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div>since QVTKWidget requires a QVTKInteractor as the Interactor. I created a new QVTKInteractor, attached it as vtkContextView's interactor, and then just set the renderwindow from context view into the qvtkwidget.</div>
</div></blockquote><div><br></div><div>I may refactor the context view to be a little more lightweight (the render view it currently derives from contains quite a few things that are not used by the context view). </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div><br></div><div>(BTW, thanks to the guys developing the new chart classes, they look very nice! Especially in Paraview!)</div><div class="im"><div><br></div></div></div></blockquote><div>Thanks - I have been working really hard on getting all the pieces in place for the release. There are quite a few things I would like to do, but think that the 2D API coupled with the 2D scene, chart API and mark API should give VTK a powerful suite of tools for rendering 2D views.</div>
<div><br></div><div>Sandia and the Titan project have played a key role in funding and steering the development of the new 2D APIs and charts in VTK/ParaView. We will continue collaborating with them as we move forward with this work.</div>
<div><br></div><div>Thanks,</div><div><br></div><div>Marcus </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="im"><div></div><br><div class="gmail_quote">
On Wed, Apr 21, 2010 at 12:11 PM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu" target="_blank">emonson@cs.duke.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
As long as you are programming in C++ I think you can follow the examples in [vtksource]/Examples/Infovis/Cxx -- there they have things like EasyView that put a vtkGraphLayoutView into a QVTKWidget. I haven't tried this with the Charts specifically, but since vtkContextView is also a vtkRenderView, hopefully you can do the same thing:<br>
<br>
// Graph View needs to get my render window<br>
this->GraphView->SetInteractor(this->ui->vtkGraphViewWidget->GetInteractor());<br>
this->ui->vtkGraphViewWidget->SetRenderWindow(this->GraphView->GetRenderWindow());<br>
<br>
(The reason I say that hopefully you're using C++ is that I can't get this to work with the Python wrappers and PyQt4...)<br>
<br>
-Eric<br>
<br>
------------------------------------------------------<br>
<font color="#888888">Eric E Monson<br>
Duke Visualization Technology Group<br>
</font><div><br>
<br>
On Apr 21, 2010, at 12:28 PM, da wrote:<br>
<br>
> Hey everyone,<br>
><br>
> I've been playing around with the plotting functionality: first the older vtkQt* classes and now I'm looking at VTK/Charts classes. It seems that vtkContextView is an entire "view" in itself. How would I get this embedded into a QWidget? I've been using QVTKWidget previously but I don't think I can just put the renderer from the context view into the qvtkwidget?<br>
><br></div></blockquote></div></div></div></blockquote></div>