Workspace 6.21.5
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
RenderingPlugin Class Reference

WorkspacePlugin singleton class for this module.

#include <Rendering/renderingplugin.h>

Inheritance diagram for RenderingPlugin:
[legend]

Public Types

enum  DriverVendor {
  DriverMesa , DriverIntel , DriverNvidia , DriverAti ,
  DriverOther = 100
}
 
- Public Types inherited from WorkspacePlugin
using PreviousVersionNameMap = QMap< QString, QString >
 
using size_type = size_t
 
using WorkspacePluginList = QList< WorkspacePlugin * >
 

Public Member Functions

Application::PluginConfigcreatePluginConfig () override
 
QStringList getCustomWidgetPaths () const override
 
QString getDefaultIconPath () const override
 
int getMaxOpenGLMSAASamplesSupported () const
 
QString getPackageURI () const override
 
const WorkspacePlugin::PreviousVersionNameMapgetPreviousNames () const override
 
const RenderingSettingsgetSettings () const
 
bool isOpenGLSupportAdequate () const
 
void onWorkspaceClose () override
 
bool setup () override
 
bool usingKnownProblemDriver (DriverVendor driver, const QRegExp &versionStringMatch=QRegExp(".*"))
 
- Public Member Functions inherited from WorkspacePlugin
 WorkspacePlugin (const QString &name, const QString &displayName, const QString &version, const QString &buildDescription=QString::null)
 
 WorkspacePlugin (const QString &name, const QString &displayName, int versionMajor, int versionMinor, int versionRevision, const QString &buildDescription=QString::null)
 
virtual ~WorkspacePlugin ()
 
virtual PluginConfigcreatePluginConfig ()
 
virtual PluginMenucreatePluginMenu ()
 
const QString & getBuildDescription () const
 
virtual QStringList getCustomWidgetPaths () const
 
virtual const DataExecution::DataFactorygetDataFactory (const QString &dataType) const
 
const DataExecution::DataFactorygetDataFactory (size_type index) const
 
virtual QString getDefaultHelpPagePath () const
 
virtual QString getDefaultIconPath () const
 
virtual WorkspacePluginList getDependencies () const
 
const QString & getDisplayName () const
 
virtual QString getHelpFile () const
 
const QString & getLibraryFileName () const
 
virtual QStringList getLicensePaths () const
 
const QString & getName () const
 
size_type getNumDataFactories () const
 
size_type getNumOperationFactories () const
 
size_type getNumWidgetFactories () const
 
virtual const DataExecution::OperationFactorygetOperationFactory (const QString &opType, bool ignoreAliasedOperations=false) const
 
const DataExecution::OperationFactorygetOperationFactory (size_type index) const
 
virtual QString getPackageURI () const
 
virtual const PreviousVersionNameMapgetPreviousNames () const
 
const QString & getVersion () const
 
const Widgets::WidgetFactorygetWidgetFactory (size_type index) const
 
virtual bool isVisible () const
 
void logText (const QString &message)
 
virtual void onWorkspaceClose ()
 
void setLibraryFileName (const QString &fileName)
 
virtual bool setup ()=0
 
virtual bool setupAuthenticationProvider (Authentication::ProviderManager &manager)
 
virtual bool setupSchedulerProvider (DataExecution::SchedulerProviderManager &manager)
 
void showHelp (const QMap< QString, QUrl > &links, const QString &keyword="")
 
void showHelp (const QString &keyword)
 
void showHelp (const QUrl &url)
 
bool wasPreviouslyNamed (const QString &oldName) const
 

Static Public Member Functions

static RenderingPlugingetInstance ()
 

Protected Member Functions

const DataExecution::DataFactorygetAliasedDataFactory (const QString &dataType) const override
 
const DataExecution::OperationFactorygetAliasedOperationFactory (const QString &opType) const override
 
- Protected Member Functions inherited from WorkspacePlugin
bool addFactory (const DataExecution::DataFactory &factory)
 
bool addFactory (const DataExecution::OperationFactory &factory)
 
bool addFactory (const DataExecution::TypeAdaptorFactory &factory, bool replaceExisting=false)
 
bool addFactory (const Widgets::WidgetFactory &factory)
 
bool addTranslation (const QString &fileName="")
 
void addWorkspaceCollection (const QString &location)
 
const DataExecution::DataFactoryforwardDataFactoryRequest (const QString &pluginName, const QString &dataType) const
 
const DataExecution::OperationFactoryforwardOperationFactoryRequest (const QString &pluginName, const QString &opType) const
 
virtual const DataExecution::DataFactorygetAliasedDataFactory (const QString &dataType) const
 
virtual const DataExecution::OperationFactorygetAliasedOperationFactory (const QString &opType) const
 

Additional Inherited Members

- Static Public Attributes inherited from WorkspacePlugin
static const QString DEFAULT_ICON_PATH = "images:/Workspace/core/operation_icon.png"
 

Member Enumeration Documentation

◆ DriverVendor

Enumerator
DriverMesa 
DriverIntel 
DriverNvidia 
DriverAti 
DriverOther 

Member Function Documentation

◆ createPluginConfig()

Application::PluginConfig & createPluginConfig ( )
overridevirtual

This function will be called by clients wanting to create a widget for configuring this plugin. The default implementation creates a widget with simple text indicating that the plugin has no editable configuration items. Those plugins wishing to provide some kind of QWidget-based configuration will need to subclass PluginConfig, but if no configuration is needed then the PluginConfig header file does not need to be included and therefore no reference to QWidget will be made.

Ownership of the instance returned by this function will be given to the caller. At some point, the caller must then call the PluginConfig's destroy() function when it is finished with it.

Returns
A new instance of a PluginConfig object for this plugin.

Reimplemented from WorkspacePlugin.

◆ getAliasedDataFactory()

const DataExecution::DataFactory * getAliasedDataFactory ( const QString &  dataType) const
overrideprotectedvirtual
Parameters
dataTypeName of a data type.

If a data type is renamed, this function provides a backwards compatibility mechanism so that the plugin can provide the new factory that corresponds to an old name. By default, this function returns a null pointer, but subclasses can override it to provide an appropriate factory if a data type is renamed. Note that this function is only called by getDataFactory() if it could not find the factory from the plugin directly. Subclasses can assume that the request for dataType will only be made when the plugin has already been correctly identified by name (ie no functionality is provided for renaming a plugin).

Returns
The factory that should be used for data objects of the type dataType, or a null pointer if no appropriate factory exists.

Reimplemented from WorkspacePlugin.

◆ getAliasedOperationFactory()

const DataExecution::OperationFactory * getAliasedOperationFactory ( const QString &  opType) const
overrideprotectedvirtual
Parameters
opTypeName of an operation.

If an operation is renamed, this function provides a backwards compatibility mechanism so that the plugin can provide the new factory that corresponds to an old name. By default, this function returns a null pointer, but subclasses can override it to provide an appropriate factory if an operation is renamed. Note that this function is only called by getOperationFactory() if it could not find the factory from the operation factory manager. Subclasses can assume that the request for opType will only be made when the plugin has already been correctly identified by name (ie no functionality is provided for renaming a plugin).

Returns
The factory that should be used for operations of the type opType, or a null pointer if no appropriate factory exists.

Reimplemented from WorkspacePlugin.

◆ getCustomWidgetPaths()

QStringList getCustomWidgetPaths ( ) const
overridevirtual
Returns
A list of additional path prefixes to use when searching for custom .ui files when creating widgets for operation, inputs and outputs.

The custom widget paths would normally be specified using the "widgets" resource search path. A typical example would be something like widgets:MyPluginPath where MyPluginPath would be an area below which you put all your plugin's custom widget .ui files. If you use the widgets: prefix instead of just an ordinary (absolute or relative) file path, then the paths you specify will be interpretted as being relative to the application's default search paths. This is normally what you want, since plugins should generally install their custom .ui files in their own directory below the common widgets directory in the install area. This directory structuring is used by both the widget style sheets (in the styles directory) and by the custom widget .ui files.

If you follow the directory structure recommended above, then your .ui files should be found without having to do anything else. When a plugin is loaded by the PluginManager, it looks at the directory in which the plugin was located and it searches for a widgets directory related to that location. See PluginManager::loadPlugin() for more details about this directory structure.

See also
WidgetManager::createWidget()

Reimplemented from WorkspacePlugin.

◆ getDefaultIconPath()

QString getDefaultIconPath ( ) const
overridevirtual
Returns
The default icon path (generally a resource path) for all operations in this plugin. Individual operations can override this by using the DEFINE_WORKSPACE_OPERATION_WITH_ICON macro, and specifying a unique path.

Reimplemented from WorkspacePlugin.

◆ getInstance()

RenderingPlugin & getInstance ( )
static
Returns
The plugin instance.

The first call to this function is not thread-safe, since it creates the plugin instance. All subsequent calls are then thread-safe. Given that the workspace application will call this function on startup when only one thread is active, client code can therefore call this function with the assumption that it is thread-safe.

◆ getMaxOpenGLMSAASamplesSupported()

int getMaxOpenGLMSAASamplesSupported ( ) const
Returns
The maximum number of samples permitted by OpenGL for multi-sample antialiasing on this particular platform or device. If MSAA is not supported at all, 0 will be returned.
Precondition
This function must only be called while a valid OpenGL context is current, as it invokes OpenGL functions.

◆ getPackageURI()

QString getPackageURI ( ) const
overridevirtual
Returns
A unique URI that can be used to record the origin of this plugin for provenance recording purposes. This URI should be unique for each platform and released of this plugin.

An example implementation might be: return getName() + "/" + getVersion() + "/" + System::Utilities::getPlatformString() + "/" + System::Utilities::getPlatformArchitectureString();

Reimplemented from WorkspacePlugin.

◆ getPreviousNames()

const WorkspacePlugin::PreviousVersionNameMap & getPreviousNames ( ) const
overridevirtual
Returns
A map of versionNumber -> name, indicating the version at which the plugin stopped using that particular name. e.g. "3.0" -> "www.csiro.au/cfd/workspace" indicates that at version 3.0, the workspace plugin no longer used that name.

Reimplemented from WorkspacePlugin.

◆ getSettings()

const RenderingSettings & getSettings ( ) const
Returns
Settings object containing settings specific to the rendering plugin.

◆ isOpenGLSupportAdequate()

bool isOpenGLSupportAdequate ( ) const
Returns
True if the OpenGL implementation on this platform is sufficient to run the Rendering plugin.

Assumes the plugin has already had setup() invoked.

◆ onWorkspaceClose()

void onWorkspaceClose ( )
overridevirtual

This function will be called by the workspace application whenever a workspace is closed. A close event could occur whenever 'New', 'Load' or 'Close' are pressed in workspace-gui, for example.

Reimplemented from WorkspacePlugin.

◆ setup()

bool setup ( )
overridevirtual

This function will be called by the workspace application when the plugin is loaded. The function must register all factories it supplies (operations, data objects, etc.) with calls to addFactory(). Note that this function is the only place where addFactory() should be called (ie never in a plugin's constructor). A plugin may also do any other processing it requires in setup() before the plugin is used.

Returns
True if successful, false otherwise. If the plugin is being loaded and setup() returns false, the loading of the plugin is assumed to have failed and it will therefore not be available to clients.
See also
setupSchedulerProvider(), setupAuthenticationProvider()

Implements WorkspacePlugin.

◆ usingKnownProblemDriver()

bool usingKnownProblemDriver ( RenderingPlugin::DriverVendor  driver,
const QRegExp &  versionStringMatch = QRegExp(".*") 
)
Returns
True if we are using a known problem driver (recorded by the RenderingPlugin at startup. False otherwise. This allows us to implement driver-specific workarounds for specific driver versions.