man SbViewportRegion () - class for representing a viewport

NAME

SbViewportRegion - class for representing a viewport

INHERITS FROM

SbViewportRegion

SYNOPSIS

#include <Inventor/SbViewportRegion.h> Methods from class SbViewportRegion: c } c } SbViewportRegion()

c } c } SbViewportRegion(short width, short height)

c } c } SbViewportRegion(SbVec2s winSize)

c } c } SbViewportRegion(const SbViewportRegion &vpReg)

c } c } setWindowSize(short width, short height)

c } c } setWindowSize(SbVec2s winSize)

c } c } setViewport(float left, float bottom, float width, float height)

c } c } setViewport(SbVec2f origin, SbVec2f size)

c } c } setViewportPixels(short left, short bottom, short width, short height)

c } c } setViewportPixels(SbVec2s origin, SbVec2s size)

c } c } getWindowSize() const

c } c } getViewportOrigin() const

c } c } getViewportOriginPixels() const

c } c } getViewportSize() const

c } c } getViewportSizePixels() const

c } c } getViewportAspectRatio() const

c } c } scaleWidth(float ratio)

c } c } scaleHeight(float ratio)

c } c } setPixelsPerInch(float ppi)

c } c } getPixelsPerInch() const

c } c } getPixelsPerPoint() const

c } c } operator ==(const SbViewportRegion &reg1, const SbViewportRegion &reg2)

DESCRIPTION

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.

METHODS

c } c } SbViewportRegion()

c } c } SbViewportRegion(short width, short height)

c } c } SbViewportRegion(SbVec2s winSize)

c } c } SbViewportRegion(const SbViewportRegion &vpReg)

Constructors of various kinds. c } c } setWindowSize(short width, short height)

Changes window size to given width and height in pixels. c } c } setWindowSize(SbVec2s winSize)

Changes window size to given width and height in pixels, given as SbVec2s. c } c } setViewport(float left, float bottom, float width, float height)

Sets viewport to given region, specified as normalized window coordinates: (0,0) is the lower-left corner, (1,1) is the upper-right. c } c } setViewport(SbVec2f origin, SbVec2f size)

Sets viewport to region with given origin (lower-left corner) and size, given as normalized coordinate vectors. c } c } setViewportPixels(short left, short bottom, short width, short height)

Sets viewport to given region, specified as pixel coordinates in window: (0,0) is the lower-left corner. c } c } setViewportPixels(SbVec2s origin, SbVec2s size)

Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates. c } c } getWindowSize() const

Returns window size in pixels. c } c } getViewportOrigin() const

Returns viewport origin in normalized coordinates. c } c } getViewportOriginPixels() const

Returns viewport origin in pixels. c } c } getViewportSize() const

Returns viewport size in normalized coordinates. c } c } getViewportSizePixels() const

Returns viewport size in pixels. c } c } getViewportAspectRatio() const

Returns aspect ratio (width/height) of viewport. c } c } scaleWidth(float ratio)

c } c } scaleHeight(float ratio)

Scales viewport within window to be the given ratio of its current width or height, leaving the resulting viewport centered about the same point as the current one. c } c } setPixelsPerInch(float ppi)

c } c } getPixelsPerInch() const

Sets/returns 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). c } c } getPixelsPerPoint() const

Convenience function that returns number of pixels per printer's point. c } c } operator ==(const SbViewportRegion &reg1, const SbViewportRegion &reg2)

Equality comparison operator.

SEE ALSO

SbVec2f, SbVec2s