GH_NamedView

References
Named views are used both to store named views but also to allow smooth programmatic canvas navigation.

Constructors

GH_NamedView

#
public GH_NamedView()
Create a default named view.

GH_NamedView

#
public GH_NamedView(GH_Viewport view, Point point, PointF target)
Create a new view useful for point match transitions.
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

#
public GH_NamedView(GH_Viewport view, Rectangle region, PointF target)
Create a new view useful for point inclusion transitions.
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

#
public GH_NamedView(Rectangle view_box, RectangleF target_box)
Create a new view useful for box-fit transitions.
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.
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

Name

#
public string Name { get; set; }
Gets or sets the name of the view.

Point

#
public PointF Point { get; set; }
Gets or sets the anchor point of the named view.

Type

#
public GH_NamedViewType Type { get; set; }
Gets or sets a value indicating whether the anchor point represents the target or the center.

Zoom

#
public float Zoom { get; set; }
Gets or sets the zoom factor of the named view.

Methods

LoadFromViewport

#
public void LoadFromViewport(GH_Viewport vp, GH_NamedViewType view_type)
Create a named view from a viewport.
vp (GH_Viewport)Viewport to mimic.
view_type (GH_NamedViewType)Type of named view to create.

Read

#
public bool Read(GH_IReader reader)
reader (GH_IReader)
Read

SetToViewport

#
public void SetToViewport(GH_Canvas cv, int length)
Animates a view transition.
cv (GH_Canvas)Canvas to apply the transition to.
length (int)Length (in milliseconds) of the transition.

SetToViewport

#
public void SetToViewport(GH_Canvas cv)
Set the named view to the canvas viewport and redraw the canvas.
cv (GH_Canvas)Canvas to set

SetToViewport

#
public void SetToViewport(GH_Viewport vp)
Set the named view to a viewport.
vp (GH_Viewport)Viewport to set.

Write

#
public bool Write(GH_IWriter writer)
writer (GH_IWriter)
Write

Events

SmoothFrame

#
public event GH_NamedView.SmoothFrameEventHandler SmoothFrame
This event is raised during smooth animations.