chrono_batch_render/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
9 / 9
100.0%
Branches:
9 / 15
60.0%
Functions:
4 / 4
100.0%

scene/tables/sensors.h
Line Branch Exec Source
1 // SPDX-License-Identifier: BSD-3-Clause
2 #pragma once
3
4 #include <cstdint>
5 #include <span>
6 #include <string_view>
7 #include <vector>
8
9 #include "chrono_batch_render/device/program.h"
10 #include "chrono_batch_render/device/ref.h"
11 #include "chrono_batch_render/scene/records/sensors.h"
12 #include "chrono_batch_render/scene/tables/storage.h"
13 #include "chrono_batch_render/scene/tables/table.h"
14 #include "chrono_batch_render/stage/structure/structure.h"
15
16 namespace chrono::batch_render {
17
18 class SensorTable : public RenderTable {
19 public:
20
5/7
✓ Branch 1 taken 353 times.
✓ Branch 5 taken 353 times.
✓ Branch 9 taken 353 times.
✓ Branch 13 taken 353 times.
✓ Branch 17 taken 353 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
2118 explicit SensorTable(Structure& structure) : m_structure(structure) {}
21
22 928 std::string_view Name() const override {
23 928 return "sensors";
24 }
25
26 std::span<const ColumnRef> Inputs() const override;
27
28 353 std::span<const TableId> TableOutputs() const override {
29 353 static constexpr TableId kTables[] = {TableId::Cameras};
30 353 return kTables;
31 }
32
33 void Prepare() override;
34 void Run(const ChangeSet& changes, TableVersions& versions) override;
35 void Describe(RenderTables& tables) const override;
36
37 928 void Hold(std::vector<Ref<const RefCounted>>& held) const override {
38
4/8
✓ Branch 0 taken 4640 times.
✓ Branch 1 taken 928 times.
✓ Branch 2 taken 4635 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
5568 HoldBuffers(held, {m_cameras.Buffer(), m_distortions.Buffer(), m_detectors.Buffer(),
39 m_lidars.Buffer(), m_radars.Buffer()});
40 1856 }
41
42 private:
43 device::Program& Kernels();
44
45 Structure& m_structure;
46 Ref<device::Program> m_program;
47 DeviceTable<CameraRecord> m_cameras{"camera records"};
48 DeviceTable<DistortionRecord> m_distortions{"distortion records"};
49 DeviceTable<DetectorRecord> m_detectors{"detector records"};
50 DeviceTable<LidarRecord> m_lidars{"lidar records"};
51 DeviceTable<RadarRecord> m_radars{"radar records"};
52 };
53
54 }
55