Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
pqLoadDataReaction Class Reference

Reaction for open data files. More...

#include <pqLoadDataReaction.h>

Inheritance diagram for pqLoadDataReaction:
Inheritance graph
[legend]
Collaboration diagram for pqLoadDataReaction:
Collaboration graph
[legend]

Public Types

typedef QPair< QString, QString > ReaderPair
 
typedef QSet< ReaderPairReaderSet
 

Public Slots

void updateEnableState () override
 Updates the enabled state. More...
 

Signals

void loadedData (pqPipelineSource *)
 Fired when a dataset is loaded by this reaction. More...
 

Public Member Functions

 pqLoadDataReaction (QAction *parent)
 Constructor. More...
 
- Public Member Functions inherited from pqReaction
 pqReaction (QAction *parent, Qt::ConnectionType type=Qt::AutoConnection)
 Constructor. More...
 
 ~pqReaction () override
 
QAction * parentAction () const
 Provides access to the parent action. More...
 

Static Public Member Functions

static pqPipelineSourceloadData (const QList< QStringList > &files, const QString &readergroup=QString(), const QString &readername=QString(), pqServer *server=nullptr)
 Loads multiple data files. More...
 
static pqPipelineSourceloadData (const QStringList &files, const QString &readergroup=QString(), const QString &readername=QString(), pqServer *server=nullptr)
 Loads data files. More...
 
static QVector< pqPipelineSource * > loadFilesForSupportedTypes (QList< QStringList > files)
 Called when the file dialog filter was on "Supported Types" or when dropping a file. More...
 
static QList< pqPipelineSource * > loadData (const ReaderSet &readerSet, bool groupFiles=true)
 Convenience static method that shows a file dialog, let user select files and opens the selected files. More...
 
static QList< pqPipelineSource * > loadData (bool groupFiles=true)
 Convenience static method that shows a file dialog, let user select files and opens the selected files. More...
 

Protected Member Functions

void onTriggered () override
 Called when the action is triggered. More...
 

Static Protected Member Functions

static bool TestFileReadability (const QString &file, pqServer *server, vtkSMReaderFactory *factory)
 
static bool DetermineFileReader (const QString &filename, pqServer *server, vtkSMReaderFactory *factory, QPair< QString, QString > &readerInfo)
 
static pqPipelineSourceLoadFile (const QStringList &files, pqServer *server, const QPair< QString, QString > &readerInfo)
 
static QVector< pqPipelineSource * > loadFilesForAllTypes (QList< QStringList > files, pqServer *server, vtkSMReaderFactory *readerFactory)
 Called when the file dialog filter was on "All Types" Lists all existing readers for the user to choose. More...
 
static void addReaderToDefaults (QString const &readerName, pqServer *server, vtkSMReaderFactory *readerFactory, QString const &customPattern="")
 Adds the reader to the defaults readers settings. More...
 

Additional Inherited Members

- Protected Slots inherited from pqReaction
virtual void updateEnableState ()
 
virtual void updateMasterEnableState (bool)
 
- Protected Attributes inherited from pqReaction
bool IsMaster
 

Detailed Description

Reaction for open data files.

Definition at line 20 of file pqLoadDataReaction.h.

Member Typedef Documentation

◆ ReaderPair

typedef QPair<QString, QString> pqLoadDataReaction::ReaderPair

Definition at line 65 of file pqLoadDataReaction.h.

◆ ReaderSet

Definition at line 66 of file pqLoadDataReaction.h.

Constructor & Destructor Documentation

◆ pqLoadDataReaction()

pqLoadDataReaction::pqLoadDataReaction ( QAction *  parent)

Constructor.

Parent cannot be nullptr.

Member Function Documentation

◆ loadData() [1/4]

static pqPipelineSource* pqLoadDataReaction::loadData ( const QList< QStringList > &  files,
const QString &  readergroup = QString(),
const QString &  readername = QString(),
pqServer server = nullptr 
)
static

Loads multiple data files.

Uses reader factory to determine what reader are supported. If a file requires user input the reader of choice, it will use that reader for all other files of that type. Returns the reader is creation successful, otherwise returns nullptr. Note that this method is static. Applications can simply use this without having to create a reaction instance.

If readergroup and readername are non empty, then they are assumed to be the type of the reader to use and reader factory is not used.

If server is nullptr, active server is used.

◆ loadData() [2/4]

static pqPipelineSource* pqLoadDataReaction::loadData ( const QStringList &  files,
const QString &  readergroup = QString(),
const QString &  readername = QString(),
pqServer server = nullptr 
)
static

Loads data files.

Uses reader factory to determine what reader are supported. Returns the reader is creation successful, otherwise returns nullptr. Note that this method is static. Applications can simply use this without having to create a reaction instance.

If readergroup and readername are non empty, then they are assumed to be the type of the reader to use and reader factory is not used.

If server is nullptr, active server is used.

◆ loadData() [3/4]

static QList<pqPipelineSource*> pqLoadDataReaction::loadData ( const ReaderSet readerSet,
bool  groupFiles = true 
)
static

Convenience static method that shows a file dialog, let user select files and opens the selected files.

readerSet is a set of readergroup, readername pair to restrict the proposed types of files shown to the user, not using it let the user choose between all files. Returns the list of opened file in the pipeline. Set groupFiles to false to disable automatic file group mechanisms

◆ loadData() [4/4]

static QList<pqPipelineSource*> pqLoadDataReaction::loadData ( bool  groupFiles = true)
static

Convenience static method that shows a file dialog, let user select files and opens the selected files.

readerSet is a set of readergroup, readername pair to restrict the proposed types of files shown to the user, not using it let the user choose between all files. Returns the list of opened file in the pipeline. Set groupFiles to false to disable automatic file group mechanisms

◆ loadFilesForSupportedTypes()

static QVector<pqPipelineSource*> pqLoadDataReaction::loadFilesForSupportedTypes ( QList< QStringList >  files)
static

Called when the file dialog filter was on "Supported Types" or when dropping a file.

First search for a matching reader in the default readers settings, and if none is found use the standard method to choose a reader.

◆ updateEnableState

void pqLoadDataReaction::updateEnableState ( )
overrideslot

Updates the enabled state.

Applications need not explicitly call this.

◆ loadedData

void pqLoadDataReaction::loadedData ( pqPipelineSource )
signal

Fired when a dataset is loaded by this reaction.

◆ onTriggered()

void pqLoadDataReaction::onTriggered ( )
inlineoverrideprotectedvirtual

Called when the action is triggered.

Reimplemented from pqReaction.

Definition at line 104 of file pqLoadDataReaction.h.

◆ TestFileReadability()

static bool pqLoadDataReaction::TestFileReadability ( const QString &  file,
pqServer server,
vtkSMReaderFactory factory 
)
staticprotected

◆ DetermineFileReader()

static bool pqLoadDataReaction::DetermineFileReader ( const QString &  filename,
pqServer server,
vtkSMReaderFactory factory,
QPair< QString, QString > &  readerInfo 
)
staticprotected

◆ LoadFile()

static pqPipelineSource* pqLoadDataReaction::LoadFile ( const QStringList &  files,
pqServer server,
const QPair< QString, QString > &  readerInfo 
)
staticprotected

◆ loadFilesForAllTypes()

static QVector<pqPipelineSource*> pqLoadDataReaction::loadFilesForAllTypes ( QList< QStringList >  files,
pqServer server,
vtkSMReaderFactory readerFactory 
)
staticprotected

Called when the file dialog filter was on "All Types" Lists all existing readers for the user to choose.

If the user clicks "Set reader as default", this lets the user choose the pattern they want to add to the setting for this reader.

◆ addReaderToDefaults()

static void pqLoadDataReaction::addReaderToDefaults ( QString const readerName,
pqServer server,
vtkSMReaderFactory readerFactory,
QString const customPattern = "" 
)
staticprotected

Adds the reader to the defaults readers settings.

If customPattern is empty, the reader pattern will be used.


The documentation for this class was generated from the following file: