Class SBDApp#
This class is the base class for apps. More...
#include "SBDApp.hpp"
Inherits the following classes: SBCReferenceTarget
Public Functions#
Type | Name |
---|---|
SBDApp () Constructs an app. |
|
virtual void | display (SBNode::RenderingPass renderingPass) To display elements related to the app. |
SBDAppData * | getDataPointer () |
const SBDAppData * | getDataPointer () const |
SBGApp * | getGUI () const Returns a pointer to the GUI of the app. |
virtual void | onDocumentEvent (SBDocumentEvent * event) Handles document events. |
void | setGUI (SBGApp * gui) Sets the pointer to the GUI of the app. |
virtual | ~SBDApp () Destructs the app. |
Public Functions inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTarget () Builds the reference target. |
|
unsigned int | getMemoryFootprint () const Returns the memory footprint. |
void | printReferencesToOwners () const Prints the references to the owners of this reference target. |
virtual | ~SBCReferenceTarget () Destructor. |
Protected Attributes inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTargetData * | dataPointer A pointer to the private data. |
Protected Functions inherited from SBCReferenceTarget#
Type | Name |
---|---|
SBCReferenceTarget (SBCReferenceTargetData * dataPointer) Protected constructor. |
|
void | removeAllReferenceOwners () Stops all the reference owners from referencing this reference target. |
Detailed Description#
This class is the base class for all apps in SAMSON.
Apps are classes that may provide any type of functionality to SAMSON users. An app may be e.g. a connector to an external executable or web service, may wrap previously developed code to integrate its functionality with SAMSON and other SAMSON Extensions, or provide entirely new functionality based on the SAMSON Application Programming Interface (API). When SAMSON loads an app during startup, it includes it in the app menu and the app toolbar. When users open an app from the app menu or app toolbar, the Graphical User Interface (GUI) of the app appears, and the user may start using it.
You can overload the display function to have your app render things in the viewport. You can also overload the onDocumentEvent function to handle document events, including when the active document changes, or when nodes are added and removed from a document.
An app is typically implemented by writing two classes:
- one that derives from the SBDApp class, to implement the core functionality of the app (i.e. the functions that may be exposed to SAMSON and SAMSON Extensions through the Introspection)
- one that derives from the SBGApp class, to implement the GUI of the App (i.e. the widgets used to visually interact with the app).
Please refer to the documentation about the SAMSON Extension Generator and the Tutorials for more information about writing new apps for SAMSON.
Short name: SBApp
See also: SAMSON Extensions, Tutorials, SBGApp
Public Functions Documentation#
function SBDApp#
Constructs an app.
function display#
To display elements related to the app.
function getDataPointer [1/2]#
function getDataPointer [2/2]#
function getGUI#
Returns a pointer to the GUI of the app.
function onDocumentEvent#
Handles document events.
function setGUI#
Sets the pointer to the GUI of the app.
function ~SBDApp#
Destructs the app.