[Paraview-developers] Custom Paraview Application help

Charles Boivin charles.boivin at mayahtt.com
Tue Sep 20 09:05:42 EDT 2016


Just trying to play around with creating custom Paraview-based applications. I have compiled the examples that come with Paraview itself. Focusing on the  'DemoApp1' project, this is what the constructor for the main window looks like:

myMainWindow::myMainWindow(QWidget* parentObject,
  Qt::WindowFlags wflags) : Superclass(parentObject, wflags)
{
  Ui::myMainWindow ui;
  ui.setupUi(this);

  // Make a connection to the builtin server
  pqApplicationCore* core = pqApplicationCore::instance();
  core->getObjectBuilder()->createServer(pqServerResource("builtin:"));

  // Create render view
  pqRenderView* view = qobject_cast<pqRenderView*>(
    pqApplicationCore::instance()->getObjectBuilder()->createView(
      pqRenderView::renderViewType(),
      pqActiveObjects::instance().activeServer()));
  pqActiveObjects::instance().setActiveView(view);

  // Set it as the central widget
  this->setCentralWidget(view->widget());
}

This strictly brings up a 3D render view in the window, no menus whatsoever, etc. That's what I was looking for to start with. I wanted to hardcode loading a file next. Digging around a bit, I thought this would do the trick:

  // Load a file
  QStringList fileList;
  fileList.append("D:/data/my_datafile.vtu");
  pqLoadDataReaction::loadData(fileList);

It seems to find the file alright but it cannot seem to find a proper reader for the file. It pops up a dialog with the readers it could use and the list is empty.

So it seems I am clearly missing something... documentation for vtkSMReaderFactory suggests configuration through XML files. Not too sure how to go about that at this point...  Is pqLoadDataReaction::loadData() too 'high-level' to use in something as barebones as this example? Is there a better alternative at that point? Or if it is appropriate to use, what else does it require to be set in order to properly load a file?

Thanks in advance for your reply,

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160920/bd599724/attachment-0001.html>


More information about the Paraview-developers mailing list