Skip to content

NodeCanvasPainter

Static class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll

The one look of every node canvas (Vision Center’s pipelines, Provisioning’s profiles and a camera’s flow): the dotted background, the links as vertical curves, the node cards (colour stripe on the left, icon, name, a line of text, the input dot at the top and the output dot at the bottom, the + below an output), the error directly below a red-bordered card. Colours from the theme (CanvasTheme); sizes from NodeCanvasGeometry. The canvas controls call these in drawing order; what only one canvas has (Vision Center’s eye and control inputs) it draws itself.

public static class NodeCanvasPainter
static double BelowHeight(CanvasTheme theme, string message, double? maxWidth = null)

The height NodeCanvasPainter.DrawBelow takes for message (with its gap above).

static StreamGeometry Curve(Point from, Point to, bool intoSide = false)

The curve of a link from an output down to an input (NodeCanvasGeometry.Curve).

static void DrawBackground(DrawingContext context, CanvasTheme theme, Rect bounds, CanvasView view)

The canvas’s background and its dot grid, which moves and scales with the view.

static void DrawBelow(DrawingContext context, CanvasTheme theme, Rect rect, string message, IBrush? brush = null, double? maxWidth = null)

A message directly below a card (its error in red; a canvas may use another brush), on the canvas’s background so a link down from the output passes behind it, wrapping at maxWidth (null: the card width plus 30).

static void DrawCard(DrawingContext context, Control owner, CanvasTheme theme, Rect rect, IBrush stripe, string iconKey, string name, bool isSelected, NodeCardBorder border, double? nameRight = null, IBrush? iconBrush = null)

A node card: the selection ring, the card with its border, the colour stripe along the left edge, the icon in that colour and the name (trimmed before nameRight; null: the card’s right edge less 10).

static void DrawIcon(DrawingContext context, Control owner, string key, IBrush brush, Rect at)

An icon of the theme (Icon. + key) as strokes in brush.

static void DrawLine(DrawingContext context, CanvasTheme theme, Rect rect, string text, IBrush? brush = null, int maxLines = 1)

The line of a card below its name (a live value, a result), trimmed to the card.

static void DrawLink(DrawingContext context, CanvasTheme theme, Point start, Point end, bool isSelected, bool intoSide = false)

A link: the theme’s link colour (1 px), or the accent (2 px) while it is selected.

static void DrawPlus(DrawingContext context, Control owner, CanvasTheme theme, Point output, Rect plus)

The + below an output: a line down from the output dot at output and the box with the icon.

static void DrawPort(DrawingContext context, CanvasTheme theme, Point at, bool isLit = false)

An input or output dot; isLit fills it with the accent (a link being dragged fits).

static IBrush LinkBrush(CanvasTheme theme)

The colour of links, ports and the +.

static Matrix Transform(CanvasView view)

The transform from canvas units to the control (inside NodeCanvasPainter.DrawBackground’s bounds).

const double CornerRadius = 8

The corner radius of a node card.

const double DotStep = 22

The distance between two dots of the background, in canvas units.

const double LineTop = 35

The top of the line below the name.

const double TextLeft = 38

The left edge of a card’s text (the icon sits left of it).