26#ifndef CAMITKAPPLICATION_H
27#define CAMITKAPPLICATION_H
34#include <QApplication>
110 Application(QString name,
int& argc,
char** argv,
bool autoloadExtension =
true,
bool registerFileExtension =
false,
bool useSplashScreen =
false);
120 bool notify(QObject*, QEvent*)
override;
157 static void restart(QString reason);
188 static Component*
open(
const QString& fileName,
bool blockRefresh =
false);
205 static bool close(
Component* component,
bool blockRefresh =
false);
466 static Action* currentAction;
474 static QDir lastUsedDirectory;
477 static int maxRecentDocuments;
480 static QTranslator* translator;
524 static void setSelected(
Component* component,
bool isSelected);
548 static QSettings settings;
551 static void applyPropertyValues();
554 static void applyMainWindowPropertyValues();
571 static QStack<HistoryItem>& getHistory();
587 static QMap<QString, Action*>& getActionMap();
607 static QMap<QString, Viewer*>& getViewerMap();
621 static void createProperties();
636 static void initResources();
643 bool eventFilter(QObject*
object, QEvent* event)
override;
#define CAMITK_API
Definition CamiTKAPI.h:66
Definition PersistenceManager.h:30
This class describes what is a generic Action extension.
Definition ActionExtension.h:57
Action class is an abstract class that enables you to build a action (generally an algorithm that wor...
Definition Action.h:215
static MainWindow * getMainWindow()
get the main window
Definition Application.cpp:348
static void restart(QString reason)
ask the user and if ok restart the application for the given reason
Definition Application.cpp:384
static void saveHistoryAsSCXML()
Save the history as an SCXML file, stored using.
Definition Application.cpp:1333
static const ViewerList getViewers()
get all the viewers registered in the application (note: the returned ViewerList is guaranteed to be ...
Definition Application.cpp:1140
static QSettings & getSettings()
Get the Core wide settings.
Definition Application.cpp:360
static const int getMaxRecentDocuments()
get the maximal number of recent documents stored
Definition Application.cpp:547
static const ComponentList & getAllComponents()
get the current application wide list of all Components.
Definition Application.cpp:1274
static PropertyObject * getPropertyObject()
Get the property object of the application.
Definition Application.cpp:1717
static void addHistoryItem(HistoryItem item)
Add the history item to the application history.
Definition Application.cpp:1323
static const ActionList getActions()
get all the actions registered in the application (note: the returned ActionList is guaranteed to be ...
Definition Application.cpp:896
static int registerAllViewers(ViewerExtension *)
register all viewers from the given ViewerExtension
Definition Application.cpp:1078
static void clearSelectedComponents()
clear all the selection, i.e call setSelected(false) for all the previously selected components and c...
Definition Application.cpp:1297
static void setTriggeredAction(Action *action)
set the currently triggered action This is used by Action::trigger(..) to refresh all the viewer (the...
Definition Application.cpp:1306
static const ComponentList & getTopLevelComponents()
get the current application wide list of instantiated top-level Components.
Definition Application.cpp:1269
static const QList< QFileInfo > getRecentDocuments()
Get the list of recent documents.
Definition Application.cpp:542
static Viewer * getNewViewer(QString name, QString className)
instantiate a new viewer of the given name and given class name (Viewer inheriting class).
Definition Application.cpp:1120
static void showStatusBarMessage(QString msg, int timeout=0)
Set a message to the status bar.
Definition Application.cpp:437
static Action * getAction(QString)
get a registered action given its name
Definition Application.cpp:968
static void vtkProgressFunction(vtkObject *caller, long unsigned int, void *, void *)
Observer function to be called by vtkFilters and to update progress bar Example of use:
Definition Application.cpp:482
static int unregisterAllActions(ActionExtension *)
unregister all actions from the given ActionExtension
Definition Application.cpp:925
static QString getUniqueComponentName(QString name, const ComponentList &components=getTopLevelComponents())
Get a unique name from the given name in the given componentList.
Definition Application.cpp:1203
static void setLastUsedDirectory(QDir)
set (force) the last used directory
Definition Application.cpp:537
static bool loadWorkspace(const QString &filepath)
load a camitk file and its content into the application
Definition Application.cpp:730
static const QDir getLastUsedDirectory()
Get the last used directory (e.g.
Definition Application.cpp:532
static int registerAllActions(ActionExtension *)
register all actions from the given ActionExtension
Definition Application.cpp:901
static const ComponentList & getSelectedComponents()
get the currently selected Components.
Definition Application.cpp:1279
static Component * openDirectory(const QString &dirName, const QString &pluginName)
load a directory and returns the corresponding Component (returns nullptr if an error occurs)
Definition Application.cpp:651
static Component * open(const QString &fileName, bool blockRefresh=false)
load the filename and returns the corresponding top level Component (returns nullptr if an error occu...
Definition Application.cpp:552
static Viewer * getViewer(QString name)
get the pointer to a registered viewer given its name
Definition Application.cpp:1042
static void resetProgressBar()
Resets the progress bar if it exists.
Definition Application.cpp:455
friend class Component
Definition Application.h:443
friend class PersistenceManager
Definition Application.h:444
static bool hasModified()
Return true if at least one of the opened components has been modified, false otherwise.
Definition Application.cpp:1191
static bool close(Component *component, bool blockRefresh=false)
Close a Component: if it has been changed, ask the user for more information, then if everything is o...
Definition Application.cpp:757
Application(QString name, int &argc, char **argv, bool autoloadExtension=true, bool registerFileExtension=false, bool useSplashScreen=false)
Initializes the window system and constructs a CamiTK application object with argc command line argum...
Definition Application.cpp:84
static bool registerViewer(Viewer *)
register a viewer in the viewer list (therefore allowing it to be refreshed by the main window automa...
Definition Application.cpp:1047
static bool saveWorkspace(const QString &filepath)
save the current workspace to a .camitk file.
Definition Application.cpp:869
static void addRecentDocument(QString)
Add a document to the list of recent documents (e.g.
Definition Application.cpp:497
static bool save(Component *component)
save a component to its file (as given by component->getFileName()).
Definition Application.cpp:806
static int unregisterAllViewers(ViewerExtension *)
unregister all viewers from the given ViewerExtension
Definition Application.cpp:1145
static Action * getTriggeredAction()
get the currently triggered action
Definition Application.cpp:1311
static int exec()
Overriden from QApplication: Enters the main event loop and waits until exit() is called,...
Definition Application.cpp:365
static HistoryItem removeLastHistoryItem()
Remove the last pushed actions in the history of the current pipeline.
Definition Application.cpp:1328
bool notify(QObject *, QEvent *) override
reimplemented from QApplication to catch all exception from external libs used in CEP (e....
Definition Application.cpp:263
static void refresh()
refresh the main window (this will call the refresh method of all viewers)
Definition Application.cpp:425
bool eventFilter(QObject *object, QEvent *event) override
Event filter of this class instance to watch its properties instances.
Definition Application.cpp:1722
void setMainWindow(MainWindow *mw, bool redirect=true)
set the main window.
Definition Application.cpp:294
static bool isAlive(Component *)
does this Component still exist? (components can be deleted)
Definition Application.cpp:1182
static QString getSelectedLanguage()
Returns for the current CamiTK application, the selected language (stored in its ....
Definition Application.cpp:1627
static QString getName()
get the application name
Definition Application.cpp:243
static void setProgressBarValue(int)
set the progress bar value, value should be in [0..100].
Definition Application.cpp:468
This class describes what is a generic Component extension.
Definition ComponentExtension.h:59
HistoryItem class describes the entry of an action used in a pipeline, in the history.
Definition HistoryItem.h:61
This class is the base class for your application.
Definition MainWindow.h:68
This class describes a property object.
Definition PropertyObject.h:72
This class describes a property that can be used in components and actions or any class that needs to...
Definition Property.h:306
CamiTK application splash screen.
Definition SplashScreen.h:44
This class describes what is a generic Action extension.
Definition ViewerExtension.h:85
Viewer is an abstract class that is the base class for all viewers.
Definition Viewer.h:182
QSet< Action * > ActionSet
A set of Action.
Definition CamiTKAPI.h:164
QList< Action * > ActionList
A list of Action.
Definition CamiTKAPI.h:170
QList< Component * > ComponentList
A list of Component.
Definition CamiTKAPI.h:161
QSet< Viewer * > ViewerSet
A set of Viewer.
Definition CamiTKAPI.h:167
QList< Viewer * > ViewerList
A list of Viewer.
Definition CamiTKAPI.h:173