Click or drag to resize
SbViewportRegion Structure
Class for representing a viewport.

This class represents the active viewport region in a display window. It contains the screen-space size of the window as well as the origin and size of the viewport within the window. By default, the viewport is the same as the full window. Methods allow the viewport to be set either in terms of screen-space pixels or as normalized coordinates, where (0,0) is the lower-left corner of the window and (1,1) is the upper-right corner.

Namespace: OIV.Inventor
Assembly: OIV.Inventor.SbLinear (in OIV.Inventor.SbLinear.dll) Version: 2024.2.0.Release.b1c2f41e1719ac8d4c3f00435c0b4b040d8bfcc0
Syntax
public struct SbViewportRegion

The SbViewportRegion type exposes the following members.

Constructors
  NameDescription
Public methodSbViewportRegion(SbVec2i32)
Constructor that takes a window size.
Public methodSbViewportRegion(SbVec2s)
Constructor that takes a window size.
Public methodSbViewportRegion(Int16, Int16)
Constructor that takes a width and a height.
Public methodSbViewportRegion(SbVec2i32, Single)
Constructor that takes a window size and a scale. Use for remote rendering.
Public methodSbViewportRegion(SbVec2s, Single)
Constructor that takes a window size and a scale. Use for remote rendering.
Public methodSbViewportRegion(Int16, Int16, Single)
Constructor that takes a width and a height and a scale. Used for remote rendering.
Top
Methods
  NameDescription
Public methodEquals
Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object).)
Public methodGetHashCode
Returns the hash code for the value of this instance.
(Overrides ValueTypeGetHashCode.)
Public methodGetPixelsPerInch
Returns the pixel-per-inch ratio for the display device the viewport is part of.
Public methodGetPixelsPerPoint
Convenience function that returns number of pixels per printer's point.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetViewportAspectRatio Obsolete.
Use ViewportAspectRatio property instead.
Public methodGetViewportOrigin Obsolete.
Use ViewportOrigin property instead.
Public methodGetViewportOriginPixels_i32 Obsolete.
Use ViewportOriginPixelsI32 property instead.
Public methodGetViewportSize Obsolete.
Use ViewportSize property instead.
Public methodGetViewportSizePixels Obsolete.
Use ViewportSizePixels property instead.
Public methodGetViewportSizePixels_i32 Obsolete.
Use ViewportSizePixelsI32 property instead.
Public methodGetWindowSize Obsolete.
Use WindowSize property instead.
Public methodGetWindowSize_i32 Obsolete.
Use WindowSizeI32 property instead.
Public methodNormalize
Compute the normalized coordinates of the specified position, relative to this viewport region.
Public methodScaleHeight
Scales viewport within window to be the given ratio of its current height, leaving the resulting viewport centered about the same point as the current one.
Public methodScaleWidth
Scales viewport within window to be the given ratio of its current width, leaving the resulting viewport centered about the same point as the current one.
Public methodSetPixelsPerInch
Sets the pixel-per-inch ratio for the display device the viewport is part of. The default value is 72 (1 pixel per printer's point).
Public methodSetViewport(SbVec2f, SbVec2f)
Sets viewport to region with given origin (lower-left corner) and size, given as normalized coordinate vectors.
Public methodSetViewport(SbVec2f, SbVec2f)
Sets viewport to region with given origin (lower-left corner) and size, given as normalized coordinate vectors.
Public methodSetViewport(Single, Single, Single, Single)
Sets viewport to given region, specified as normalized window coordinates: (0,0) is the lower-left corner, (1,1) is the upper-right.
Public methodSetViewportPixels(SbVec2i32, SbVec2i32)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
Public methodSetViewportPixels(SbVec2i32, SbVec2i32)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
Public methodSetViewportPixels(SbVec2s, SbVec2s)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
Public methodSetViewportPixels(SbVec2s, SbVec2s)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
Public methodSetViewportPixels(Int16, Int16, Int16, Int16)
Sets viewport to given region, specified as pixel coordinates in window: (0,0) is the lower-left corner.
Public methodSetWindowSize(SbVec2i32)
Changes window size to given width and height in pixels, given as SbVec2i32.
Public methodSetWindowSize(SbVec2i32)
Changes window size to given width and height in pixels, given as SbVec2i32.
Public methodSetWindowSize(SbVec2s)
Changes window size to given width and height in pixels, given as SbVec2s.
Public methodSetWindowSize(SbVec2s)
Changes window size to given width and height in pixels, given as SbVec2s.
Public methodSetWindowSize(Int16, Int16)
Changes window size to given width and height in pixels.
Public methodToString
Returns the fully qualified type name of this instance.
(Inherited from ValueType.)
Top
Operators
  NameDescription
Public operatorStatic memberEquality
The equality operator.
Public operatorStatic memberInequality
The inequality operator.
Top
Fields
  NameDescription
Public fieldStatic memberDefault
Provide a default viewport region equivalent to
new SbViewportRegion(100,100,1)
Remarks
Note to developper who comes from C++. As .NET framework does not allow to define a parameterless constructor for struct, use this field to keep the same behavior. When you write
SbViewportRegion viewport = new SbViewportRegion()
> all internal fields are zeroed. Writing
SbViewportRegion viewport = SbViewportRegion.Default
ensures you to have an equivalent object.
Top
Properties
  NameDescription
Public propertyViewportAspectRatio
Aspect ratio (width/height) of viewport.
Public propertyViewportOrigin
Viewport origin in normalized coordinates.
Public propertyViewportOriginPixelsI32
Viewport origin in pixels (int values).
Public propertyViewportSize
Viewport size in normalized coordinates.
Public propertyViewportSizePixels
Viewport size in pixels (short values).
Public propertyViewportSizePixelsI32
Viewport size in pixels (int values).
Public propertyWindowSize
Window size in pixels (short values).
Public propertyWindowSizeI32
Window size in pixels (int values).
Top
See Also