scene/tables/plans.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include <array> | ||
| 5 | #include <cstdint> | ||
| 6 | #include <list> | ||
| 7 | #include <memory> | ||
| 8 | #include <mutex> | ||
| 9 | #include <span> | ||
| 10 | #include <string> | ||
| 11 | #include <vector> | ||
| 12 | |||
| 13 | #include "chrono_batch_render/scene/records/products.h" | ||
| 14 | #include "chrono_batch_render/scene/tables/products.h" | ||
| 15 | |||
| 16 | namespace chrono::batch_render { | ||
| 17 | |||
| 18 | 99 | struct PlannedSensorPipeline { | |
| 19 | uint32_t pipeline = kNoPrim; | ||
| 20 | uint32_t sensor = kNoPrim; | ||
| 21 | std::vector<uint32_t> products; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct ProductPlan { | ||
| 25 | uint64_t id = 0; | ||
| 26 | std::vector<std::string> paths; | ||
| 27 | std::vector<std::shared_ptr<const ResolvedProduct>> products; | ||
| 28 | std::array<std::vector<PlannedCapture>, kRenderEntryCount> captures; | ||
| 29 | std::array<uint64_t, kRenderEntryCount> pixelCounts{}; | ||
| 30 | uint32_t captureCount = 0; | ||
| 31 | uint64_t pixelCount = 0; | ||
| 32 | std::vector<Token> taxonomies; | ||
| 33 | std::vector<PlannedSensorPipeline> pipelines; | ||
| 34 | }; | ||
| 35 | |||
| 36 | inline constexpr size_t kCachedPlans = 4; | ||
| 37 | |||
| 38 | 353 | class ProductPlans { | |
| 39 | public: | ||
| 40 | 353 | ProductPlans(Scene& scene, const ProductTable& products) | |
| 41 | 353 | : m_scene(scene), m_products(products) {} | |
| 42 | |||
| 43 | std::shared_ptr<const ProductPlan> Plan(std::span<const std::string> paths); | ||
| 44 | |||
| 45 | private: | ||
| 46 | Scene& m_scene; | ||
| 47 | const ProductTable& m_products; | ||
| 48 | std::mutex m_mutex; | ||
| 49 | std::list<std::shared_ptr<const ProductPlan>> m_plans; | ||
| 50 | uint64_t m_ids = 0; | ||
| 51 | }; | ||
| 52 | |||
| 53 | } | ||
| 54 |