pqLoadDataReaction in custom application

Hi all,

i am trying to implement my first custom application based on paraview and I have defined a pqLoadDataReaction linked to a QAction.

pqLoadDataReaction* dataLoader = new pqLoadDataReaction(ui.actionOpen);

When I execute my app, triggering the action I obtain the following error:

**Assertion failed: (filters.isEmpty()), function loadData, file pqLoadDataReaction.cxx, line 86.**

I think it is related to an empty response from readerFactory->GetSupportedFileTypes.

How I can define the supported file types of my application?

Try calling pqApplicationCore::updateAvailableReadersAndWriters explicitly during application startup. I suspect for some reason it’s being called during initialization.

I have solved with

    readerFactory->RegisterPrototype("sources", "XMLPolyDataReader");

I am now trying to visualize data with a custom reader for Fits format files with this code:

    pqObjectBuilder *builder = pqApplicationCore::instance()->getObjectBuilder();
    pqDataRepresentation *drep = builder->createDataRepresentation(
    this->originSource->getOutputPort(0), this->view);
    vtkSMPropertyHelper(drep->getProxy(), "Representation").Set(VTK_SURFACE);
    drep->getProxy()->UpdateVTKObjects();
    
    this->view->resetDisplay();
    this->view->render();

But I obtain this error:

vtkPVCompositeRepresentation (0x16f473ff0): No representation was found with Name: 2

UPDATE: I realised that only Outline representation is available, How can I create other type of representation?

“Representation” is a string property. The values it accepts are the string e.g. "Surface", "Wireframe", etc. and not enums.

Thanks