Skip to content

Version 0.8

Pre-release
Pre-release

Choose a tag to compare

@csparker247 csparker247 released this 24 Jun 20:05

This release implements a few new API features and tweaks in response to usage in other projects.

InputPort

Added new assignment operators to make code a bit more readable.

foo.input = 4;            // equivalent to input.post(4, false)
foo.input = bar.output;   // equivalent to smgl::connect(bar.output, foo.input)

Graphviz

Added Graphviz node styling support. See the documentation for smgl::GraphStyle for more information.

// Setup graph
Graph graph;
auto a = graph.insertNode<IntNode>();
auto b = graph.insertNode<IntNode>();
auto c = graph.insertNode<FloatNode>();

// Global style
GraphStyle style;
style.defaultStyle().base.bgcolor = "red";

// Class-specific style
auto className = NodeName(a);
style.nodeClassStyle(className).base.bgcolor = "white";

// Instance-specific style
style.nodeInstanceStyle(a).base.bgcolor = "blue";
style.nodeInstanceStyle(a).font.color = "white";

// Write the graph
WriteDotFile("StyledGraph.gv", graph, style);

Result:

graphviz-styled