Click or drag to resize

RhinoViewport Class

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.
Inheritance Hierarchy
SystemObject
  Rhino.DisplayRhinoViewport

Namespace:  Rhino.Display
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public class RhinoViewport : IDisposable

The RhinoViewport type exposes the following members.

Constructors
  NameDescription
Public methodRhinoViewport
Initializes a new instance of the RhinoViewport class
Public methodRhinoViewport(RhinoViewport)
Initializes a new instance of the RhinoViewport class
Top
Properties
  NameDescription
Public propertyBounds
Gets the size and location of the viewport, in pixels, relative to the parent view.
Public propertyCamera35mmLensLength
Public propertyCameraDirection
Public propertyCameraLocation
Public propertyCameraTarget
Viewport target point.
Public propertyCode exampleCameraUp
Public propertyCameraX
Gets the "unit to the right" vector.
Public propertyCameraY
Gets the "unit up" vector.
Public propertyCameraZ
Gets the unit vector in CameraDirection.
Public propertyChangeCounter
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.
Public propertyConstructionAxesVisible
Public propertyConstructionGridVisible
Public propertyDisplayMode
Public propertyFrustumAspect
Gets the width/height ratio of the frustum.
Public propertyId
Unique id for this viewport.
Public propertyIsParallelProjection
Public propertyIsPerspectiveProjection
Public propertyIsPlanView
true if construction plane z axis is parallel to camera direction.
Public propertyIsTwoPointPerspectiveProjection
Public propertyIsValidCamera
Public propertyIsValidFrustum
Public propertyCode exampleName
Name associated with this viewport.
Public propertyParentView
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 propertyScreenPortAspect
screen port's width/height.
Public propertyCode exampleSize
Gets or sets the height and width of the viewport (in pixels)
Public propertyViewportType
Public propertyWallpaperFilename
Public propertyWallpaperGrayscale
Public propertyWallpaperVisible
Public propertyWorldAxesVisible
Top
Methods
  NameDescription
Public methodChangeToParallelProjection
Use this function to change projections of valid viewports from persective 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 methodChangeToPerspectiveProjection(Boolean, Double)
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 methodChangeToPerspectiveProjection(Double, Boolean, Double)
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 methodChangeToTwoPointPerspectiveProjection(Double)
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 methodChangeToTwoPointPerspectiveProjection(Double, Vector3d, Double)
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 methodClearTraceImage
Remove trace image (background bitmap) for this viewport if one exists.
Public methodClientToScreen(Point)
Public methodClientToScreen(Point2d)
Public methodClientToWorld(Point)
Public methodClientToWorld(Point2d)
Public methodCode exampleConstructionPlane
Simple plane information for this viewport's construction plane. If you want detailed construction lpane information, use GetConstructionPlane.
Public methodDispose
Releases all resources used by the RhinoViewport
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the RhinoViewport and optionally releases the managed resources
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Overrides ObjectFinalize.)
Public methodStatic memberFromId
Call this method to get the viewport with the specified Id.
Public methodGetCameraAngle
Public methodGetCameraExtents
Public methodGetCameraFrame
Gets the camera plane.
Public methodGetConstructionPlane
Public methodGetDepth(Point3d, Double)
Gets clipping distance of a point.
Public methodGetDepth(BoundingBox, Double, Double)
Gets near and far clipping distances of a bounding box.
Public methodGetDepth(Sphere, Double, Double)
Gets near and far clipping distances of a sphere.
Public methodGetFarRect
Get corners of far clipping plane rectangle.
Public methodGetFrustum
Gets the view frustum.
Public methodGetFrustumBottomPlane
Get bottom world frustum clipping plane.
Public methodGetFrustumBoundingBox
Public methodGetFrustumCenter
Returns world coordinates of frustum's center.
Public methodGetFrustumFarPlane
Get far clipping plane.
Public methodGetFrustumLeftPlane
Get left world frustum clipping plane.
Public methodGetFrustumLine
Gets the world coordinate line in the view frustum that projects to a point on the screen.
Public methodGetFrustumNearPlane
Get near clipping plane.
Public methodGetFrustumRightPlane
Get right world frustum clipping plane.
Public methodGetFrustumTopPlane
Get top world frustum clipping plane.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetNearRect
Get corners of near clipping plane rectangle.
Public methodGetPickTransform(Point)
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 methodGetPickTransform(Rectangle)
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 methodGetPickTransform(Int32, Int32)
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 methodGetScreenPort
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 methodCode exampleGetTransform
Gets a transform from origin coordinate system to a target coordinate system.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWorldToScreenScale
Gets the world to screen size scaling factor at a point in frustum.
Public methodIsVisible(BoundingBox)
Returns true if some portion of a world coordinate bounding box is potentially visible in the viewing frustum.
Public methodIsVisible(Point3d)
Deterines if a world coordinate point is visible in the viewing frustum.
Public methodKeyboardDolly
Emulates the keyboard arrow key in terms of interaction.
Public methodKeyboardDollyInOut
Emulates the keyboard arrow key in terms of interaction.
Public methodKeyboardRotate
Emulates the keyboard arrow key in terms of interaction.
Public methodMagnify(Double, Boolean)
Zooms or dollies in order to scale the viewport projection of observed objects.
Public methodMagnify(Double, Boolean, Point)
Zooms or dollies in order to scale the viewport projection of observed objects.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMouseAdjustLensLength
Adjusts the camera lens length.
Public methodMouseDollyZoom
Zooms lens (thus adjusting the field of view) while moving the camera.
Public methodMouseInOutDolly
Moves the camera towards or away from the view maintaing focus on the view.
Public methodMouseLateralDolly
Pans the camera
Public methodMouseMagnify
Moves the camera towards or away from the view.
Public methodMouseRotateAroundTarget
Rotates the viewport around target.
Public methodMouseRotateCamera
Rotates the view around the camera location.
Public methodMouseTilt
Tilts the camera view.
Public methodNextConstructionPlane
Sets the construction plane to the plane that was active before the last call to PreviousConstructionPlane.
Public methodNextViewProjection
Sets the view projection and target to the settings that were active before the last call to PrevView.
Public methodPopConstructionPlane
Sets the construction plane to the plane that was active before the last call to PushConstructionPlane.
Public methodCode examplePopViewProjection
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 methodPreviousConstructionPlane
Sets the construction plane to the plane that was active before the last call to NextConstructionPlane or SetConstructionPlane.
Public methodPreviousViewProjection
Sets the view projection and target to the settings that were active before the last call to NextViewProjection.
Public methodPushConstructionPlane
Pushes the current construction plane on the viewport's construction plane stack and sets the construction plane to cplane.
Public methodPushViewInfo
Public methodCode examplePushViewProjection
Appends the current view projection and target to the viewport's view stack.
Public methodRotate
Rotates about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
Public methodScreenToClient
Public methodCode exampleSetCameraDirection
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 methodCode exampleSetCameraLocation
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 methodSetCameraLocations
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 methodSetCameraTarget
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 methodSetClippingPlanes
Sets optimal clipping planes to view objects in a world coordinate 3d bounding box.
Public methodSetConstructionPlane(ConstructionPlane)
Sets the construction plane to cplane.
Public methodSetConstructionPlane(Plane)
Public methodSetProjection
Set viewport to a defined projection.
Public methodSetToPlanView
Public methodCode exampleSetTraceImage
Set trace image (background bitmap) for this viewport.
Public methodSetViewProjection
Sets the viewport camera projection.
Public methodSetWallpaper(String, Boolean)
Public methodSetWallpaper(String, Boolean, Boolean)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWorldToClient
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 methodZoomBoundingBox
Zooms the viewport to the given bounding box.
Public methodCode exampleZoomExtents
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 methodZoomExtentsSelected
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.
Top
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.9
See Also