Skip to content

Commit

Permalink
Extended and hormonized App documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hudrima1 committed Aug 3, 2024
1 parent 643e349 commit 9a8a655
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 125 deletions.
2 changes: 0 additions & 2 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ function(sl_add_app)
${SL_PROJECT_ROOT}/apps/source/AppCommon.h
${SL_PROJECT_ROOT}/apps/source/SLScene.h
${SL_PROJECT_ROOT}/apps/source/SLInterface.h
${SL_PROJECT_ROOT}/apps/source/Scene.h
${APP_HEADERS}
)

file(GLOB COMMON_SOURCES
${SL_PROJECT_ROOT}/apps/source/CVCapture.cpp
${SL_PROJECT_ROOT}/apps/source/AppCommon.cpp
${SL_PROJECT_ROOT}/apps/source/SLInterface.cpp
${SL_PROJECT_ROOT}/apps/source/SLProjectScene.cpp
${APP_SOURCES}
)

Expand Down
1 change: 1 addition & 0 deletions apps/source/AppCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* \remarks Please use clangformat to format the code. See more code style on
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
*/

#include <App.h>
#include <AppCommon.h>
#include <SL.h>
Expand Down
65 changes: 32 additions & 33 deletions apps/source/AppCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* \brief The AppCommon class holds the top-level instances of the app-demo
* \details For more info on how to create a new app with SLProject see:
* https://github.com/cpvrlab/SLProject4/wiki/Creating-a-New-App
* For more info about App framework see:
* For more info about App framework see:
* https://cpvrlab.github.io/SLProject4/app-framework.html
* \date February 2018
* \authors Marcus Hudritsch
* \copyright http://opensource.org/licenses/GPL-3.0
* \remarks Please use clangformat to format the code. See more code style on
* https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
*/
*/

#ifndef SLAPPCOMMON_H
#define SLAPPCOMMON_H
Expand All @@ -37,14 +37,14 @@ class SLUiInterface;
using std::optional;

//-----------------------------------------------------------------------------
//! Top level class for an SLProject application.
//! Top level class for the major global instances off an SLProject app.
/*!
The AppCommon holds static instances of top-level items such as the asset
manager, the scene pointer, the vector of all sceneviews, the gui pointer,
the camera calibration objects and the device rotation and location
information.<br>
The static function createApp is called by the C-interface functions
slCreateApp and the function deleteApp by slTerminate. At the moment only
The static function createApp is called by the C-interface functions
slCreateApp and the function deleteApp by slTerminate. At the moment only
one scene can be open at the time.
<br>
AppCommon holds two static video camera calibrations, one for a main camera
Expand All @@ -55,38 +55,39 @@ class AppCommon
{
public:
// Major owned instances of the app
static SLInputManager inputManager; //!< Input events manager
static SLAssetManager* assetManager; //!< asset manager is the owner of all assets
static SLAssetLoader* assetLoader; //!< responsible for async asset loading
static SLScene* scene; //!< scene pointer
static SLVSceneView sceneViews; //!< vector of sceneview pointers
static SLUiInterface* gui; //!< gui pointer
static SLDeviceRotation devRot; //!< Mobile device rotation from IMU
static SLDeviceLocation devLoc; //!< Mobile device location from GPS
static optional<SLSceneID> sceneToLoad; //!< scene id to load at start up
static SLInputManager inputManager; //!< Input events manager
static SLAssetManager* assetManager; //!< asset manager is the owner of all assets
static SLAssetLoader* assetLoader; //!< Asset-loader for async asset loading
static SLScene* scene; //!< Pointer to the one and only SLScene instance
static SLVSceneView sceneViews; //!< Vector of sceneview pointers
static SLUiInterface* gui; //!< Pointer to the GUI
static SLDeviceRotation devRot; //!< Mobile device rotation from IMU
static SLDeviceLocation devLoc; //!< Mobile device location from GPS

static void createApp(SLstring appName);
static void registerCoreAssetsLoad();
static void switchScene(SLSceneView* sv, SLSceneID sceneID);
static void deleteApp();

static SLstring name; //!< Application name
static SLstring appTag; //!< Tag string used in logging
static SLstring version; //!< SLProject version string
static SLstring asciiLabel; //!< SLProject ascii label string
static SLstring configuration; //!< Debug or Release configuration
static SLstring gitBranch; //!< Current GIT branch
static SLstring gitCommit; //!< Current GIT commit short hash id
static SLstring gitDate; //!< Current GIT commit date
static SLstring exePath; //!< executable root path
static SLstring configPath; //!< Default path for calibration files
static SLstring externalPath; //!< Default path for external file storage
static SLstring dataPath; //!< Path to data directory (it is set platform dependent)
static SLstring shaderPath; //!< Path to GLSL shader programs
static SLstring modelPath; //!< Path to 3D models
static SLstring texturePath; //!< Path to texture images
static SLstring fontPath; //!< Path to font images
static SLstring videoPath; //!< Path to video files
static SLstring name; //!< Application name
static SLstring appTag; //!< Tag string used in logging
static SLstring version; //!< SLProject version string
static SLstring asciiLabel; //!< SLProject ascii label string
static SLstring configuration; //!< Debug or Release configuration
static SLstring gitBranch; //!< Current GIT branch
static SLstring gitCommit; //!< Current GIT commit short hash id
static SLstring gitDate; //!< Current GIT commit date
static SLstring exePath; //!< executable root path
static SLstring configPath; //!< Default path for calibration files
static SLstring externalPath; //!< Default path for external file storage
static SLstring dataPath; //!< Path to data directory (it is set platform dependent)
static SLstring shaderPath; //!< Path to GLSL shader programs
static SLstring modelPath; //!< Path to 3D models
static SLstring texturePath; //!< Path to texture images
static SLstring fontPath; //!< Path to font images
static SLstring videoPath; //!< Path to video files
static SLSceneID sceneID; //!< ID of currently loaded scene
static optional<SLSceneID> sceneToLoad; //!< Scene id to load at start up

// static methods for parallel job processing
static void handleParallelJob();
Expand All @@ -97,8 +98,6 @@ class AppCommon
static int jobProgressNum() { return _jobProgressNum; }
static int jobProgressMax() { return _jobProgressMax; }

static SLSceneID sceneID; //!< ID of last loaded scene

static map<string, string> deviceParameter; //!< Generic device parameter
static deque<function<void(void)>> jobsToBeThreaded; //!< Queue of functions to be executed in a thread
static deque<function<void(void)>> jobsToFollowInMain; //!< Queue of function to follow in the main thread
Expand Down
39 changes: 19 additions & 20 deletions docs/images/SLProject.mdj
Original file line number Diff line number Diff line change
Expand Up @@ -27979,7 +27979,7 @@
"top": 24,
"width": 153,
"height": 177,
"text": "Application code split in platform independent (C/C++) code (light gray boxes) and platform dependent code (C/C++, Java or Objective C) in dark gray boxes. Supported platforms are: GLFW (desktop OS), Emscripten (Web), iOS and Android."
"text": "Application code split in platform independent (C/C++) code (light brown boxes) and platform dependent code (C/C++, Java or Objective C) in dark brown boxes. Supported platforms are: GLFW (desktop OS), Emscripten (Web), iOS and Android."
},
{
"_type": "UMLClassView",
Expand Down Expand Up @@ -28008,7 +28008,7 @@
"$ref": "AAAAAAFs2JHSOnGRR7w="
},
"visible": false,
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 864,
"top": -80,
Expand All @@ -28020,7 +28020,7 @@
"_parent": {
"$ref": "AAAAAAFs2JHSOnGRR7w="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;1",
"left": 445,
"top": 31,
Expand All @@ -28035,7 +28035,7 @@
"$ref": "AAAAAAFs2JHSOnGRR7w="
},
"visible": false,
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 864,
"top": -80,
Expand All @@ -28050,15 +28050,15 @@
"$ref": "AAAAAAFs2JHSOnGRR7w="
},
"visible": false,
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 864,
"top": -80,
"height": 13,
"horizontalAlignment": 1
}
],
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 440,
"top": 24,
Expand Down Expand Up @@ -28096,7 +28096,7 @@
"model": {
"$ref": "AAAAAAFs2JQVNKp+XQI="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 54,
Expand All @@ -28106,7 +28106,7 @@
"horizontalAlignment": 0
}
],
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 440,
"top": 49,
Expand All @@ -28132,7 +28132,7 @@
"model": {
"$ref": "AAAAAAFs2JPjhKSGySk="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 77,
Expand All @@ -28150,7 +28150,7 @@
"model": {
"$ref": "AAAAAAFs2KUTYyly5Go="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 92,
Expand All @@ -28168,7 +28168,7 @@
"model": {
"$ref": "AAAAAAFs2JTCB7HVIC4="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 107,
Expand All @@ -28186,7 +28186,7 @@
"model": {
"$ref": "AAAAAAFs2JUlCbfNDpE="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 122,
Expand All @@ -28204,7 +28204,7 @@
"model": {
"$ref": "AAAAAAFs4d04ZM9d42Q="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 137,
Expand All @@ -28222,7 +28222,7 @@
"model": {
"$ref": "AAAAAAFs2JXTn8jGmqs="
},
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 445,
"top": 152,
Expand All @@ -28241,7 +28241,7 @@
"$ref": "AAAAAAFs2Ka1zkOazmQ="
},
"visible": false,
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 701,
"top": 167,
Expand All @@ -28251,7 +28251,7 @@
"horizontalAlignment": 0
}
],
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 440,
"top": 72,
Expand All @@ -28268,7 +28268,7 @@
"$ref": "AAAAAAFs2JHSOnGOo7U="
},
"visible": false,
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 432,
"top": -40,
Expand All @@ -28285,15 +28285,15 @@
"$ref": "AAAAAAFs2JHSOnGOo7U="
},
"visible": false,
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"left": 432,
"top": -40,
"width": 10,
"height": 10
}
],
"fillColor": "#f6d678",
"fillColor": "#daac20",
"font": "Arial;13;0",
"containerChangeable": true,
"left": 440,
Expand Down Expand Up @@ -35201,7 +35201,6 @@
"propertyLabel": {
"$ref": "AAAAAAGRE1Ge9wOL1sY="
},
"showEndOrder": "hide",
"tailRoleNameLabel": {
"$ref": "AAAAAAGRE1Ge9wOMnTk="
},
Expand Down
2 changes: 1 addition & 1 deletion docs/images/SLProject_UML_min.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/images/app_framework.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9a8a655

Please sign in to comment.