Inviwo 0.9.12-pre
Inviwo documentation
|
The main application which holds the instances of all modules. More...
#include <inviwoapplication.h>
Classes | |
struct | Queue |
Public Types | |
enum class | LongWait { Start , Update , End } |
Public Member Functions | |
InviwoApplication (std::string_view displayName) | |
InviwoApplication (int argc, char **argv, std::string_view displayName) | |
InviwoApplication (const InviwoApplication &rhs)=delete | |
InviwoApplication & | operator= (const InviwoApplication &that)=delete |
void | registerModules (std::vector< std::unique_ptr< InviwoModuleFactoryObject > > modules) |
Registers modules from factories and takes ownership of input module factories. Module is registered if dependencies exist and they have correct version. | |
void | registerModules (RuntimeModuleLoading) |
Load modules from dynamic library files in the regular search paths. | |
void | registerModules (RuntimeModuleLoading, std::function< bool(std::string_view)> isEnabled) |
std::filesystem::path | getBasePath () const |
std::filesystem::path | getPath (PathType pathType, const std::string &suffix="", const bool &createFolder=false) |
ModuleManager & | getModuleManager () |
const ModuleManager & | getModuleManager () const |
template<class T > | |
T * | getModuleByType () const |
InviwoModule * | getModuleByIdentifier (const std::string &identifier) const |
ProcessorNetwork * | getProcessorNetwork () |
ProcessorNetworkEvaluator * | getProcessorNetworkEvaluator () |
WorkspaceManager * | getWorkspaceManager () |
PropertyPresetManager * | getPropertyPresetManager () |
PortInspectorManager * | getPortInspectorManager () |
DataVisualizerManager * | getDataVisualizerManager () |
CommandLineParser & | getCommandLineParser () |
const CommandLineParser & | getCommandLineParser () const |
virtual void | addCallbackAction (ModuleCallbackAction *callbackAction) |
Add an action that can be shown in for example property widget context menu. Will be shown when right clicking on a property in the NetworkEditor. Added callbacks will be removed in ~InviwoModule when your module is destroyed. Example if you want to do it earlier: | |
virtual std::vector< std::unique_ptr< ModuleCallbackAction > > & | getCallbackActions () |
Get list of ModuleCallbackAction shown in for example property widget context menu. Do not keep references to elements in the list around since you cannot be notified when they will be removed. | |
std::vector< Settings * > | getModuleSettings () |
SystemSettings & | getSystemSettings () |
template<class T > | |
T * | getSettingsByType () |
std::vector< Capabilities * > | getModuleCapabilities () |
template<class T > | |
T * | getCapabilitiesByType () |
std::locale | getUILocale () const |
void | setUILocale (const std::locale &locale) |
template<class F , class... Args> | |
auto | dispatchPool (F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > > |
template<class F , class... Args> | |
auto | dispatchFront (F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > > |
void | dispatchFrontAndForget (std::function< void()> fun) |
size_t | processFront () |
void | processEvents () |
void | setProcessEventsCallback (std::function< void()> callback) |
size_t | getPoolSize () const |
void | resizePool (size_t newSize) |
void | setPoolResizeWaitCallback (std::function< void(LongWait)> callback) |
void | waitForPool () |
void | setPostEnqueueFront (std::function< void()> func) |
void | setProgressCallback (std::function< void(std::string_view)> progressCallback) |
ThreadPool & | getThreadPool () |
ResourceManager * | getResourceManager () |
void | setFileSystemObserver (std::unique_ptr< FileSystemObserver > observer) |
FileSystemObserver * | getFileSystemObserver () const |
TimerThread & | getTimerThread () |
const std::string & | getDisplayName () const |
virtual void | printApplicationInfo () |
void | postProgress (std::string_view progress) const |
LayerRamResizer * | getLayerRamResizer () const |
void | setLayerRamResizer (LayerRamResizer *obj) |
Public Member Functions inherited from inviwo::Singleton< InviwoApplication > | |
Singleton (const Singleton &)=delete | |
void | operator= (const Singleton &)=delete |
Protected Attributes | |
std::string | displayName_ |
std::unique_ptr< CommandLineParser > | commandLineParser_ |
std::shared_ptr< ConsoleLogger > | consoleLogger_ |
std::shared_ptr< FileLogger > | filelogger_ |
std::function< void(std::string_view)> | progressCallback_ |
std::unique_ptr< FileSystemObserver > | fileSystemObserver_ |
std::locale | uiLocale_ {} |
std::function< void(LongWait)> | poolResizeCallback_ |
std::function< void()> | processEventsCallback_ |
ThreadPool | pool_ |
Queue | queue_ |
util::OnScopeExit | clearAllSingeltons_ |
std::unique_ptr< ResourceManager > | resourceManager_ |
std::unique_ptr< CameraFactory > | cameraFactory_ |
std::unique_ptr< DataReaderFactory > | dataReaderFactory_ |
std::unique_ptr< DataWriterFactory > | dataWriterFactory_ |
std::unique_ptr< DialogFactory > | dialogFactory_ |
std::unique_ptr< MeshDrawerFactory > | meshDrawerFactory_ |
std::unique_ptr< MetaDataFactory > | metaDataFactory_ |
std::unique_ptr< OutportFactory > | outportFactory_ |
std::unique_ptr< InportFactory > | inportFactory_ |
std::unique_ptr< PortInspectorFactory > | portInspectorFactory_ |
std::unique_ptr< DataVisualizerManager > | dataVisualizerManager_ |
std::unique_ptr< ProcessorFactory > | processorFactory_ |
std::unique_ptr< ProcessorWidgetFactory > | processorWidgetFactory_ |
std::unique_ptr< PropertyConverterManager > | propertyConverterManager_ |
std::unique_ptr< PropertyFactory > | propertyFactory_ |
std::unique_ptr< PropertyWidgetFactory > | propertyWidgetFactory_ |
std::unique_ptr< RepresentationMetaFactory > | representationMetaFactory_ |
std::unique_ptr< RepresentationConverterMetaFactory > | representationConverterMetaFactory_ |
std::unique_ptr< SystemSettings > | systemSettings_ |
std::vector< std::unique_ptr< ModuleCallbackAction > > | moduleCallbackActions_ |
ModuleManager | moduleManager_ |
std::unique_ptr< ProcessorNetwork > | processorNetwork_ |
std::unique_ptr< ProcessorNetworkEvaluator > | processorNetworkEvaluator_ |
std::unique_ptr< WorkspaceManager > | workspaceManager_ |
std::unique_ptr< PropertyPresetManager > | propertyPresetManager_ |
std::unique_ptr< PortInspectorManager > | portInspectorManager_ |
WorkspaceManager::ClearHandle | networkClearHandle_ |
WorkspaceManager::SerializationHandle | networkSerializationHandle_ |
WorkspaceManager::DeserializationHandle | networkDeserializationHandle_ |
WorkspaceManager::ClearHandle | presetsClearHandle_ |
WorkspaceManager::SerializationHandle | presetsSerializationHandle_ |
WorkspaceManager::DeserializationHandle | presetsDeserializationHandle_ |
std::unique_ptr< TimerThread > | timerThread_ |
LayerRamResizer * | layerRamResizer_ |
Additional Inherited Members | |
Static Public Member Functions inherited from inviwo::Singleton< InviwoApplication > | |
static void | init () |
static void | init (InviwoApplication *instance) |
static InviwoApplication * | getPtr () |
static void | deleteInstance () |
static bool | isInitialized () |
The main application which holds the instances of all modules.
All modules should be owned and accessed trough this singleton, as well as the processor network and the evaluator.
|
virtual |
Add an action that can be shown in for example property widget context menu. Will be shown when right clicking on a property in the NetworkEditor. Added callbacks will be removed in ~InviwoModule when your module is destroyed. Example if you want to do it earlier:
auto inviwo::InviwoApplication::dispatchFront | ( | F && | f, |
Args &&... | args ) -> std::future<std::invoke_result_t<F, Args...>> |
Enqueue a functor to be run in the GUI thread
void inviwo::InviwoApplication::dispatchFrontAndForget | ( | std::function< void()> | fun | ) |
Enqueue a functor to be run in the GUI thread.
std::filesystem::path inviwo::InviwoApplication::getBasePath | ( | ) | const |
Get the base path of the application. i.e. where the core data and modules folder and etc are.
|
virtual |
Get list of ModuleCallbackAction shown in for example property widget context menu. Do not keep references to elements in the list around since you cannot be notified when they will be removed.
|
inline |
Camera factory
|
inline |
DataReader factory
|
inline |
DataWriter factory
|
inline |
Dialog factory
|
inline |
Inport factory
LayerRamResizer * inviwo::InviwoApplication::getLayerRamResizer | ( | ) | const |
Get the current LayerRamResizer
|
inline |
MeshDrawer factory
|
inline |
MetaData factory
std::vector< Capabilities * > inviwo::InviwoApplication::getModuleCapabilities | ( | ) |
Retrieve all Capabilities from all modules, and the system capabilities
std::vector< Settings * > inviwo::InviwoApplication::getModuleSettings | ( | ) |
Retrieve all Settings from all modules including the SystemSettings
|
inline |
Outport factory
std::filesystem::path inviwo::InviwoApplication::getPath | ( | PathType | pathType, |
const std::string & | suffix = "", | ||
const bool & | createFolder = false ) |
Get basePath + pathType + suffix.
pathType | Enum for type of path |
suffix | Path extension |
createFolder | whether to create the folder if it does not exist. |
size_t inviwo::InviwoApplication::getPoolSize | ( | ) | const |
Get the current number of worker threads in the thread pool
|
inline |
PortInspector factory
|
inline |
Processor factory
|
inline |
ProcessorWidget factory
|
inline |
|
inline |
Property factory
|
inline |
PropertyWidget factory
RepresentationConverterFactory< BaseRepr > * inviwo::InviwoApplication::getRepresentationConverterFactory | ( | ) | const |
|
inline |
RepresentationFactory< BaseRepr > * inviwo::InviwoApplication::getRepresentationFactory | ( | ) | const |
|
inline |
|
inline |
Returns the ResourceManager owned the InviwoApplication
void inviwo::InviwoApplication::registerModules | ( | RuntimeModuleLoading | ) |
Load modules from dynamic library files in the regular search paths.
Will recursively search for all dll/so/dylib/bundle files in the regular search paths. The library filename must contain "inviwo-module" to be loaded.
void inviwo::InviwoApplication::resizePool | ( | size_t | newSize | ) |
Set the number of worker threads in the thread pool. This will block for working threads to finish
void inviwo::InviwoApplication::setFileSystemObserver | ( | std::unique_ptr< FileSystemObserver > | observer | ) |
Sets the a FileSystemObserver for the application The FileObservers will register themselves in the FileSystemObserver of the InviwoApplication by default. Usually one would set the FileSystemObserver in the main function just after creating the app. By default the FileSystemObserver is nullptr, and no file observation is provided.
void inviwo::InviwoApplication::setLayerRamResizer | ( | LayerRamResizer * | obj | ) |
Allow a module the register a LayerRamResizer with the inviwoapplication. The module is responsible for unregistering the LayerRamResizer before it is removed, by calling setLayerRamResizer(nullptr)
, if the current LayerRamResizer was registered by that module.