[Paraview-developers] Custom Paraview Application help
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Tue Sep 20 09:56:21 EDT 2016
Charles,
Try calling the following before the pqLoadDataReaction.
vtkSMReaderFactory* readerFactory =
vtkSMProxyManager::GetProxyManager()->GetReaderFactory();
readerFactory->UpdateAvailableReaders()
Does that help?
Utkarsh
Utkarsh
On Tue, Sep 20, 2016 at 9:05 AM, Charles Boivin
<charles.boivin at mayahtt.com> wrote:
> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
More information about the Paraview-developers
mailing list