Viewport Class

Viewport settings.
Public Class Viewport 
Inherits DisposableBase 
Implements IViewport, _ 
ICloneable, _ 
IUserInterfaceElement
This language is not supported or no code example is available.
public class Viewport : DisposableBase
IViewport
ICloneable
IUserInterfaceElement
This language is not supported or no code example is available.
Name Description
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, SavedViewsManager, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, displayType, bool, bool, bool, bool, Grid[], bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, SavedViewsManager, viewType) Obsolete. Deprecated constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar, Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, SavedViewsManager) Obsolete. Deprecated constructor.
Protected constructor Viewport(Viewport) Shallow-copy constructor.
Public constructor Viewport() Empty constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar[], Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, viewType) Viewport constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar[], Legend[], displayType, bool, bool, bool, bool, Grid, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, viewType) Viewport constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ObservableCollection<devDept.Eyeshot.ToolBar>, ObservableCollection<devDept.Eyeshot.Legend>, displayType, bool, bool, bool, bool, ObservableCollection<devDept.Eyeshot.Grid>, OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, SavedViewsManager, viewType) Viewport constructor (WPF).
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar[], Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, viewType) Viewport constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar[], Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, SavedViewsManager) Viewport constructor.
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar[], Legend[], displayType, bool, bool, bool, bool, Grid[], OriginSymbol, bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, CoordinateSystemIcon, ViewCubeIcon, SavedViewsManager, viewType) Viewport constructor (WinForms).
Public constructor Viewport(Point, Size, BackgroundSettings, Camera, ToolBar[], displayType, bool, bool, bool, bool, Grid[], bool, RotateSettings, ZoomSettings, PanSettings, NavigationSettings, SavedViewsManager, viewType) Viewport constructor.
Top
Name Description
Public property AutoHideLabels Gets or sets the auto hide labels flag. If true labels are hidden automatically when behind the model.
Public property Background Gets or sets the background settings.
Public property Camera Gets or sets the Camera settings.
Public property CenterOfRotation Gets the current center of rotation.
Public property CoordinateSystemIcon Gets or sets the coordinate system icon settings.
Public property DisplayMode Gets or sets the active display mode.
Public property Disposed (inherited from DisposableBase).
Public property Grid Gets the first planar grids settings.
Public property Grids Gets or sets the planar grids settings.
Public property InitialView Gets or sets the active initial view.
Public property InstanceId For internal use only. Gets the instance id for the logging.
Public property Labels Master label collection.
Public property Legends Gets or sets the legend objects.
Public property Location The coordinates of the upper-left corner of the viewport relative to the upper-left corner of its container.
Public property Navigation Gets or sets the Navigation settings for the navigationType.Walk and navigationType.Fly camera navigation modes.
Public property OriginSymbol Gets or sets the origin symbol settings.
Public property Pan Gets or sets the Pan settings.
Public property Rotate Gets or sets the Rotate settings.
Public property SavedViews Gets or sets the manager of the saved views.
Public property ShowLabels Labels visibility status.
Public property ShowVertexIndices If true, the model vertices are displayed.
Public property ShowVertices If true, the model vertices are displayed.
Public property Size The size of the viewport in pixels.
Public property SortLabels Sorts the Labels using the depth from the viewer.
Public property ToolBar Gets the first ToolBar settings in the active viewport.
Public property ToolBars Gets or sets the ToolBars settings.
Public property VertexSize Gets or sets the vertex visualization size (meaningful only if ShowVertices is true).
Public property ViewCubeIcon Gets or sets the view cube icon settings.
Public property Zoom Gets or sets the Zoom settings.
Top
Methods
 
Name Description
Public method AdjustNearAndFarPlanes() Adjusts camera near and far planes based on model extents and on origin symbol, grid and shadow visibility status.
Public method Clone()
Public method CompareWithReferenceImage(Bitmap, out Bitmap, out Bitmap, viewType, displayType, double) Executes a 3D scene visual testing.
Public method CompareWithReferenceImage(Bitmap, out Bitmap, out Bitmap, viewType, double, Color) Executes a 3D scene visual testing.
Public method CompileBackground() Compiles the background, used by the designer.
Public method CompileUserInterfaceElements() Compiles 3D user interface elements like the origin symbol, the bitmap background, the FEM restraint and load symbols, etc.
Public method Contains(Point) // Tells if the viewport contains the given point in screen coordinates (0,0 on top-left) //
Public method CopyToClipboardRaster(float, bool, bool) Copies a raster image of the current viewport scene on the clipboard.
Public method CopyToClipboardRaster(float, double, bool, bool) Copies a raster image of the current viewport scene on the clipboard.
Public method CreateReferenceImage(displayType, viewType, backgroundStyleType, string, bool, backfaceColorMethodType, projectionType) Create a bitmap for the image comparison.
Public method Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Internal protected (Protected Friend) method DrawBackground(RenderContextBase, bool, float, Color, Transformation) Draws the viewport background.
Protected method DrawForBitmap(object)
Internal protected (Protected Friend) method DrawLabels(RenderContextBase) Draws the labels.
Internal protected (Protected Friend) method DrawOverlay(DrawSceneParams) Draws overlaying UI elements.
Internal protected (Protected Friend) method DrawText(int, int, string, Font, Color, Color, ContentAlignment) Draws a text on the Model's client area.
Internal protected (Protected Friend) method DrawText(int, int, string, Font, Color, Color, ContentAlignment, RotateFlipType) Draws a text on the Model's client area.
Internal protected (Protected Friend) method DrawText(int, int, string, Font, Color, ContentAlignment) Draws a text on the Model's client area.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Internal protected (Protected Friend) method FireLabelSelectionChanged(SelectionChangedEventArgs)
Public method GetBitmapSizeToPrintInWorldUnits(GraphicsUnit, linearUnitsType, double) Gets the size to print the viewport so that world units in the model correspond to world units on paper.
Public method GetBounds(Viewport) Obsolete.
Public method GetBounds() Gets the bounds rectangle in screen coordinates.
Public method GetCameraFrustum() Gets the planes of the viewport camera frustum.
Public method GetCameraRotation(viewType, Quaternion) Gets the Quaternion that describes the orientation of the given view.
Public method Static GetCameraRotation(viewType)
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Protected method GetNormal(Entity, int, int, int)
Public method GetThumbnail(Viewport, Size, Color) Gets a bitmap of the user inteferace element.
Public method GetType Gets the Type of the current instance. (inherited from Object).
Public method GetViewFrame() Gets the viewport bounds.
Public method Invalidate()
Public method IsCameraAnimating() Tells if the Camera is performing an animation.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Internal protected (Protected Friend) method ObservableCollectionPropertyChanged(object, NotifyCollectionChangedEventArgs) For internal use only. (inherited from DisposableBase).
Public method OrientCamera(Point3D, Point3D) Orients the Camera between the two specified points.
Public method PanCamera(Point, Point) Pans the view from one screen point to the other.
Public method PanCamera(Point, Point, bool) Pans the view from one screen point to the other.
Public method Project(IList<Point3D>, int) Projects a list of points on the screen.
Public method Project(int, double, double, double, out double, out double, out double) Maps world coordinates to screen coordinates.
Protected method RaisePropertyChangedEvent(object, DependencyProperty) For internal use only. (inherited from DisposableBase).
Public method RenderToBitmap(Rectangle, Size, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(RectangleF, Size, double, Color, bool, bool) Returns an image of the current <see cref="Model" /> scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(RectangleF, Size, double, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(RectangleF, Size, double, bool, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(RectangleF, double, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(RectangleF, double, double, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(Size, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(Size, double, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(Size, double, bool, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(double) Returns an image of the current Model viewport scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(double, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RenderToBitmap(double, double, bool, bool) Returns an image of the current Model scene. The image can be scaled even to a poster size one.
Public method RestoreView(Camera) Restores the previously saved view.
Public method RotateCamera(Point, Point) Rotates the view simulating the movement between two mouse position.
Public method RotateCamera(Point, Point, bool) Rotates the view simulating the movement between two mouse position.
Public method RotateCamera(Vector3D, double, bool) Rotates the view of the specified amount.
Public method RotateCamera(Vector3D, double, bool, bool) Rotates the view of the specified amount.
Public method RotateCamera(Vector3D, Vector3D) Rotates the view of the specified amount.
Public method RotateCamera(Vector3D, Vector3D, bool) Rotates the view of the specified amount.
Public method RotateCamera(int, int) Rotates the view of the specified amount.
Public method RotateCamera(int, int, bool) Rotates the view of the specified amount.
Public method RotateCamera(Point) Sets the view direction as the normal of the plane under the mouse cursor.
Public method SaveView(out Camera) Stores the current view.
Public method ScaleForDPI() Scales the element for high DPI settings.
Public method ScreenToPlane(IList<Point>, Plane) Maps screen coordinates to world coordinates.
Public method ScreenToPlane(Point, PlaneEquation, out Point3D) Maps screen coordinates to world coordinates.
Public method ScreenToViewport(Point) Converts Screen coordinates (0 on top of control) to Viewport coordinates (0 on top of viewport)
Public method ScreenToViewport(PointF) Converts Screen coordinates (0 on top of control) to Viewport coordinates (0 on top of viewport)
Public method ScreenToWorld(Point) Maps screen coordinates to world coordinates.
Public method ScreenToWorld(IList<Point>) Maps screen coordinates to world coordinates.
Public method SetView(Quaternion, Point3D, double, double) Sets the specified view by doing an animation.
Public method SetView(Quaternion, Point3D, double, double, bool) Sets the specified view by doing an animation.
Public method SetView(Quaternion, bool, bool) Sets the specified view.
Public method SetView(Quaternion, bool, bool, int, bool, int) Sets the specified view.
Public method SetView(Vector3D, Vector3D, bool, int, bool) Sets the view direction of the camera to the specified direction.
Public method SetView(Vector3D, Vector3D, bool, bool, int, bool) Sets the view direction of the camera to the specified direction.
Public method SetView(Vector3D, bool, int, bool) Sets the view direction of the camera to the specified direction.
Public method SetView(Vector3D, bool, bool, int, bool) Sets the view direction of the camera to the specified direction.
Public method SetView(viewType) Sets the specified view.
Public method SetView(viewType, bool, bool) Sets the specified view.
Public method SetView(viewType, bool, bool, int, bool, int) Sets the specified view.
Public method StopCameraAnimation() Stops the camera animation.
Public method ToString() Returns a string that represents the current object.
Public method UnProject(IList<Point3D>, int) Maps viewport coordinates to world coordinates.
Public method UnProject(int, double, double, double, out double, out double, out double) Maps viewport coordinates to world coordinates.
Public method Update(IUserInterfaceElement)
Public method UpdateEnvironment() Updates the environment control in both desing-time and run-time mode. If necessary adjust near and far planes to accomodate origin symbols of various sizes.
Public method ViewportToCameraScreen(Point) Converts Viewport coordinates (0 on top of viewport) to Camera Screen coordinates (0 on bottom of control)
Public method ViewportToScreen(Point) Converts Viewport coordinates (0 on top of viewport) to Screen coordinates (0 on top of control)
Public method WorldToScreen(Point3D) Maps world coordinates to screen coordinates.
Public method WorldToScreen(double, double, double) Maps world coordinates to screen coordinates.
Public method WorldToScreen(IList<Point3D>) Maps world coordinates to screen coordinates.
Public method WriteToFileRaster(float, double, string, ImageFormat, bool, bool) Saves a raster image of the current viewport scene on disk.
Public method WriteToFileRaster(float, string, ImageFormat, bool, bool) Saves a raster image of the current viewport scene on disk.
Public method ZoomCamera(Point, int) Zooms the view of the specified amount.
Public method ZoomCamera(Point, int, bool) Zooms the view of the specified amount.
Public method ZoomCamera(int) Zooms the view of the specified amount.
Public method ZoomCamera(int, bool) Zooms the view of the specified amount.
Public method ZoomCamera(int, double) Zooms the view of the specified amount.
Public method ZoomCamera(int, double, bool) Zooms the view of the specified amount.
Public method ZoomFit() Fits the entire model in the viewport control's client area.
Public method ZoomFit(IList<Entity>, bool, perspectiveFitType) Fits the entire model in the viewport control's client area.
Public method ZoomFit(IList<Entity>, bool, perspectiveFitType, int, bool) Fits the entire model in the viewport control's client area.
Public method ZoomFit(IList<SelectedItem>) Fits the selected items.
Public method ZoomFit(IList<SelectedItem>, int) Fits the selected items.
Public method ZoomFit(IList<SelectedItem>, int, perspectiveFitType) Fits the selected items.
Public method ZoomFit(bool, perspectiveFitType) Fits the entire model in the viewport control's client area.
Public method ZoomFit(bool, perspectiveFitType, int) Fits the entire model in the viewport control's client area.
Public method ZoomFit(int) Fits the entire model in the viewport control's client area.
Public method ZoomFitSelectedLeaves() Fits the selected entities, including the ones inside BlockReferences.
Public method ZoomFitSelectedLeaves(int) Fits the selected entities, including the ones inside BlockReferences.
Public method ZoomFitSelectedLeaves(int, perspectiveFitType) Fits the selected entities, including the ones inside BlockReferences.
Public method ZoomWindow(Point, Point) Zooms to the specified window.
Top
Events
 
Name Description
Public event LabelSelectionChanged Occurs when label selection has changed.
Public event PropertyChanged For internal use only. (inherited from DisposableBase).
Public event UpdateGraphics Occurs when graphics is updated.
Public event ViewRestored Occurs when a view is restored from the SavedViewsManager.
Public event ViewSaved Occurs when a view is saved in the SavedViewsManager.
Top
Classes
 
Name Description
Public class SavedViewsManager Class that manages the saved views stack.
Top
Name Description
Public delegate UpdateGraphicsHandler
Public delegate ViewRestoredHandler Represents a method that will handle the Viewport.ViewRestored event.
Public delegate ViewSavedEventHandler Represents a method that will handle the Viewport.ViewSaved event.
Top
Fields
 
Name Description
Public field Static PropertyChangedEvent For internal use only. (inherited from DisposableBase).
Top

.NET Framework

Supported in: 4.5, 4.6, 4.7

In this article

Definition