Commit 47480f53 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED some api doc

parent 3f1a5e27
......@@ -81,7 +81,7 @@ class ViewerDockStyle;
*
* The viewer's icon is displayed inside the dock window.
*
* Unregistered viewers are managed independently of the CamiTK Application logic. In this case it should managed separately
* Unregistered viewers are managed independently of the CamiTK Application logic. In this case it should be managed separately
* and it is not connected to the automatic refresh chain. This is a special (rare) use case. If you think this is what you
* need, then you will have to programmatically/specifically manage the content of the viewer and its refresh logic.
*
......@@ -95,6 +95,44 @@ class ViewerDockStyle;
* or as the central widget). The viewer toolbar is visible by default.
* If you don't want to show the viewer toolbar in your main window, even if the viewer's widget is visible,
* set its visibility to false.
*
* ### Using viewers
*
* In a viewer extension, the default behaviour is to have one instance of the Viewer inherited class.
* E.g. if FooBarViewer inherits from the Viewer class, then one default instance of the class, called
* "Foo Bar Viewer", is available when the extension is loaded.
*
* To get the default FooBarViewer instance, use Application::getViewer("Foo Bar Viewer").
*
* One simple way of checking that a viewer extension is available, is to check the return value
* of Application::getViewer(...), e.g. some code inside a MainWindow inherited class constructor:
*
* \code
* #include <FooBarViewer.h>
* #include <Log.h>
* ...
*
* FooBarViewer* fooBarViewer = dynamic_cast<FooBarViewer*>(Application::getViewer("Foo Bar Viewer"));
* if (fooBarViewer != nullptr) {
* // everything is ok, the FooBar viewer extension is available, add it to the right docker, not visibile by default
* addDockViewer(Qt::RightDockWidgetArea, fooBarViewer);
* showDockViewer(fooBarViewer, false);
* }
* else {
* CAMITK_ERROR(tr("Cannot find \"Foo Bar Viewer\". This viewer is mandatory for running this application."))
* }
* \endcode
*
* \note
* If your action or component requires a specific viewer, you need to add the following argument to the
* `camitk_extension` macro of your extension's `CMakeLists.txt`:
* \code
* camitk_extension(...
* NEEDS_VIEWER_EXTENSION foobarviewer
* ...
* )
* \endcode
*
*/
class CAMITK_API Viewer : public QObject {
Q_OBJECT
......
......@@ -69,12 +69,15 @@ class Viewer;
*
* Using registerDefaultViewer registers the class and instantiate a default viewer of the same name.
* \note the default viewer's name is the same as the class name with all words separated by spaces.
*
* This is important as this name will be shown in the GUI.
* Therefore:
* \code
* registerDefaultViewer(FooBarViewer);
* \endcode
* will instantiate the default FooBarViewer viewer called "Foo Bar Viewer".
*
* To get the default FooBarViewer instance, use Application::getViewer("Foo Bar Viewer").
*
* @see BasicMeshExtension For an example of an extension registering more than one actions
*/
......
......@@ -47,13 +47,16 @@
* @brief
* ActionViewer is the viewer used to manage the actions.
*
* By default all action widgets are displayed in this viewer widget (in the stackedWidget).
* By default all action widgets are displayed in this viewer widget (in the QStackedWidget).
* There is also a search panel to find an action to apply to the currently selected component.
* The search panel is not not shown by default. Use setSearchPanelVisible(true) to show it.
* The search panel is shown by default. Use setSearchPanelVisible(false) to hide it.
*
* This viewer also manages a singleton (THE CamiTK action viewer). See getInstance() for more information.
* You do not have to use it, but it is convienent (and sometimes preferable) to use this instance
* instead of creating your own one.
* \note
* This is a very special viewer as it calls setComponents(...) method with an empty list.
* This means that this viewer is going to be notified/refreshed every time the
* current selected action is changed (i.e., anytime an action is triggered).
*
* Use Application::getViewer("Action Viewer") To get the default instance of this viewer.
*/
class ACTIONVIEWER_API ActionViewer : public camitk::Viewer {
Q_OBJECT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment