Skip to content

RhinoViewport

Public 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

System.Object
Rhino.Display.RhinoViewport

Namespace: Rhino.Display

Assembly: RhinoCommon (in RhinoCommon.dll)

Syntax

public class RhinoViewport : IDisposable

The RhinoViewport type exposes the following members.

Constructors

Name

Description


Public Method

Initializes a new instance of the RhinoViewport class


Public Method

Initializes a new instance of the RhinoViewport class


Properties

Name

Description


Public Property

Gets the size and location of the viewport, in pixels, relative to the parent view.


Public Property

Public Property

Public Property

Public Property

Viewport target point.


Public Property
Code Example

Public Property

Gets the “unit to the right” vector.


Public Property

Gets the “unit up” vector.


Public Property

Gets the unit vector in CameraDirection.


Public Property

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 Property

Public Property

Public Property

Public Property

Gets the width/height ratio of the frustum.


Public Property

Unique id for this viewport.


Public Property

Public Property

Public Property

true if construction plane z axis is parallel to camera direction.


Public Property

Public Property

Public Property

Public Property

If true, the the camera location, camera direction, and lens angle should not be changed.


Public Property
Code Example

Name associated with this viewport.


Public Property

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 Property

screen port’s width/height.


Public Property
Code Example

Get or set the height and width of the viewport (in pixels)


Public Property

Public Property

Public Property

Public Property

Public Property

Public Property

Methods

Name

Description


Public Method

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 Method

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 Method

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 Method

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 Method

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 Method

Remove trace image (background bitmap) for this viewport if one exists.


Public Method

Public Method

Public Method

Public Method

Public Method
Code Example

Simple plane information for this viewport’s construction plane. If you want detailed construction plane information, use GetConstructionPlane.


Public Method

Public Method

Public Method

Releases all resources used by the RhinoViewport


Protected Method

Releases the unmanaged resources used by the RhinoViewport and optionally releases the managed resources


Public Method

Equals

Determines whether the specified object is equal to the current object.

(Inherited from Object.)


Protected Method

(Overrides Object.Finalize..)


Public Method
Static Member

Call this method to get the viewport with the specified Id.


Public Method

Public Method

Public Method

Gets the camera plane.


Public Method

Public Method

Gets clipping distance of a point.


Public Method

Gets near and far clipping distances of a bounding box.


Public Method

Gets near and far clipping distances of a sphere.


Public Method

Get corners of far clipping plane rectangle.


Public Method

Gets the view frustum.


Public Method

Get bottom world frustum clipping plane.


Public Method

Public Method

Returns world coordinates of frustum’s center.


Public Method

Get far clipping plane.


Public Method

Get left world frustum clipping plane.


Public Method

Gets the world coordinate line in the view frustum that projects to a point on the screen.


Public Method

Get near clipping plane.


Public Method

Get right world frustum clipping plane.


Public Method

Get top world frustum clipping plane.


Public Method

GetHashCode

Serves as the default hash function.

(Inherited from Object.)


Public Method

Get corners of near clipping plane rectangle.


Public Method

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 Method

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 Method

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 Method

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 Method
Code Example

Gets a transform from origin coordinate system to a target coordinate system.


Public Method

GetType

Gets the Type of the current instance.

(Inherited from Object.)


Public Method

Gets a user string.


Public Method

Gets an independent copy of the collection of (user text key, user text value) pairs attached to this object.


Public Method

Get Scale transform applied to the viewport


Public Method

Gets the world to screen size scaling factor at a point in frustum.


Public Method

Returns true if some portion of a world coordinate bounding box is potentially visible in the viewing frustum.


Public Method

Determines if a world coordinate point is visible in the viewing frustum.


Public Method

Emulates the keyboard arrow key in terms of interaction.


Public Method

Emulates the keyboard arrow key in terms of interaction.


Public Method

Emulates the keyboard arrow key in terms of interaction.


Public Method

Zooms or dollies in order to scale the viewport projection of observed objects.


Public Method

Zooms or dollies in order to scale the viewport projection of observed objects.


Protected Method

MemberwiseClone

Creates a shallow copy of the current Object.

(Inherited from Object.)


Public Method

Adjusts the camera lens length.


Public Method

Zooms lens (thus adjusting the field of view) while moving the camera.


Public Method

Moves the camera towards or away from the view maintaining focus on the view.


Public Method

Pans the camera


Public Method

Moves the camera towards or away from the view.


Public Method

Rotates the viewport around target.


Public Method

Rotates the view around the camera location.


Public Method

Tilts the camera view.


Public Method

Sets the construction plane to the plane that was active before the last call to PreviousConstructionPlane.


Public Method

Sets the view projection and target to the settings that were active before the last call to PrevView.


Public Method

Sets the construction plane to the plane that was active before the last call to PushConstructionPlane.


Public Method
Code Example

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 Method

Sets the construction plane to the plane that was active before the last call to NextConstructionPlane or SetConstructionPlane.


Public Method

Sets the view projection and target to the settings that were active before the last call to NextViewProjection.


Public Method

Pushes the current construction plane on the viewport’s construction plane stack and sets the construction plane to cplane.


Public Method

Public Method
Code Example

Appends the current view projection and target to the viewport’s view stack.


Public Method

Rotates about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).


Public Method

Public Method
Code Example

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 Method
Code Example

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 Method

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 Method
SetCameraTarget

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 Method

Sets optimal clipping planes to view objects in a world coordinate 3d bounding box.


Public Method

Sets the construction plane to cplane.


Public Method

Public Method

Set viewport to a defined projection.


Public Method

Public Method
Code Example

Set trace image (background bitmap) for this viewport.


Public Method

Attach a user string (key,value combination) to this geometry.


Public Method

Sets the viewport camera projection.


Public Method

Public Method

Public Method

ToString

Returns a string that represents the current object.

(Inherited from Object.)


Public Method

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 Method

Zooms the viewport to the given bounding box.


Public Method
Code Example

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 Method

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 Method

Zooms the viewport to the given rectangle.