GH_NamedView
ReferencesNamed views are used both to store named views but also to allow smooth programmatic canvas navigation.
Constructors
GH_NamedView
#Create a new view useful for point match transitions.
Parameters:
| view (GH_Viewport) | Viewport this transition is supposed to work in. |
| point (Point) | Point in control coordinates that is supposed to be matched. |
| target (PointF) | Point in canvas coordinates that will be matched. |
GH_NamedView
#Create a new view useful for point inclusion transitions.
Parameters:
| view (GH_Viewport) | Viewport this transition is supposed to work in. |
| region (Rectangle) | Region into which the target is supposed to be visible in control coordinates. For example, the contents of the viewport. |
| target (PointF) | Point to ensure. |
GH_NamedView
#Create a new view useful for box-fit transitions.
Parameters:
| view_box (Rectangle) | The dimensions of the area into which we want to display something in control coordinates. For example, the Visible area in a Viewport. |
| target_box (RectangleF) | The dimensions of the area we want to display in viewport coordinates. For example, the bounding box of some objects. |
GH_NamedView
#public GH_NamedView(string view_name, PointF view_point, float view_zoom = 1, GH_NamedViewType view_type = GH_NamedViewType.target)
Create a new named view.
Parameters:
| view_name (string) | Name of view. |
| view_point (PointF) | Anchor point of named view. |
| view_zoom (float = 1) | Zoom factor of named view. |
| view_type (GH_NamedViewType = GH_NamedViewType.target) | The type of named view. |
Properties
Methods
LoadFromViewport
#Create a named view from a viewport.
Parameters:
| vp (GH_Viewport) | Viewport to mimic. |
| view_type (GH_NamedViewType) | Type of named view to create. |
SetToViewport
#Animates a view transition.
SetToViewport
#Set the named view to the canvas viewport and redraw the canvas.
Parameters:
| cv (GH_Canvas) | Canvas to set |