Skip to content

NodeCanvasGeometry

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

Where the parts of a node canvas are, in canvas units (Vision Center’s pipelines, Provisioning’s profiles): node cards of one size, the graph drawn from top to bottom: the input dot at the top centre of a card, the output dot at its bottom centre, the + below the output (below the error when the node has one), the eye top right; links as vertical curves from an output down to an input; the view (zoom and pan). The canvas controls draw with these (NodeCanvasPainter) and their view models find what a press hit with them.

public static class NodeCanvasGeometry
static Rect ControlPlusRect(double x, double y, int index = 0)

The + left of an empty control input of the selected node: a click adds a node into that input (a Timer into Reset).

static Point ControlPort(double x, double y, int index = 0)

A control input (Reset, Send now, Only while, Second): a dot on the card’s left edge in its own row below the live line.

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

The control points of a link’s curve from from (an output) down to to (an input).

static double Distance(Point a, Point b)

The distance from a to b.

static double DistanceToCurve(Point point, Point from, Point to, bool intoSide = false)

The distance of point to the curve (sampled), in canvas units.

static double DistanceToSegment(Point point, Point a, Point b)

The distance from point to the segment a-b.

static Rect EyeRect(double x, double y)

The eye at the top right of the card at x, y.

static CanvasView Fit(Rect content, Size viewport, double topRoom, double maxZoom = 1)

Fit view: content (canvas units) in the view, at most maxZoom, centred across and at most topRoom screen pixels below the top (the graph grows downwards).

static double HeightFor(int controlInputs)

The height of a card with controlInputs control inputs.

static Point InputPort(double x, double y)

The input dot: the top centre of the card.

static Rect NodeRect(double x, double y, double height = 62)

The card at x, y (its top left).

static Point OnCurve(Point from, Point to, double t, bool intoSide = false)

A point on the curve at t (0 to 1).

static Point OutputPort(double x, double y, double height = 62)

The output dot: the bottom centre of the card.

static Rect PlusRect(double x, double y, bool belowError = false, bool besideLinks = false, double height = 62)

The + below the output, below the node’s error when it has one; beside the links when the output already leads on (besideLinks), so it never covers their curve and count.

static CanvasView? ZoomAround(CanvasView view, Point screen, double factor)

The wheel: zoom by factor around screen (it stays under the pointer), 25 % to 200 %; null when the zoom stays.

const double ColumnGap = 40

Tidy up: the gap between two cards side by side, and one column (a card and its gap).

const double ColumnStep = 240

Tidy up: one column, a card and its gap.

const double ControlPortRadius = 6

A control input’s dot: the size of the data dots, centred on the card’s left edge.

const double ControlRowHeight = 20

A row per control input below the live line: its dot on the left edge, its label beside it.

const double ErrorRoom = 34

The room of an error below a node (two lines of small text): the + moves below it.

const double EyeSize = 24

The size of the eye at the top right of a card.

const double LinkReach = 6

A press this near a link (screen pixels) takes it.

const double Margin = 40

The room around the cards when the view fits them.

const double MaxZoom = 2

The largest zoom.

const double MinZoom = 0.25

The smallest zoom.

const double NodeHeight = 62

The height of a card without control inputs.

const double NodeWidth = 200

The width of every card.

const double PlusGap = 18

The + sits this far below the node’s bottom edge.

const double PlusSize = 22

The size of the + below a card.

const double PortRadius = 7

The radius of an input or output dot.

const double PortReach = 11

A press this near a port takes it.

const double RowGap = 56

Tidy up: the gap between a row’s tallest card and the next row: room for a link and its count.

const double RowStep = 118

Where a node added after another goes: below it, one card and one gap down.