1SbViewportRegion(3IV)() SbViewportRegion(3IV)()
2
3
4
6 SbViewportRegion — class for representing a viewport
7
9 SbViewportRegion
10
12 #include <Inventor/SbViewportRegion.h>
13
14 Methods from class SbViewportRegion:
15
16 SbViewportRegion()
17 SbViewportRegion(short width, short height)
18 SbViewportRegion(SbVec2s winSize)
19 SbViewportRegion(const SbViewportRegion &vpReg)
20 void setWindowSize(short width, short height)
21 void setWindowSize(SbVec2s winSize)
22 void setViewport(float left, float bottom, float width,
23 float height)
24 void setViewport(SbVec2f origin, SbVec2f size)
25 void setViewportPixels(short left, short bottom, short
26 width, short height)
27 void setViewportPixels(SbVec2s origin, SbVec2s size)
28 const SbVec2s & getWindowSize() const
29 const SbVec2f & getViewportOrigin() const
30 const SbVec2s & getViewportOriginPixels() const
31 const SbVec2f & getViewportSize() const
32 const SbVec2s & getViewportSizePixels() const
33 float getViewportAspectRatio() const
34 void scaleWidth(float ratio)
35 void scaleHeight(float ratio)
36 void setPixelsPerInch(float ppi)
37 float getPixelsPerInch() const
38 float getPixelsPerPoint() const
39 friend int operator ==(const SbViewportRegion ®1, const
40 SbViewportRegion ®2)
41
42
44 This class represents the active viewport region in a display window.
45 It contains the screen-space size of the window as well as the origin
46 and size of the viewport within the window. By default, the viewport is
47 the same as the full window. Methods allow the viewport to be set
48 either in terms of screen-space pixels or as normalized coordinates,
49 where (0,0) is the lower-left corner of the window and (1,1) is the
50 upper-right corner.
51
53 SbViewportRegion()
54 SbViewportRegion(short width, short height)
55 SbViewportRegion(SbVec2s winSize)
56 SbViewportRegion(const SbViewportRegion &vpReg)
57 Constructors of various kinds.
58
59 void setWindowSize(short width, short height)
60 Changes window size to given width and height in pixels.
61
62 void setWindowSize(SbVec2s winSize)
63 Changes window size to given width and height in pixels, given as
64 SbVec2s.
65
66 void setViewport(float left, float bottom, float width,
67 float height)
68 Sets viewport to given region, specified as normalized window coor‐
69 dinates: (0,0) is the lower-left corner, (1,1) is the upper-right.
70
71 void setViewport(SbVec2f origin, SbVec2f size)
72 Sets viewport to region with given origin (lower-left corner) and
73 size, given as normalized coordinate vectors.
74
75 void setViewportPixels(short left, short bottom, short
76 width, short height)
77 Sets viewport to given region, specified as pixel coordinates in
78 window: (0,0) is the lower-left corner.
79
80 void setViewportPixels(SbVec2s origin, SbVec2s size)
81 Sets viewport to region with given origin (lower-left corner) and
82 size, given as pixel coordinates.
83
84 const SbVec2s & getWindowSize() const
85 Returns window size in pixels.
86
87 const SbVec2f & getViewportOrigin() const
88 Returns viewport origin in normalized coordinates.
89
90 const SbVec2s & getViewportOriginPixels() const
91 Returns viewport origin in pixels.
92
93 const SbVec2f & getViewportSize() const
94 Returns viewport size in normalized coordinates.
95
96 const SbVec2s & getViewportSizePixels() const
97 Returns viewport size in pixels.
98
99 float getViewportAspectRatio() const
100 Returns aspect ratio (width/height) of viewport.
101
102 void scaleWidth(float ratio)
103 void scaleHeight(float ratio)
104 Scales viewport within window to be the given ratio of its current
105 width or height, leaving the resulting viewport centered about the
106 same point as the current one.
107
108 void setPixelsPerInch(float ppi)
109 float getPixelsPerInch() const
110 Sets/returns the pixel-per-inch ratio for the display device the
111 viewport is part of. The default value is 72 (1 pixel per printer's
112 point).
113
114 float getPixelsPerPoint() const
115 Convenience function that returns number of pixels per printer's
116 point.
117
118 friend int operator ==(const SbViewportRegion ®1, const
119 SbViewportRegion ®2)
120 Equality comparison operator.
121
122
124 SbVec2f, SbVec2s
125
126
127
128
129 SbViewportRegion(3IV)()