137 template <class NodeT>
142 template <class NodeT>
147 template <class NodeT>
156 template <class NodeT>
165 template <class NodeT>
234 template <typename... Args>
241 template <typename... Args>
245 template <typename... Args>
252 template <typename... Args>
262 template <typename... Args>
271 template <typename T, typename... Args>
327#include "smgl/GraphvizImpl.hpp"
Class defining a Graph's style when writing to a Dot file.
void setRankMin(const Args &... args)
Assign node(s) to the minimum rank.
auto defaultStyle() const -> const NodeStyle &
Access the default node style.
auto hasClassStyle(const std::string &name) const -> bool
Check if a class of nodes has an associated style.
void appendRankSame(T idx, const Args &... args)
Assign node(s) to an existing group ranking.
void setRankMax(const Args &... args)
Assigns node(s) to the maximum rank.
void setInstanceStyle(const Node::Pointer &node, const NodeStyle &style)
Set a instance-specific node style.
auto rankSource() -> std::unordered_set< Uuid > &
Get the set of nodes assigned to the source rank.
void eraseInstanceStyle(const Node::Pointer &node)
Erase the style associated with a node instance.
std::unordered_map< std::string, NodeStyle > classStyles_
void setRankSource(const Args &... args)
Assign node(s) to the minimum rank and limits the minimum rank to nodes with rank=min or rank=source.
auto rankMax() -> std::unordered_set< Uuid > &
Get the set of nodes assigned to the maximum rank.
auto setRankSame(const Args &... args) -> std::size_t
Assign node(s) to a new group ranking.
std::unordered_set< Uuid > rankMax_
void setRankSink(const Args &... args)
Assign node(s) to the maximum rank and limits the maximum rank to nodes with rank=max or rank=sink.
auto defaultStyle() -> NodeStyle &
Access the default node style.
GraphStyle()
Default constructor.
auto rankMin() -> std::unordered_set< Uuid > &
Get the set of nodes assigned to the minimum rank.
std::unordered_set< Uuid > rankMin_
std::unordered_set< Uuid > rankSink_
std::unordered_set< Uuid > rankSrc_
void eraseClassStyle(const std::string &name)
Erase the style associated with a class of nodes.
auto hasInstanceStyle(const Node::Pointer &node) const -> bool
Check if a node has an associated instance style.
void setDefaultStyle(const NodeStyle &style)
Set the default node style.
std::vector< std::vector< Uuid > > rankSame_
auto classStyle() -> NodeStyle &
Access the style for a class of nodes.
auto rankSame() -> std::vector< std::vector< Uuid > > &
Get the set of rank groups.
auto nodeStyle(const Node::Pointer &node) const -> NodeStyle
Get the evaluated node style for a specific node.
auto rankSink() -> std::unordered_set< Uuid > &
Get the set of nodes assigned to the sink rank.
auto instanceStyle(const Node::Pointer &node) -> NodeStyle &
Access the style for a node instance.
void setClassStyle(const std::string &name, const NodeStyle &style)
Set a class-specific node style.
std::unordered_map< Uuid, NodeStyle > instanceStyles_
A collection of Nodes for managing pipeline state and serialization.
Universally unique identifier class.
Project top-level namespace.
void WriteDotFile(const filesystem::path &path, const Graph &g, const GraphStyle &style=GraphStyle())
Write Graph to a file in the Graphviz Dot format.
ISO C++ top-level namespace.
Style struct for a node's base style.
std::uint8_t cellspacing
Sub-element border spacing [0, 255].
std::uint8_t cellpadding
Sub-element border padding [0, 255].
std::uint8_t cellborder
Sub-element border thickness [0, 255].
Style struct for ports and labels.
std::string align
Text alignment.
std::string color
Element border color.
std::string bgcolor
Element background color.
std::uint8_t border
Element border thickness [0, 255].
Style struct for a node's overall font style.
std::string face
Font typeface.
std::string color
Font color.
auto empty() const -> bool
Returns whether or not this style has an values set.
Style struct containing all sub-styles for a node.
ElementStyle label
Label-specific style.
BaseStyle base
Base style for the node.
ElementStyle inputPorts
InputPort-specific style.
FontStyle font
Base font style for this node.
ElementStyle outputPorts
OutputPort-specific style.