PickContext

References
public class PickContext : IDisposable
Utility for determining if objects are picked

Constructors

PickContext

#Since v5.0
public PickContext()

Finalizer

~PickContext

#
~PickContext()

Properties

GetObjectUsed

#Since v5.0
public GetObject GetObjectUsed { get; }

PickGroupsEnabled

#Since v5.0
public bool PickGroupsEnabled { get; set; }
True if GroupObjects should be added to the pick list

PickLine

#Since v5.0
public Line PickLine { get; set; }
pick chord starts on near clipping plane and ends on far clipping plane.

PickMode

#Since v5.0
public PickMode PickMode { get; set; }

PickStyle

#Since v5.0
public PickStyle PickStyle { get; set; }

SubObjectSelectionEnabled

#Since v5.0
public bool SubObjectSelectionEnabled { get; set; }
True if the user had activated sub-object selection

View

#Since v5.0
public RhinoView View { get; set; }
This view can be a model view or a page view. When view is a page view, then you need to distinguish between the viewports MainViewport() and ActiveViewport(). When m_view is a model view, both MainViewport() and ActiveViewport() return the world view's viewport.

Methods

Dispose

#Since v5.0
public void Dispose()

Dispose

#
protected virtual void Dispose(bool disposing)
disposing (bool)

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(BezierCurve bezier, out double t, out double depth, out double distance)
bezier (BezierCurve)
t (out double)
depth (out double)
distance (out double)

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(BoundingBox box, out bool boxCompletelyInFrustum)
Fast test to check if a bounding box intersects a pick frustum.
box (BoundingBox)
boxCompletelyInFrustum (out bool)Set to true if the box is completely contained in the pick frustum. When doing a window or crossing pick, you can immediately return a hit if the object's bounding box is completely inside of the pick frustum.
False if bounding box is invalid or box does not intersect the pick frustum

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(Line line, out double t, out double depth, out double distance)
line (Line)
t (out double)
depth (out double)
distance (out double)

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(Mesh mesh, MeshPickStyle pickStyle, out Point3d hitPoint, out double depth, out double distance, out MeshHitFlag hitFlag, out int hitIndex)
Utility for picking meshes
mesh (Mesh)mesh to test
pickStyle (PickContext.MeshPickStyle)mode used for pick test
hitPoint (out Point3d)location returned here for point picks
depth (out double)depth returned here for point picks LARGER values are NEARER to the camera. SMALLER values are FARTHER from the camera.
distance (out double)planar distance returned here for point picks. SMALLER values are CLOSER to the pick point
hitFlag (out PickContext.MeshHitFlag)For point picks, How to interpret the hitIndex (vertex hit, edge hit, or face hit)
hitIndex (out int)index of vertex/edge/face that was hit. Use hitFlag to determine what this index corresponds to

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(Mesh mesh, MeshPickStyle pickStyle, out Point3d hitPoint, out Point2d hitSurfaceUV, out Point2d hitTextureCoordinate, out double depth, out double distance, out MeshHitFlag hitFlag, out int hitIndex)
Utility for picking meshes
mesh (Mesh)mesh to test
pickStyle (PickContext.MeshPickStyle)mode used for pick test
hitPoint (out Point3d)location returned here for point picks
hitSurfaceUV (out Point2d)If the mesh has surface parameters, set to the surface parameters of the hit point
hitTextureCoordinate (out Point2d)If the mesh has texture coordinates, set to the texture coordinate of the hit point. Note that the texture coordinates can be set in many different ways and this information is useless unless you know how the texture coordinates are set on this particular mesh.
depth (out double)depth returned here for point picks LARGER values are NEARER to the camera. SMALLER values are FARTHER from the camera.
distance (out double)planar distance returned here for point picks. SMALLER values are CLOSER to the pick point
hitFlag (out PickContext.MeshHitFlag)For point picks, How to interpret the hitIndex (vertex hit, edge hit, or face hit)
hitIndex (out int)index of vertex/edge/face that was hit. Use hitFlag to determine what this index corresponds to

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(NurbsCurve curve, out double t, out double depth, out double distance)
curve (NurbsCurve)
t (out double)
depth (out double)
distance (out double)

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(Point3d point, out double depth, out double distance)
Utility for picking 3d point
point (Point3d)
depth (out double)depth returned here for point picks. LARGER values are NEARER to the camera. SMALLER values are FARTHER from the camera.
distance (out double)planar distance returned here for point picks. SMALLER values are CLOSER to the pick point
true if there is a hit

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(Point3d[] points, out int pointIndex, out double depth, out double distance)
points (Point3d[])
pointIndex (out int)
depth (out double)
distance (out double)

PickFrustumTest

#Since v5.0
public bool PickFrustumTest(PointCloud cloud, out int pointIndex, out double depth, out double distance)
cloud (PointCloud)
pointIndex (out int)
depth (out double)
distance (out double)

PickMeshTopologyVertices

#Since v5.0
public int[] PickMeshTopologyVertices(Mesh mesh)
Utility for picking mesh vertices
mesh (Mesh)
indices of mesh topology vertices that were picked

SetPickTransform

#Since v5.0
public void SetPickTransform(Transform transform)
transform (Transform)

UpdateClippingPlanes

#Since v5.0
public void UpdateClippingPlanes()
Updates the clipping plane information in pick region. The SetClippingPlanes and View fields must be called before calling UpdateClippingPlanes().