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)
other (RhinoViewport)

Finalizer

~RhinoViewport

#
~RhinoViewport()

Properties

Bounds

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

Camera35mmLensLength

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

CameraAngle

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

CameraDirection

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

CameraLocation

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

CameraTarget

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

CameraUp

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

CameraX

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

CameraY

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

CameraZ

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

ChangeCounter

#Since v5.0
[CLSCompliant(false)] public uint ChangeCounter { get; }
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.

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
public double FrustumAspect { get; }
Gets the width/height ratio of the frustum.

Id

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

IsParallelProjection

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

IsPerspectiveProjection

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

IsPlanView

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

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
public bool LockedProjection { get; set; }
If true, the camera location, camera direction, and lens angle should not be changed.

Name

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

ParentView

#Since v5.0
public RhinoView ParentView { get; }
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.

ScreenPortAspect

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

Size

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

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
public bool ChangeToParallelProjection(bool symmetricFrustum)
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.
symmetricFrustum (bool)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
public bool ChangeToParallelReflectedProjection()
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.

ChangeToPerspectiveProjection

#Since v5.0
public bool ChangeToPerspectiveProjection(bool symmetricFrustum, double lensLength)
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.
symmetricFrustum (bool)true if you want the resulting frustum to be symmetric.
lensLength (double)(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
public bool ChangeToPerspectiveProjection(double targetDistance, bool symmetricFrustum, double lensLength)
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.
targetDistance (double)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 (bool)true if you want the resulting frustum to be symmetric.
lensLength (double)(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
public bool ChangeToTwoPointPerspectiveProjection(double lensLength)
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.
lensLength (double)(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
public bool ChangeToTwoPointPerspectiveProjection(double targetDistance, Vector3d up, double lensLength)
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.
targetDistance (double)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 (Vector3d)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 (double)(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
public void ClearTraceImage()
Remove trace image (background bitmap) for this viewport if one exists.

ClientToScreen

#Since v5.0
public Point ClientToScreen(Point clientPoint)
clientPoint (Point)

ClientToScreen

#Since v5.0
public Point ClientToScreen(Point2d clientPoint)
clientPoint (Point2d)

ClientToWorld

#Since v5.0
public Line ClientToWorld(Point clientPoint)
clientPoint (Point)

ClientToWorld

#Since v5.0
public Line ClientToWorld(Point2d clientPoint)
clientPoint (Point2d)

ConstructionPlane

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

DeleteAllUserStrings

#Since v6.18
public void DeleteAllUserStrings()

DeleteUserString

#Since v6.18
public bool DeleteUserString(string key)
key (string)

Dispose

#Since v5.0
public void Dispose()

Dispose

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

FromId

#Since v6.0
public static RhinoViewport FromId(Guid id)
Call this method to get the viewport with the specified Id.
id (Guid)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)
halfDiagonalAngle (out double)
halfVerticalAngle (out double)
halfHorizontalAngle (out double)

GetCameraExtents

#Since v5.0
public BoundingBox GetCameraExtents(IEnumerable<Point3d> points)
points (IEnumerable<Point3d>)

GetCameraFrame

#Since v5.0
public bool GetCameraFrame(out Plane frame)
Gets the camera plane.
frame (out Plane)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
public bool GetDepth(BoundingBox bbox, out double nearDistance, out double farDistance)
Gets near and far clipping distances of a bounding box.
bbox (BoundingBox)The bounding box.
nearDistance (out double)The near distance is assigned to this out parameter during this call.
farDistance (out double)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
public bool GetDepth(Point3d point, out double distance)
Gets clipping distance of a point.
point (Point3d)A 3D point.
distance (out double)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
public bool GetDepth(Sphere sphere, out double nearDistance, out double farDistance)
Gets near and far clipping distances of a sphere.
sphere (Sphere)The sphere.
nearDistance (out double)The near distance is assigned to this out parameter during this call.
farDistance (out double)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
public Point3d[] GetFarRect()
Get corners of far clipping plane rectangle.
[left_bottom, right_bottom, left_top, right_top] points on success null on failure.

GetFrustum

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

GetFrustumBottomPlane

#Since v5.0
public bool GetFrustumBottomPlane(out Plane plane)
Get bottom world frustum clipping plane.
plane (out 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
public bool GetFrustumCenter(out Point3d center)
Returns world coordinates of frustum's center.
center (out Point3d)The center coordinate is assigned to this out parameter if this call succeeds.
true if the center was successfully computed.

GetFrustumFarPlane

#Since v5.0
public bool GetFrustumFarPlane(out Plane plane)
Get far clipping plane.
plane (out 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
public bool GetFrustumLeftPlane(out Plane plane)
Get left world frustum clipping plane.
plane (out 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
public bool GetFrustumLine(double screenX, double screenY, out Line worldLine)
Gets the world coordinate line in the view frustum that projects to a point on the screen.
screenX (double)(screenx,screeny) = screen location.
screenY (double)(screenx,screeny) = screen location.
worldLine (out Line)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
public bool GetFrustumNearPlane(out Plane plane)
Get near clipping plane.
plane (out 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
public bool GetFrustumRightPlane(out Plane plane)
Get right world frustum clipping plane.
plane (out 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
public bool GetFrustumTopPlane(out Plane plane)
Get top world frustum clipping plane.
plane (out 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
public Point3d[] GetNearRect()
Get corners of near clipping plane rectangle.
[left_bottom, right_bottom, left_top, right_top] points on success null on failure.

GetPickTransform

#Since v5.0
public Transform GetPickTransform(int clientX, int clientY)
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.
clientX (int)The client point X coordinate.
clientY (int)The client point Y coordinate.
A transformation matrix.

GetPickTransform

#Since v5.0
public Transform GetPickTransform(Point clientPoint)
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.
clientPoint (Point)The client point.
A transformation matrix.

GetPickTransform

#Since v5.0
public Transform GetPickTransform(Rectangle clientRectangle)
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.
clientRectangle (Rectangle)The client rectangle.
A transformation matrix.

GetScreenPort

#Since v5.0
public bool GetScreenPort(out int portLeft, out int portRight, out int portBottom, out int portTop, out int portNear, out int portFar)
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.
portLeft (out int)portLeft != portRight.
portRight (out int)portLeft != portRight.
portBottom (out int)portTop != portBottom.
portTop (out int)portTop != portBottom.
portNear (out int)The viewport near value.
portFar (out int)The viewport far value.
true if the operation is successful.

GetTransform

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

GetUserString

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

GetUserStrings

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

GetViewScale

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

GetWorldToScreenScale

#Since v5.0
public bool GetWorldToScreenScale(Point3d pointInFrustum, out double pixelsPerUnit)
Gets the world to screen size scaling factor at a point in frustum.
pointInFrustum (Point3d)A point in frustum.
pixelsPerUnit (out double)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
public bool IsVisible(BoundingBox bbox)
Returns true if some portion of a world coordinate bounding box is potentially visible in the viewing frustum.
bbox (BoundingBox)A bounding box that is tested for visibility.
true if the box is potentially visible; otherwise false.

IsVisible

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

KeyboardDolly

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

KeyboardDollyInOut

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

KeyboardRotate

#Since v5.0
public bool KeyboardRotate(bool leftRight, double angleRadians)
Emulates the keyboard arrow key in terms of interaction.
leftRight (bool)left/right rotate if true, up/down rotate if false.
angleRadians (double)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
public double LastLensLength()
Returns the lens length of this viewport the last time it was using perspective projection in this session.

Magnify

#Since v5.0
public bool Magnify(double magnificationFactor, bool mode, Point fixedScreenPoint)
Zooms or dollies in order to scale the viewport projection of observed objects.
magnificationFactor (double)The scale factor.
mode (bool)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 (Point)A point in the screen that should remain fixed.
true if operation succeeded; otherwise false.

Magnify

#Since v5.0
public bool Magnify(double magnificationFactor, bool mode)
Zooms or dollies in order to scale the viewport projection of observed objects.
magnificationFactor (double)The scale factor.
mode (bool)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
public bool MouseAdjustLensLength(Point mousePreviousPoint, Point mouseCurrentPoint, bool moveTarget)
Adjusts the camera lens length.
mousePreviousPoint (Point)The mouse previous point.
mouseCurrentPoint (Point)The mouse current point.
moveTarget (bool)Should this operation move the target?

MouseDollyZoom

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

MouseInOutDolly

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

MouseLateralDolly

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

MouseMagnify

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

MouseRotateAroundTarget

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

MouseRotateCamera

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

MouseTilt

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

NextConstructionPlane

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

NextViewProjection

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

PopConstructionPlane

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

PopViewProjection

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

PreviousConstructionPlane

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

PreviousViewProjection

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

PushConstructionPlane

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

PushViewInfo

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

PushViewProjection

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

Rotate

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

ScreenToClient

#Since v5.0
public Point ScreenToClient(Point screenPoint)
screenPoint (Point)

SetCameraDirection

#ExampleSince v5.0
public void SetCameraDirection(Vector3d cameraDirection, bool updateTargetLocation)
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.
cameraDirection (Vector3d)new camera direction.
updateTargetLocation (bool)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
public void SetCameraLocation(Point3d cameraLocation, bool updateTargetLocation)
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.
cameraLocation (Point3d)new camera location.
updateTargetLocation (bool)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
public void SetCameraLocations(Point3d targetLocation, Point3d cameraLocation)
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.
targetLocation (Point3d)new target location.
cameraLocation (Point3d)new camera location.

SetCameraTarget

#Since v5.0
public void SetCameraTarget(Point3d targetLocation, bool updateCameraLocation)
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.
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.
targetLocation (Point3d)new target location.
updateCameraLocation (bool)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.

SetClippingPlanes

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

SetConstructionPlane

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

SetConstructionPlane

#Since v5.0
public void SetConstructionPlane(Plane plane)
plane (Plane)

SetProjection

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

SetProjection

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

SetScreenPort

#Since v9.0
public bool SetScreenPort(int portLeft, int portRight, int portBottom, int portTop, int portNear = 0, int portFar = 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.
portLeft (int)portLeft != portRight.
portRight (int)portLeft != portRight.
portBottom (int)portTop != portBottom.
portTop (int)portTop != portBottom.
portNear (int = 0)The viewport near value.
portFar (int = 0)The viewport far value.
true if the operation is successful.

SetToPlanView

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

SetTraceImage

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

SetUserString

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

SetUserStrings

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

SetViewProjection

#Since v5.0
public bool SetViewProjection(ViewportInfo projection, bool updateTargetLocation)
Sets the viewport camera projection.
projection (ViewportInfo)The "standard" projection type.
updateTargetLocation (bool)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(string imageFilename, bool grayscale, bool visible)
imageFilename (string)
grayscale (bool)
visible (bool)

SetWallpaper

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

WorldToClient

#Since v5.0
public Point2d WorldToClient(Point3d worldPoint)
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)
worldPoint (Point3d)The 3D point in world coordinates.
The 2D point on the screen.

ZoomBoundingBox

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

ZoomExtents

#ExampleSince v5.0
public bool ZoomExtents()
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.
true if successful.

ZoomExtentsSelected

#Since v5.0
public bool ZoomExtentsSelected()
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.
true if successful.

ZoomWindow

#Since v7.33
public bool ZoomWindow(Rectangle rect)
Zooms the viewport to the given rectangle.
rect (Rectangle)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.