[Paraview] 3D widget in branded app panel?

David Thompson david.thompson at kitware.com
Mon Nov 9 10:15:57 EST 2015


Hi all,

I need to add some 3D widgets to a custom ParaView application. I've succeeded in creating a pqImplicitPlaneWidget and pqSphereWidget and adding their Qt widgets to the UI. However, the 3D widget never appears in the render view; the plane/sphere show up, but not the widgets. It's unclear from the documentation/code what proxy I should pass to the widget constructors for the "controlled" proxy. This is what I'm currently doing:

  pqServer* server = paraViewApp->getActiveServer();
  pqObjectBuilder* builder = paraViewApp->getObjectBuilder();
  QPointer<pqPipelineSource> source =
    builder->createSource("sources", "PlaneSource", server);
  vtkSMProxy* ctrlProxy = source->getProxy();
  vtkSMProxy* refProxy = ...; // proxy of the pqPipelineSource whose bounds should be used by the widget
  pq3DWidget* pvwidget = new pqImplicitPlaneWidget(refProxy, ctrlProxy);
  pqActiveObjects& actives(pqActiveObjects::instance());
  pvwidget->setView(actives.activeView());
  pqDataRepresentation* rep =
    builder->createDataRepresentation(
      source->getOutputPort(0), actives.activeView())
  panelLayout->addWidget(pvwidget);
  pvwidget->showWidget();

I've even tried

  double bds[6] = { -85, 85, -202, -34, -216, -47 };
  pvwidget->resetBounds(bds);

to fix the bounds to something meaningful, but this has no effect.

Any hints would be useful.

	Thanks,
	David


More information about the ParaView mailing list