Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::InviwoModule Class Reference

A module class contains registrations of functionality, such as processors, ports, properties etc. More...

#include <inviwomodule.h>

+ Inheritance diagram for inviwo::InviwoModule:

Public Member Functions

 InviwoModule (InviwoApplication *app, std::string_view identifier)
 
 InviwoModule (const InviwoModule &)=delete
 
InviwoModuleoperator= (const InviwoModule &)=delete
 
 InviwoModule (InviwoModule &&)=delete
 
InviwoModuleoperator= (InviwoModule &&)=delete
 
const std::string & getIdentifier () const
 Get module identifier, i.e the module folder name.
 
virtual std::string getDescription () const
 
virtual const std::filesystem::path & getPath () const
 
std::filesystem::path getPath (ModulePath type) const
 
virtual int getVersion () const
 
virtual std::unique_ptr< VersionConvertergetConverter (int oldModuleVersion) const
 
const std::vector< CameraFactoryObject * > getCameras () const
 
const std::vector< Capabilities * > getCapabilities () const
 
const std::vector< DataReader * > getDataReaders () const
 
const std::vector< DataWriter * > getDataWriters () const
 
const std::vector< DialogFactoryObject * > getDialogs () const
 
const std::vector< MeshDrawer * > getDrawers () const
 
const std::vector< MetaData * > getMetaData () const
 
const std::vector< InportFactoryObject * > getInports () const
 
const std::vector< OutportFactoryObject * > getOutports () const
 
const std::vector< PortInspectorFactoryObject * > getPortInspectors () const
 
const std::vector< ProcessorFactoryObject * > getProcessors () const
 
const std::vector< ProcessorWidgetFactoryObject * > getProcessorWidgets () const
 
const std::vector< PropertyFactoryObject * > getProperties () const
 
const std::vector< PropertyWidgetFactoryObject * > getPropertyWidgets () const
 
const std::vector< BaseRepresentationFactoryObject * > getRepresentationFactoryObjects () const
 
const std::vector< BaseRepresentationFactory * > getRepresentationFactories () const
 
const std::vector< BaseRepresentationConverter * > getRepresentationConverters () const
 
const std::vector< BaseRepresentationConverterFactory * > getRepresentationConverterFactories () const
 
const std::vector< Settings * > & getSettings () const
 
void registerCapabilities (std::unique_ptr< Capabilities > info)
 
void registerCamera (std::unique_ptr< CameraFactoryObject > camera)
 
template<typename T >
void registerCamera (std::string_view classIdentifier)
 
void registerDataReader (std::unique_ptr< DataReader > reader)
 
void registerDataWriter (std::unique_ptr< DataWriter > writer)
 
void registerDialog (std::unique_ptr< DialogFactoryObject > dialog)
 
template<typename T >
void registerDialog (std::string_view classIdentifier)
 
void registerDrawer (std::unique_ptr< MeshDrawer > drawer)
 
void registerMetaData (std::unique_ptr< MetaData > meta)
 
void registerProcessor (std::unique_ptr< ProcessorFactoryObject > pfo)
 
template<typename T >
void registerProcessor ()
 
void registerCompositeProcessor (const std::filesystem::path &file)
 
void registerProcessorWidget (std::unique_ptr< ProcessorWidgetFactoryObject > widget)
 
template<typename T , typename P >
void registerProcessorWidget ()
 
void registerPortInspector (std::string_view portClassIdentifier, const std::filesystem::path &inspectorPath)
 
void registerDataVisualizer (std::unique_ptr< DataVisualizer > visualizer)
 
void registerInport (std::unique_ptr< InportFactoryObject > inport)
 
void registerOutport (std::unique_ptr< OutportFactoryObject > outport)
 
template<typename T >
void registerPort ()
 
template<typename T >
void registerDefaultsForDataType ()
 
void registerProperty (std::unique_ptr< PropertyFactoryObject > property)
 
template<typename T >
void registerProperty ()
 
void registerPropertyWidget (std::unique_ptr< PropertyWidgetFactoryObject > propertyWidget)
 
template<typename T , typename P >
void registerPropertyWidget (PropertySemantics semantics)
 
template<typename T , typename P >
void registerPropertyWidget (std::string_view semantics)
 
void registerPropertyConverter (std::unique_ptr< PropertyConverter > propertyConverter)
 
template<typename BaseRepr >
void registerRepresentationFactoryObject (std::unique_ptr< RepresentationFactoryObject< BaseRepr > > representation)
 
void registerRepresentationFactory (std::unique_ptr< BaseRepresentationFactory > representationFactory)
 
template<typename BaseRepr >
void registerRepresentationConverter (std::unique_ptr< RepresentationConverter< BaseRepr > > converter)
 
void registerRepresentationConverterFactory (std::unique_ptr< BaseRepresentationConverterFactory > converterFactory)
 
void registerSettings (std::unique_ptr< Settings > settings)
 
void registerSettings (Settings *settings)
 
InviwoApplicationgetInviwoApplication () const
 

Protected Attributes

InviwoApplicationapp_
 

Detailed Description

A module class contains registrations of functionality, such as processors, ports, properties etc.

Constructor & Destructor Documentation

◆ InviwoModule()

inviwo::InviwoModule::InviwoModule ( InviwoApplication * app,
std::string_view identifier )
Parameters
appthe inviwo application.
identifierName of module folder.

Member Function Documentation

◆ getConverter()

virtual std::unique_ptr< VersionConverter > inviwo::InviwoModule::getConverter ( int oldModuleVersion) const
virtual

Should return a converter that updates a processor network from the oldModuleVersion to the current module version returned by getVersion. You need to overload this together with getVersion to implement conversioning for the module. This is needed whenever you modify a processor in such a was as breaking the deserialization of a old network. For example by changing the identifier of a property. By the default it will return a nullptr. Since there is no need to convert to version 0. Look at BaseModule for an example of this in use.

Reimplemented in inviwo::AnimationModule, inviwo::BaseGLModule, inviwo::BaseModule, inviwo::FontRenderingModule, inviwo::PlottingGLModule, inviwo::PlottingModule, inviwo::PostProcessingModule, inviwo::VectorFieldVisualizationGLModule, and inviwo::VectorFieldVisualizationModule.

◆ getDescription()

virtual std::string inviwo::InviwoModule::getDescription ( ) const
virtual

Override to provide a description of the module

◆ getPath()

virtual const std::filesystem::path & inviwo::InviwoModule::getPath ( ) const
virtual

Get the path to this module directory. For instance: C:/inviwo/modules/mymodule/

Note
Assumes that getIdentifier() returns the module folder name. The folder name should always be lower case.
The returned directory might not exist in the case that the app is deployed and the module does not contain any resources.
Returns
std::string Path to module directory

Reimplemented in inviwo::InviwoCore.

◆ getVersion()

virtual int inviwo::InviwoModule::getVersion ( ) const
virtual

Returns the module version. This is used for converting old processor networks in connection with the getConverter function. By default it will return 0. Overload this function to return a larger value when you need to update the module version.

Reimplemented in inviwo::AnimationModule, inviwo::BaseGLModule, inviwo::BaseModule, inviwo::FontRenderingModule, inviwo::PlottingGLModule, inviwo::PlottingModule, inviwo::PostProcessingModule, inviwo::VectorFieldVisualizationGLModule, and inviwo::VectorFieldVisualizationModule.

◆ registerCompositeProcessor()

void inviwo::InviwoModule::registerCompositeProcessor ( const std::filesystem::path & file)

Register a workspace file as a CompositeProcessor. The CompositeProcessor will load the file as its sub network on construction.

◆ registerDefaultsForDataType()

template<typename T >
void inviwo::InviwoModule::registerDefaultsForDataType ( )

Utility for register a standard set of ports and processors for a data type T Will register the following ports: DataInport<T> Inport DataInport<T, 0> Multi Inport (accepts multiple input connections) DataInport<T, 0, true> Flat Multi Inport (accepts input connections with vector<shared_ptr<T>>) DataOutport<T> Outport and Sink and Source Processors: CompositeSink<DataInport<T>, DataOutport<T>> CompositeSource<DataInport<T>, DataOutport<T>>

See also
DataInport
DataOutport
CompositeSource
CompositeSink

◆ registerPort()

template<typename T >
void inviwo::InviwoModule::registerPort ( )

Register port type T, PortTraits<T>::classIdentifier has to be defined and return a non empty and unique string. We use reverse DNS for class identifiers, i.e. org.inviwo.classname Prefer using registerDefaultsForDataType to registerPort since it adds support for CompositeProcessor

See also
PortTraits
registerDefaultsForDataType

◆ registerRepresentationConverter()

template<typename BaseRepr >
void inviwo::InviwoModule::registerRepresentationConverter ( std::unique_ptr< RepresentationConverter< BaseRepr > > converter)

Register a representation converter with the respective representation converter factory. The template type BaseRepr is used to select representation converter factory. A representation converter should implement RepresentationConverterType

See also
RepresentationConverterFactory
RepresentationConverter
DataRepresentation
InviwoApplication::getRepresentationConverterFactory()

◆ registerRepresentationConverterFactory()

void inviwo::InviwoModule::registerRepresentationConverterFactory ( std::unique_ptr< BaseRepresentationConverterFactory > converterFactory)

Register a factory for representation converters. Each base representation (Volume Representation, Layer Representation, Buffer Representation, etc) has its own representation converter factory. A converter factory should implement RepresentationConverterFactory

See also
RepresentationConverterFactory
RepresentationConverter
DataRepresentation
InviwoApplication::getRepresentationConverterMetaFactory()

◆ registerRepresentationFactory()

void inviwo::InviwoModule::registerRepresentationFactory ( std::unique_ptr< BaseRepresentationFactory > representationFactory)

Register a factory for representations. Each base representation (Volume Representation, Layer Representation, Buffer Representation, etc) has its own representation factory. A representation factory should implement RepresentationFactory

See also
RepresentationFactory
DataRepresentation
InviwoApplication::getRepresentationMetaFactory()

◆ registerRepresentationFactoryObject()

template<typename BaseRepr >
void inviwo::InviwoModule::registerRepresentationFactoryObject ( std::unique_ptr< RepresentationFactoryObject< BaseRepr > > representation)

Register a representation factory object for creating representations with the respective representation factory. The template type BaseRepr is used to select representation factory. A representation factory object should implement RepresentationFactoryObject

See also
RepresentationFactory
RepresentationFactoryObject
DataRepresentation
InviwoApplication::getRepresentationFactory()

◆ registerSettings() [1/2]

void inviwo::InviwoModule::registerSettings ( Settings * settings)

◆ registerSettings() [2/2]

void inviwo::InviwoModule::registerSettings ( std::unique_ptr< Settings > settings)

Register a Settings class and hand over ownership.

See also
Settings
InviwoApplication::getModuleSettings()

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