Loading...
Searching...
No Matches
score-plugin-gfx/Gfx/Graph/Graph.hpp
1#pragma once
2#include <Gfx/Graph/Node.hpp>
3#include <Gfx/Graph/RenderList.hpp>
4
5#include <ossia/detail/algorithms.hpp>
6
7#include <score_plugin_gfx_export.h>
8namespace score::gfx
9{
10class OutputNode;
11class Window;
15struct SCORE_PLUGIN_GFX_EXPORT Graph
16{
20 explicit Graph();
21
22 ~Graph();
23
27 void addNode(score::gfx::Node* n);
28
32 void removeNode(score::gfx::Node* n);
33
37 void addEdge(Port* source, Port* sink);
38
42 void removeEdge(Port* source, Port* sink);
43
47 void addAndLinkEdge(Port* source, Port* sink);
48
52 void unlinkAndRemoveEdge(Port* source, Port* sink);
53
57 void clearEdges();
58
62 void createAllRenderLists(GraphicsApi graphicsApi);
63
67 void createSingleRenderList(score::gfx::OutputNode& node, GraphicsApi graphicsApi);
68
72 void destroyOutputRenderList(score::gfx::OutputNode& node);
73
77 void relinkGraph();
78
82 bool canDoVSync() const noexcept;
83
84 const std::vector<std::shared_ptr<RenderList>>& renderLists() const noexcept
85 {
86 return m_renderers;
87 }
88
89 std::span<OutputNode* const> outputs() const noexcept
90 {
91 return m_outputs;
92 }
93
94private:
95 void initializeOutput(OutputNode* output, GraphicsApi graphicsApi);
96 void createOutputRenderList(OutputNode& output);
97 void recreateOutputRenderList(OutputNode& output);
98 std::shared_ptr<RenderList>
99 createRenderList(OutputNode*, std::shared_ptr<RenderState> state);
100
101 std::vector<std::shared_ptr<RenderList>> m_renderers;
102 std::vector<std::shared_ptr<Window>> m_unused_windows;
103
104 std::vector<score::gfx::Node*> m_nodes;
105 std::vector<Edge*> m_edges;
106
107 std::vector<OutputNode*> m_outputs;
108};
109}
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:71
Base class for sink nodes (QWindow, spout, syphon, NDI output, ...)
Definition OutputNode.hpp:31
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:20
Represents a graph of renderers.
Definition score-plugin-gfx/Gfx/Graph/Graph.hpp:16
Port of a score::gfx::Node.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:53