62 std::shared_ptr<GpuSync::MeshWriterNode> node,
63 std::optional<uint32_t> parent = std::nullopt);
69 [[nodiscard]]
MeshSlot& get_slot(uint32_t index);
70 [[nodiscard]]
const MeshSlot& get_slot(uint32_t index)
const;
76 [[nodiscard]]
MeshSlot* find_slot(std::string_view name);
77 [[nodiscard]]
const MeshSlot* find_slot(std::string_view name)
const;
83 [[nodiscard]] std::optional<uint32_t> find_slot_index(std::string_view name)
const;
88 [[nodiscard]]
size_t slot_count()
const {
return m_slots.size(); }
93 [[nodiscard]]
const std::vector<MeshSlot>&
slots()
const {
return m_slots; }
94 [[nodiscard]] std::vector<MeshSlot>&
slots() {
return m_slots; }
100 void process_batch(
unsigned int num_samples)
override;
101 void reset()
override;
104 [[nodiscard]] std::optional<double> get_node_output(
size_t index)
const override;
105 [[nodiscard]] std::unordered_map<std::string, std::string> get_metadata()
const override;
115 void set_operator(std::shared_ptr<NetworkOperator> op);
122 template <
typename OpType,
typename... Args>
125 auto op = std::make_shared<OpType>(std::forward<Args>(args)...);
132 return m_operator.get();
137 return m_operator.get();
142 return m_operator !=
nullptr;
149 [[nodiscard]]
const std::vector<uint32_t>&
sorted_indices()
const {
return m_sorted_indices; }
156 void ensure_sorted();
165 bool m_sort_dirty {
true };
170 void propagate_world_transforms();
std::vector< MeshSlot > m_slots
bool has_operator() const override
std::vector< uint32_t > m_sorted_indices
Processing order: indices into m_slots, parents before children.
size_t get_node_count() const override
Get the number of nodes in the network.
size_t slot_count() const
Number of slots in the network.
~MeshNetwork() override=default
std::shared_ptr< NetworkOperator > m_operator
NetworkOperator * get_operator() override
const std::vector< MeshSlot > & slots() const
Read-only access to the full slot list.
std::vector< MeshSlot > & slots()
const std::vector< uint32_t > & sorted_indices() const
Get the processing order of slots as indices into m_slots.
std::shared_ptr< OpType > create_operator(Args &&... args)
Construct and set the primary operator in one call.
const NetworkOperator * get_operator() const override
NodeNetwork subclass whose nodes are named, hierarchically transformable mesh slots.
Domain-agnostic interpretive lens for network processing.
Abstract base class for structured collections of nodes with defined relationships.
Named, independently transformable mesh unit within a MeshNetwork.