GetPoint
Used to interactively get a point.
Inheritance Hierarchy
System.Object
Rhino.Input.Custom.GetBaseClass
Rhino.Input.Custom.GetPoint
Rhino.Input.Custom.GetTransform
Namespace: Rhino.Input.Custom
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
public class GetPoint : GetBaseClass
The GetPoint type exposes the following members.
Constructors
Name
Description
Public Method
Code Example
GetPoint
Create a new GetPoint.
Properties
Name
Description
Public Property
DynamicDrawColor
Color used by CRhinoGetPoint::DynamicDraw to draw the current point and the line from the base point to the current point.
Public Property
FullFrameRedrawDuringGet
In the “RARE” case that you need to draw some depth buffered geometry during a Get() operation, setting this value to true will force entire frames to be redrawn while the user moves the mouse. This allows DisplayPipeline events to be triggered as well as OnPostDrawObjects NOTE!! Setting this value to true comes with a significant performance penalty because the scene needs to be fully regenerated every frame where the standard DynamicDraw event draws temporary decorations (geometry) on top of a static scene.
Public Property
OsnapEventType
Gets the type of object snap used to obtain the point.
Public Property
Code Example
Tag
Gets or sets an arbitrary object that can be attached to this GetPoint instance. Useful for passing some/ information that you may need in a DynamicDraw event since you can get at this Tag from the GetPointDrawEventArgs.
Methods
Name
Description
Public Method
AcceptColor
If you want to allow the user to be able to type in a color r,g,b or name during GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptColor(true) before calling GetPoint()/GetObject(). If the user chooses to type in a color, then the result code GetResult.Color is returned and you can use RhinoGet.Color() to get the value of the color. If the get accepts points, then the user will not be able to type in r,g,b colors but will be able to type color names.
(Inherited from GetBaseClass.)
Public Method
AcceptCustomMessage
(Inherited from GetBaseClass.)
Public Method
AcceptEnterWhenDone
There are instances of RhinoGet that prompt with “Press Enter when Done.” yet do not call AcceptNothing(). On the Mac, these instances need an additional call to AcceptEnterWhenDone() so the GetPointOptions dialog can correctly enable the Done button.
(Inherited from GetBaseClass.)
Public Method
Code Example
AcceptNothing
If you want to allow the user to be able to press enter in order to skip selecting a something in GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptNothing( true ) beforehand.
(Inherited from GetBaseClass.)
Public Method
AcceptNumber
If you want to allow the user to be able to type in a number during GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptNumber() beforehand. If the user chooses to type in a number, then the result code GetResult.Number is returned and you can use RhinoGet.Number() to get the value of the number. If you are using GetPoint and you want “0” to return (0,0,0) instead of the number zero, then set acceptZero = false.
(Inherited from GetBaseClass.)
Public Method
AcceptPoint
If you want to allow the user to be able to type in a point then call AcceptPoint(true) before calling GetPoint()/GetObject(). If the user chooses to type in a number, then the result code GetResult.Point is returned and you can use RhinoGet.Point() to get the value of the point.
(Inherited from GetBaseClass.)
Public Method
AcceptString
If you want to allow the user to be able to type in a string during GetPoint.Get(), GetObject::GetObjects(), etc., then call AcceptString(true) before calling GetPoint()/GetObject(). If the user chooses to type in a string, then the result code GetResult.String is returned and you can use RhinoGet.String() to get the value of the string.
(Inherited from GetBaseClass.)
Public Method
AcceptUndo
If you want to allow the user to have an ‘undo’ option in GetPoint.Get(), GetObject.GetObjects(), etc., then call AcceptUndo(true) beforehand.
(Inherited from GetBaseClass.)
Public Method
AddConstructionPoint
Adds a point to the list of construction points.
Public Method
AddConstructionPoints
Adds points to the list of construction points.
Public Method
AddOption(LocalizeStringPair)
Adds a command line option.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOption(String)
Adds a command line option.
(Inherited from GetBaseClass.)
Public Method
AddOption(LocalizeStringPair, LocalizeStringPair)
Adds a command line option.
(Inherited from GetBaseClass.)
Public Method
AddOption(String, String)
Adds a command line option.
(Inherited from GetBaseClass.)
Public Method
AddOption(LocalizeStringPair, LocalizeStringPair, Boolean)
Adds a command line option.
(Inherited from GetBaseClass.)
Public Method
AddOption(String, String, Boolean)
Adds a command line option.
(Inherited from GetBaseClass.)
Public Method
AddOptionColor(LocalizeStringPair, OptionColor.)
Add a command line option to get colors and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionColor(String, OptionColor.)
Add a command line option to get colors and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionColor(LocalizeStringPair, OptionColor., String)
Add a command line option to get colors and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionColor(String, OptionColor., String)
Add a command line option to get colors and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionDouble(LocalizeStringPair, OptionDouble.)
Adds a command line option to get numbers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionDouble(String, OptionDouble.)
Adds a command line option to get numbers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionDouble(LocalizeStringPair, OptionDouble., String)
Adds a command line option to get numbers and automatically saves the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionDouble(String, OptionDouble., String)
Adds a command line option to get numbers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionEnumList.T.(String, T)
Adds a choice of enumerated values as list option
(Inherited from GetBaseClass.)
Public Method
AddOptionEnumList.T.(String, T, .T.)
Adds a choice of enumerated values as list option. Allows to include only some enumerated values.
(Inherited from GetBaseClass.)
Public Method
AddOptionEnumSelectionList.T.
Adds a list of enumerated values as option list. Use enumSelection[go.Option.CurrentListOptionIndex] to retrieve selection.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionInteger(LocalizeStringPair, OptionInteger.)
Adds a command line option to get integers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionInteger(String, OptionInteger.)
Adds a command line option to get integers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionInteger(LocalizeStringPair, OptionInteger., String)
Adds a command line option to get integers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
AddOptionInteger(String, OptionInteger., String)
Adds a command line option to get integers and automatically save the value.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionList(LocalizeStringPair, IEnumerable.LocalizeStringPair., Int32)
Adds a command line list option.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionList(String, IEnumerable.String., Int32)
Adds a command line list option.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionToggle(LocalizeStringPair, OptionToggle.)
Adds a command line option to toggle a setting.
(Inherited from GetBaseClass.)
Public Method
Code Example
AddOptionToggle(String, OptionToggle.)
Adds a command line option to toggle a setting.
(Inherited from GetBaseClass.)
Public Method
AddSnapPoint
Adds a point to the list of osnap points.
Public Method
AddSnapPoints
Adds points to the list of osnap points.
Public Method
Code Example
ClearCommandOptions
Clear all command options.
(Inherited from GetBaseClass.)
Public Method
Code Example
ClearConstraints
Removes any explicit constraints added by calls to GetPoint::Constraint() and enable the built-in constraint options.
Public Method
ClearConstructionPoints
Remove all construction points.
Public Method
ClearDefault
Clears any defaults set using SetDefaultPoint, SetDefaultNumber, SetDefaultString, or SetCommandPromptDefault.
(Inherited from GetBaseClass.)
Public Method
ClearSnapPoints
Remove all snap points.
Public Method
Color
Gets a color if Get*() returns GetResult.Color.
(Inherited from GetBaseClass.)
Public Method
Code Example
CommandResult
Helper method for getting command result value from getter results.
(Inherited from GetBaseClass.)
Public Method
Constrain(Arc)
Constrains the picked point to lie on an arc.
Public Method
Constrain(Circle)
Constrains the picked point to lie on a circle.
Public Method
Constrain(Cylinder)
Constrains the picked point to lie on a cylinder.
Public Method
Code Example
Constrain(Line)
Constrains the picked point to lie on a line.
Public Method
Constrain(Sphere)
Constrains the picked point to lie on a sphere.
Public Method
Code Example
Constrain(Curve, Boolean)
Constrains the picked point to lie on a curve.
Public Method
Constrain(Mesh, Boolean)
Constrains the picked point to lie on a mesh.
Public Method
Constrain(Plane, Boolean)
constrain the picked point to lie on a plane.
Public Method
Code Example
Constrain(Point3d, Point3d)
Constrains the picked point to lie on a line.
Public Method
Code Example
Constrain(Surface, Boolean)
Constrains the picked point to lie on a surface.
Public Method
Constrain(Brep, Int32, Int32, Boolean)
Constrains the picked point to lie on a brep.
Public Method
ConstrainDistanceFromBasePoint
Sets distance constraint from base point.
Public Method
Code Example
ConstrainToConstructionPlane
If enabled, the picked point is constrained to be on the active construction plane. If the base point is set, then the point is constrained to be on the plane that contains the base point and is parallel to the active construction plane. By default this constraint is enabled.
Public Method
ConstrainToTargetPlane
Constrains point to lie on a plane that is parallel to the viewing plane and passes through the view’s target point.
Public Method
ConstrainToVirtualCPlaneIntersection
If enabled, the picked point is constrained to be on the intersection of the plane and the virtual CPlane going through the plane origin. If the planes are parallel, the constraint works just like planar constraint.
Public Method
CustomMessage
(Inherited from GetBaseClass.)
Public Method
Dispose.
(Inherited from GetBaseClass.)
Protected Method
Dispose(Boolean)
(Inherited from GetBaseClass.)
Public Method
Code Example
DrawLineFromPoint
Use DrawLineFromPoint() if you want a dynamic line drawn from a point to the point being picked.
Public Method
EnableCurveSnapArrow
Controls display of the curve snap arrow icon.
Public Method
EnableCurveSnapPerpBar
Controls display of the curve snap perpendicular bar icon.
Public Method
EnableCurveSnapTangentBar
Controls display of the curve snap tangent bar icon.
Public Method
EnableDrawLineFromPoint
Controls drawing of dynamic a line from the start point.
Public Method
EnableNoRedrawOnExit
The default functionality of the GetPoint operation is to perform a redraw on exit. Calling this function with true turns off automatic redraw at the end of GetPoint. May be needed in some commands for flicker free feedback. When set to true, the caller is responsible for cleaning up the screen after GetPoint.
Public Method
EnableObjectSnapCursors
Enables or disables object snap cursors. By default, object snap cursors are enabled.
Public Method
EnableSnapToCurves
If you want GetPoint() to try to snap to curves when the mouse is near a curve (like the center point in the Circle command when the AroundCurve option is on), then enable the snap to curves option.
Public Method
EnableTransparentCommands
Control the availability of transparent commands during the get.
(Inherited from GetBaseClass.)
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected Method
Finalize
(Inherited from GetBaseClass.)
Public Method
Code Example
Get.
After setting up options and so on, call GetPoint::Get to get a 3d point. The point is retrieved when the mouse goes down.
Public Method
Get(Boolean)
After setting up options and so on, call this method to get a 3d point.
Public Method
Get(Boolean, Boolean)
After setting up options and so on, call this method to get a 2d or 3d point.
Public Method
GetConstructionPoints
Gets current construction points.
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public Method
GetPlanarConstraint
Public Method
GetSelectedEnumValue.T.
Returns the selected enumerated value. Use this in combination with
AddOptionEnumList.T.(String, T)
.This must be called directly after having called a Get method, and having obtained a Option value.
(Inherited from GetBaseClass.)
Public Method
GetSelectedEnumValueFromSelectionList.T.
Returns the selected enumerated value by looking at the list of values from which to select. Use this in combination with
AddOptionEnumSelectionList.T.(String, IEnumerable.T., Int32)
(Inherited from GetBaseClass.)
Public Method
GetSnapPoints
Gets current snap points.
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
GotDefault
Returns true if user pressed Enter to accept a default point, number, or string set using SetDefaultPoint, SetDefaultNumber, or SetDefaultString.
(Inherited from GetBaseClass.)
Public Method
InterruptMouseMove
If you have lengthy computations in OnMouseMove() and/or DymanicDraw() overrides, then periodically call InterruptMouseMove() to see if you should interrupt your work because the mouse has moved again.
Public Method
Line2d
Returns two points defining the location in the view window of the 2d line selected in GetPoint::Get2dLine().
(0,0) = upper left corner of window.
(Inherited from GetBaseClass.)
Protected Method
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public Method
Code Example
Number
Gets a number if GetPoint.Get(), GetObject.GetObjects(), etc., returns GetResult.Number.
(Inherited from GetBaseClass.)
Public Method
NumberPreview
If the user is typing a number, but hasn’t pressed Enter, true is returned, along with the number the user typed.
Protected Method
Code Example
OnDynamicDraw
Default calls the DynamicDraw event.
Protected Method
OnMouseDown
Default calls the MouseDown event.
Protected Method
OnMouseMove
Calls the
MouseMove
event and can/should be called by overriding implementation.Protected Method
OnPostDrawObjects
In the “rare” case that you need to draw some depth buffered geometry during a GetPoint operation, override the OnPostDrawObjects function. NOTE!! Overriding this function comes with a significant performance penalty because the scene needs to be fully regenerated every frame where the standard DynamicDraw event draws temporary decorations (geometry) on top of a static scene.
Public Method
Option
(Inherited from GetBaseClass.)
Public Method
OptionIndex
(Inherited from GetBaseClass.)
Public Method
PermitConstraintOptions
Control the availability of the built-in linear, planar, curve, and surface constraint options like “Along”, “AlongPerp”, “AlongTan”, “AlongParallel”, “Between”, “OnCrv”, “OnSrf”, “.x”, “.y”, “.z”, “.xy”, etc.
Public Method
PermitElevatorMode
Permits the use of the control key to define a line constraint.
Public Method
PermitFromOption
Control the availability of the built-in “From” option. By default, the “From” option is enabled.
Public Method
PermitObjectSnap
By default, object snaps like “end”, “near”, etc. are controlled by the user. If you want to disable this ability, then call PermitObjectSnap(false).
Public Method
PermitOrthoSnap
Controls availability of ortho snap. Default is true.
Public Method
PermitTabMode
Permits the use of the tab key to define a line constraint.
Public Method
PickRectangle
If the get was a GetObjects() and the mouse was used to select the objects, then the returned rectangle has left < right and top < bottom. This rectangle is the Windows GDI screen coordinates of the picking rectangle. RhinoViewport.GetPickXform( pick_rect, pick_xform ) will calculate the picking transformation that was used. In all other cases, left=right=top=bottom=0;
(Inherited from GetBaseClass.)
Public Method
Code Example
Point
Gets a point if Get*() returns GetResult.Point.
(Inherited from GetBaseClass.)
Public Method
Point2d
Returns location in view of point in selected in GetPoint::Get() or GetPoint::Get2dPoint(). (0,0) = upper left corner of window.
(Inherited from GetBaseClass.)
Public Method
PointOnBrep
Use to determine if point was on a Brep face. If the point was on a Brep face, then the (u,v) are the face parameters for the point.
Public Method
Code Example
PointOnCurve
Use to determine is point was on a curve.
Public Method
PointOnObject
Call this function to see if the point was on an object. If the point was on an object an ObjRef is returned; otherwise null is returned.
Public Method
PointOnSurface
Use to determine if point was on a surface. If the point was on a surface, then the (u,v) are the surface parameters for the point. The point returned by Point() is the same as surface.PointAt(u,v).
Public Method
Rectangle2d
Returns the location in the view of the 2d rectangle selected in GetPoint::Get2dRectangle(). rect.left < rect.right and rect.top < rect.bottom (0,0) = upper left corner of window.
(Inherited from GetBaseClass.)
Public Method
Result
Returns result of the Get*() call.
(Inherited from GetBaseClass.)
Public Method
Code Example
SetBasePoint
Sets a base point used by ortho snap, from snap, planar snap, etc.
Public Method
Code Example
SetCommandPrompt
Sets prompt message that appears in the command prompt window.
(Inherited from GetBaseClass.)
Public Method
Code Example
SetCommandPromptDefault
Sets message that describes what default value will be used if the user presses enter. This description appears in angle brackets <> in the command prompt window. You do not need to provide a default value description unless you explicitly enable AcceptNothing.
(Inherited from GetBaseClass.)
Public Method
SetCursor
Sets cursor that will be used when Get() is called and snap is not happening.
Public Method
SetDefaultColor
Sets a color as default value that will be returned if the user presses ENTER key during the get.
(Inherited from GetBaseClass.)
Public Method
SetDefaultInteger
Sets a number as default value that will be returned if the user presses ENTER key during the get.
(Inherited from GetBaseClass.)
Public Method
SetDefaultNumber
Sets a number as default value that will be returned if the user presses ENTER key during the get.
(Inherited from GetBaseClass.)
Public Method
SetDefaultPoint
Sets a point as default value that will be returned if the user presses the ENTER key during the get.
(Inherited from GetBaseClass.)
Public Method
Code Example
SetDefaultString
Sets a string as default value that will be returned if the user presses ENTER key during the get.
(Inherited from GetBaseClass.)
Public Method
SetOptionVaries
Sets a command line option value to print “Varies” instead of the regular value.
(Inherited from GetBaseClass.)
Public Method
SetWaitDuration
Sets the wait duration (in milliseconds) of the getter. If the duration passes without the user making a decision, the GetResult.Timeout code is returned.
(Inherited from GetBaseClass.)
Public Method
Code Example
StringResult
Gets a string if GetPoint.Get(), GetObject.GetObjects(), etc., returns GetResult.String.
(Inherited from GetBaseClass.)
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public Method
TryGetBasePoint
Public Method
Vector
Gets a direction if Get*() returns GetResult.Point (Set by some digitizers, but in general it’s (0,0,0).
(Inherited from GetBaseClass.)
Public Method
Code Example
View
Gets a view the user clicked in during GetPoint.Get(), GetObject.GetObjects(), etc.
(Inherited from GetBaseClass.)
Events
Name
Description
Public Event
DynamicDraw
Event to use if you want to dynamically draw things as the mouse/digitizer moves. Every time the mouse moves, DynamicDraw will be called once per viewport. The calls to DynamicDraw happen AFTER the call to MouseMove. If you are drawing anything that takes a long time, periodically call InterruptMouseMove() to see if you should stop.
Public Event
MouseDown
Called during Get2dRectangle, Get2dLine, and GetPoint(..,true) when the mouse down event for the initial point occurs. This function is not called during ordinary point getting because the mouse down event terminates an ordinary point get and returns a GetResult.Point result.
Public Event
MouseMove
Called every time the mouse moves. MouseMove is called once per mouse move and is called BEFORE any calls to OnDynamicDraw. If you are doing anything that takes a long time, periodically call InterruptMouseMove() to see if you should stop. If the view is such that the 2d screen point can’t be mapped to a 3d point, the ‘point’ argument will be Unset.
Public Event
PostDrawObjects
Same as the DisplayPipeline.PostDrawObjects, but only works during the operation of the Get() function. NOTE: You must set FullFrameRedrawDuringGet to true in order for this event to be called.