OrthoGrid

References
public class OrthoGrid
Immutable class for rendering orthogonal grids into graphics contexts.

Constructors

OrthoGrid

#
Constructor.
public OrthoGrid(
xAxis,
yAxis,
xLines,
yLines,
marks
)

Properties

Default

#
Gets the default grid Grasshopper usually draws.
public static OrthoGrid Default { get; }

DefaultTight

#
Gets the default grid for drawing tight grids.
public static OrthoGrid DefaultTight { get; }

Marks

#
Gets the grid lines properties.
public MarkStyle Marks { get; }

XAxis

#
Gets the grid x-axis properties.
public AxisStyle XAxis { get; }

XLines

#
Gets the properties for the lines parallel to the x-axis.
public LineStyle XLines { get; }

YAxis

#
Gets the grid y-axis properties.
public AxisStyle YAxis { get; }

YLines

#
Gets the properties for the lines parallel to the y-axis.
public LineStyle YLines { get; }

Methods

ControlToGrid

#
Map a coordinate from control space into grid space.
public void ControlToGrid(double x, double y, out double xʹ, out double yʹ)
x (double)Pixel x coordinate.
y (double)Pixel y coordinate.
xʹ (out double)X parameter
yʹ (out double)Y parameter.

Draw

#
Draw this grid into a control graphics context. The grid drawing is designed to work in control-space, not content space. You should provide a graphics context without zoom transformations.
public void Draw(
context,
Graphics context to draw into.
elements
Grid elements to render.
)

GridToControl

#
Map a coordinate from grid space into control space.
public void GridToControl(double x, double y, out double xʹ, out double yʹ)
x (double)X parameter.
y (double)Y parameter.
xʹ (out double)Pixel x coordinate.
yʹ (out double)Pixel y coordinate.

ResolveSnapping

#
Determine the snapping intervals in the X and Y directions. This only works after a grid has been successfully drawn.
public bool ResolveSnapping(
out double
x,
Interval between grid lines in the X direction.
out double
y
Interval between grid lines in the Y direction.
)
True if the snapping could be resolved.

Setup

#
Setup a specific projection. This method must be called before any calls to RenderXXXX() methods.
public void Setup(
RectangleF
frame,
Grid boundary frame.
(double min, double max)
xDomain,
X domain to be visible within frame.
(double min, double max)
yDomain
Y domain to be visible within frame.
)

Setup

#
Setup a specific projection. This method must be called before any calls to RenderXXXX() methods.
public void Setup(
RectangleF
frame,
Grid boundary frame.
PointF
origin,
Grid origin.
SizeF
unit
Grid unit rectangle.
)

WithAxes

#
Swap out the X and Y-Axis style of this grid.
public OrthoGrid WithAxes(
xStyle,
yStyle
)

WithAxisColours

#
Change the axis colours of this grid.
public OrthoGrid WithAxisColours(
Color
xColour,
Color
yColour
)

WithLines

#
Swap out the X and Y-Line style of this grid.
public OrthoGrid WithLines(
xStyle,
yStyle
)

WithMarks

#
Swap out the Marker style of this grid.
public OrthoGrid WithMarks(
style
)

WithXAxis

#
Swap out the X-Axis style of this grid.
public OrthoGrid WithXAxis(
style
)

WithXLines

#
Swap out the X-Line style of this grid.
public OrthoGrid WithXLines(
style
)

WithYAxis

#
Swap out the Y-Axis style of this grid.
public OrthoGrid WithYAxis(
style
)

WithYLines

#
Swap out the X-Line style of this grid.
public OrthoGrid WithYLines(
style
)