Building a Custom Paraview Application to Only Output to a Single Window

Hi, I have setup a remote bewoulf cluster that I run a pvserver on. Using the paraview gui client, I first connect to the server, load a pvd file, apply some inbuilt and custom filters and then volume render the data. What I want to do is, build a custom application that does all of the above steps programmatically but only displays the output render on a window that I can interact with. I don’t want any other gui related things. Just a simple application. Although I am struggling to do so. I have downloaded and built the paraview source. I can also run the examples but am having a hard time figuring out how do I create it from scratch. I have gone through the customising paraview guide but cannot wrap my head around it. I would be grateful, If anyone can help me or point in the right direction. Any help would be greatly appreciated.
Thank You

Sounds like you want a pvpython script instead.

Just use File->SaveState->, add Interact() at the end and run with pvpython.

If that doesnt do it for you, I will help with customizing paraview.

Hi, thanks for the response.
I want to connect to the cluster, run the pvpython script in parallel (which I assume is done by pvbatch) and display the output on a client. Which I am not able to do so due to my limited knowledge.
I actually want to write a custom application because I later want to send the data over to hololens and display it there. I just want to use the paraview’s capabilities to load and distribute data, read pvd files, do volume rendering, apply filters etc. I will also be dynamically extracting the subsets according to the input from the client in the application and updating the renders (like loading in more subsets, removing others etc.). This is the reason I thought writing a custom application would be a better choice.

Sounds like a standard Trame usecase to me. But it can be done with a custome ParaView based application, look at


Ok, I will look into Trame. In the meanwhile, I tried modifying the Demo1 example

#include "mainWindow.h"
#include "ui_mainWindow.h"

#include <pqActiveObjects.h>
#include <pqApplicationCore.h>
#include <pqObjectBuilder.h>
#include <pqRenderView.h>
#include <pqServerResource.h>
#include <pqLoadDataReaction.h>
#include <pqDataRepresentation.h>
#include <vtkSMPropertyHelper.h>
#include <vtkPVGeneralSettings.h>

mainWindow::mainWindow(QWidget* parent, Qt::WindowFlags flags) : Superclass(parent, flags)
	Ui::mainWindow ui;

	// make a connection to the builtin server
	pqApplicationCore* core = pqApplicationCore::instance();
	// Use auto apply to show data automatically

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

	QStringList files;
	files << "/mnt/c/DEV/Torso.pvd";

	pqPipelineSource* pipelineSource = pqLoadDataReaction::loadData(files, "sources", "PVDReader");

	pqObjectBuilder *builder = pqApplicationCore::instance()->getObjectBuilder();

	pqDataRepresentation *drep = builder->createDataRepresentation(pipelineSource->getOutputPort(0), view);
	vtkSMPropertyHelper(drep->getProxy(), "Representation").Set("Volume");


mainWindow::~mainWindow() = default;

This how I have modified the Demo1 example. The window opens but there is not data loaded in it. Could please point out where the issues are?

Hi, I am able to load and render the pvd data in the representation modes “Outline” and “Surface”. But when I set it to “Volume” it does not display anything. What might be the reason behind this?

	// create data representation and add it to render view
	pqDataRepresentation *drep = builder->createDataRepresentation(pipelineSource->getOutputPort(0), view);
    // Changing this to "Volume"
	vtkSMPropertyHelper(drep->getProxy(), "Representation").Set("Outline");

I believe it is due this property. It switches to MetaImage when I set the representation type to Volume in ParaView. How do I replicate this behaviour in script?


You need to set the scalars for rendering, it is a representation property. Use the trace in ParaView to understands how it works in python, it will help you figure out the right C++ code.

Hi, I have got it working with the following:

// create data representation and add it to render view
pqDataRepresentation *drep = builder->createDataRepresentation(pipelineSource->getOutputPort(0), view);
auto dProxy = drep->getProxy();
vtkSMPropertyHelper(dProxy, "Representation").Set("Volume");
// use color and opacity from original data
vtkSMPropertyHelper(dProxy, "UseSeparateColorMap").Set(1);
vtkSMPVRepresentationProxy::SetScalarColoring(dProxy, "MetaImage", vtkDataObject::POINT);
vtkSMPVRepresentationProxy::RescaleTransferFunctionToDataRange(dProxy, false, false);


1 Like