HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUI_ViewParameter.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GUI_ViewParameter (Geometry Render Library, C++)
7  *
8  * COMMENTS:
9  * ViewParameter contains information relating to the
10  * viewport's physical characteristics, eg aspect ratio,
11  * position, lookat.
12  *
13  */
14 
15 #ifndef __GUI_ViewParameter__
16 #define __GUI_ViewParameter__
17 
18 #include "GUI_API.h"
19 #include <UT/UT_BoundingBox.h>
20 #include <UT/UT_Matrix3.h>
21 #include <UT/UT_Matrix4.h>
22 #include <UT/UT_Quaternion.h>
23 #include <UT/UT_Rect.h>
24 #include <UT/UT_Vector3.h>
25 #include <UT/UT_Plane.h>
26 
27 class RE_Render;
28 
30 
32 {
33 public:
35  {
36  ortho = 0;
37  applyAspect = 0;
38  matrixDirty = 1;
39  iMatrixDirty = 1;
40  boxZoom = 0;
41  viewportDirty = 0;
42  rotoTrackWindow = 0;
43  initXform = 0;
44  rxyzDirty = 1;
45  }
46 
47  // ASCII methods to save and load flags
48  void save(std::ostream &os) const;
49  bool load(UT_IStream &is);
50 
51  unsigned ortho:1,
52  applyAspect:1,
53  matrixDirty:1,
54  iMatrixDirty:1,
55  boxZoom:1,
56  viewportDirty:1,
57  rotoTrackWindow:1,
58  initXform:1,
59  rxyzDirty:1;
60 };
61 
63 {
64 public:
67 
68  enum axis { OBLIQUE, CUSTOM, XAXIS, YAXIS, ZAXIS,
69  FRONT, RIGHT, TOP, BACK, LEFT, BOTTOM };
70 
71  enum orientation { Y_UP, Z_UP };
72 
74  {
75  int w,h;
76  getViewportSize(w,h);
77  area.set(myViewportLeft, myViewportBottom, w,h);
78  }
79  void getViewport(int &l, int &r, int &b, int &t) const;
80  void getViewportSize(int &w, int &h) const
81  {
82  // Note that we have inclusive coordinates.
83  w = myViewportRight - myViewportLeft + 1;
84  h = myViewportTop - myViewportBottom + 1;
85  }
86  int getViewportWidth() const
87  { return myViewportRight - myViewportLeft + 1; }
88  int getViewportHeight() const
89  { return myViewportTop - myViewportBottom + 1; }
90  void setViewport(RE_Render *r, int x, int y, int w, int h);
91  void setViewport(RE_Render *r, const UT_DimRect &viewarea)
92  { setViewport(r, viewarea.x(), viewarea.y(),
93  viewarea.w(), viewarea.h()); }
94 
95  // Utility for converting our viewport into a UT_Rect.
97  { return UT_InclusiveRect(myViewportLeft, myViewportBottom,
98  myViewportRight, myViewportTop); }
99 
100 
101  // Both setViewport and setView must be called before setProjection.
102  // r may be NULL to set the projection matrix without loading it into
103  // RE_Render.
104  void setProjection(RE_Render *r);
105 
106  // Returns the projection matrix. If depth_adjust is false, Z is not
107  // mapped to [0,1], and instead remains as-is.
108  void getProjection(UT_Matrix4D &view, bool depth_adjust=true);
109 
110 
111  // temporarily use this projection matrix. This class does not take
112  // ownership.
113  void setProjectionOverride(UT_Matrix4D *override);
114 
115  // Get the direction a particular point (px, py) in the camera's
116  // near plane is pointing to in world coordinates. The range of
117  // (px, py) is (0, 0) to (1, 1) with (0, 0) representing the
118  // lower-left corner and the default arguments represent the center of
119  // the screen.
120  UT_Vector3 getCameraDir(fpreal px = 0.5, fpreal py = 0.5);
121 
122  // A utility method to return the world space plane representing our
123  // view plane. The point will be set to the center of the view and
124  // the normal will point towards the camera.
125  UT_PlaneD getViewPlane();
126 
127  // The view is a subregion of the viewport that represents the current
128  // "camera" view. Aspect ratio bars are used to dim the parts of the
129  // viewport not in this view. The window coordinates are relative to
130  // this view, not the viewport.
131  void setView(const UT_DimRect &area)
132  { setView(area.x(), area.y(), area.w(), area.h()); }
133  void setView(int x, int y, int w, int h);
134  void getView(int &l, int &r, int &b, int &t) const;
135  int getViewWidth() const
136  { return myViewRight - myViewLeft + 1; }
137  int getViewHeight() const
138  { return myViewTop - myViewBottom + 1; }
139 
140  // A handy method to compute projection bounds for the viewport such
141  // that the specified bounds map to the view subregion.
142  void viewToViewportProjectionBounds(
143  fpreal &left, fpreal &right,
144  fpreal &bottom, fpreal &top) const;
145 
146  // Convenience methods to query the margins on each side of the view
147  // subregion.
148  int getLeftMargin() const
149  { return myViewLeft - myViewportLeft; }
150  int getRightMargin() const
151  { return myViewportRight - myViewRight; }
152  int getBottomMargin() const
153  { return myViewBottom - myViewportBottom; }
154  int getTopMargin() const
155  { return myViewportTop - myViewTop; }
156 
157  void homeToBox(int width, int height, fpreal minzoom,
158  UT_BoundingBox &box, const UT_Matrix3R *rot = NULL,
159  bool centre_to_origin = false, bool zoom_in = false);
160  void homeRotation(axis a, UT_Matrix3R &rot) const;
161  void homeRotation(axis a);
162 
163  void resetFOV();
164 
165  // Query the rotation that converts the view rotation from the old mode
166  // to the new mode.
167  static void getOrientationChangeRotation(
170  UT_Matrix3R &rot);
171 
172  // Convert a view transform relative to the old_mode to the corresponding
173  // view transform relative to the new mode.
174  void convertTransform(GUI_ViewParameter::axis home_axis,
177 
178  // To perform view operations that are being exported continuously, we
179  // need to cache some data to account for view changes that occur as a
180  // result of the exporting. Generally, you'll want to call the begin
181  // method on a UI_VALUE_START and the end method on a UI_VALUE_CHANGED.
182  void beginContinuouslyExportedOperation();
183  void endContinuouslyExportedOperation();
184  bool continuouslyExportedOperationInProgress() const;
185 
186  void rotate(UT_Axis3::axis axis, fpreal dx);
187  void rotate(const UT_Vector3R &axis, fpreal dx);
188  void rotate(const UT_Quaternion &quat);
189  void trackball(fpreal dx, fpreal dy);
190  void incrementtrackball(fpreal dx, fpreal dy, int finish);
191  void eulertumble(fpreal dx, fpreal dy, int finish, bool lock);
192  void dotumble(fpreal dx, fpreal dy, int finish);
193 
194  void scroll(fpreal dx, fpreal dy);
195  // Scroll using the specified viewport size instead of our settings. Used
196  // for scrolling linked ortho viewports.
197  void scroll(fpreal dx, fpreal dy, const UT_InclusiveRect &viewport);
198 
199  void dolly(fpreal dx,
200  bool precise_zoom = false,
201  bool smooth_deltas = false);
202 
203  // Dolly using a specified world-space direction (instead of towards the
204  // center of the view as in a regular dolly). The use of world space is
205  // a convenience for the GUI_ViewState wrapper that would otherwise have
206  // to transform this to a view space direction for each instance of this
207  // class.
208  void directedDolly(const UT_Vector3R &unit_worldspace_dir,
209  fpreal dx, bool precise_zoom = false,
210  bool smooth_deltas = false);
211 
213  {
215  GUI_ORTHO_WIDTH
216  };
217  void zoom(fpreal dx, GUI_ZoomItem item, bool precise_zoom = false);
218  // Zoom using the specified viewport size instead of our settings. Used
219  // for zooming linked ortho viewports.
220  void zoom(fpreal dx, GUI_ZoomItem item,
221  const UT_InclusiveRect &viewport,
222  bool precise_zoom = false);
223 
224  // Versions of the zoom() methods that center the zoom around the given
225  // (normalized) screen position (sx, sy). This affects either the window
226  // offset, when GUI_WIN_SIZE is specified, or the view position, when
227  // GUI_ORTHO_WIDTH is specified.
228  void offsetZoom(fpreal sx, fpreal sy, fpreal dx, GUI_ZoomItem item,
229  bool precise_zoom = false);
230  void offsetZoom(fpreal sx, fpreal sy, fpreal dx, GUI_ZoomItem item,
231  const UT_InclusiveRect &viewport,
232  bool precise_zoom = false);
233 
234  // Dolly onto a target located at a specified distance.
235  // Note that the location and size of the "box" must be
236  // normalized to [0, 1]
237  // ** Note : Aspect ratio of the box is assumed to match aspect ratio
238  // of the viewport!
239  void boxZoom(fpreal firstx, fpreal firsty, fpreal lastx,
240  fpreal lasty, fpreal distance);
241 
242  // Returns the width of the frustum cross-section at the distance t.
243  static fpreal getFrustumWidth(fpreal t, fpreal aperture, fpreal focal_length,
244  fpreal orthowidth, bool is_ortho);
245 
246  // Returns the centre of the frustum (cx, cy) and the half-width and
247  // half-height (hw, hh), from these, you can compute the corners of the
248  // frustum.
249  static void getFrustumCenter(fpreal frustum_width, fpreal aspect,
250  fpreal x_offset, fpreal y_offset,
251  fpreal x_window_size, fpreal y_window_size,
252  fpreal &cx, fpreal &cy,
253  fpreal &hw, fpreal &hh);
254 
255 // member data access methods
256 
257  bool isDirty() const { return (myFlag.viewportDirty ||
258  myFlag.matrixDirty ||
259  myFlag.iMatrixDirty); }
260  // bumped whenever the view has changed.
261  int getViewVersion() const { return myVersion; }
262 
263  // projection
264  int initialized() const { return myFlag.initXform; }
265  int getOrthoFlag() const { return myFlag.ortho; }
266  void setOrthoFlag(int o) { myFlag.ortho = o; }
267  void setLimits(fpreal n, fpreal f) { setNearClip(n); setFarClip(f); }
269  {
270  *n = myView.myNearLimit;
271  *f = myView.myFarLimit;
272  }
273  void setNearClip(fpreal near);
274  void setFarClip(fpreal far);
275  fpreal getNearClip() const { return myView.myNearLimit; }
276  fpreal getFarClip() const { return myView.myFarLimit; }
277 
279  {
280  myView.myWinX = x;
281  myView.myWinY = y;
282  myView.myWinW = SYSmax(w, fpreal(0.001));
283  myView.myWinH = SYSmax(h, fpreal(0.001));
284  }
286  fpreal &w, fpreal &h) const
287  {
288  x = myView.myWinX;
289  y = myView.myWinY;
290  w = myView.myWinW;
291  h = myView.myWinH;
292  }
293 
294  // The window is stored as an offset from 0, 0 with the scale applied prior
295  // to translation. However, mantra and other renderers expect the window
296  // to be relative to the (0,1) rectangle. getScreenWindow() will translate
297  // the window parameters into a screen window. setScreenWindow() will take
298  // a screen window and set the appropriate parameters.
300  fpreal &b, fpreal &t) const
301  {
302  convertViewToScreenWindow(myView.myWinX, myView.myWinY,
303  myView.myWinW, myView.myWinH,
304  l, r, b, t);
305  }
307  {
308  convertScreenToViewWindow(l, r, b, t,
309  myView.myWinX, myView.myWinY,
310  myView.myWinW, myView.myWinH);
311  }
312 
313  static void convertScreenToViewWindow(
314  fpreal l, fpreal r, fpreal b, fpreal t,
315  fpreal &xoff, fpreal &yoff, fpreal &xsize, fpreal &ysz);
316  static void convertViewToScreenWindow(
317  fpreal xoff, fpreal yoff, fpreal xsize, fpreal ysize,
318  fpreal &l, fpreal &r, fpreal &b, fpreal &t);
319 
320  fpreal getWinSizeX() const { return myView.myWinW; }
321  fpreal getWinSizeY() const { return myView.myWinH; }
322  fpreal getWinX() const { return myView.myWinX; }
323  fpreal getWinY() const { return myView.myWinY; }
324 
326  {
327  GUI_VIEW_ADJUST_NONE = 0,
328  GUI_VIEW_ADJUST_FAR = 1,
329  GUI_VIEW_ADJUST_NEAR = 2,
330  GUI_VIEW_ADJUST_BOTH = 3
331  };
333  { myAdjustLimits = which; }
334  GUI_ViewAdjustLimits getAdjustLimits() const { return myAdjustLimits; }
335 
336  void setWindowAffectRotoscope(int v) { myFlag.rotoTrackWindow = v; }
338  { return myFlag.rotoTrackWindow; }
339 
340  // aspectRatio
341  void setApplyAspectFlag(int a) { myFlag.applyAspect = a; }
342  int getApplyAspectFlag() const { return myFlag.applyAspect; }
343  void setAspectRatio(fpreal a) { myViewAspectRatio = a; }
344  fpreal getAspectRatio() const { return myViewAspectRatio; }
345 
347  {
348  myFrustumWidthScale = xsc;
349  myFrustumHeightScale = ysc;
350  }
351 
352  // position
353  void setT(const UT_Vector3D &t)
354  { myView.myT = t; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
355  void setTx(fpreal v)
356  { myView.myT.x()=v; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
357  void setTy(fpreal v)
358  { myView.myT.y()=v; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
359  void setTz(fpreal v)
360  { myView.myT.z() = v; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
361 
362  UT_Vector3D getT() const { return myView.myT; }
363  fpreal getTx() const { return myView.myT.x(); }
364  fpreal getTy() const { return myView.myT.y(); }
365  fpreal getTz() const { return myView.myT.z(); }
366 
367  // pivot
368  UT_Vector3D getP() const { return myView.myP; }
369  fpreal getPx() const { return myView.myP.x(); }
370  fpreal getPy() const { return myView.myP.y(); }
371  fpreal getPz() const { return myView.myP.z(); }
372  void setP(const UT_Vector3D &p)
373  { myView.myP = p; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
374  void setPx(fpreal v)
375  { myView.myP.x() = v; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
376  void setPy(fpreal v)
377  { myView.myP.y() = v; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
378  void setPz(fpreal v)
379  { myView.myP.z() = v; myFlag.matrixDirty=1; myFlag.iMatrixDirty=1;}
380 
382  { myOrientationMode = o; }
383  static orientation getOrientationMode() { return myOrientationMode; }
384  static bool isOrientationYUp()
385  { return myOrientationMode == Y_UP; }
386  static bool isOrientationZUp()
387  { return myOrientationMode == Z_UP; }
388 
389  // Rotation style:
390  static void setTumbleStyleFlag(int style)
391  { myTumbleStyle = style; }
392  static int getTumbleStyleFlag() { return myTumbleStyle; }
393  static void setAltKeyViewControlsFlag(int style)
394  { myAltKeyViewControls = style; }
395  static int getAltKeyViewControlsFlag() { return myAltKeyViewControls; }
396  static void setScrollStyleFlag(int style)
397  { myScrollStyle = style; }
398  static int getScrollStyleFlag() { return myScrollStyle; }
399  static void setDefaultHomingStyleFlag(int style)
400  { myDefaultHomingStyle = GUI_ViewParameter::axis(style); }
401  static axis getDefaultHomingStyleFlag() { return myDefaultHomingStyle; }
402 
403  // the resulting matrices
404  void setRotateMatrix(const UT_Matrix3D &mat)
405  { myView.myRotateMatrix = mat;
406  myFlag.matrixDirty = 1;
407  myFlag.iMatrixDirty = 1;
408  myFlag.rxyzDirty = 1; }
409  const UT_Matrix4D &getRotateMatrix() const { return myView.myRotateMatrix; }
410 
412  { return myProjectionOverride ? *myProjectionOverride
413  : myView.myProjectionMatrix; }
414  const UT_Matrix4D &getTransformMatrix() { updateTransformMatrix();
415  return myTransformMatrix; }
416  const UT_Matrix4D &getItransformMatrix() { updateItransformMatrix();
417  return myItransformMatrix; }
418 
419  // This sets the transform matrix to the given value, bypassing the
420  // PX, TX, etc. The purpose of this is to get accurate camera transforms
421  // you can first set all the PX, Rotate, etc, according to the cracked
422  // values, and then do a forceTransformMatrix to ensure the user sees
423  // the most accurate possible matrix.
424  void forceTransformMatrix(const UT_DMatrix4 &mat);
425  void getTransformMatrix(UT_DMatrix4 &mat, fpreal time);
427  void *data)
428  {
429  myTransformCallback = callback;
430  myTransformCallbackData = data;
431  }
432 
433  // Class I/O methods. They return 0 if successful, -1 if not.
434  int save(std::ostream &os, char separator = '\n') const;
435  bool load(UT_IStream &is);
436  bool oldLoad(UT_IStream &is, int version);
437 
438  // inline for non-virtual class
439  const char *className() const { return "GUI_ViewParameter"; }
440 
441  fpreal getLastHomeRadius() const { return myLastHomeRadius; }
442 
443  void setHomeAxis(axis homeaxis)
444  { myHomeAxis = homeaxis; myFlag.rxyzDirty = 1; }
445  axis getHomeAxis() const { return myHomeAxis; }
446  void setCustomHomeRot(UT_Matrix3R &rot) { myCustomHomeRot = rot; }
447  const UT_Matrix3R &getCustomHomeRot() const { return myCustomHomeRot; }
448 
449 
450  void setOrthoWidth(fpreal w) { myView.myOrthoWidth = w; }
451  fpreal getOrthoWidth() const { return myView.myOrthoWidth; }
452 
453  void setFocalLength(fpreal f) { myView.myFocalLength = f; }
454  fpreal getFocalLength() const { return myView.myFocalLength; }
455 
456  void setAperture(fpreal a) { myView.myAperture = a; }
457  fpreal getAperture() const { return myView.myAperture; }
458  fpreal getNearLimit() const { return myView.myNearLimit; }
459  fpreal getFarLimit() const { return myView.myFarLimit; }
460 
461  fpreal getZBufferNear() const { return myZBufferNear; }
462  fpreal getZBufferFar() const { return myZBufferFar; }
463 
464  // viewport clearing
466 
467  // fog
468  int myFog;
470  float myFogNear;
471  float myFogFar;
472  float myFogColor[3];
473  float myFogAlpha;
474 
475  // used for rotoscoping only
477 
478  // container for all view home information
479  class gui_View
480  {
481  public:
483  : myT(0.0, 0.0, 0.1),
484  myP(0.0, 0.0, 0.0),
485  myRotateMatrix(1.0),
486  myProjectionMatrix(1.0),
487  myWinX(0.0),
488  myWinY(0.0),
489  myWinW(1.0),
490  myWinH(1.0),
491  myOrthoWidth(1.0),
492  myFocalLength(50.0),
493  myAperture(41.4214),
494  myNearLimit(0.1),
495  myFarLimit(10000.0)
496  {}
497 
500 
503 
504  // window (zooming)
509 
510  // projection information
511  // ortho specific
513 
514  // perspective specific sSee diagram below)
517 
520  };
521 
522  // methods to quickly stash and recall the view state.
523  void getViewState(gui_View &view_state) const
524  { view_state = myView; }
525  void setViewState(const gui_View &view_state)
526  {
527  myView = view_state;
528  myFlag.matrixDirty=1;
529  myFlag.iMatrixDirty=1;
530  myFlag.rxyzDirty=1;
531  }
532 
533  // clipping
534 private:
535  fpreal myZBufferNear;
536  fpreal myZBufferFar;
537  GUI_ViewAdjustLimits myAdjustLimits;
538 
539  // aspect ratio
540  fpreal myViewAspectRatio;
541 public:
542  fpreal myPixelAspect; // depends on output device
543 
544 // projection information (see docs below)
555 
557 
558 private:
559  void updateTransformMatrix();
560  void updateItransformMatrix();
561  void updateRXYZValues();
562  fpreal getDistanceToBoxCenter(int clamp = 0) const;
563 
564  void internalScroll(fpreal dx, fpreal dy,
565  const UT_InclusiveRect &viewport,
566  bool decouple_axes);
567  void internalZoom(fpreal dx, GUI_ZoomItem item, int width);
568  void internalOffsetZoom(fpreal sx, fpreal sy, fpreal dx,
569  GUI_ZoomItem item,
570  const UT_InclusiveRect &viewport);
571 
572  void getFrustumClip(fpreal &l, fpreal &r, fpreal &t, fpreal &b,
573  fpreal &n, fpreal &f);
574  fpreal computeZoomDelta(fpreal dx,
575  bool precise_zoom,
576  bool smooth_deltas);
577 
578  GUI_ViewFlag myFlag;
579 
580 // transform information
581 
582  gui_View myView;
583  fpreal myDx, myDy;
584  static orientation myOrientationMode;
585  static int myTumbleStyle;
586  static int myAltKeyViewControls;
587  static int myScrollStyle;
588  static axis myDefaultHomingStyle;
589 
590  fpreal myRx, myRy, myRz; // Used by euler method. In degrees
591 
592  // always call updateTransformMatrix before using myTransformMatrix.
593  UT_Matrix4D myTransformMatrix; // this one is generated from the above
594  UT_Matrix4D myItransformMatrix; // inverse of myTransformMatrix;
595 
596  GRgetTransformCallback myTransformCallback;
597  void *myTransformCallbackData;
598 
599 // home information to be used in scaling of view transformation
600  fpreal myLastHomeDistance;
601  fpreal myLastHomePixelWidthOBSOLETE;
602  fpreal myLastHomeAdjustedBoxWidth;
603  fpreal myLastHomeOrthoWidth;
604  fpreal myLastHomeRadius;
605 
606  // myLastHomeAdjustedBoxWidth supercedes myLastHomePixelWidth, but to load
607  // view transforms from old hip files without screwed up scrolling, we may
608  // need to use the obsolete quantity until the next manual home operation.
609  bool myObsoleteScrollIsActive;
610 
611  axis myHomeAxis;
612  UT_Matrix3R myCustomHomeRot;
613 
614  // A collection of data needed for calculating the appropriate changes to
615  // the view transform to perform view operations under continuous export
616  // of view changes to a camera.
617  class ContinuousExportCache
618  {
619  public:
620  ContinuousExportCache() {}
621 
622  UT_Matrix4D myRotateMatrix;
623  fpreal myAdjustedNear;
624  fpreal myAdjustedX;
625  fpreal myAdjustedY;
626  };
627 
628  typedef ContinuousExportCache ViewOpCache;
629 
630  ViewOpCache myContinuousExportCache;
631  bool myContinuousExportInProgress;
632 
633  // These might be needed for other guys.
634  int myViewportLeft, myViewportRight;
635  int myViewportBottom, myViewportTop;
636 
637  // The view is a subregion of the viewport that represents the current
638  // "camera" view. Aspect ratio bars are used to dim the parts of the
639  // viewport not in this view. The window coordinates are relative to
640  // this view, not the viewport.
641  int myViewLeft, myViewRight;
642  int myViewBottom, myViewTop;
643 
644  int myVersion;
645 
646  UT_Matrix4D *myProjectionOverride;
647 };
648 
649 
650 #ifdef __DOCUMENTATION__
651 
652 FOV can be computed from aperture and focal length.
653 
654  <--aperture--->
655  | |
656  | |
657  +------+------+-----------
658  \ | / ^
659  \ | / |
660  \_--+--_/ Focal
661 Unzoomed \ | / Length
662  FOV --> \ | / |
663  \|/ v
664  +------------------
665 
666 myFullW and myFullH are the dimensions of the plane onto which the
667 image is projected before any adjustments for zoom or window parms.
668 the plane is located at "myAdjustedNear" along the z axis.
669 After taking the zoom and win channels into account, myAdjustedX and
670 myAdjustedY refer to the center of the view on the same plane, and
671 myAdjustedW and myAdjustedH contain the dimensions of the adjusted view.
672 
673 #endif
674 
675 #endif
#define SYSmax(a, b)
Definition: SYS_Math.h:1367
void setLimits(fpreal n, fpreal f)
fpreal getNearClip() const
int getViewWidth() const
fpreal getNearLimit() const
int rotoscopeTracksWindowVals() const
void getViewportSize(int &w, int &h) const
static void setDefaultHomingStyleFlag(int style)
fpreal getPy() const
GLint left
Definition: glcorearb.h:2004
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:836
void setTx(fpreal v)
void setWindow(fpreal x, fpreal y, fpreal w, fpreal h)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
axis getHomeAxis() const
GA_API const UT_StringHolder rot
fpreal getWinX() const
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
fpreal getTy() const
int getBottomMargin() const
int h() const
Get width/height dimensions.
Definition: UT_Rect.h:246
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
static void setOrientationMode(orientation o)
void setAperture(fpreal a)
GLint y
Definition: glcorearb.h:102
GLdouble far
Definition: glcorearb.h:142
3D Vector class.
int getApplyAspectFlag() const
static void setTumbleStyleFlag(int style)
void getLimits(fpreal *n, fpreal *f)
void setView(const UT_DimRect &area)
void setPz(fpreal v)
int initialized() const
void setViewport(RE_Render *r, const UT_DimRect &viewarea)
void setP(const UT_Vector3D &p)
GLint GLsizei width
Definition: glcorearb.h:102
png_bytepp image
Definition: png.h:1849
fpreal getFarLimit() const
int getOrthoFlag() const
void setScreenWindow(fpreal l, fpreal r, fpreal b, fpreal t)
fpreal getAperture() const
void setFocalLength(fpreal f)
const char * className() const
void setAdjustLimits(GUI_ViewAdjustLimits which)
fpreal getFocalLength() const
GLdouble n
Definition: glcorearb.h:2007
GLfloat f
Definition: glcorearb.h:1925
void getWindow(fpreal &x, fpreal &y, fpreal &w, fpreal &h) const
int getViewportHeight() const
void setApplyAspectFlag(int a)
void setWindowAffectRotoscope(int v)
T distance(const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
Definition: UT_Vector4.h:698
#define GUI_API
Definition: GUI_API.h:10
void setHomeAxis(axis homeaxis)
void setTz(fpreal v)
void setOrthoFlag(int o)
void getViewport(UT_DimRect &area) const
fpreal getTx() const
GUI_ViewAdjustLimits getAdjustLimits() const
void set(int v1, int v2, int v3, int v4)
Set the native rect type values.
Definition: UT_Rect.h:135
void setOrthoWidth(fpreal w)
static bool isOrientationZUp()
void setRotateMatrix(const UT_Matrix3D &mat)
int getViewHeight() const
int getViewportWidth() const
int x() const
Get lower-left corner.
Definition: UT_Rect.h:225
int w() const
Get width/height dimensions.
Definition: UT_Rect.h:245
GLboolean * data
Definition: glcorearb.h:130
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
fpreal getZBufferFar() const
void setPx(fpreal v)
fpreal getLastHomeRadius() const
fpreal getWinSizeX() const
static int getScrollStyleFlag()
int getRightMargin() const
fpreal getTz() const
void(* GRgetTransformCallback)(UT_DMatrix4 &, fpreal time, void *)
UT_Rect< UT_InclusiveRectImpl > UT_InclusiveRect
Integer rectangle class which stores its data as inclusive lower-left to upper-right (x1...
Definition: UT_Rect.h:53
void setT(const UT_Vector3D &t)
GT_API const UT_StringHolder version
GLint GLint bottom
Definition: glcorearb.h:2004
GLint GLsizei GLsizei height
Definition: glcorearb.h:102
fpreal getWinY() const
IFDmantra py
Definition: HDK_Image.dox:266
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
static orientation getOrientationMode()
double fpreal
Definition: SYS_Types.h:270
static axis getDefaultHomingStyleFlag()
static int getTumbleStyleFlag()
void setPy(fpreal v)
static void setScrollStyleFlag(int style)
static int getAltKeyViewControlsFlag()
const UT_Matrix4D & getTransformMatrix()
static void setAltKeyViewControlsFlag(int style)
void getViewState(gui_View &view_state) const
void setTy(fpreal v)
fpreal getAspectRatio() const
bool isDirty() const
UT_Vector3D getT() const
GLint GLenum GLint x
Definition: glcorearb.h:408
static bool isOrientationYUp()
int y() const
Get lower-left corner.
Definition: UT_Rect.h:226
void setCustomHomeRot(UT_Matrix3R &rot)
int getTopMargin() const
void setViewState(const gui_View &view_state)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
void setFrustumScale(fpreal xsc, fpreal ysc)
void setAspectRatio(fpreal a)
fpreal getPz() const
const UT_Matrix4D & getProjectionMatrix() const
GLboolean r
Definition: glcorearb.h:1221
const UT_Matrix4D & getRotateMatrix() const
int getViewVersion() const
fpreal getPx() const
fpreal getFarClip() const
fpreal getOrthoWidth() const
const UT_Matrix3R & getCustomHomeRot() const
fpreal getWinSizeY() const
fpreal getZBufferNear() const
UT_Vector3D getP() const
void setTransformCallback(GRgetTransformCallback callback, void *data)
void getScreenWindow(fpreal &l, fpreal &r, fpreal &b, fpreal &t) const
UT_InclusiveRect getViewport() const
GA_API const UT_StringHolder area
GLenum clamp
Definition: glcorearb.h:1233
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
const UT_Matrix4D & getItransformMatrix()
int getLeftMargin() const