GH_CapsuleRenderEngine
ReferencesProvides 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 radius, int size, bool jaggedLeft, bool jaggedRight)
Static (Shared in VB) method for creating Grasshopper Capsule highlight fills.
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.
Parameters:
| 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. |
Returns: Graphics path that describes the rounded rectangle.
CreateRoundedRectangle
#Static (Shared in VB) method for creating rectangles with rounded corners.
Parameters:
| 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. |
Returns: 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.
Parameters:
| 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. |
Returns: Graphics path that describes the rounded rectangle.
CreateRoundedRectangle
#Static (Shared in VB) method for creating rectangles with rounded corners.
Parameters:
| rec (RectangleF) | Rectangle to fillet. Rectangles smaller than 3 pixels wide/high will be grown. |
| radius (float) | Radius of corner fillets. |
Returns: Graphics path that describes the rounded rectangle.
GetImpliedPalette
#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.
Parameters:
| obj (IGH_ActiveObject) | Object to evaluate. |
Returns: 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.
Parameters:
| 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
#Static (Shared in VB) method for solving which palette style is implied by the properties.
Parameters:
| 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
Parameters:
| 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
Parameters:
| palette (GH_Palette) | |
| attributes (IGH_Attributes) |
RenderAlphaFill
#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.
Parameters:
| G (Graphics) |
RenderBackground
#Render a default capsule background fill. This is usually the third stage in a capsule rendering.
Parameters:
| G (Graphics) | Graphics object to draw with. |
| zoom (float) | Zoom of graphics object. |
| style (GH_PaletteStyle) | Final style to draw with. |
RenderBackground_Alternative
#Render a custom capsule background fill. This is usually the third stage in a capsule rendering.
RenderBoundaryDots
#Render a collection of boundary dots along the top edge of the capsule.
Parameters:
| G (Graphics) | |
| count (int) | Number of dots to render. |
| style (GH_PaletteStyle) |
RenderGrips
#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.
Parameters:
| G (Graphics) |
RenderGrips_Alternative
#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.
Parameters:
| G (Graphics) |
RenderHighlight
#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.
Parameters:
| G (Graphics) |
RenderIcon
#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.
RenderIcon
#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.
Parameters:
| 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
#Static (Shared in VB) method to render a default input grip.
RenderMessage
#Render a text message underneath the capsule.
Parameters:
| G (Graphics) | Graphics object to draw with. |
| message (string) | Message to draw. |
| style (GH_PaletteStyle) | Style to use. |
RenderOutlines
#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.
Parameters:
| G (Graphics) | Graphics object to draw with. |
| zoom (float) | Zoom level of graphics object. |
| style (GH_PaletteStyle) | Palette style that defines edge properties. |
RenderOutputGrip
#Static (Shared in VB) method to render a default output grip.