SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
WAIAppTest.h
Go to the documentation of this file.
1 #ifndef WAI_APP_TEST_H
2 #define WAI_APP_TEST_H
3 
4 #include <string>
6 #include <SLGLTexture.h>
7 #include <SLCamera.h>
8 
9 class SLSceneView;
10 class SENSCamera;
11 
12 //-----------------------------------------------------------------------------
14 {
15  std::string writableDir;
16  std::string waiDataRoot;
17  std::string slDataRoot;
18  std::string vocabularyDir;
19  std::string logFileDir;
20 };
21 //-----------------------------------------------------------------------------
22 //! Implements app functionality (e.g. scene description, which camera, how to start and use WAISlam)
24 {
25 public:
26  using CloseAppCallback = std::function<void()>;
27 
28  WAIApp();
29 
30  void init(int screenWidth,
31  int screenHeight,
32  int screenDpi,
33  AppDirectories directories);
35  void initCamera(SENSCamera* camera);
36 
37  bool update();
38  void close();
39 
40  // back button pressed
41  void goBack();
42 
43 private:
44  void initSceneCamera();
45  void initDirectories(AppDirectories directories);
46 
47  // initialize SLScene, SLSceneView and UI
48  void initSceneGraph(int scrWidth, int scrHeight, int dpi);
49  void initIntroScene();
50  void deleteSceneGraph();
51 
52  SENSCamera* _camera = nullptr;
53 
54  SLSceneView* _sv = nullptr;
55  SLCamera* _sceneCamera = nullptr;
57 
59 
60  // implanted callback from WaiApp to system to
62 
63  bool _goBackRequested = false;
64  bool _initSceneGraphDone = false;
65  bool _initIntroSceneDone = false;
66 };
67 //-----------------------------------------------------------------------------
68 #endif // WAI_APP_TEST_H
static SLint dpi
Dot per inch resolution of screen.
Definition: AppGLFW.cpp:41
static SLint scrHeight
Window height at start up.
Definition: AppGLFW.cpp:38
static SLint scrWidth
Window width at start up.
Definition: AppGLFW.cpp:37
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
Active or visible camera node class.
Definition: SLCamera.h:54
Texture object for OpenGL texturing.
Definition: SLGLTexture.h:110
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69
Implements app functionality (e.g. scene description, which camera, how to start and use WAISlam)
Definition: WAIAppTest.h:24
SENSCamera * _camera
Definition: WAIAppTest.h:52
SLGLTexture * _videoImage
Definition: WAIAppTest.h:56
void initSceneCamera()
Definition: WAIAppTest.cpp:220
void init(int screenWidth, int screenHeight, int screenDpi, AppDirectories directories)
Definition: WAIAppTest.cpp:35
void initIntroScene()
Definition: WAIAppTest.cpp:236
bool _goBackRequested
Definition: WAIAppTest.h:63
void initDirectories(AppDirectories directories)
Definition: WAIAppTest.cpp:80
std::function< void()> CloseAppCallback
Definition: WAIAppTest.h:26
void initCloseAppCallback(CloseAppCallback cb)
Definition: WAIAppTest.cpp:53
void deleteSceneGraph()
Definition: WAIAppTest.cpp:210
void close()
Definition: WAIAppTest.cpp:196
void goBack()
Definition: WAIAppTest.cpp:203
bool _initIntroSceneDone
Definition: WAIAppTest.h:65
AppDirectories _dirs
Definition: WAIAppTest.h:58
bool _initSceneGraphDone
Definition: WAIAppTest.h:64
void initCamera(SENSCamera *camera)
Definition: WAIAppTest.cpp:58
void initSceneGraph(int scrWidth, int scrHeight, int dpi)
Definition: WAIAppTest.cpp:93
SLCamera * _sceneCamera
Definition: WAIAppTest.h:55
SLSceneView * _sv
Definition: WAIAppTest.h:54
CloseAppCallback _closeAppCallback
Definition: WAIAppTest.h:61
bool update()
Definition: WAIAppTest.cpp:124
std::string logFileDir
Definition: WAIAppTest.h:19
std::string writableDir
Definition: WAIAppTest.h:15
std::string waiDataRoot
Definition: WAIAppTest.h:16
std::string slDataRoot
Definition: WAIAppTest.h:17
std::string vocabularyDir
Definition: WAIAppTest.h:18