[Serializable] public sealed class ViewportInfo : CommonObject
Represents a viewing frustum.

Constructors

ViewportInfo

#Since v5.0
public ViewportInfo()
Initializes a new instance.

ViewportInfo

#Since v5.0
public ViewportInfo(RhinoViewport rhinoViewport)
Copies all of the ViewportInfo data from an existing RhinoViewport.
rhinoViewport (RhinoViewport)A viewport to copy.

ViewportInfo

#Since v5.0
public ViewportInfo(ViewportInfo other)
Initializes a new instance by copying values from another instance.
other (ViewportInfo)The other viewport info.

Properties

Camera35mmLensLength

#Since v5.0
public double Camera35mmLensLength { get; set; }
This property assumes the camera is horizontal and crop the film rather than the image when the aspect of the frustum is not 36/24. (35mm film is 36mm wide and 24mm high.) Setting preserves camera location, changes the frustum, but maintains the frustum's aspect.

CameraAngle

#Since v5.0
public double CameraAngle { get; set; }
Gets or sets the 1/2 of smallest subtended view angle. See GetCameraAngles(double, double, double) for more information.

CameraDirection

#Since v5.0
public Vector3d CameraDirection { get; }
Gets the direction that the camera faces.

CameraLocation

#Since v5.0
public Point3d CameraLocation { get; }
Gets the camera location (position) point.

CameraUp

#Since v5.0
public Vector3d CameraUp { get; }
Gets the camera up vector.

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.

DefaultCameraDirection

#Since v6.0
public static Vector3d DefaultCameraDirection { get; }
Default z=up perspective camera direction

Disposed

public bool Disposed { get; }
Indicates if this object has been disposed or the document it originally belonged to has been disposed.
inherited fromCommonObject

FrustumAspect

#Since v5.0
public double FrustumAspect { get; set; }
Setting FrustumAspect changes the larger of the frustum's width/height so that the resulting value of width/height matches the requested aspect. The camera angle is not changed. If you change the shape of the view port with a call SetScreenPort(), then you generally want to call SetFrustumAspect() with the value returned by GetScreenPortAspect().

FrustumBottom

#Since v5.0
public double FrustumBottom { get; }
Gets the frustum bottom value. This is -top if the frustum has a horizontal symmetry axis.

This number is usually negative.

FrustumBottomPlane

#Since v5.0
public Plane FrustumBottomPlane { get; }
Gets the frustum bottom plane that separates visible from off-screen.

FrustumCenter

#Since v5.0
public Point3d FrustumCenter { get; }
Gets the frustum center point.

FrustumFar

#Since v5.0
public double FrustumFar { get; }
Gets the frustum far-cutting value.

FrustumFarPlane

#Since v5.0
public Plane FrustumFarPlane { get; }
Gets 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. The plane's normal points into the frustum towards the camera location.

FrustumHeight

#Since v5.0
public double FrustumHeight { get; }
Gets the frustum height. This is FrustumTop - FrustumBottom.

FrustumLeft

#Since v5.0
public double FrustumLeft { get; }
Gets the frustum left value. This is -right if the frustum has a vertical symmetry axis.

This number is usually negative.

FrustumLeftPlane

#Since v5.0
public Plane FrustumLeftPlane { get; }
Gets the frustum left plane that separates visible from off-screen.

FrustumMaximumDiameter

#Since v5.0
public double FrustumMaximumDiameter { get; }
Gets the frustum maximum diameter, or the maximum between FrustumWidth and FrustumHeight.

FrustumMinimumDiameter

#Since v5.0
public double FrustumMinimumDiameter { get; }
Gets the frustum minimum diameter, or the minimum between FrustumWidth and FrustumHeight.

FrustumNear

#Since v5.0
public double FrustumNear { get; }
Gets the frustum near-cutting value.

FrustumNearPlane

#Since v5.0
public Plane FrustumNearPlane { get; }
Gets 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. The plane's normal points out of the frustum towards the camera location.

FrustumRight

#Since v5.0
public double FrustumRight { get; }
Gets the frustum right value. This is -left if the frustum has a vertical symmetry axis.

This number is usually positive.

FrustumRightPlane

#Since v5.0
public Plane FrustumRightPlane { get; }
Gets the frustum right plane that separates visible from off-screen.

FrustumTop

#Since v5.0
public double FrustumTop { get; }
Gets the frustum top value. This is -bottom if the frustum has a horizontal symmetry axis.

This number is usually positive.

FrustumTopPlane

#Since v5.0
public Plane FrustumTopPlane { get; }
Gets the frustum top plane that separates visible from off-screen.

FrustumWidth

#Since v5.0
public double FrustumWidth { get; }
Gets the frustum width. This is FrustumRight - FrustumLeft.

HasUserData

public bool HasUserData { get; }
Gets true if this class has any custom information attached to it through UserData.
inherited fromCommonObject

Id

#Since v5.0
public Guid Id { get; set; }
Sets the viewport's id to the value used to uniquely identify this viewport. There is no approved way to change the viewport id once it is set in order to maintain consistency across multiple viewports and those routines that manage them.

IsCameraDirectionLocked

#Since v5.0
public bool IsCameraDirectionLocked { get; set; }
Gets or sets a value that indicates whether the direction that the camera faces is unmodifiable.

IsCameraLocationLocked

#Since v5.0
public bool IsCameraLocationLocked { get; set; }
Gets or sets a value that indicates whether the camera location is unmodifiable.

IsCameraUpLocked

#Since v5.0
public bool IsCameraUpLocked { get; set; }
Gets or sets a value that indicates whether the camera up vector is unmodifiable.

IsDocumentControlled

public virtual bool IsDocumentControlled { get; }
If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to "IsReadOnly" will throw a NotSupportedException.
inherited fromCommonObject

IsFrustumLeftRightSymmetric

#Since v5.0
public bool IsFrustumLeftRightSymmetric { get; set; }
Gets or sets a value that indicates whether the camera frustum has a vertical symmetry axis.

IsFrustumTopBottomSymmetric

#Since v5.0
public bool IsFrustumTopBottomSymmetric { get; set; }
Gets or sets a value that indicates whether the camera frustum has a horizontal symmetry axis.

IsParallelProjection

#Since v5.0
public bool IsParallelProjection { get; set; }
Get or set whether this projection is parallel.

IsPerspectiveProjection

#Since v5.0
public bool IsPerspectiveProjection { get; set; }
Get or set whether this projection is perspective.

IsTwoPointPerspectiveProjection

#Since v5.0
public bool IsTwoPointPerspectiveProjection { get; }
Gets a value that indicates whether this projection is a two-point perspective.

IsValid

public virtual bool IsValid { get; }
Tests an object to see if it is valid.
inherited fromCommonObject

IsValidCamera

#Since v5.0
public bool IsValidCamera { get; }
Gets a value that indicates whether the camera is valid.

IsValidFrustum

#Since v5.0
public bool IsValidFrustum { get; }
Gets a value that indicates whether the frustum is valid.

PerspectiveMinNearDist

#Since v7.0
public double PerspectiveMinNearDist { get; set; }
Expert user function to control the minimum value of near when perspective projections are being used.

PerspectiveMinNearOverFar

#Since v7.0
public double PerspectiveMinNearOverFar { get; set; }
Expert user function to control the minimum ratio of near/far when perspective projections are begin used.

ScreenPort

#Since v6.0
public Rectangle ScreenPort { get; set; }
Get or set the screen port. SetScreenPort(Rectangle) and GetScreenPort()

ScreenPortAspect

#Since v5.0
public double ScreenPortAspect { get; }
Gets the screen aspect ratio.

This is width / height.

TargetPoint

#Since v5.0
public Point3d TargetPoint { get; set; }
The current value of the target point. This point does not play a role in the view projection calculations. It can be used as a fixed point when changing the camera so the visible regions of the before and after frustums both contain the region of interest. The default constructor sets this point on ON_3dPoint::UnsetPoint. You must explicitly call one SetTargetPoint() functions to set the target point.

UserData

public UserDataList UserData { get; }
List of custom information that is attached to this class.
inherited fromCommonObject

UserDictionary

public ArchivableDictionary UserDictionary { get; }
Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use shareable set of information.
inherited fromCommonObject

ViewScale

#Since v5.0
public SizeF ViewScale { get; set; }
Applies scaling factors to parallel projection clipping coordinates by setting the m_clip_mod transformation. If you want to compress the view projection across the viewing plane, then set x = 0.5, y = 1.0, and z = 1.0.

Methods

CalculateCameraRotationAngle

#Since v6.8
public static double CalculateCameraRotationAngle(Vector3d direction, Vector3d up)
Calculates the camera rotation angle.
direction (Vector3d)The camera direction.
up (Vector3d)The camera up direction.
The camera rotation angle in radians.

CalculateCameraUpDirection

#Since v6.8
public static Vector3d CalculateCameraUpDirection(Point3d location, Vector3d direction, double angle)
Calculates the camera up direction.
location (Point3d)The camera location.
direction (Vector3d)The camera direction.
angle (double)The camera rotation angle in radians.
The camera up direction.

ChangeToParallelProjection

#Since v5.0
public bool ChangeToParallelProjection(bool symmetricFrustum)
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. If the current projection is parallel and symmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.
symmetricFrustum (bool)true if you want the resulting frustum to be symmetric.
true if the operation succeeded; otherwise, false.

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.
true if successful

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 changed. If the current projection is perspective and symmetricFrustum, IsFrustumIsLeftRightSymmetric, and IsFrustumIsTopBottomSymmetric are all equal, then no changes are made and true is returned.
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.
true if the operation succeeded; otherwise, false.

ChangeToSymmetricFrustum

#Since v5.0
public bool ChangeToSymmetricFrustum(bool isLeftRightSymmetric, bool isTopBottomSymmetric, double targetDistance)
If needed, adjusts the current frustum so it has the specified symmetries and adjust the camera location so the target plane remains visible.
isLeftRightSymmetric (bool)If true, the frustum will be adjusted so left = -right.
isTopBottomSymmetric (bool)If true, the frustum will be adjusted so top = -bottom.
targetDistance (double)If projection is not perspective or target_distance is RhinoMath.UnsetValue, then this parameter is ignored. If the projection is perspective and targetDistance is not RhinoMath.UnsetValue, then it must be > 0.0 and it is used to determine which plane in the old frustum will appear unchanged in the new frustum.
Returns true if the viewport has now a frustum with the specified symmetries.

ChangeToTwoPointPerspectiveProjection

#Since v5.0
public bool ChangeToTwoPointPerspectiveProjection(double targetDistance, Vector3d up, double lensLength)
Changes 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. If the current projection is perspective and IsFrustumIsLeftRightSymmetric is true and IsFrustumIsTopBottomSymmetric is false, then no changes are made and true is returned.
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)The locked up direction. Pass Vector3d.Zero 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.
true if the operation succeeded; otherwise, false.

ConstructConstObject

protected void ConstructConstObject(object parentObject, int subobjectIndex)
Assigns a parent object and a sub-object index to this.
inherited fromCommonObject
parentObject (object)The parent object.
subobjectIndex (int)The sub-object index.

Dispose

public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
inherited fromCommonObject

Dispose

protected virtual void Dispose(bool disposing)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

inherited fromCommonObject
disposing (bool)true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.

DollyCamera

#Since v5.0
public bool DollyCamera(Vector3d dollyVector)
DollyCamera() does not update the frustum's clipping planes. To update the frustum's clipping planes call DollyFrustum(d) with d = dollyVector o cameraFrameZ. To convert screen locations into a dolly vector, use GetDollyCameraVector(). Does not update frustum. To update frustum use DollyFrustum(d) with d = dollyVector o cameraFrameZ.
dollyVector (Vector3d)dolly vector in world coordinates.
true if the operation succeeded; otherwise, false.

DollyExtents

#Since v5.6
public bool DollyExtents(BoundingBox cameraCoordinateBoundingBox, double border)
Dolly the camera location and so that the view frustum contains all of the document objects that can be seen in view. If the projection is perspective, the camera angle is not changed.
cameraCoordinateBoundingBox (BoundingBox)
border (double)If border > 1.0, then the frustum is enlarged by this factor to provide a border around the view. If 0.0 < border < 1.0, then the frustum is shrunk by this factor and the objects will extend past the edges of the view. A border of 0.0 or 1.0 adds no border. 1.1 works well for parallel projections; 0.0 is suggested for perspective projections.
True if successful.

DollyExtents

#Since v5.6
public bool DollyExtents(IEnumerable<GeometryBase> geometry, double border)
Dolly the camera location and so that the view frustum contains all of the document objects that can be seen in view. If the projection is perspective, the camera angle is not changed.
geometry (IEnumerable<GeometryBase>)
border (double)If border > 1.0, then the frustum is enlarged by this factor to provide a border around the view. If 0.0 < border < 1.0, then the frustum is shrunk by this factor and the objects will extend past the edges of the view. A border of 0.0 or 1.0 adds no border. 1.1 works well for parallel projections; 0.0 is suggested for perspective projections.
True if successful.

DollyFrustum

#Since v5.0
public bool DollyFrustum(double dollyDistance)
Moves the frustum clipping planes.
dollyDistance (double)Distance to move in camera direction.
true if the operation succeeded; otherwise, false.

EnsurePrivateCopy

public void EnsurePrivateCopy()
If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
inherited fromCommonObject

Extents

#Since v5.0
public bool Extents(double halfViewAngleRadians, BoundingBox bbox)
Extends this viewport view to include a bounding box.

Use Extents() as a quick way to set a viewport to so that bounding volume is inside of a viewports frustum. The view angle is used to determine the position of the camera.

halfViewAngleRadians (double)1/2 smallest subtended view angle in radians.
bbox (BoundingBox)A bounding box in 3d world coordinates.
true if the operation succeeded; otherwise, false.

Extents

#Since v5.0
public bool Extents(double halfViewAngleRadians, Sphere sphere)
Extends this viewport view to include a sphere.

Use Extents() as a quick way to set a viewport to so that bounding volume is inside of a viewports frustum. The view angle is used to determine the position of the camera.

halfViewAngleRadians (double)1/2 smallest subtended view angle in radians.
sphere (Sphere)A sphere in 3d world coordinates.
true if the operation succeeded; otherwise, false.

FrustumCenterPoint

#Since v5.0
public Point3d FrustumCenterPoint(double targetDistance)
Return a point on the central axis of the view frustum. This point is a good choice for a general purpose target point.
targetDistance (double)If targetDistance > 0.0, then the distance from the returned point to the camera plane will be targetDistance. Note that if the frustum is not symmetric, the distance from the returned point to the camera location will be larger than targetDistance. If targetDistance == ON_UNSET_VALUE and the frustum is valid with near > 0.0, then 0.5*(near + far) will be used as the targetDistance.
A point on the frustum's central axis. If the viewport or input is not valid, then ON_3dPoint::UnsetPoint is returned.

GetBoundingBoxDepth

#Since v5.0
public bool GetBoundingBoxDepth(BoundingBox bbox, out double nearDistance, out double farDistance)
Gets near and far clipping distances of a bounding box. This function ignores the current value of the viewport's near and far settings. If the viewport is a perspective projection, the it intersects the semi infinite frustum volume with the bounding box and returns the near and far distances of the intersection. If the viewport is a parallel projection, it intersects the infinite view region with the bounding box and returns the near and far distances of the projection.
bbox (BoundingBox)The bounding box to sample.
nearDistance (out double)Near distance of the box. This value can be zero or negative when the camera location is inside box.
farDistance (out double)Far distance of the box. This value can be equal to near_dist, zero or negative when the camera location is in front of the bounding box.
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.

GetCameraAngles

#Since v5.0
public bool GetCameraAngles(out double halfDiagonalAngleRadians, out double halfVerticalAngleRadians, out double halfHorizontalAngleRadians)
Gets the field of view angles.
halfDiagonalAngleRadians (out double)1/2 of diagonal subtended angle. This out parameter is assigned during this call.
halfVerticalAngleRadians (out double)1/2 of vertical subtended angle. This out parameter is assigned during this call.
halfHorizontalAngleRadians (out double)1/2 of horizontal subtended angle. This out parameter is assigned during this call.
true if the operation succeeded; otherwise, false.

GetCameraFrame

#Since v5.0
public bool GetCameraFrame(out Point3d location, out Vector3d cameraX, out Vector3d cameraY, out Vector3d cameraZ)
Gets location and vectors of this camera.
location (out Point3d)An out parameter that will be filled with a point during the call.
cameraX (out Vector3d)An out parameter that will be filled with the X vector during the call.
cameraY (out Vector3d)An out parameter that will be filled with the Y vector during the call.
cameraZ (out Vector3d)An out parameter that will be filled with the Z vector during the call.
true if current camera orientation is valid; otherwise false.

GetDollyCameraVector

#Since v5.0
public Vector3d GetDollyCameraVector(int screenX0, int screenY0, int screenX1, int screenY1, double projectionPlaneDistance)
Gets a world coordinate dolly vector that can be passed to DollyCamera().
screenX0 (int)Screen coordinates of start point.
screenY0 (int)Screen coordinates of start point.
screenX1 (int)Screen coordinates of end point.
screenY1 (int)Screen coordinates of end point.
projectionPlaneDistance (double)Distance of projection plane from camera. When in doubt, use 0.5*(frus_near+frus_far).
The world coordinate dolly vector.

GetDollyCameraVector

#Since v5.0
public Vector3d GetDollyCameraVector(Point screen0, Point screen1, double projectionPlaneDistance)
Gets a world coordinate dolly vector that can be passed to DollyCamera().
screen0 (Point)Start point.
screen1 (Point)End point.
projectionPlaneDistance (double)Distance of projection plane from camera. When in doubt, use 0.5*(frus_near+frus_far).
The world coordinate dolly vector.

GetFarPlaneCorners

#Since v5.0
public Point3d[] GetFarPlaneCorners()
Gets the corners of far clipping plane rectangle. 4 points are returned in the order of bottom left, bottom right, top left, top right.
Four corner points on success. Empty array if viewport is not valid.

GetFramePlaneCorners

#Since v8.0
public Point3d[] GetFramePlaneCorners(double depth)
Gets the corners of the frame plane rectangle at specified depth. 4 points are returned in the order of bottom left, bottom right, top left, top right.
depth (double)Distance from camera location.
Four corner points on success. Empty array if viewport is not valid.

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)A left value that will be filled during the call.
right (out double)A right value that will be filled during the call.
bottom (out double)A bottom value that will be filled during the call.
top (out double)A top value that will be filled during the call.
nearDistance (out double)A near distance value that will be filled during the call.
farDistance (out double)A far distance value that will be filled during the call.
true if operation succeeded; otherwise, false.

GetFrustumLine

#Since v5.1
public Line GetFrustumLine(double screenX, double screenY)
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.
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.

GetFrustumLine

#Since v5.1
public Line GetFrustumLine(Point screenPoint)
Gets the world coordinate line in the view frustum that projects to a point on the screen.
screenPoint (Point)screen location
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.

GetFrustumLine

#Since v5.1
public Line GetFrustumLine(PointF screenPoint)
Gets the world coordinate line in the view frustum that projects to a point on the screen.
screenPoint (PointF)screen location
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.

GetNearPlaneCorners

#Since v5.0
public Point3d[] GetNearPlaneCorners()
Gets the corners of near clipping plane rectangle. 4 points are returned in the order of bottom left, bottom right, top left, top right.
Four corner points on success. Empty array if viewport is not valid.

GetObjectData

[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
inherited fromCommonObject
info (SerializationInfo)The System.Runtime.Serialization.SerializationInfo to populate with data.
context (StreamingContext)The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.

GetPointDepth

#Since v5.0
public bool GetPointDepth(Point3d point, out double distance)
Gets the clipping distance of a point. This function ignores the current value of the viewport's near and far settings. If the viewport is a perspective projection, then it intersects the semi infinite frustum volume with the bounding box and returns the near and far distances of the intersection. If the viewport is a parallel projection, it intersects the infinite view region with the bounding box and returns the near and far distances of the projection.
point (Point3d)A point to measure.
distance (out double)distance of the point (can be < 0)
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.

GetScreenPort

#Since v5.0
public Rectangle GetScreenPort()
Gets the location of viewport in pixels. See documentation for SetScreenPort.
The rectangle, or Empty rectangle on error.

GetScreenPort

#Since v5.0
public Rectangle GetScreenPort(out int near, out int far)
Gets the location of viewport in pixels.

See value meanings in SetScreenPort.

near (out int)The near value. This out parameter is assigned during the call.
far (out int)The far value. This out parameter is assigned during the call.
The rectangle, or Empty rectangle on error.

GetScreenPortLocation

#Since v6.0
public void GetScreenPortLocation(out int left, out int top, out int right, out int bottom)
Get the location of viewport in pixels (non System.Drawing version of GetScreenPort)
left (out int)
top (out int)
right (out int)
bottom (out int)

GetSphereDepth

#Since v5.0
public bool GetSphereDepth(Sphere sphere, out double nearDistance, out double farDistance)
Gets near and far clipping distances of a bounding sphere.
sphere (Sphere)The sphere to sample.
nearDistance (out double)Near distance of the sphere (can be < 0)
farDistance (out double)Far distance of the sphere (can be equal to near_dist)
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.

GetViewScale

#Since v8.0
public double[] GetViewScale()
Get scaling applied to this viewport projection. Reflected ceiling projections will return the values 1,1,-1

GetWorldToScreenScale

#Since v5.1
public double GetWorldToScreenScale(Point3d pointInFrustum)
Gets the scale factor from point in frustum to screen scale.
pointInFrustum (Point3d)point in viewing frustum.
number of pixels per world unit at the 3d point.

GetXform

#Since v5.0
public Transform GetXform(CoordinateSystem sourceSystem, CoordinateSystem destinationSystem)
Computes a transform from a coordinate system to another.
sourceSystem (CoordinateSystem)The coordinate system to map from.
destinationSystem (CoordinateSystem)The coordinate system to map into.
The 4x4 transformation matrix (acts on the left).

IsValidWithLog

public bool IsValidWithLog(out string log)
Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
inherited fromCommonObject
log (out string)A textual log. This out parameter is assigned during this call.
true if this object is valid; false otherwise.

NonConstOperation

protected virtual void NonConstOperation()
For derived classes implementers.

Defines the necessary implementation to free the instance from being constant.

inherited fromCommonObject

OnSwitchToNonConst

protected virtual void OnSwitchToNonConst()
Is called when a non-constant operation first occurs.
inherited fromCommonObject

RotateCamera

#Since v7.0
public bool RotateCamera(double rotationAngleRadians, Vector3d rotationAxis, Point3d rotationCenter)
Rotates the view camera.
rotationAngleRadians (double)The amount to rotate expressed in radians.
rotationAxis (Vector3d)The axis to rotate around.
rotationCenter (Point3d)The point to rotate around.
True if rotation is successful, false otherwise.

SetCameraDirection

#Since v5.0
public bool SetCameraDirection(Vector3d direction)
Sets the direction that the camera faces.
direction (Vector3d)A new direction.
true if the direction was set; otherwise false.

SetCameraLocation

#Since v5.0
public bool SetCameraLocation(Point3d location)
Sets the camera location (position) point.
location (Point3d)
true if the operation succeeded; otherwise, false.

SetCameraUp

#Since v5.0
public bool SetCameraUp(Vector3d up)
Sets the camera up vector.
up (Vector3d)A new direction.
true if the direction was set; otherwise false.

SetFrustum

#Since v5.0
public bool SetFrustum(double left, double right, double bottom, double top, double nearDistance, double farDistance)
Sets the view frustum. If FrustumSymmetryIsLocked() is true and left != -right or bottom != -top, then they will be adjusted so the resulting frustum is symmetric.
left (double)A new left value.
right (double)A new right value.
bottom (double)A new bottom value.
top (double)A new top value.
nearDistance (double)A new near distance value.
farDistance (double)A new far distance value.
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
public bool SetFrustumNearFar(BoundingBox boundingBox)
Sets the frustum near and far using a bounding box.
boundingBox (BoundingBox)A bounding box to use.
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
public bool SetFrustumNearFar(double nearDistance, double farDistance, double minNearDistance, double minNearOverFar, double targetDistance)
Sets near and far clipping distance subject to constraints.
nearDistance (double)(>0) desired near clipping distance.
farDistance (double)(>near_dist) desired near clipping distance.
minNearDistance (double)If min_near_dist <= 0.0, it is ignored. If min_near_dist > 0 and near_dist < min_near_dist, then the frustum's near_dist will be increased to min_near_dist.
minNearOverFar (double)If min_near_over_far <= 0.0, it is ignored. If near_dist < far_dist*min_near_over_far, then near_dist is increased and/or far_dist is decreased so that near_dist = far_dist*min_near_over_far. If near_dist < target_dist < far_dist, then near_dist near_dist is increased and far_dist is decreased so that projection precision will be good at target_dist. Otherwise, near_dist is simply set to far_dist*min_near_over_far.
targetDistance (double)If target_dist <= 0.0, it is ignored. If target_dist > 0, it is used as described in the description of the min_near_over_far parameter.
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
public bool SetFrustumNearFar(double nearDistance, double farDistance)
Sets the frustum near and far distances using two values.
nearDistance (double)The new near distance.
farDistance (double)The new far distance.
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
public bool SetFrustumNearFar(Point3d center, double radius)
Sets the frustum near and far using a center point and radius.
center (Point3d)A center point.
radius (double)A radius value.
true if operation succeeded; otherwise, false.

SetScreenPort

#Since v5.0
public bool SetScreenPort(int left, int right, int bottom, int top, int near, int far)
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. // For a Windows window / int width = width of window client area in pixels; / int height = height of window client area in pixels; / port_left = 0; / port_right = width; / port_top = 0; / port_bottom = height; / port_near = 0; / port_far = 1; / SetScreenPort( port_left, port_right, / port_bottom, port_top, / port_near, port_far );
left (int)A left value.
right (int)A left value. (port_left != port_right)
bottom (int)A bottom value.
top (int)A top value. (port_top != port_bottom)
near (int)A near value.
far (int)A far value.
true if input is valid.

SetScreenPort

#Since v5.0
public bool SetScreenPort(Rectangle windowRectangle, int near, int far)
Gets the location of viewport in pixels.

See value meanings in SetScreenPort.

windowRectangle (Rectangle)A new rectangle.
near (int)The near value.
far (int)The far value.
true if input is valid.

SetScreenPort

#Since v5.0
public bool SetScreenPort(Rectangle windowRectangle)
Gets the location of viewport in pixels.

See value meanings in SetScreenPort.

windowRectangle (Rectangle)A new rectangle.
true if input is valid.

SetViewScale

#Since v8.0
public void SetViewScale(double scaleX, double scaleY, double scaleZ)
Set scaling applied for this viewport projection. For reflected projections, call with values 1,1,-1
scaleX (double)
scaleY (double)
scaleZ (double)

TargetDistance

#Since v5.0
public double TargetDistance(bool useFrustumCenterFallback)
Gets the distance from the target point to the camera plane. Note that if the frustum is not symmetric, then this distance is shorter than the distance from the target to the camera location.
useFrustumCenterFallback (bool)If bUseFrustumCenterFallback is false and the target point is not valid, then ON_UNSET_VALUE is returned. If bUseFrustumCenterFallback is true and the frustum is valid and current target point is not valid or is behind the camera, then 0.5*(near + far) is returned.
Shortest signed distance from camera plane to target point. If the target point is on the visible side of the camera, a positive value is returned. ON_UNSET_VALUE is returned when the input of view is not valid.

ToJSON

public string ToJSON(SerializationOptions options)
Create a JSON string representation of this object
inherited fromCommonObject
options (SerializationOptions)

TransformCamera

#Since v7.0
public bool TransformCamera(Transform xform)
Transforms the view camera location, direction, and up.
xform (Transform)Transformation to apply to camera.
True if a valid camera was transformed, false if invalid camera, frustum, or transformation.

UnlockCamera

#Since v5.0
public void UnlockCamera()
Unlocks the camera vectors and location.

UnlockFrustumSymmetry

#Since v5.0
public void UnlockFrustumSymmetry()
Unlocks frustum horizontal and vertical symmetries.

ZoomToScreenRect

#Since v5.0
public bool ZoomToScreenRect(int left, int top, int right, int bottom)
Zooms to a screen zone.

View changing from screen input points. Handy for using a mouse to manipulate a view. ZoomToScreenRect() may change camera and frustum settings.

left (int)Screen coordinate.
top (int)Screen coordinate.
right (int)Screen coordinate.
bottom (int)Screen coordinate.
true if the operation succeeded; otherwise, false.

ZoomToScreenRect

#Since v5.0
public bool ZoomToScreenRect(Rectangle windowRectangle)
Zooms to a screen zone.

View changing from screen input points. Handy for using a mouse to manipulate a view. ZoomToScreenRect() may change camera and frustum settings.

windowRectangle (Rectangle)The new window rectangle in screen space.
true if the operation succeeded; otherwise, false.