[Paraview-developers] Custom Paraview Application help

Charles Boivin charles.boivin at mayahtt.com
Tue Sep 20 11:08:19 EDT 2016


Uktarsh,

That did the trick -- thank you very much. It seems the file is loaded... not that it is being displayed of course.

Where could I find more info on where to go next from here (like, say, actually displaying the data in that file I just loaded)? Is there something that documents the high-level architecture/overview for Paraview, in particular for people interested in custom applications? I have used VTK in the (distant) past, and I'm assuming that Paraview follows the same concepts (pipelines, etc), but not quite sure where to find that info.

Thanks,

Charles


-----Original Message-----
From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com] 
Sent: Tuesday, September 20, 2016 9:56 AM
To: Charles Boivin
Cc: paraview-developers at paraview.org
Subject: Re: [Paraview-developers] Custom Paraview Application help

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