RhinoViewport

References
public class RhinoViewport : IDisposable
Displays geometry with a given projection. In standard modeling views there is a one to one relationship between RhinoView and RhinoViewports. In a page layout, there may be multiple RhinoViewports for a single layout.

Constructors

RhinoViewport

#Since v5.0
public RhinoViewport()

RhinoViewport

#Since v5.0
public RhinoViewport(
RhinoViewport
other
)

Finalizer

~RhinoViewport

#
~RhinoViewport()

Properties

Bounds

#Since v5.0
Gets the size and location of the viewport, in pixels, relative to the parent view.
public Rectangle Bounds { get; }

Camera35mmLensLength

#Since v5.0
public double Camera35mmLensLength { get; set; }

CameraAngle

#Since v9.0
Gets or sets the 1/2 of smallest subtended view angle.
public double CameraAngle { get; set; }

CameraDirection

#Since v5.0
public Vector3d CameraDirection { get; }

CameraLocation

#Since v5.0
public Point3d CameraLocation { get; }

CameraTarget

#Since v5.0
Viewport target point.
public Point3d CameraTarget { get; }

CameraUp

#ExampleSince v5.0
public Vector3d CameraUp { get; set; }

CameraX

#Since v5.0
Gets the "unit to the right" vector.
public Vector3d CameraX { get; }

CameraY

#Since v5.0
Gets the "unit up" vector.
public Vector3d CameraY { get; }

CameraZ

#Since v5.0
Gets the unit vector in CameraDirection.
public Vector3d CameraZ { get; }

ChangeCounter

#Since v5.0
The value of change counter is incremented every time the view projection or construction plane changes. The user can the mouse and nestable view manipulation commands to change a view at any time. The value of change counter can be used to detect these changes in code that is sensitive to the view projection.
[CLSCompliant(false)] public uint ChangeCounter { get; }

ConstructionAxesVisible

#Since v5.0
public bool ConstructionAxesVisible { get; set; }

ConstructionGridVisible

#Since v5.0
public bool ConstructionGridVisible { get; set; }

DisplayMode

#Since v5.0
public DisplayModeDescription DisplayMode { get; set; }

FrustumAspect

#Since v5.0
Gets the width/height ratio of the frustum.
public double FrustumAspect { get; }

Id

#Since v5.0
Unique id for this viewport.
public Guid Id { get; }

IsParallelProjection

#Since v5.0
public bool IsParallelProjection { get; }

IsPerspectiveProjection

#Since v5.0
public bool IsPerspectiveProjection { get; }

IsPlanView

#Since v5.0
true if construction plane z axis is parallel to camera direction.
public bool IsPlanView { get; }

IsTwoPointPerspectiveProjection

#Since v5.0
public bool IsTwoPointPerspectiveProjection { get; }

IsValidCamera

#Since v5.0
public bool IsValidCamera { get; }

IsValidFrustum

#Since v5.0
public bool IsValidFrustum { get; }

LockedProjection

#Since v8.0
If true, the camera location, camera direction, and lens angle should not be changed.
public bool LockedProjection { get; set; }

Name

#ExampleSince v5.0
Name associated with this viewport.
public string Name { get; set; }

ParentView

#Since v5.0
Gets the parent view, if there is one Every RhinoView has an associated RhinoViewport that does all the 3d display work. Those associated viewports return the RhinoView as their parent view. However, RhinoViewports are used in other image creating contexts that do not have a parent RhinoView. If you call ParentView, you MUST check for NULL return values.
public RhinoView ParentView { get; }

ScreenPortAspect

#Since v5.0
screen port's width/height.
public double ScreenPortAspect { get; }

Size

#ExampleSince v5.0
Get or set the height and width of the viewport (in pixels)
public Size Size { get; set; }

UserStringCount

#Since v6.18
public int UserStringCount { get; }

ViewportType

#Since v5.0
public ViewportType ViewportType { get; }

WallpaperFilename

#Since v5.0
public string WallpaperFilename { get; }

WallpaperGrayscale

#Since v5.0
public bool WallpaperGrayscale { get; }

WallpaperVisible

#Since v5.0
public bool WallpaperVisible { get; }

WorldAxesVisible

#Since v5.0
public bool WorldAxesVisible { get; set; }

Methods

ChangeToParallelProjection

#Since v5.0
Use this function to change projections of valid viewports from perspective to parallel. It will make common additional adjustments to the frustum so the resulting views are similar. The camera location and direction will not be changed.
public bool ChangeToParallelProjection(
symmetricFrustum
true if you want the resulting frustum to be symmetric.
)
If the current projection is parallel and bSymmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.

ChangeToParallelReflectedProjection

#Since v8.14
When a viewport is set to Parallel Reflected projection, the geometry on the ceiling is shown as if it is mirrored to the floor below.
public bool ChangeToParallelReflectedProjection()

ChangeToPerspectiveProjection

#Since v5.0
Use this function to change projections of valid viewports from parallel to perspective. It will make common additional adjustments to the frustum and camera location so the resulting views are similar. The camera direction and target point are not be changed.
public bool ChangeToPerspectiveProjection(
symmetricFrustum,
true if you want the resulting frustum to be symmetric.
lensLength
(pass 50.0 when in doubt) 35 mm lens length to use when changing from parallel to perspective projections. If the current projection is perspective or lens_length is <= 0.0, then this parameter is ignored.
)
If the current projection is perspective and bSymmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.

ChangeToPerspectiveProjection

#Since v5.0
Use this function to change projections of valid viewports from parallel to perspective. It will make common additional adjustments to the frustum and camera location so the resulting views are similar. The camera direction and target point are not be changed.
public bool ChangeToPerspectiveProjection(
targetDistance,
If RhinoMath.UnsetValue this parameter is ignored. Otherwise it must be > 0 and indicates which plane in the current view frustum should be preserved.
symmetricFrustum,
true if you want the resulting frustum to be symmetric.
lensLength
(pass 50.0 when in doubt) 35 mm lens length to use when changing from parallel to perspective projections. If the current projection is perspective or lens_length is <= 0.0, then this parameter is ignored.
)
If the current projection is perspective and bSymmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.

ChangeToTwoPointPerspectiveProjection

#Since v6.0
Use this function to change projections of valid viewports to a two point perspective. It will make common additional adjustments to the frustum and camera location and direction so the resulting views are similar.
public bool ChangeToTwoPointPerspectiveProjection(
lensLength
(pass 50.0 when in doubt) 35 mm lens length to use when changing from parallel to perspective projections. If the current projection is perspective or lens_length is <= 0.0, then this parameter is ignored.
)
If the current projection is perspective and bSymmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.

ChangeToTwoPointPerspectiveProjection

#Since v6.0
Use this function to change projections of valid viewports to a two point perspective. It will make common additional adjustments to the frustum and camera location and direction so the resulting views are similar.
public bool ChangeToTwoPointPerspectiveProjection(
targetDistance,
If RhinoMath.UnsetValue this parameter is ignored. Otherwise it must be > 0 and indicates which plane in the current view frustum should be preserved.
up,
This direction will be the locked up direction. Pass ON_3dVector::ZeroVector if you want to use the world axis direction that is closest to the current up direction. Pass CameraY() if you want to preserve the current up direction.
lensLength
(pass 50.0 when in doubt) 35 mm lens length to use when changing from parallel to perspective projections. If the current projection is perspective or lens_length is <= 0.0, then this parameter is ignored.
)
If the current projection is perspective and bSymmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.

ClearTraceImage

#Since v5.0
Remove trace image (background bitmap) for this viewport if one exists.
public void ClearTraceImage()

ClientToScreen

#Since v5.0
public Point ClientToScreen(
clientPoint
)

ClientToScreen

#Since v5.0
public Point ClientToScreen(
clientPoint
)

ClientToWorld

#Since v5.0
public Line ClientToWorld(
clientPoint
)

ClientToWorld

#Since v5.0
public Line ClientToWorld(
clientPoint
)

ConstructionPlane

#ExampleSince v5.0
Simple plane information for this viewport's construction plane. If you want detailed construction plane information, use GetConstructionPlane.
public Plane ConstructionPlane()

DeleteAllUserStrings

#Since v6.18
public void DeleteAllUserStrings()

DeleteUserString

#Since v6.18
public bool DeleteUserString(
key
)

Dispose

#Since v5.0
public void Dispose()

Dispose

#
protected virtual void Dispose(
disposing
)

FromId

#Since v6.0
Call this method to get the viewport with the specified Id.
public static RhinoViewport FromId(
id
Id to search for.
)
Returns a RhinoViewport if the Id is found otherwise null.

GetCameraAngle

#Since v5.0
public bool GetCameraAngle(
out double
halfDiagonalAngle,
out double
halfVerticalAngle,
out double
halfHorizontalAngle
)

GetCameraExtents

#Since v5.0
public BoundingBox GetCameraExtents()

GetCameraFrame

#Since v5.0
Gets the camera plane.
public bool GetCameraFrame(
out Plane
frame
A plane is assigned to this out parameter during the call, if the operation succeeded.
)
true if current camera orientation is valid.

GetConstructionPlane

#Since v5.0
public ConstructionPlane GetConstructionPlane()

GetDepth

#Since v5.0
Gets near and far clipping distances of a bounding box.
public bool GetDepth(
bbox,
The bounding box.
out double
nearDistance,
The near distance is assigned to this out parameter during this call.
out double
farDistance
The far distance is assigned to this out parameter during this call.
)
true if the bounding box intersects the view frustum and near_dist/far_dist were set. false if the bounding box does not intersect the view frustum.

GetDepth

#Since v5.0
Gets clipping distance of a point.
public bool GetDepth(
point,
A 3D point.
out double
distance
A computed distance is assigned to this out parameter if this call succeeds.
)
true if the point is in the view frustum and near_dist/far_dist were set. false if the bounding box does not intersect the view frustum.

GetDepth

#Since v5.0
Gets near and far clipping distances of a sphere.
public bool GetDepth(
sphere,
The sphere.
out double
nearDistance,
The near distance is assigned to this out parameter during this call.
out double
farDistance
The far distance is assigned to this out parameter during this call.
)
true if the sphere intersects the view frustum and near_dist/far_dist were set. false if the sphere does not intersect the view frustum.

GetFarRect

#Since v5.0
Get corners of far clipping plane rectangle.
public Point3d[] GetFarRect()
[left_bottom, right_bottom, left_top, right_top] points on success null on failure.

GetFrustum

#Since v5.0
Gets the view frustum.
public bool GetFrustum(
out double
left,
left < right.
out double
right,
left < right.
out double
bottom,
bottom < top.
out double
top,
bottom < top.
out double
nearDistance,
0 < nearDistance < farDistance.
out double
farDistance
0 < nearDistance < farDistance.
)
true if operation succeeded.

GetFrustumBottomPlane

#Since v5.0
Get bottom world frustum clipping plane.
public bool GetFrustumBottomPlane(
out Plane
plane
frustum bottom side clipping plane. The normal points into the visible region of the frustum. If the projection is perspective, the origin is at the camera location, otherwise the origin is the point on the plane that is closest to the camera location.
)
true if camera and frustum are valid and plane was set.

GetFrustumBoundingBox

#Since v5.0
public BoundingBox GetFrustumBoundingBox()

GetFrustumCenter

#Since v5.0
Returns world coordinates of frustum's center.
public bool GetFrustumCenter(
out Point3d
center
The center coordinate is assigned to this out parameter if this call succeeds.
)
true if the center was successfully computed.

GetFrustumFarPlane

#Since v5.0
Get far clipping plane.
public bool GetFrustumFarPlane(
out Plane
plane
far clipping plane if camera and frustum are valid. The plane's frame is the same as the camera's frame. The origin is located at the intersection of the camera direction ray and the far clipping plane.
)
true if camera and frustum are valid.

GetFrustumLeftPlane

#Since v5.0
Get left world frustum clipping plane.
public bool GetFrustumLeftPlane(
out Plane
plane
frustum left side clipping plane. The normal points into the visible region of the frustum. If the projection is perspective, the origin is at the camera location, otherwise the origin is the point on the plane that is closest to the camera location.
)
true if camera and frustum are valid and plane was set.

GetFrustumLine

#Since v5.0
Gets the world coordinate line in the view frustum that projects to a point on the screen.
public bool GetFrustumLine(
screenX,
(screenx,screeny) = screen location.
screenY,
(screenx,screeny) = screen location.
out Line
worldLine
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.
)
true if successful. false if view projection or frustum is invalid.

GetFrustumNearPlane

#Since v5.0
Get near clipping plane.
public bool GetFrustumNearPlane(
out Plane
plane
near clipping plane if camera and frustum are valid. The plane's frame is the same as the camera's frame. The origin is located at the intersection of the camera direction ray and the near clipping plane.
)
true if camera and frustum are valid.

GetFrustumRightPlane

#Since v5.0
Get right world frustum clipping plane.
public bool GetFrustumRightPlane(
out Plane
plane
frustum right side clipping plane. The normal points into the visible region of the frustum. If the projection is perspective, the origin is at the camera location, otherwise the origin is the point on the plane that is closest to the camera location.
)
true if camera and frustum are valid and plane was set.

GetFrustumTopPlane

#Since v5.0
Get top world frustum clipping plane.
public bool GetFrustumTopPlane(
out Plane
plane
frustum top side clipping plane. The normal points into the visible region of the frustum. If the projection is perspective, the origin is at the camera location, otherwise the origin is the point on the plane that is closest to the camera location.
)
true if camera and frustum are valid and plane was set.

GetNearRect

#Since v5.0
Get corners of near clipping plane rectangle.
public Point3d[] GetNearRect()
[left_bottom, right_bottom, left_top, right_top] points on success null on failure.

GetPickTransform

#Since v5.0
Takes a rectangle in screen coordinates and returns a transformation that maps the 3d frustum defined by the rectangle to a -1/+1 clipping coordinate box. This takes a single point and inflates it by Rhino.ApplicationSettings.ModelAidSettings.MousePickBoxRadius to define the screen rectangle.
public Transform GetPickTransform(
clientX,
The client point X coordinate.
clientY
The client point Y coordinate.
)
A transformation matrix.

GetPickTransform

#Since v5.0
Takes a rectangle in screen coordinates and returns a transformation that maps the 3d frustum defined by the rectangle to a -1/+1 clipping coordinate box. This takes a single point and inflates it by Rhino.ApplicationSettings.ModelAidSettings.MousePickBoxRadius to define the screen rectangle.
public Transform GetPickTransform(
clientPoint
The client point.
)
A transformation matrix.

GetPickTransform

#Since v5.0
Takes a rectangle in screen coordinates and returns a transformation that maps the 3d frustum defined by the rectangle to a -1/+1 clipping coordinate box.
public Transform GetPickTransform(
clientRectangle
The client rectangle.
)
A transformation matrix.

GetScreenPort

#Since v5.0
Location of viewport in pixels. These are provided so you can set the port you are using and get the appropriate transformations to and from screen space.
public bool GetScreenPort(
out int
portLeft,
portLeft != portRight.
out int
portRight,
portLeft != portRight.
out int
portBottom,
portTop != portBottom.
out int
portTop,
portTop != portBottom.
out int
portNear,
The viewport near value.
out int
portFar
The viewport far value.
)
true if the operation is successful.

GetTransform

#ExampleSince v5.0
Gets a transform from origin coordinate system to a target coordinate system.
public Transform GetTransform(
sourceSystem,
The origin coordinate system.
destinationSystem
The target coordinate system.
)
4x4 transformation matrix (acts on the left) Identity matrix is returned if this function fails.

GetUserString

#Since v6.18
Gets a user string.
public string GetUserString(
key
id used to retrieve the string.
)
string associated with the key if successful. null if no key was found.

GetUserStrings

#Since v6.18
Gets an independent copy of the collection of (user text key, user text value) pairs attached to this object.
public NameValueCollection GetUserStrings()
A collection of key strings and values strings. This

GetViewScale

#Since v8.0
Get Scale transform applied to the viewport
public double[] GetViewScale()

GetWorldToScreenScale

#Since v5.0
Gets the world to screen size scaling factor at a point in frustum.
public bool GetWorldToScreenScale(
pointInFrustum,
A point in frustum.
out double
pixelsPerUnit
scale = number of pixels per world unit at the 3d point.

This out parameter is assigned during this call.

)
true if the operation is successful.

IsVisible

#Since v5.0
Returns true if some portion of a world coordinate bounding box is potentially visible in the viewing frustum.
public bool IsVisible(
bbox
A bounding box that is tested for visibility.
)
true if the box is potentially visible; otherwise false.

IsVisible

#Since v5.0
Determines if a world coordinate point is visible in the viewing frustum.
public bool IsVisible(
point
A point that is tested for visibility.
)
true if the point is visible; otherwise false.

KeyboardDolly

#Since v5.0
Emulates the keyboard arrow key in terms of interaction.
public bool KeyboardDolly(
leftRight,
left/right dolly if true, up/down dolly if false.
amount
The dolly amount.
)
true if operation succeeded; otherwise false.

KeyboardDollyInOut

#Since v5.0
Emulates the keyboard arrow key in terms of interaction.
public bool KeyboardDollyInOut(
amount
The dolly amount.
)
true if operation succeeded; otherwise false.

KeyboardRotate

#Since v5.0
Emulates the keyboard arrow key in terms of interaction.
public bool KeyboardRotate(
leftRight,
left/right rotate if true, up/down rotate if false.
angleRadians
If less than 0, rotation is to left or down. If greater than 0, rotation is to right or up.
)
true if operation succeeded; otherwise false.

LastLensLength

#Since v9.0
Returns the lens length of this viewport the last time it was using perspective projection in this session.
public double LastLensLength()

Magnify

#Since v5.0
Zooms or dollies in order to scale the viewport projection of observed objects.
public bool Magnify(
magnificationFactor,
The scale factor.
mode,
false = perform a "dolly" magnification by moving the camera towards/away from the target so that the amount of the screen subtended by an object changes. true = perform a "zoom" magnification by adjusting the "lens" angle
fixedScreenPoint
A point in the screen that should remain fixed.
)
true if operation succeeded; otherwise false.

Magnify

#Since v5.0
Zooms or dollies in order to scale the viewport projection of observed objects.
public bool Magnify(
magnificationFactor,
The scale factor.
mode
false = perform a "dolly" magnification by moving the camera towards/away from the target so that the amount of the screen subtended by an object changes. true = perform a "zoom" magnification by adjusting the "lens" angle
)
true if operation succeeded; otherwise false.

MouseAdjustLensLength

#Since v6.0
Adjusts the camera lens length.
public bool MouseAdjustLensLength(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint,
The mouse current point.
moveTarget
Should this operation move the target?
)

MouseDollyZoom

#Since v5.0
Zooms lens (thus adjusting the field of view) while moving the camera.
public bool MouseDollyZoom(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

MouseInOutDolly

#Since v5.0
Moves the camera towards or away from the view maintaining focus on the view.
public bool MouseInOutDolly(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

MouseLateralDolly

#Since v6.0
Pans the camera
public bool MouseLateralDolly(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

MouseMagnify

#Since v5.0
Moves the camera towards or away from the view.
public bool MouseMagnify(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

MouseRotateAroundTarget

#Since v5.0
Rotates the viewport around target.
public bool MouseRotateAroundTarget(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

MouseRotateCamera

#Since v5.0
Rotates the view around the camera location.
public bool MouseRotateCamera(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

MouseTilt

#Since v5.0
Tilts the camera view.
public bool MouseTilt(
mousePreviousPoint,
The mouse previous point.
mouseCurrentPoint
The mouse current point.
)

NextConstructionPlane

#Since v5.0
Sets the construction plane to the plane that was active before the last call to PreviousConstructionPlane.
public bool NextConstructionPlane()
true if successful.

NextViewProjection

#Since v5.0
Sets the view projection and target to the settings that were active before the last call to PrevView.
public bool NextViewProjection()
true if the view stack was popped.

PopConstructionPlane

#Since v5.0
Sets the construction plane to the plane that was active before the last call to PushConstructionPlane.
public bool PopConstructionPlane()
true if a construction plane was popped.

PopViewProjection

#ExampleSince v5.0
Sets the view projection and target to the settings at the top of the view stack and removes those settings from the view stack.
public bool PopViewProjection()
true if there were settings that could be popped from the stack.

PreviousConstructionPlane

#Since v5.0
Sets the construction plane to the plane that was active before the last call to NextConstructionPlane or SetConstructionPlane.
public bool PreviousConstructionPlane()
true if successful.

PreviousViewProjection

#Since v5.0
Sets the view projection and target to the settings that were active before the last call to NextViewProjection.
public bool PreviousViewProjection()
true if the view stack was popped.

PushConstructionPlane

#Since v5.0
Pushes the current construction plane on the viewport's construction plane stack and sets the construction plane to cplane.
public void PushConstructionPlane(
cplane
The construction plane to push.
)

PushViewInfo

#Since v5.0
public bool PushViewInfo(
viewinfo,
includeTraceImage
)

PushViewProjection

#ExampleSince v5.0
Appends the current view projection and target to the viewport's view stack.
public void PushViewProjection()

Rotate

#Since v5.0
Rotates about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
public bool Rotate(
angleRadians,
angle of rotation in radians.
rotationAxis,
direction of the axis of rotation.
rotationCenter
point on the axis of rotation.
)
true if geometry successfully rotated.

ScreenToClient

#Since v5.0
public Point ScreenToClient(
screenPoint
)

SetCameraDirection

#ExampleSince v5.0
Set viewport camera direction. By default the target location is changed so that the vector from the camera location to the target is parallel to the camera direction.
public void SetCameraDirection(
cameraDirection,
new camera direction.
updateTargetLocation
if true, the target location is changed so that the vector from the camera location to the target is parallel to the camera direction. If false, the target location is not changed. See the remarks section of RhinoViewport.SetTarget for important details.
)

SetCameraLocation

#ExampleSince v5.0
Set viewport camera location. By default the target location is changed so that the vector from the camera location to the target is parallel to the camera direction vector.
public void SetCameraLocation(
cameraLocation,
new camera location.
updateTargetLocation
if true, the target location is changed so that the vector from the camera location to the target is parallel to the camera direction vector. If false, the target location is not changed. See the remarks section of RhinoViewport.SetTarget for important details.
)

SetCameraLocations

#Since v5.0
Set viewport camera location and target location. The camera direction vector is changed so that it is parallel to the vector from the camera location to the target location.
public void SetCameraLocations(
targetLocation,
new target location.
cameraLocation
new camera location.
)

SetCameraTarget

#Since v5.0
Set viewport target point. By default the camera location is translated so that the camera direction vector is parallel to the vector from the camera location to the target location.
public void SetCameraTarget(
targetLocation,
new target location.
updateCameraLocation
if true, the camera location is translated so that the camera direction vector is parallel to the vector from the camera location to the target location. If false, the camera location is not changed.
)
Remarks: In general, Rhino users expect to have the camera direction vector and the vector from the camera location to the target location to be parallel. If you use the RhinoViewport functions to set the camera location, camera direction, and target point, then the relationship between these three points and vectors is automatically maintained. If you directly manipulate the camera properties, then you should carefully set the target by calling SetTarget() with updateCameraLocation=false.

SetClippingPlanes

#Since v5.0
Sets optimal clipping planes to view objects in a world coordinate 3d bounding box.
public void SetClippingPlanes(
box
The bounding box
)

SetConstructionPlane

#Since v5.0
Sets the construction plane to cplane.
public void SetConstructionPlane(
cplane
The construction plane to set.
)

SetConstructionPlane

#Since v5.0
public void SetConstructionPlane(
plane
)

SetProjection

#Since v5.0
Set viewport to a defined projection.
public bool SetProjection(
projection,
The "standard" projection type.
viewName,
If not null or empty, the name is set.
updateConstructionPlane
If true, the construction plane is set to the viewport plane.
)
true if successful.

SetProjection

#Since v9.0
Set viewport to a defined projection.
public bool SetProjection(
projection,
The "isometric" projection type.
viewName,
If not null or empty, the name is set.
updateConstructionPlane
If true, the construction plane is set to the viewport plane.
)
true if successful.

SetScreenPort

#Since v9.0
Location of viewport in pixels. These are provided so you can set the port you are using and get the appropriate transformations to and from screen space.
public bool SetScreenPort(
portLeft,
portLeft != portRight.
portRight,
portLeft != portRight.
portBottom,
portTop != portBottom.
portTop,
portTop != portBottom.
portNear = 0,
The viewport near value.
portFar = 0
The viewport far value.
)
true if the operation is successful.

SetToPlanView

#Since v5.0
public bool SetToPlanView(
planeOrigin,
planeXaxis,
planeYaxis,
setConstructionPlane
)

SetTraceImage

#ExampleSince v5.0
Set trace image (background bitmap) for this viewport.
public bool SetTraceImage(
bitmapFileName,
The bitmap file name.
plane,
A picture plane.
width,
The picture width.
height,
The picture height.
grayscale,
true if the picture should be in grayscale.
filtered
true if image should be filtered (bilinear) before displayed.
)
true if successful.

SetUserString

#Since v6.18
Attach a user string (key,value combination) to this geometry.
public bool SetUserString(
key,
id used to retrieve this string.
value
string associated with key. If null, the key will be removed
)
true on success.

SetUserStrings

#Since v8.18
Attach a user string (key,value combination) to this viewport.
public bool SetUserStrings(
items,
collection of key-value pairs to set.
replace
If True, the previous user string will be removed
)
true on success.

SetViewProjection

#Since v5.0
Sets the viewport camera projection.
public bool SetViewProjection(
projection,
The "standard" projection type.
updateTargetLocation
if true, the target location is changed so that the vector from the camera location to the target is parallel to the camera direction vector. If false, the target location is not changed.
)
true on success.

SetWallpaper

#Since v5.0
public bool SetWallpaper(
imageFilename,
grayscale,
visible
)

SetWallpaper

#Since v5.0
public bool SetWallpaper(
imageFilename,
grayscale
)

WorldToClient

#Since v5.0
Convert a point from world coordinates in the viewport to a 2d screen point in the local coordinates of the viewport (X/Y of point is relative to top left corner of viewport on screen)
public Point2d WorldToClient(
worldPoint
The 3D point in world coordinates.
)
The 2D point on the screen.

ZoomBoundingBox

#Since v5.0
Zooms the viewport to the given bounding box.
public bool ZoomBoundingBox(
box
The bounding box to zoom.
)
true if operation succeeded; otherwise false.

ZoomExtents

#ExampleSince v5.0
Dollies the camera location and so that the view frustum contains all of the selected document objects that can be seen in view. If the projection is perspective, the camera angle is not changed.
public bool ZoomExtents()
true if successful.

ZoomExtentsSelected

#Since v5.0
Dollies the camera location and so that the view frustum contains all of the selected document objects that can be seen in view. If the projection is perspective, the camera angle is not changed.
public bool ZoomExtentsSelected()
true if successful.

ZoomWindow

#Since v7.33
Zooms the viewport to the given rectangle.
public bool ZoomWindow(
rect
A 2d screen rectangle in client coordinates of the parent Rhino view, where 0,0 is the upper left corner of the view window.
)
true if operation succeeded; otherwise false.