50#ifndef _SB_VIEWPORT_REGION_
51#define _SB_VIEWPORT_REGION_
67#include <Inventor/SbLinear.h>
172 void setViewport(
float left,
float bottom,
float width,
float height)
285 { pixelsPerInch = ppi; }
292 {
return pixelsPerInch; }
298 {
return (pixelsPerInch / s_historicalPixelPerInch); }
332 void setViewportScale(
float vpScale)
333 { viewportScale = vpScale; }
335 float getViewportScale()
const
336 {
return viewportScale; }
338 static const float s_historicalPixelPerInch;
339 static float s_defaultPixelsPerInch;
340 static void setDefaultPixelsPerInch(
float ppi)
341 { s_defaultPixelsPerInch = ppi; }
357 void setFullViewport();
360 void adjustViewport();
Class for representing a viewport.
const SbVec2i32 & getWindowSize_i32() const
Returns window size in pixels.
SbViewportRegion()
Default constructor.
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 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
Returns the pixel-per-inch ratio for the display device the viewport is part of.
const SbVec2s & getViewportOriginPixels() const
Returns viewport origin in pixels.
SbViewportRegion(SbVec2i32 winSize, float newScale=1.0)
Constructor that takes width and a height in pixels.
SbViewportRegion(SbVec2s winSize, float newScale=1.0)
Constructor that takes width and a height in pixels.
void setWindowSize(SbVec2i32 winSize)
Changes window size to given width and height in pixels, given as SbVec2i32.
friend int operator==(const SbViewportRegion ®1, const SbViewportRegion ®2)
Equality comparison operator.
void setViewportPixels(SbVec2i32 origin, SbVec2i32 size)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
void setWindowSize(SbVec2s winSize)
Changes window size to given width and height in pixels, given as SbVec2s.
SbViewportRegion(const SbViewportRegion &vpReg)
Constructor that takes a viewport region.
void setViewportPixels(SbVec2s origin, SbVec2s size)
Sets viewport to region with given origin (lower-left corner) and size, given as pixel coordinates.
const SbVec2i32 & getViewportOriginPixels_i32() const
Returns viewport origin in pixels.
const SbVec2f & getViewportOrigin() const
Returns viewport origin in 0..1 normalized coordinates relative to the current window size.
friend int operator!=(const SbViewportRegion ®1, const SbViewportRegion ®2)
Inequality comparison operator.
const SbVec2i32 & getViewportSizePixels_i32() const
Returns viewport size in pixels.
void scaleHeight(float ratio)
Scales viewport within window to be the given ratio of its current height, leaving the resulting view...
SbVec2f normalize(const SbVec2s &position) const
Compute the 0..1 normalized coordinates of the specified pixel position, relative to the current view...
SbViewportRegion(short width, short height, float newScale=1.0)
Constructor that takes width and a height in pixels.
float getViewportAspectRatio() const
Returns aspect ratio (width/height) of viewport.
void setViewport(SbVec2f origin, SbVec2f size)
Sets viewport to given region, specified as normalized coordinates relative to the current window siz...
void setViewport(float left, float bottom, float width, float height)
Sets viewport to given region, specified as normalized coordinates relative to the current window siz...
const SbVec2s & getViewportSizePixels() const
Returns viewport size in pixels.
const SbVec2f & getViewportSize() const
Returns viewport size in 0..1 normalized coordinates relative to the current window size.
Class to access a MeshViz view.
virtual const SbVec2f getViewportSize() const
Returns SbViewportRegion size.
SoGetView()
Default constructor.
virtual SbBool getViewportIsEnabled() const
Returns TRUE if SoGetView functionalities are enabled, FALSE otherwise.
virtual const SbVec2f getViewportOrigin() const
Returns SbViewportRegion origin.