SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
AppDemoGui.h
Go to the documentation of this file.
1 /**
2  * \file AppDemoGui.h
3  * \brief C++ Header file for the class AppDemoGui.h
4  * \date July 2014
5  * \note https://github.com/cpvrlab/SLProject/wiki/SLProject-Coding-Style
6  * \authors Marcus Hudritsch, Marino von Wattenwyl
7  * \copyright http://opensource.org/licenses/GPL-3.0
8 */
9 
10 #ifndef SLGUIDEMO_H
11 #define SLGUIDEMO_H
12 
13 #include <SL.h>
14 #include <SLTransformNode.h>
15 #include <assimp/ProgressHandler.hpp>
16 
17 class SLScene;
18 class SLSceneView;
19 class SLNode;
20 class SLGLTexture;
21 class SLTexColorLUT;
22 
23 //-----------------------------------------------------------------------------
24 //! ImGui UI class for the UI of the demo applications
25 /* The UI is completely built within this class by calling build function
26 AppDemoGui::build. This build function is passed in the slCreateSceneView and
27 it is called in SLSceneView::onPaint in every frame.<br>
28 The entire UI is configured and built on every frame. That is why it is called
29 "Im" for immediate. See also the SLImGui class to see how it is minimal
30 integrated in the SLProject.<br>
31 */
33 {
34 public:
35  static void clear();
36  static void build(SLScene* s, SLSceneView* sv);
37  static void buildMenuBar(SLScene* s, SLSceneView* sv);
38  static void buildMenuEdit(SLScene* s, SLSceneView* sv);
39  static void buildMenuContext(SLScene* s, SLSceneView* sv);
40  static void buildSceneGraph(SLScene* s);
41  static void addSceneGraphNode(SLScene* s, SLNode* node);
42  static void buildProperties(SLScene* s, SLSceneView* sv);
43  static void showTexInfos(SLGLTexture* tex);
44  static void loadConfig(SLint dotsPerInch);
45  static void saveConfig();
46  static void showLUTColors(SLTexColorLUT* lut);
47  static void setActiveNamedLocation(int locIndex,
48  SLSceneView* sv,
49  SLVec3f lookAtPoint = SLVec3f::ZERO);
50 
51  static SLstring configTime; //!< Time of stored configuration
52  static SLstring infoAbout; //!< About info string
53  static SLstring infoCredits; //!< Credits info string
54  static SLstring infoHelp; //!< Help info string
55  static SLstring infoCalibrate; //!< Calibration info string
56  static SLbool hideUI; //!< Flag if menubar should be shown
57  static SLbool showProgress; //!< Flag if about info should be shown
58  static SLbool showDockSpace; //!< Flag if dock space should be enabled
59  static SLbool showAbout; //!< Flag if about info should be shown
60  static SLbool showHelp; //!< Flag if help info should be shown
61  static SLbool showHelpCalibration; //!< Flag if calibration info should be shown
62  static SLbool showCredits; //!< Flag if credits info should be shown
63  static SLbool showStatsTiming; //!< Flag if timing info should be shown
64  static SLbool showStatsScene; //!< Flag if scene info should be shown
65  static SLbool showStatsVideo; //!< Flag if video info should be shown
66  static SLbool showStatsWAI; //!< Flag if WAI info should be shown
67  static SLbool showImGuiMetrics; //!< Flag if imgui metrics infor should be shown
68  static SLbool showInfosSensors; //!< Flag if device sensors info should be shown
69  static SLbool showInfosDevice; //!< Flag if device info should be shown
70  static SLbool showInfosScene; //!< Flag if scene info should be shown
71  static SLbool showSceneGraph; //!< Flag if scene graph should be shown
72  static SLbool showProperties; //!< Flag if properties should be shown
73  static SLbool showErlebAR; //!< Flag if Christoffel infos should be shown
74  static SLbool showUIPrefs; //!< Flag if UI preferences
75  static SLbool showTransform; //!< Flag if transform dialog should be shown
76  static SLbool showDateAndTime; //!< Flag if date-time dialog should be shown
77  static std::time_t adjustedTime; //!< Adjusted GUI time for sun setting (default 0)
78  static SLstring loadingString; //!< String shown during loading screens
79 
80 private:
81  static void setTransformEditMode(SLScene* s,
82  SLSceneView* sv,
83  SLNodeEditMode editMode);
84  static void removeTransformNode(SLScene* s);
85  static void showHorizon(SLScene* s,
86  SLSceneView* sv);
87  static void hideHorizon(SLScene* s);
89 
90  static void loadSceneWithLargeModel(SLScene* s,
91  SLSceneView* sv,
92  string downloadFilename,
93  string filenameToLoad,
94  SLSceneID sceneIDToLoad);
95  static void downloadModelAndLoadScene(SLScene* s,
96  SLSceneView* sv,
97  string downloadFilename,
98  string urlFolder,
99  string dstFolder,
100  string filenameToLoad,
101  SLSceneID sceneIDToLoad);
102 };
103 //-----------------------------------------------------------------------------
104 #endif
bool SLbool
Definition: SL.h:175
string SLstring
Definition: SL.h:158
int SLint
Definition: SL.h:170
int SLSceneID
Scene identifier.
Definition: SLEnums.h:91
SLNodeEditMode
ImGui UI class for the UI of the demo applications.
Definition: AppDemoGui.h:33
static void loadConfig(SLint dotsPerInch)
Loads the UI configuration.
static SLbool showImGuiMetrics
Flag if imgui metrics infor should be shown.
Definition: AppDemoGui.h:67
static SLstring infoCalibrate
Calibration info string.
Definition: AppDemoGui.h:55
static void showTexInfos(SLGLTexture *tex)
Shows UI infos for a texture.
static void downloadModelAndLoadScene(SLScene *s, SLSceneView *sv, string downloadFilename, string urlFolder, string dstFolder, string filenameToLoad, SLSceneID sceneIDToLoad)
Parallel HTTP download, unzip and load scene job scheduling.
static SLbool hideUI
Flag if menubar should be shown.
Definition: AppDemoGui.h:56
static SLbool showHelpCalibration
Flag if calibration info should be shown.
Definition: AppDemoGui.h:61
static void saveConfig()
Stores the UI configuration.
static void loadSceneWithLargeModel(SLScene *s, SLSceneView *sv, string downloadFilename, string filenameToLoad, SLSceneID sceneIDToLoad)
static SLbool showCredits
Flag if credits info should be shown.
Definition: AppDemoGui.h:62
static SLbool showDateAndTime
Flag if date-time dialog should be shown.
Definition: AppDemoGui.h:76
static SLbool showStatsTiming
Flag if timing info should be shown.
Definition: AppDemoGui.h:63
static SLbool showSceneGraph
Flag if scene graph should be shown.
Definition: AppDemoGui.h:71
static SLbool _horizonVisuEnabled
Definition: AppDemoGui.h:88
static SLbool showUIPrefs
Flag if UI preferences.
Definition: AppDemoGui.h:74
static void showHorizon(SLScene *s, SLSceneView *sv)
Enables calculation and visualization of horizon line (using rotation sensors)
static SLbool showProperties
Flag if properties should be shown.
Definition: AppDemoGui.h:72
static SLbool showErlebAR
Flag if Christoffel infos should be shown.
Definition: AppDemoGui.h:73
static void build(SLScene *s, SLSceneView *sv)
This is the main building function for the GUI of the Demo apps.
Definition: AppDemoGui.cpp:229
static void addSceneGraphNode(SLScene *s, SLNode *node)
Builds the node information once per frame.
static SLbool showTransform
Flag if transform dialog should be shown.
Definition: AppDemoGui.h:75
static void buildSceneGraph(SLScene *s)
Builds the scenegraph dialog once per frame.
static SLstring infoCredits
Credits info string.
Definition: AppDemoGui.h:53
static void setActiveNamedLocation(int locIndex, SLSceneView *sv, SLVec3f lookAtPoint=SLVec3f::ZERO)
Set the a new active named location from SLDeviceLocation.
static void removeTransformNode(SLScene *s)
Searches and removes the transform node.
static void buildMenuEdit(SLScene *s, SLSceneView *sv)
Builds the edit menu that can be in the menu bar and the context menu.
static SLstring loadingString
String shown during loading screens.
Definition: AppDemoGui.h:78
static SLbool showProgress
Flag if about info should be shown.
Definition: AppDemoGui.h:57
static SLbool showInfosSensors
Flag if device sensors info should be shown.
Definition: AppDemoGui.h:68
static SLbool showInfosDevice
Flag if device info should be shown.
Definition: AppDemoGui.h:69
static SLbool showStatsScene
Flag if scene info should be shown.
Definition: AppDemoGui.h:64
static void buildMenuBar(SLScene *s, SLSceneView *sv)
Builds the entire menu bar once per frame.
static void showLUTColors(SLTexColorLUT *lut)
Displays a editable color lookup table wit ImGui widgets.
static SLbool showInfosScene
Flag if scene info should be shown.
Definition: AppDemoGui.h:70
static void clear()
Definition: AppDemoGui.cpp:218
static SLstring infoHelp
Help info string.
Definition: AppDemoGui.h:54
static void hideHorizon(SLScene *s)
Disables calculation and visualization of horizon line.
static void buildProperties(SLScene *s, SLSceneView *sv)
Builds the properties dialog once per frame.
static SLstring configTime
Time of stored configuration.
Definition: AppDemoGui.h:51
static SLstring infoAbout
About info string.
Definition: AppDemoGui.h:52
static std::time_t adjustedTime
Adjusted GUI time for sun setting (default 0)
Definition: AppDemoGui.h:77
static void setTransformEditMode(SLScene *s, SLSceneView *sv, SLNodeEditMode editMode)
Adds a transform node for the selected node and toggles the edit mode.
static SLbool showStatsWAI
Flag if WAI info should be shown.
Definition: AppDemoGui.h:66
static SLbool showHelp
Flag if help info should be shown.
Definition: AppDemoGui.h:60
static SLbool showStatsVideo
Flag if video info should be shown.
Definition: AppDemoGui.h:65
static void buildMenuContext(SLScene *s, SLSceneView *sv)
Builds context menu if right mouse click is over non-imgui area.
static SLbool showAbout
Flag if about info should be shown.
Definition: AppDemoGui.h:59
static SLbool showDockSpace
Flag if dock space should be enabled.
Definition: AppDemoGui.h:58
Texture object for OpenGL texturing.
Definition: SLGLTexture.h:110
SLNode represents a node in a hierarchical scene graph.
Definition: SLNode.h:147
The SLScene class represents the top level instance holding the scene structure.
Definition: SLScene.h:47
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69
SLTexColorLUT defines a lookup table as an 1D texture of (256) RGBA values.
Definition: SLTexColorLUT.h:70
static SLVec3 ZERO
Definition: SLVec3.h:285