GH_CapsuleRenderEngine

References
Provides basic Render methods for capsule display. You typically don't need this class, just use the Render() overloads on GH_Capsule directly.

Methods

CreateHighlightBar

#
public static GraphicsPath CreateHighlightBar(Rectangle rec, int R0, int R1, int size, bool jaggedLeft, bool jaggedRight)
Static (Shared in VB) method for creating Grasshopper Capsule highlight fills.
rec (Rectangle)Rectangle for entire fill.
R0 (int)Radius of upper left corner.
R1 (int)Radius of upper right corner.
size (int)Highlight fill height.
jaggedLeft (bool)
jaggedRight (bool)
Graphics path that describes the highlight fill shape.

CreateHighlightBar

#
public static GraphicsPath CreateHighlightBar(Rectangle rec, int R0, int R1, int size)
Static (Shared in VB) method for creating Grasshopper Capsule highlight fills.
rec (Rectangle)Rectangle for entire fill.
R0 (int)Radius of upper left corner.
R1 (int)Radius of upper right corner.
size (int)Highlight fill height.
Graphics path that describes the highlight fill shape.

CreateHighlightBar

#
public static GraphicsPath CreateHighlightBar(Rectangle rec, int radius, int size, bool jaggedLeft, bool jaggedRight)
Static (Shared in VB) method for creating Grasshopper Capsule highlight fills.
rec (Rectangle)Rectangle for entire fill.
radius (int)Corner radius.
size (int)Highlight fill height.
jaggedLeft (bool)
jaggedRight (bool)
Graphics path that describes the highlight fill shape.

CreateHighlightBar

#
public static GraphicsPath CreateHighlightBar(Rectangle rec, int radius, int size)
Static (Shared in VB) method for creating Grasshopper Capsule highlight fills.
rec (Rectangle)Rectangle for entire fill.
radius (int)Corner radius.
size (int)Highlight fill height.
Graphics path that describes the highlight fill shape.

CreateJaggedRectangle

#
public static GraphicsPath CreateJaggedRectangle(RectangleF rec, float R0, float R1, float R2, float R3, bool jaggedLeft, bool jaggedRight)
Static (Shared in VB) method for creating rectangles with rounded corners.
rec (RectangleF)Rectangle to fillet. Rectangles smaller than 3 pixels wide/high will be grown.
R0 (float)Radius of upper left corner. Zero or negative values omit fillets.
R1 (float)Radius of upper right corner. Zero or negative values omit fillets.
R2 (float)Radius of lower right corner. Zero or negative values omit fillets.
R3 (float)Radius of lower left corner. Zero or negative values omit fillets.
jaggedLeft (bool)If true, the left edge of the rectangle will be jagged and R0 and R3 will be ignored.
jaggedRight (bool)If true, the right edge of the rectangle will be jagged and R1 and R2 will be ignored.
Graphics path that describes the rounded rectangle.

CreateRoundedRectangle

#
public static GraphicsPath CreateRoundedRectangle(Rectangle rec, int R0, int R1, int R2, int R3)
Static (Shared in VB) method for creating rectangles with rounded corners.
rec (Rectangle)Rectangle to fillet. Rectangles smaller than 3 pixels wide/high will be grown.
R0 (int)Radius of upper left corner. Zero or negative values omit fillets.
R1 (int)Radius of upper right corner. Zero or negative values omit fillets.
R2 (int)Radius of lower right corner. Zero or negative values omit fillets.
R3 (int)Radius of lower left corner. Zero or negative values omit fillets.
Graphics path that describes the rounded rectangle.

CreateRoundedRectangle

#
public static GraphicsPath CreateRoundedRectangle(Rectangle rec, int radius)
Static (Shared in VB) method for creating rectangles with rounded corners.
rec (Rectangle)Rectangle to fillet. Rectangles smaller than 3 pixels wide/high will be grown.
radius (int)Radius of corner fillets.
Graphics path that describes the rounded rectangle.

CreateRoundedRectangle

#
public static GraphicsPath CreateRoundedRectangle(RectangleF rec, float R0, float R1, float R2, float R3)
Static (Shared in VB) method for creating rectangles with rounded corners.
rec (RectangleF)Rectangle to fillet. Rectangles smaller than 3 pixels wide/high will be grown.
R0 (float)Radius of upper left corner. Zero or negative values omit fillets.
R1 (float)Radius of upper right corner. Zero or negative values omit fillets.
R2 (float)Radius of lower right corner. Zero or negative values omit fillets.
R3 (float)Radius of lower left corner. Zero or negative values omit fillets.
Graphics path that describes the rounded rectangle.

CreateRoundedRectangle

#
public static GraphicsPath CreateRoundedRectangle(RectangleF rec, float radius)
Static (Shared in VB) method for creating rectangles with rounded corners.
rec (RectangleF)Rectangle to fillet. Rectangles smaller than 3 pixels wide/high will be grown.
radius (float)Radius of corner fillets.
Graphics path that describes the rounded rectangle.

GetImpliedPalette

#
public static GH_Palette GetImpliedPalette(IGH_ActiveObject obj)
Static (Shared in VB) method for solving which palette is the default given a specific object's properties. Default palettes are either GH_Palette.Normal, GH_Palette.Warning or GH_Palette.Error depending on the objects' runtime message level.
obj (IGH_ActiveObject)Object to evaluate.
The default palette.

GetImpliedStyle

#
public static GH_PaletteStyle GetImpliedStyle(GH_Palette palette, bool selected, bool locked, bool hidden)
Static (Shared in VB) method for solving which palette style is implied by the properties.
palette (GH_Palette)Palette hint.
selected (bool)Specifies whether the selected flavour of a palette needs to be returned.
locked (bool)If True, the returned palette style is always Locked.
hidden (bool)If True, the returned palette style is always Hidden.

GetImpliedStyle

#
public static GH_PaletteStyle GetImpliedStyle(GH_Palette palette, IGH_Attributes attributes)
Static (Shared in VB) method for solving which palette style is implied by the properties.
palette (GH_Palette)Palette hint.
attributes (IGH_Attributes)Attributes to parse for style details.

GetPaletteStyle

#
[EditorBrowsable(EditorBrowsableState.Never)] public static GH_PaletteStyle GetPaletteStyle(GH_Palette palette, bool selected, bool locked, bool hidden)
obsoletethis method has been replaced by GetImpliedStyle
palette (GH_Palette)
selected (bool)
locked (bool)
hidden (bool)

GetPaletteStyle

#
[EditorBrowsable(EditorBrowsableState.Never)] public static GH_PaletteStyle GetPaletteStyle(GH_Palette palette, IGH_Attributes attributes)
obsoletethis method has been replaced by GetImpliedStyle
palette (GH_Palette)
attributes (IGH_Attributes)

RenderAlphaFill

#
public void RenderAlphaFill(Graphics G)
Render a standard transparancy background hatch. This is only needed when the capsule background colour is not fully opaque. This is usually the second stage in a capsule rendering, right after the Grips are drawn.
G (Graphics)

RenderBackground

#
public void RenderBackground(Graphics G, float zoom, GH_PaletteStyle style)
Render a default capsule background fill. This is usually the third stage in a capsule rendering.
G (Graphics)Graphics object to draw with.
zoom (float)Zoom of graphics object.
style (GH_PaletteStyle)Final style to draw with.

RenderBackground_Alternative

#
public void RenderBackground_Alternative(Graphics G, Color colourOverride, bool drawAlphaGrid)
Render a custom capsule background fill. This is usually the third stage in a capsule rendering.
G (Graphics)Graphics object to draw with.
colourOverride (Color)Custom background colour.
drawAlphaGrid (bool)If true, and the background colour is not opaque, an alpha grid will be drawn as well.

RenderBoundaryDots

#
public void RenderBoundaryDots(Graphics G, int count, GH_PaletteStyle style)
Render a collection of boundary dots along the top edge of the capsule.
G (Graphics)
count (int)Number of dots to render.
style (GH_PaletteStyle)

RenderGrips

#
public void RenderGrips(Graphics G)
Render all the grips associates with the capsule. Grips are not drawn if the zoom level is less than 50%. This is usually the first stage in a Capsule rendering.
G (Graphics)

RenderGrips_Alternative

#
public void RenderGrips_Alternative(Graphics G)
Render all the grips associates with the capsule as semi-circles. This is needed if the capsule background is not fully opaque. Grips are not drawn if the zoom level is less than 50%. This is usually the first stage in a Capsule rendering.
G (Graphics)

RenderHighlight

#
public void RenderHighlight(Graphics G)
Render a highlight bar. This is highly zoom-dependant. Highlight rendering is usually the fourth stage in a Capsule Rendering, after the background but prior to the edges.
G (Graphics)

RenderIcon

#
public void RenderIcon(Graphics G, Image icon, int offsetX = 0, int offsetY = 0)
Render an image icon centered into the box. If the content box has been defined the icon will be centered there, otherwise the outline box will be used.
G (Graphics)Graphics surface to draw onto.
icon (Image)Icon to draw.
offsetX (int = 0)Additional x-offset (in original pixel units).
offsetY (int = 0)Additional y-offset (in original pixel units).

RenderIcon

#
public void RenderIcon(Graphics G, Image icon, RectangleF box, int offsetX = 0, int offsetY = 0)
Render an image icon centered into the box. If the content box has been defined the icon will be centered there, otherwise the outline box will be used.
G (Graphics)Graphics surface to draw onto.
icon (Image)Icon to draw.
box (RectangleF)Box override.
offsetX (int = 0)Additional x-offset (in original pixel units).
offsetY (int = 0)Additional y-offset (in original pixel units).

RenderInputGrip

#
public static void RenderInputGrip(Graphics G, float zoom, PointF loc, bool full)
Static (Shared in VB) method to render a default input grip.
G (Graphics)Graphics objects to draw with.
zoom (float)Zoom level of graphics surface.
loc (PointF)Location of grip.
full (bool)If true, a complete circular grip will be draw. If false, a semi-circular grip will be drawn.

RenderMessage

#
public Rectangle RenderMessage(Graphics G, string message, GH_PaletteStyle style)
Render a text message underneath the capsule.
G (Graphics)Graphics object to draw with.
message (string)Message to draw.
style (GH_PaletteStyle)Style to use.

RenderOutlines

#
public void RenderOutlines(Graphics G, float zoom, GH_PaletteStyle style)
Render default capsule outlines. If the zoom factor is less than 50% the inner outline is not drawn. This is usually the fifth stage in a Capsule rendering.
G (Graphics)Graphics object to draw with.
zoom (float)Zoom level of graphics object.
style (GH_PaletteStyle)Palette style that defines edge properties.

RenderOutputGrip

#
public static void RenderOutputGrip(Graphics G, float zoom, PointF loc, bool full)
Static (Shared in VB) method to render a default output grip.
G (Graphics)Graphics objects to draw with.
zoom (float)Zoom level of graphics surface.
loc (PointF)Location of grip.
full (bool)If true, a complete circular grip will be draw. If false, a semi-circular grip will be drawn.

RenderText

#
public void RenderText(Graphics G, Color colour)
Render the capsule text. This is usually the sixth and final stage in a capsule rendering.
G (Graphics)Graphics object to draw with.
colour (Color)Colour of text.