55#ifndef _SB_VIEWPORT_REGION_
56#define _SB_VIEWPORT_REGION_
99 { setWindowSize(
SbVec2s(width, height)); }
108 float width,
float height)
118 short width,
short height)
119 { setViewportPixels(
SbVec2s(left, bottom),
SbVec2s(width, height)); }
142 {
return (vpSizePix[1] == 0 ? 1.0f :
143 (float) vpSizePix[0] / (
float) vpSizePix[1]); }
162 {
return pixelsPerInch / 72.0f; }
178 void setFullViewport();
181 void adjustViewport();
INVENTOR_API bool operator==(const SbBox3f &b1, const SbBox3f &b2)
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
Class for representing a viewport.
SbViewportRegion()
Constructors of various kinds.
void setWindowSize(short width, short height)
Changes window size to given width and height in pixels.
const SbVec2s & getWindowSize() const
Returns window size in pixels.
void scaleWidth(float ratio)
Scales viewport within window to be the given ratio of its current width, leaving the resulting viewp...
void setPixelsPerInch(float ppi)
Sets/returns the pixel-per-inch ratio for the display device the viewport is part of.
float getPixelsPerPoint() const
Convenience function that returns number of pixels per printer's point.
void 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 corn...
float getPixelsPerInch() const
const SbVec2s & getViewportOriginPixels() const
Returns viewport origin in pixels.
void setWindowSize(SbVec2s winSize)
Changes window size to given width and height in pixels, given as SbVec2s.
SbViewportRegion(const SbViewportRegion &vpReg)
Constructors of various kinds.
SbViewportRegion(SbVec2s winSize)
Constructors of various kinds.
void setViewportPixels(SbVec2s origin, SbVec2s size)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
const SbVec2f & getViewportOrigin() const
Returns viewport origin in normalized coordinates.
void scaleHeight(float ratio)
Scales viewport within window to be the given ratio of its current height, leaving the resulting view...
float getViewportAspectRatio() const
Returns aspect ratio (width/height) of viewport.
void setViewport(SbVec2f origin, SbVec2f size)
Sets viewport to region with given origin (lower-left corner) and size, given as normalized coordinat...
void 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 co...
SbViewportRegion(short width, short height)
Constructors of various kinds.
const SbVec2s & getViewportSizePixels() const
Returns viewport size in pixels.
const SbVec2f & getViewportSize() const
Returns viewport size in normalized coordinates.