[Paraview] Adding an interactive slice widget

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue May 25 14:39:16 EDT 2010


Try adding the following code after your code:
      pqSMAdaptor::setElementProperty(sliceWidget->GetProperty("Enabled"), 1);
     sliceWidget->UpdateVTKObjects();

Utkarsh

On Tue, May 25, 2010 at 2:08 PM, Jenya Burstein <taijinian at gmail.com> wrote:
> Hello,
>
> I am trying to figure out how to add a slice widget that has the
> interactivity behavior just liek in the Paraview application.
> When I add the following code, I get the visual representation of the
> widget. However, performing mouse events on the bounding box or normal of
> the widget doesn't make the widget change its position, orientation. Instead
> the whole view's camera position is changing.
>
>     vtkSMProxy* sliceWidget =
> m_paraviewObjectBuilder->createProxy("representations",
>
> "ImplicitPlaneWidgetRepresentation",
>
> m_paraviewActiveObjects->activeServer(),
>                                                                    "slice
> widget");
>     doubleProp = vtkSMDoubleVectorProperty::SafeDownCast(
>
> sliceWidget->GetProperty("PlaceWidget"));
>     double sourceBounds[6];
>     sourceRepresentation.getDataBounds(sourceBounds);
>     doubleProp->SetElements(sourceBounds);
>     pqSMAdaptor::setElementProperty(sliceWidget->GetProperty("Visibility"),
> true);
>     sliceWidget->UpdateVTKObjects();
>     // Add the widget to the view.
>     pqSMAdaptor::addProxyProperty(
>         m_renderView->getProxy()->GetProperty("Representations"),
> sliceWidget);
>
> Any advise is much appreciated,
> Jenya
>
> _______________________________________________
> Powered by 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
>
>


More information about the ParaView mailing list