[Paraview] Getting camera/view data in c++ filter

Alex Rattner Alex.Rattner at gatech.edu
Thu Jun 14 16:23:12 EDT 2012


Hi Jean-Noel,

Thank you very much for the assistance. I was able to retrieve the 
camera data and use it in my filter.

For everyone else here is the working block of code to get camera data 
directly.
pqView *view = 0;
pqActiveObjects* tempInstance = &( pqActiveObjects::instance() );
view = tempInstance->activeView();
vtkCamera* camera = vtkSMRenderViewProxy::SafeDownCast( 
view->getViewProxy() )->GetActiveCamera();

-Alex

On 06/14/2012 01:33 AM, Jean-Noël Chiganne wrote:
> I forgot to mention that "this->viewProxy" is a vtkSMRenderViewProxy*
>
> 2012/6/14 Jean-Noël Chiganne <jean-noel.chiganne at limsi.fr 
> <mailto:jean-noel.chiganne at limsi.fr>>
>
>     You can access the active camera this way :
>
>     pqView *view = 0;
>
>     view = pqActiveObjects::instance().activeView();
>
>     this->viewProxy = 0;
>
>     this->viewProxy = vtkSMRenderViewProxy::SafeDownCast(
>     view->getViewProxy());
>
>             vtkCamera* camera = viewProxy->GetActiveCamera();
>
>
>     Hope it helps =)
>
>
>     Regards,
>
>
>     Jean-Noël
>
>
>     2012/6/13 Alex Rattner <Alex.Rattner at gatech.edu
>     <mailto:Alex.Rattner at gatech.edu>>
>
>         Hello,
>
>         I have been working on a c++ paraview filter and would like to
>         modify output data based on the camera view
>         direction/location. For example, I may want to highlight data
>         closer to the viewer and remove far away data. Is it possible
>         to access some of this information (like camera location, view
>         direction, etc.) from a filter? I've seen some information on
>         accessing this data in python, but I want to get it in a
>         compiled c++ filter.
>
>         Thank you,
>         Alex
>         _______________________________________________
>         Powered by www.kitware.com <http://www.kitware.com>
>
>         Visit other Kitware open-source projects at
>         http://www.kitware.com/opensource/opensource.html
>
>         Please keep messages on-topic and check the ParaView Wiki at:
>         http://paraview.org/Wiki/ParaView
>
>         Follow this link to subscribe/unsubscribe:
>         http://www.paraview.org/mailman/listinfo/paraview
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120614/7eff1307/attachment.htm>


More information about the ParaView mailing list