-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCSceneWindow.h
More file actions
73 lines (58 loc) · 2.07 KB
/
CSceneWindow.h
File metadata and controls
73 lines (58 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright (C) 2025-2026 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h
#ifndef _NBL_THIS_EXAMPLE_C_SCENE_WINDOW_H_INCLUDED_
#define _NBL_THIS_EXAMPLE_C_SCENE_WINDOW_H_INCLUDED_
#include "imgui.h"
#include <functional>
#include <string>
#include <vector>
namespace nbl::this_example
{
// Forward declarations
class CScene;
class CSession;
}
namespace nbl::this_example::gui
{
class CSceneWindow final
{
public:
// Callbacks for user actions - main app handles the actual logic
struct SCallbacks
{
std::function<void(size_t sensorIndex)> onSensorSelected = nullptr;
std::function<void(const std::string& path)> onLoadRequested = nullptr;
std::function<void()> onReloadRequested = nullptr;
};
void setCallbacks(const SCallbacks& callbacks) { m_callbacks = callbacks; }
CSceneWindow() = default;
~CSceneWindow() = default;
// Set the scene to display (can be null)
void setScene(const CScene* scene) { m_scene = scene; }
// Get current scene path for display
void setScenePath(const std::string& path) { m_scenePath = path; }
// Main draw call - renders the window
// forceReposition: if true, window will reposition to default location
void draw(bool forceReposition = false);
// Current selection state
int getSelectedSensorIndex() const { return m_selectedSensorIndex; }
void setSelectedSensorIndex(int idx) { m_selectedSensorIndex = idx; }
// Window visibility
bool isOpen() const { return m_isOpen; }
void setOpen(bool open) { m_isOpen = open; }
private:
const CScene* m_scene = nullptr;
std::string m_scenePath = "";
int m_selectedSensorIndex = -1;
bool m_isOpen = true;
SCallbacks m_callbacks;
// Section drawing helpers
void drawLoadSection();
void drawSensorsSection();
void drawGlobalsSection();
void drawEmittersSection();
void drawEditorSection();
};
} // namespace nbl::this_example::gui
#endif // _NBL_THIS_EXAMPLE_C_SCENE_WINDOW_H_INCLUDED_