[Paraview] Adding an interactive slice widget

Jenya Burstein taijinian at gmail.com
Tue May 25 14:08:59 EDT 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100525/0c073f2d/attachment.htm>


More information about the ParaView mailing list