Loading...
Searching...
No Matches
SceneMonitor.hpp
1#pragma once
2#include <Process/Monitoring/Monitor.hpp>
3
4#include <ossia/dataflow/geometry_port.hpp>
5
6#include <atomic>
7#include <cstdint>
8#include <memory>
9#include <string>
10#include <vector>
11
12namespace Gfx::GeometryViewer
13{
16{
17 uint32_t nodes{};
18 uint32_t meshes{};
19 uint32_t primitives{};
20 uint64_t vertices{};
21 uint32_t materials{};
22 uint32_t lights{};
23 uint32_t cameras{};
24 uint32_t instances{};
25
26 bool operator==(const SceneCounts&) const noexcept = default;
27};
28
31{
32 enum class Kind : uint8_t
33 {
34 Node,
35 Mesh,
36 Material,
37 Light,
38 Camera,
39 Skeleton,
40 Animation,
41 Instance,
42 Data,
43 Splat,
44 Voxels,
45 PointCloud,
46 Volume,
47 PrimitiveCloud
48 };
49
51 int32_t parent{-1};
52 Kind kind{};
53 std::string name;
54 std::string details;
56 ossia::aabb bounds{{1.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}};
57};
58
60{
63 uint32_t serial{};
64 SceneCounts counts;
65 std::vector<SceneRow> rows;
66};
67
74{
76
79 std::atomic<int64_t> selected{-1};
80
81 static int64_t selection(uint32_t serial, int32_t row) noexcept
82 {
83 return row < 0 ? -1 : int64_t((uint64_t(serial) << 32) | uint32_t(row));
84 }
85
87 const std::shared_ptr<const SceneSummary>& latest()
88 {
89 summary.consume(m_latest);
90 return m_latest;
91 }
92
93private:
94 std::shared_ptr<const SceneSummary> m_latest;
95};
96}
Definition Monitor.hpp:59
What a scene holds, as the viewer counts it.
Definition SceneMonitor.hpp:16
Definition SceneMonitor.hpp:74
std::atomic< int64_t > selected
Definition SceneMonitor.hpp:79
const std::shared_ptr< const SceneSummary > & latest()
GUI thread: the newest summary, kept for every view that asks.
Definition SceneMonitor.hpp:87
One object of the scene, in the order of a depth-first walk.
Definition SceneMonitor.hpp:31
int32_t parent
Index of the row it is under, -1 for a root.
Definition SceneMonitor.hpp:51
ossia::aabb bounds
Where it is in the space of the scene; empty when it occupies none.
Definition SceneMonitor.hpp:56
Definition SceneMonitor.hpp:60
uint32_t serial
Definition SceneMonitor.hpp:63
Definition Monitor.hpp:27