GH_GraphicTreeDisplayArgs

References
A class that contains useful information used for drawing GH_GraphicTrees.

Fields

maxPathLength

#
public int maxPathLength
The number of elements in the longest path of the tree.

origin

#
public PointF origin
The origin point of the tree in Graphics coordinates.

radius

#
public float radius
Radius of the outer ring Leaf objects.

vp

#
public GH_Viewport vp
Gets the viewport of the canvas in which we're drawing.

Methods

AdjustMaxPathLength

#
public void AdjustMaxPathLength(int potential_new_length)
Call this function to register a new maximum path length. This function is only used during the construction of this class. Do not call this while in the middle of a drawing operation.
potential_new_length (int)

Distance

#
public static float Distance(PointF A, PointF B, PointF P)
Compute the distance between a point P and a finite line segment defined by A-B.
A (PointF)
B (PointF)
P (PointF)

Distance

#
public static float Distance(PointF A, PointF B)
Compute the distance between two points.
A (PointF)
B (PointF)

DistanceSquared

#
public static float DistanceSquared(PointF A, PointF B)
Compute the squared distance between two points.
A (PointF)
B (PointF)

RadialBox

#
public RectangleF RadialBox(float box_edge)
Compute the extents of a rectanle within the current layout.
box_edge (float)

RadialCrd

#
public PointF RadialCrd(float angle, float offset)
Compute the x and y coordinates of a point defined by radial coordinates
angle (float)
offset (float)

RadialX

#
public float RadialX(float angle, float offset)
Compute the x-coordinate of a point defined by radial coordinates
angle (float)
offset (float)

RadialY

#
public float RadialY(float angle, float offset)
Compute the y-coordinate of a point defined by radial coordinates
angle (float)
offset (float)

RadToDeg

#
public static float RadToDeg(float a)
Convert Radians to Degrees
a (float)

RemapDegrees

#
public static float RemapDegrees(float a)
Adjust the angle (in degrees) to match tree orientation
a (float)

SetupViewport

#
public void SetupViewport(GH_Viewport vport)
Assign the viewport member with this function to ensure that other constants are also set.
vport (GH_Viewport)

Visible

#
public bool Visible(PointF P0, PointF P1, PointF P2, PointF P3, float fuzz = 0)
Test to see if a bezier segment is within the visible domain. This test is fuzzy in the interest of performance.
P0 (PointF)
P1 (PointF)
P2 (PointF)
P3 (PointF)
fuzz (float = 0)

Visible

#
public bool Visible(PointF pt, float radius)
Test to see if a circle is within the visible domain.
pt (PointF)
radius (float)

Visible

#
public bool Visible(PointF pt)
Test to see if a point is within the visible domain.
pt (PointF)

Visible

#
public bool Visible(PointF ptA, PointF ptB, float fuzz = 0)
Test to see if a line segment is within the visible domain. This test is fuzzy in the interest of performance.
ptA (PointF)
ptB (PointF)
fuzz (float = 0)

Visible

#
public bool Visible(RectangleF rec, float margin)
Test to see if a rectangle is within the visible domain.
rec (RectangleF)
margin (float)

Visible

#
public bool Visible(RectangleF rec)
Test to see if a rectangle is within the visible domain.
rec (RectangleF)