HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUI_DisplayOption.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_DisplayOption.h ( GUI Library, C++)
7  *
8  * COMMENTS: This class contains the options for all the different types
9  * of details (templates, footprints, etc.) and options that
10  * are common to them.
11  */
12 
13 #ifndef __GUI_DisplayOption__
14 #define __GUI_DisplayOption__
15 
16 #include "GUI_API.h"
17 #include <UT/UT_Rect.h>
18 #include <UT/UT_Vector2.h>
19 #include <RE/RE_TextureMap.h>
20 #include <UI/UI_Value.h>
21 #include <GR/GR_Defines.h>
22 #include <GR/GR_CommonDispOption.h>
23 #include <GR/GR_DisplayOption.h>
24 #include "GUI_RenderCommon.h"
25 
26 class OPUI_RotoscopeData;
27 class GR_DisplayOption;
28 
29 const int GUI_NUM_DISPLAY_SETS = 6;
32 
33 /// Context specific display options for geometry states
35 {
39  // ---- obj/model break
43 };
44 
45 #define ANY_FLAG_ACTIVE_IN_SETS(METHOD) \
46  bool METHOD##Any() const \
47  { return ((*this)[GUI_SCENE_OBJECT].METHOD() || \
48  (*this)[GUI_SELECTED_SCENE_OBJECT].METHOD() || \
49  (*this)[GUI_GHOST_SCENE_OBJECT].METHOD() || \
50  (*this)[GUI_DISPLAY_MODEL].METHOD() || \
51  (*this)[GUI_CURRENT_MODEL].METHOD() || \
52  (*this)[GUI_TEMPLATE_MODEL].METHOD()); }
53 
54 
55 /// Display options object that contains all high-level viewport display
56 /// settings, and contains the objects with context-specific display options
57 /// and common drawing options.
59 {
60 public:
61  GUI_DisplayOption(bool for_lops_view);
63 
64  GUI_DisplayOption &operator=(const GUI_DisplayOption &opt);
65 
66  /// Context-specific geometry-specific display options. If a display set
67  /// follows another set, it will be remapped to return that set.
68  /// @{
70  { return *myDisplaySet[myDisplaySetMap[type]]; }
72  { return *myDisplaySet[myDisplaySetMap[type]]; }
73  /// @}
74 
75  /// Direct cccess to the display set, without any mapping.
77  { return *myDisplaySet[type]; }
78 
79  /// Low-level drawing display options common to all geometry contexts
80  /// @{
81  const GR_CommonDispOption &common() const { return myCommonOptions; }
82  GR_CommonDispOption &common() { return myCommonOptions; }
83  /// @}
84 
85  /// Return true if the load/save was successful, and false otherwise.
86  /// @{
87  bool save(std::ostream &) const;
88  bool load(UT_IStream &);
89  /// @}
90 
91  /// Remap the display option set to another set.
94  { myDisplaySetMap[follower] = reference; }
95 
96  /// Query which display set this set is following. If none, it will refer
97  /// to itself.
99  { return myDisplaySetMap[t]; }
100 
101  /// Scene custom display option support - set and query scene options
102  /// @{
103  void enableSceneOption(const char *name, bool enable);
104  bool isSceneOptionEnabled(const char *name) const;
105  /// @}
106 
107  // These flags are stored here because they deal with different concepts
108  // unknown to GR. The flags at the GR level should only be used by GR when
109  // it renders a specific detail.
110  bool showSelected() const { return myFlags.showSelected; }
111  bool showNonSelected() const { return myFlags.showNonSelected; }
112  bool showTemplates() const { return myFlags.showTemplates; }
113  bool showFootprints() const { return myFlags.showFootprints; }
114  bool showCurrentOutput() const { return myFlags.showCurrentOutput; }
115  bool showDisplay() const { return myFlags.showDisplay; }
116  bool showGuides() const { return myFlags.showGuides; }
117  bool showObjectNames() const { return myFlags.showObjectNames; }
118  bool showFullNames() const { return myFlags.showFullNames; }
119  bool drawOrigin() const { return myFlags.drawOrigin; }
120  bool drawStickyOrigin() const { return myFlags.drawStickyOrigin; }
121  bool drawViewPivot() const { return myFlags.drawViewPivot; }
122  bool drawWalls() const { return myFlags.drawWalls; }
123  bool drawXYPlane() const { return myFlags.drawXYPlane; }
124  bool drawXZPlane() const { return myFlags.drawXZPlane; }
125  bool drawYZPlane() const { return myFlags.drawYZPlane; }
126  bool drawFieldGuide() const { return myFlags.drawFieldGuide; }
127  bool drawSafeArea() const { return myFlags.drawSafeArea; }
128  bool drawBackgrounds() const { return myFlags.drawBackgrounds; }
129  bool drawEnvironmentMaps() const
130  { return myFlags.drawEnvironmentMaps; }
132  { return myFlags.drawFilteredBackgrounds; }
133  bool showIKCriticalZones() const
134  { return myFlags.showIKCriticalZones; }
135  bool getDrawCameraMask() const
136  { return myFlags.drawCameraMask; }
137  bool drawBadges() const { return myFlags.drawBadges; }
138 
139  bool drawVertexAttrib2D() const
140  { return myFlags.drawVertexAttrib2D; }
142  { return myFlags.autoDetectAttribType2D; }
143 
144  bool drawSpecular() const { return myFlags.drawSpecular; }
145  bool drawMultiTexture() const { return common().drawMultiTexture();}
146 
147  bool applySelectMask() const { return myFlags.applySelectMask; }
148 
149  bool drawXRay() const { return myFlags.drawXRay; }
150  bool xrayQuality() const { return myFlags.xrayQuality; }
151  bool drawObjectOrigins() const { return myFlags.drawObjOrigins; }
152  bool showMaterials() const { return myFlags.showMaterials; }
153  bool useMaterialOverrides() const { return myFlags.useOverrides; }
154  bool mssEnable() const { return myFlags.mssEnable; }
155  bool mssPerPrim() const { return myFlags.mssPerPrim; }
156  bool mssPacked() const { return myFlags.mssPacked; }
157  int objectMaterialLimit() const { return myObjectMaterialLimit; }
158  fpreal xrayWireStrength() const { return myXRayWireStrength; }
159 
161  {
162  MAT_ALWAYS = 0,
163  MAT_NO_PLAYBACK = 1,
164  MAT_MANUAL = 2
165  };
166  gui_MatAssignMode materialAssignMode() const { return myMatAssignMode; }
168  { myMatAssignMode = mode; }
169  bool materialUpdate() const { return myMatUpdate; }
170  void materialUpdate(bool update) { myMatUpdate = update; }
171 
172 
173  // the threshold a shading mode is set to change when modifying view
174 
175  void showSelected(bool onoff) { myFlags.showSelected =onoff;}
176  void showNonSelected(bool onoff) { myFlags.showNonSelected =onoff;}
177  void showTemplates(bool onoff) { myFlags.showTemplates =onoff;}
178  void showFootprints(bool onoff) { myFlags.showFootprints =onoff;}
179  void showCurrentOutput(bool onoff)
180  { myFlags.showCurrentOutput = onoff;}
181  void showDisplay(bool onoff) { myFlags.showDisplay =onoff;}
182  void showGuides(bool onoff) { myFlags.showGuides =onoff;}
183  void showObjectNames(bool onoff) { myFlags.showObjectNames =onoff;}
184  void showFullNames(bool onoff) { myFlags.showFullNames =onoff;}
185  void drawOrigin(bool onoff) { myFlags.drawOrigin =onoff;}
186  void drawStickyOrigin(bool onoff) { myFlags.drawStickyOrigin=onoff;}
187  void drawViewPivot(bool onoff) { myFlags.drawViewPivot =onoff;}
188  void drawWalls(bool onoff) { myFlags.drawWalls =onoff;}
189  void drawXYPlane(bool onoff) { myFlags.drawXYPlane =onoff;}
190  void drawXZPlane(bool onoff) { myFlags.drawXZPlane =onoff;}
191  void drawYZPlane(bool onoff) { myFlags.drawYZPlane =onoff;}
192  void drawFieldGuide(bool onoff) { myFlags.drawFieldGuide =onoff;}
193  void drawSafeArea(bool onoff) { myFlags.drawSafeArea =onoff;}
194  void drawBackgrounds(bool onoff) { myFlags.drawBackgrounds =onoff;}
195  void drawEnvironmentMaps(bool onoff)
196  { myFlags.drawEnvironmentMaps =onoff;}
197  void drawFilteredBackgrounds(bool onoff)
198  { myFlags.drawFilteredBackgrounds=onoff;}
199  void showIKCriticalZones(bool onoff)
200  { myFlags.showIKCriticalZones =onoff;}
201  void setDrawCameraMask(bool onoff)
202  { myFlags.drawCameraMask =onoff;}
203  void drawBadges(bool onoff) { myFlags.drawBadges =onoff;}
204  void drawVertexAttrib2D(bool onoff)
205  { myFlags.drawVertexAttrib2D = onoff; }
206  void autoDetectAttribType2D(bool onoff)
207  { myFlags.autoDetectAttribType2D = onoff; }
208  void drawSpecular(bool onoff)
209  { myFlags.drawSpecular = onoff; }
210  void drawMultiTexture(bool onoff)
211  { common().drawMultiTexture(onoff); }
212  void applySelectMask(bool onoff)
213  { myFlags.applySelectMask = onoff; }
214  void drawXRay(bool xray) { myFlags.drawXRay = xray; }
215  void xrayQuality(bool q) { myFlags.xrayQuality = q; }
216  void xrayWireStrength(fpreal w) { myXRayWireStrength = w; }
217  void drawObjectOrigins(bool org) { myFlags.drawObjOrigins = org; }
218  void showMaterials(bool show) { myFlags.showMaterials = show; }
219  void useMaterialOverrides(bool ovr) { myFlags.useOverrides = ovr; }
220  void mssEnable(bool mss) { myFlags.mssEnable = mss; }
221  void mssPerPrim(bool mpp) { myFlags.mssPerPrim = mpp; }
222  void mssPacked(bool mp) { myFlags.mssPacked = mp; }
224  { myObjectMaterialLimit=SYSmax(1,m); }
225 
226  void handleHighlightSize(int hl)
227  { myHandleHighlightSize = SYSclamp(hl, 0, 2); }
228  int handleHighlightSize() const { return myHandleHighlightSize; }
230  { myOriginGnomonSize = SYSmax(size, 0.0); }
231  fpreal originGnomonSize() const { return myOriginGnomonSize; }
232 
233  /// set/query enable/disable of shading mode change
234  /// @{
235  void moveModeOn(bool onoff) { myMoveModeOn = onoff; }
236  bool moveModeOn() const { return myMoveModeOn; }
237  /// @}
238 
239  void setUVMapFile(const UT_StringRef &uvmap);
240  const UT_StringRef &getUVMapFile() const { return myUVMapFile; }
241 
242  void setUVMapScale(fpreal scale);
243  fpreal getUVMapScale() const { return myUVMapScale; }
244 
245  /// Rotoscoping background image set/query methods
246  /// @{
247  RE_TextureHolder getRotoTexture(RE_Render *r,
249  float &quality,
250  float &aspect_ratio,
251  UT_DimRect *udim_area = nullptr) const;
252  void getRotoResolution(GUI_RotoView type, UT_Vector2i &res);
253 
254  bool setRotoFileParms(GUI_RotoView type,
255  const char *file, float quality);
256  bool setRotoCopParms(GUI_RotoView type,
257  const char *path, float quality);
258  void setRotoSource(GUI_RotoView type,bool file);
259 
260  void setRotoTime(fpreal t);
261  bool isRotoTimeDependent(GUI_RotoView type) const;
262 
263  fpreal getRotoQuality() const;
264  void setRotoQuality(fpreal q);
265 
266  void setRotoPath(GUI_RotoView type,
267  bool file_path, const char *path);
268  bool isRotoFile(GUI_RotoView type) const;
269  const char *getRotoCopPath(GUI_RotoView type) const;
270  const char *getRotoFilePath(GUI_RotoView type) const;
271 
272  UI_Value &getRotoCopCookNotify(GUI_RotoView type);
273  UI_Value &getRotoCopNameChangeNotify(GUI_RotoView type);
274 
276  { myFlags.showForegroundImage = enable; }
278  { return myFlags.showForegroundImage; }
279  void setForegroundImage(const UT_StringRef &file_node_path)
280  {myFGImage = file_node_path; }
281  const UT_StringRef &getForegroundImage() { return myFGImage; }
283  { myFlags.useForegroundDepth = enable; }
285  { return myFlags.useForegroundDepth; }
287  { myFGDepthPlane = plane; }
289  { return myFGDepthPlane; }
291  {
296  DEPTH_WORLD_POS
297  };
299  { myFGDepthStyle = style; }
301  { return myFGDepthStyle; }
302 
303 
304  void getImageMinUV(float arr[2]) const
305  {
306  arr[0] = myImageMinUV[0];
307  arr[1] = myImageMinUV[1];
308  }
309  void setImageMinUV(float arr[2])
310  {
311  myImageMinUV[0] = arr[0];
312  myImageMinUV[1] = arr[1];
313  }
314  void getImageMaxUV(float arr[2]) const
315  {
316  arr[0] = myImageMaxUV[0];
317  arr[1] = myImageMaxUV[1];
318  }
319  void setImageMaxUV(float arr[2])
320  {
321  myImageMaxUV[0] = arr[0];
322  myImageMaxUV[1] = arr[1];
323  }
324 
325  void getImageOffset(GUI_RotoView view, float arr[2]) const
326  {
327  arr[0] = myRotoViews[view].myImageOffset[0];
328  arr[1] = myRotoViews[view].myImageOffset[1];
329  }
330  void setImageOffset(GUI_RotoView view, float arr[2])
331  {
332  myRotoViews[view].myImageOffset[0] = arr[0];
333  myRotoViews[view].myImageOffset[1] = arr[1];
334  }
335  void getImageScale(GUI_RotoView view, float arr[2]) const
336  {
337  arr[0] = myRotoViews[view].myImageScale[0];
338  arr[1] = myRotoViews[view].myImageScale[1];
339  }
340  void setImageScale(GUI_RotoView view, float arr[2])
341  {
342  myRotoViews[view].myImageScale[0] = arr[0];
343  myRotoViews[view].myImageScale[1] = arr[1];
344  }
345 
347  { return myRotoViews[view].myBrightness; }
348  void setBrightness(GUI_RotoView view, float brightness)
349  { myRotoViews[view].myBrightness = brightness; }
350 
351  void autoPlaceImage(GUI_RotoView view, bool onoff)
352  { myRotoViews[view].myAutoPlaceImage = onoff; }
354  { return myRotoViews[view].myAutoPlaceImage; }
355 
356  void envMapImage(GUI_RotoView view, bool onoff)
357  { myRotoViews[view].myEnvMapImage = onoff; }
359  { return myRotoViews[view].myEnvMapImage; }
360 
361  void setUseFixedImageRes(bool use_fixed)
362  { myUseFixedImageRes = use_fixed; }
363  bool getUseFixedImageRes() const
364  { return myUseFixedImageRes; }
365  void setUseViewportRes(bool use_vp)
366  { myUseViewportRes = use_vp; }
367  bool getUseViewportRes() const
368  { return myUseViewportRes; }
369  void setFixedImageRes(int w, int h)
370  {
371  if(myForLopsView)
372  myFixedImageRes.assign(w,h);
373  }
375  { return myForLopsView ? myFixedImageRes : UT_Vector2i(0,0); }
376  void setCurrentImageRes(int w, int h)
377  { myCurrentImageRes.assign(w,h); }
379  { return myForLopsView ? myCurrentImageRes :UT_Vector2i(0,0); }
381  { myImageResFraction =fraction; }
383  { return myImageResFraction; }
384 
385  bool getCameraCropMask() const { return myCameraCropMask; }
386  void setCameraCropMask(bool crop) { myCameraCropMask = crop; }
387 
388  static const char *getRotoViewName(GUI_RotoView view);
389  /// @}
390 
391  /// Methods to query/change the scale at which handles are drawn.
392  /// @{
393  static float getHandleScale() { return theHandleScale; }
394  static void setHandleScale(float v)
395  { theHandleScale = SYSclamp(v, 0.01f, 1.0f); }
396  /// @}
397 
398  // This method is called when user options are being destroyed.
399  void removeUserOption(int option_id);
400 
401  /// Refresh the cached version keys for the enabled user options to reflect
402  /// the most up-to-date version.
403  void refreshUserOptionVersions();
404 
405  /// State which switches the geometry context display options between the
406  /// Scene and Model display sets. When at the object level, the scene is
407  /// used.
408  /// @{
409  bool isObjectLevel() const { return myNoSaveFlags.isObjectLevel; }
410  void setObjectLevel(bool onoff);
411  /// @}
412 
413  /// The select mask is set when the user is in a "select" state to
414  /// automatically turn on some decorations. The mask is used to
415  /// temporarily tweak the appropriate display options, and does not,
416  /// in and of itself, invalidate display lists.
417  /// @{
418  unsigned getSelectMask() const { return mySelectMask; }
419  void setSelectMask(unsigned mask) { mySelectMask = mask; }
420  /// @}
421 
422  /// This value is changed when the scene is switched from obj to sop/dop
423  /// level.
424  UI_Value &getObjectLevelNotify() { return myObjectLevelNotify; }
425 
426  /// For the OpenGL ROP only: Allows a single stereo camera to be rendered.
428  {
431  GUI_DISP_STEREO_RIGHT
432  };
433 
434  /// Allow rendering of a single stereo camera eye.
435  /// @{
437  { myStereoPass = pass; }
438  bool isStereoLeftRender() const
439  { return (myStereoPass == GUI_DISP_STEREO_BOTH ||
440  myStereoPass == GUI_DISP_STEREO_LEFT); }
441  bool isStereoRightRender() const
442  { return (myStereoPass == GUI_DISP_STEREO_BOTH ||
443  myStereoPass == GUI_DISP_STEREO_RIGHT); }
444  /// @}
445 
446  /// Returns true if any of the geometry contexts have this option set.
447  /// @{
448  ANY_FLAG_ACTIVE_IN_SETS(drawPointCoincident);
449  ANY_FLAG_ACTIVE_IN_SETS(drawPointMarkers);
450  ANY_FLAG_ACTIVE_IN_SETS(uvFillOverlap);
451  /// @}
452 
453  /// Auto-select quality/preformance presets based on hardware queries.
454  /// Only works at startup.
455  void updateOptionsForHardware(RE_Render *r);
456 
457 
458  /// Returns true if the passed options are compatible with these options,
459  /// meaning that update() does not need to be called on GR_Primitives if
460  /// 'opt' is used after this option. This could happen if 'opt' had a marker
461  /// on that required an attribute that this options set does not.
462  bool compatibleWith(const GUI_DisplayOption &opt) const;
463 
464 
465  void setHeadlightIntensity(fpreal i);
466  fpreal getHeadlightIntensity() const { return myHeadlightIntensity; }
467 
468  void setHeadlightDirection(UT_Vector3D dir);
469  UT_Vector3D getHeadlightDirection() const { return myHeadlightDir; }
470 
471  void setHeadlightSpecular(bool use_spec);
472  bool getHeadlightSpecular() const { return myHeadlightSpec; }
473 
474  void setHeadlightHighQuality(bool hq) { myHeadlightHQ = hq; }
475  bool getHeadlightHighQuality() const { return myHeadlightHQ; }
476 
477  void setHQLightLimit(int nlights) { myHQLightLimit = nlights; }
478  int getHQLightLimit() const { return myHQLightLimit; }
479  bool hasHQLightLimit() const { return myHQLightLimit > 0; }
480  void setShadowMapMemMB(int mem) { myShadowMapMemMB = SYSmax(1,mem);}
481  int getShadowMapMemMB() const { return myShadowMapMemMB;}
483  { myShadowMapGenTime=SYSmax(0.0,t); }
484  fpreal getShadowMapGenTime() const { return myShadowMapGenTime; }
485  void setLightSamplingLimit(int limit) {myLightSampleLimit = limit;}
486  int getLightSamplingLimit() const { return myLightSampleLimit; }
487  bool hasLightSamplingLimit() const { return myLightSampleLimit>0; }
489  { myFlags.myFastHQIntLight = e; }
491  { return myFlags.myFastHQIntLight; }
492 
493  void setDOFEnable(bool dof) { myFlags.dofEnable = dof; }
494  bool isDOFEnabled() const { return myFlags.dofEnable; }
495  enum DOFBokeh
496  {
499  DOF_TEXTURE_BOKEH
500  };
501  void setDOFBokeh(DOFBokeh b) { myDOFBokeh = b; }
502  DOFBokeh getDOFBokeh() const { return myDOFBokeh; }
503  void setDOFTexture(const UT_StringRef &tex) { myDOFTex = tex; }
504  const UT_StringRef &getDOFTexture() const { return myDOFTex; }
505  fpreal getDOFBokehAspect() const { return myDOFBokehAspect; }
506  void setDOFBokehAspect(fpreal a) { myDOFBokehAspect=SYSmax(a,0.01); }
507  fpreal getDOFBokehBoost() const { return myDOFBokehBoost; }
508  void setDOFBokehBoost(fpreal b) { myDOFBokehBoost = b; }
509 
510  // Uniform fog
511  void setUniformFogEnable(bool fog) { myFlags.uniformFogEnable=fog; }
512  bool isUniformFogEnabled() const { return myFlags.uniformFogEnable;}
513  void setUniformFogDensity(fpreal d) { myUniformFog.myFogDensity=d; }
514  fpreal getUniformFogDensity() const{return myUniformFog.myFogDensity;}
515  void setUniformFogOpacity(fpreal d) { myUniformFog.myFogOpacity=d; }
516  fpreal getUniformFogOpacity() const{return myUniformFog.myFogOpacity;}
518  { myUniformFog.myFogColor = c; }
519  UT_Vector3F getUniformFogColor() const { return myUniformFog.myFogColor; }
520  void setUniformFogStart(fpreal s) { myUniformFog.myFogStart = s; }
521  fpreal getUniformFogStart() const { return myUniformFog.myFogStart; }
522  void setUniformFogEnd(fpreal e) { myUniformFog.myFogEnd = e; }
523  fpreal getUniformFogEnd() const { return myUniformFog.myFogEnd; }
525  { return myUniformFog.myFogHeightMode; }
527  { myUniformFog.myFogHeightMode = SYSclamp(m,-1,1); }
528  fpreal getUniformFogHeight() const { return myUniformFog.myFogHeight;}
529  void setUniformFogHeight(fpreal h) { myUniformFog.myFogHeight = h; }
531  { return myUniformFog.myFogFalloff; }
533  { myUniformFog.myFogFalloff = f; }
535  { myUniformFog.myFogIntensity=SYSmax(0.0,f); }
537  { return myUniformFog.myFogIntensity; }
538 
539  void setUniformFogSunBloom(fpreal f) { myUniformFogSunBloom = f; }
540  fpreal getUniformFogSunBloom() const { return myUniformFogSunBloom; }
541  void setUniformFogUseSun(bool d) { myUniformFogUseSun = d; }
542  bool getUniformFogUseSun() const { return myUniformFogUseSun; }
544  { myUniformFogClipDistance = d; }
546  { return myUniformFogClipDistance; }
547 
548 
549  // Volume Fog
550  void setVolumeFogEnable(bool fog) { myFlags.volumeFogEnable=fog; }
551  bool isVolumeFogEnabled() const { return myFlags.volumeFogEnable;}
552  void setVolumeFogDensity(fpreal d) { myVolumeFog.myFogDensity=d; }
553  fpreal getVolumeFogDensity() const{return myVolumeFog.myFogDensity;}
554  void setVolumeFogOpacity(fpreal d) { myVolumeFog.myFogOpacity=d; }
555  fpreal getVolumeFogOpacity() const{return myVolumeFog.myFogOpacity;}
557  { myVolumeFog.myFogColor = c; }
558  UT_Vector3F getVolumeFogColor() const { return myVolumeFog.myFogColor; }
559  void setVolumeFogStart(fpreal s) { myVolumeFog.myFogStart = s; }
560  fpreal getVolumeFogStart() const { return myVolumeFog.myFogStart; }
561  void setVolumeFogEnd(fpreal e) { myVolumeFog.myFogEnd = e; }
562  fpreal getVolumeFogEnd() const { return myVolumeFog.myFogEnd; }
564  { return myVolumeFog.myFogHeightMode; }
566  { myVolumeFog.myFogHeightMode = SYSclamp(m,-1,1); }
567  fpreal getVolumeFogHeight() const { return myVolumeFog.myFogHeight;}
568  void setVolumeFogHeight(fpreal h) { myVolumeFog.myFogHeight = h; }
570  { return myVolumeFog.myFogFalloff; }
572  { myVolumeFog.myFogFalloff = f; }
574  { myVolumeFog.myFogIntensity=SYSmax(0.0,f); }
576  { return myVolumeFog.myFogIntensity; }
577  int getVolumeFogQuality() const { return myVolumeFogQuality; }
579  { myVolumeFogQuality = SYSclamp(q, 0,3); }
581  {
582  myVolumeFogScatterPara = SYSmax(0.0, para);
583  myVolumeFogScatterPerp = SYSmax(0.0, perp);
584  }
585  void getVolumeFogLightScatter(fpreal &para, fpreal &perp) const
586  {
587  para = myVolumeFogScatterPara;
588  perp = myVolumeFogScatterPerp;
589  }
590 
591  void setBloomEnable(bool e) { myFlags.bloom = e; }
592  bool isBloomEnabled() const { return myFlags.bloom; }
593  void setBloomScale(fpreal sc) { myBloomScale = sc; }
594  fpreal getBloomScale() const { return myBloomScale; }
595  void setBloomIntensity(fpreal i) { myBloomIntensity = i; }
596  fpreal getBloomIntensity() const { return myBloomIntensity; }
597  void setBloomThreshold(fpreal th) { myBloomThreshold = th; }
598  fpreal getBloomThreshold() const { return myBloomThreshold; }
599 
600  void setFogNode(const char *node) { myFogNode = node; }
601  const UT_StringRef &getFogNode() const { return myFogNode; }
602 
604  {
605  DEFAULT_MATERIAL_SIMPLE = 0,
606  DEFAULT_MATERIAL_MATCAP
607  };
608  void setDefaultMaterialType(DefaultMaterialType type);
609  void setDefaultMatCapFile(const UT_StringRef &tex_filepath);
610  void setDefaultMatCapIntensity(fpreal intensity);
611  void setDefaultMaterialDiffuse(UT_Color col);
612  void setDefaultMaterialSpecular(UT_Color col);
613  void setDefaultMaterialAmbient(UT_Color col);
614  void setDefaultMaterialEmission(UT_Color col);
615  void setDefaultMaterialRoughness(fpreal rough);
616  void setDefaultMaterialSpecRoughness(fpreal srough);
617 
619  { return myDefaultMatType; }
621  { return myDefaultMatCapFile; }
623  { return myDefaultMatCapIntensity; }
624  UT_Color getDefaultMaterialDiffuse() const { return myDefaultDiffuse; }
625  UT_Color getDefaultMaterialSpecular() const{ return myDefaultSpecular; }
626  UT_Color getDefaultMaterialAmbient() const { return myDefaultAmbient; }
627  UT_Color getDefaultMaterialEmission() const{ return myDefaultEmission; }
628  fpreal getDefaultMaterialRoughness() const{ return myDefaultRough; }
630  { return myDefaultSpecRough; }
631 
632  bool isDefaultMaterialDirty() const{ return myDefaultMaterialDirty;}
633  void clearDefaultMaterialDirty() { myDefaultMaterialDirty=false;}
634 
635  bool isDefaultMatCapDirty() const{ return myDefaultMatCapDirty;}
636  bool clearDefaultMatCapDirty(){ return myDefaultMatCapDirty=false;}
637 
638  void forceMSSUpdate(bool) { myMSSUpdateSerial++; }
639  exint getMSSUpdateSerial() const { return myMSSUpdateSerial; }
640 
641  void getRecommendedTextureLimit(RE_Render *r,
642  int &max2d, int &max3d) const;
643 private:
644  // data:
645 
646  GR_DisplayOption *myDisplaySet[GUI_NUM_DISPLAY_SETS];
647  GUI_DisplaySetType myDisplaySetMap[GUI_NUM_DISPLAY_SETS];
648  GR_CommonDispOption myCommonOptions; // global to viewport
649 
650  float myImageMinUV[2];
651  float myImageMaxUV[2];
652 
653  fpreal myOriginGnomonSize;
654  int myHandleHighlightSize;
655 
656  static float theHandleScale;
657 
658  UT_Vector3D myHeadlightDir;
659  fpreal myHeadlightIntensity;
660  bool myHeadlightSpec;
661  bool myHeadlightHQ;
662 
663  UT_Color myDefaultDiffuse;
664  UT_Color myDefaultSpecular;
665  UT_Color myDefaultEmission;
666  UT_Color myDefaultAmbient;
667  fpreal myDefaultRough;
668  fpreal myDefaultSpecRough;
669  bool myDefaultMaterialDirty;
670 
671  DefaultMaterialType myDefaultMatType;
672  UT_StringHolder myDefaultMatCapFile;
673  fpreal myDefaultMatCapIntensity;
674  bool myDefaultMatCapDirty;
675 
676  fpreal myXRayWireStrength;
677 
678  struct
679  {
680  OPUI_RotoscopeData *myRotoscopeData;
681  float myImageOffset[2];
682  float myImageScale[2];
686  } myRotoViews[GUI_NUM_ROTO_VIEWS];
687 
688  UT_StringHolder myFGImage;
689  UT_StringHolder myFGDepthPlane;
690  FGDepthStyle myFGDepthStyle;
691 
692  unsigned mySelectMask; // mask of entities the user
693  // wants to select. Not saved.
694  struct
695  {
696  unsigned
697  showSelected :1,
698  showNonSelected :1,
699  showTemplates :1,
700  showFootprints :1,
701  showCurrentOutput :1,
702  showDisplay :1,
703  showGuides :1,
704  showObjectNames :1,
705  showFullNames :1,
706  drawOrigin :1,
707  drawStickyOrigin :1,
708  drawViewPivot :1,
709  drawWalls :1, // draw bounding walls
710  drawXYPlane :1, // draw XY reference plane
711  drawXZPlane :1, // draw XZ reference plane
712  drawYZPlane :1, // draw YZ reference plane
713  drawFieldGuide :1,
714  drawSafeArea :1,
715  drawBackgrounds :1, // draw background images
716  drawEnvironmentMaps :1,
717  drawFilteredBackgrounds:1, // filter background in UV viewport.
718  drawVertexAttrib2D :1, // use vertex attribute
719  autoDetectAttribType2D:1, // automatically track the attribute type
720  drawSpecular :1, // specular highlights
721  showIKCriticalZones :1, // inverse kin. danger zones
722  drawCameraMask :1,
723  drawBadges :1, // show viewport status badges
724  drawXRay :1, // allow draw of xray objs
725  xrayQuality :1, // fast/quality xray draw
726  drawObjOrigins :1, // allow draw of obj axes
727  applySelectMask :1, // select mask drives specific decorations
728  showMaterials :1, // SHOP materials used
729  useOverrides :1, // Apply material overrides
730  mssEnable :1, // Apply material stylesheets
731  mssPacked :1, // Eval material stylesheets for packed geo
732  mssPerPrim :1, // per-prim material stylesheet eval
733  dofEnable :1, // Depth of field
734  uniformFogEnable :1, // Fog (uniform)
735  volumeFogEnable :1, // Fog (volumetric)
736  bloom :1, // Light bloom
737  showForegroundImage :1, // FG Image
738  useForegroundDepth :1, // Use FG Image depth plane if present
739  myFastHQIntLight :1; // Lower samples in HQ Lighting/interaction
740 
741  } myFlags;
742 
743  struct
744  {
745  unsigned isObjectLevel :1; // Is this an object view?
746  } myNoSaveFlags;
747 
748  // whether shading mode change is enabled/disabled
749  bool myMoveModeOn;
750  int myObjectMaterialLimit;
751 
752  gui_StereoPass myStereoPass;
753  UI_Value myObjectLevelNotify;
754  bool myLoadedDefaults;
755  exint myMSSUpdateSerial;
756  gui_MatAssignMode myMatAssignMode;
757  bool myMatUpdate;
758  bool myForLopsView;
759 
760  int myHQLightLimit;
761  int myLightSampleLimit;
762  int myShadowMapMemMB;
763  fpreal myShadowMapGenTime;
764 
765  UT_IntArray mySceneOptions;
766  UT_Vector2i myFixedImageRes;
767  UT_Vector2i myCurrentImageRes;
768  fpreal myImageResFraction;
769  bool myUseFixedImageRes;
770  bool myUseViewportRes;
771  bool myCameraCropMask;
772 
773  class FogParms
774  {
775  public:
776  FogParms() : myFogColor(1.0,1.0,1.0), myFogDensity(1.0),
777  myFogOpacity(1.0), myFogStart(0.0), myFogEnd(1000.0),
778  myFogHeightMode(0), myFogHeight(100.0),
779  myFogIntensity(1.0), myFogFalloff(10.0)
780  {}
781  UT_Vector3F myFogColor;
782  fpreal myFogDensity;
783  fpreal myFogOpacity;
784  fpreal myFogStart;
785  fpreal myFogEnd;
786  int myFogHeightMode;
787  fpreal myFogHeight;
788  fpreal myFogIntensity;
789  fpreal myFogFalloff;
790  };
791  FogParms myUniformFog;
792  fpreal myUniformFogClipDistance;
793  bool myUniformFogUseSun;
794  fpreal myUniformFogSunBloom;
795 
796  FogParms myVolumeFog;
797  int myVolumeFogQuality;
798  fpreal myVolumeFogScatterPara;
799  fpreal myVolumeFogScatterPerp;
800  UT_StringHolder myFogNode;
801 
802  fpreal myBloomScale;
803  fpreal myBloomIntensity;
804  fpreal myBloomThreshold;
805 
806  DOFBokeh myDOFBokeh;
807  UT_StringHolder myDOFTex;
808  fpreal myDOFBokehAspect;
809  fpreal myDOFBokehBoost;
810 
811  UT_StringHolder myUVMapFile;
812  fpreal myUVMapScale;
813 };
814 
815 #endif
fpreal getUniformFogHeight() const
FGDepthStyle getForegroundDepthStyle() const
bool drawXYPlane() const
#define SYSmax(a, b)
Definition: SYS_Math.h:1513
UI_Value & getObjectLevelNotify()
void drawObjectOrigins(bool org)
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GLboolean enable
Definition: glew.h:2750
bool isStereoRightRender() const
void setForegroundImageDepth(bool enable)
void setCurrentImageRes(int w, int h)
bool getUseFixedImageRes() const
void setVolumeFogStart(fpreal s)
void getImageMinUV(float arr[2]) const
void showFullNames(bool onoff)
fpreal getDefaultMaterialRoughness() const
void showIKCriticalZones(bool onoff)
bool isObjectLevel() const
UT_Color getDefaultMaterialSpecular() const
void drawFilteredBackgrounds(bool onoff)
void setVolumeFogEnable(bool fog)
void setForegroundImageEnable(bool enable)
const int GUI_NUM_DISPLAY_MODEL_SETS
fpreal xrayWireStrength() const
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:14163
bool materialUpdate() const
void drawViewPivot(bool onoff)
fpreal getBloomThreshold() const
static float getHandleScale()
fpreal getVolumeFogStart() const
void setVolumeFogQuality(int q)
void setDrawCameraMask(bool onoff)
void mssEnable(bool mss)
void showMaterials(bool show)
const GR_DisplayOption & operator[](GUI_DisplaySetType type) const
int getShadowMapMemMB() const
fpreal getHeadlightIntensity() const
fpreal getUniformFogOpacity() const
DefaultMaterialType getDefaultMaterialType() const
void setUseFixedImageRes(bool use_fixed)
float getBrightness(GUI_RotoView view) const
bool drawFilteredBackgrounds() const
void drawWalls(bool onoff)
const GLfloat * c
Definition: glew.h:16631
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UT_Color getDefaultMaterialEmission() const
void drawStickyOrigin(bool onoff)
bool drawObjectOrigins() const
void getImageOffset(GUI_RotoView view, float arr[2]) const
GLenum const void GLuint GLint reference
Definition: glew.h:13927
int64 exint
Definition: SYS_Types.h:125
void setVolumeFogOpacity(fpreal d)
fpreal getUniformFogSunBloom() const
const UT_StringRef & getForegroundDepthPlane() const
bool drawOrigin() const
void setVolumeFogFalloff(fpreal f)
void drawYZPlane(bool onoff)
bool getHeadlightSpecular() const
void drawMultiTexture(bool onoff)
void setImageMinUV(float arr[2])
bool drawViewPivot() const
bool showNonSelected() const
bool drawSpecular() const
bool getDrawCameraMask() const
void setFastInteractiveHQLight(bool e)
int getVolumeFogHeightMode() const
void setForegroundImage(const UT_StringRef &file_node_path)
void setUniformFogOpacity(fpreal d)
GLuint const GLchar * name
Definition: glcorearb.h:786
void handleHighlightSize(int hl)
void setVolumeFogDensity(fpreal d)
void setVolumeFogHeightMode(int m)
bool isDOFEnabled() const
void drawXRay(bool xray)
bool getForegroundImageEnable() const
int getHQLightLimit() const
GLdouble GLdouble t
Definition: glew.h:1403
bool showFullNames() const
UT_Color getDefaultMaterialAmbient() const
GUI_DisplaySetType
Context specific display options for geometry states.
void showDisplay(bool onoff)
bool getFastInteractiveHQLight() const
void setImageOffset(GUI_RotoView view, float arr[2])
bool drawYZPlane() const
int getLightSamplingLimit() const
void setDOFTexture(const UT_StringRef &tex)
exint getMSSUpdateSerial() const
bool getHeadlightHighQuality() const
GLsizeiptr size
Definition: glcorearb.h:664
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
bool xrayQuality() const
GLdouble GLdouble GLdouble GLdouble q
Definition: glew.h:1419
UT_Vector3D getHeadlightDirection() const
void setUniformFogUseSun(bool d)
bool getUseViewportRes() const
void xrayWireStrength(fpreal w)
void showObjectNames(bool onoff)
fpreal getVolumeFogEnd() const
bool showIKCriticalZones() const
fpreal getVolumeFogOpacity() const
void setLightSamplingLimit(int limit)
void envMapImage(GUI_RotoView view, bool onoff)
const UT_StringRef & getDefaultMatCapFile() const
void setShadowMapGenTime(fpreal t)
bool getCameraCropMask() const
const UT_StringRef & getUVMapFile() const
bool mssPerPrim() const
void getImageMaxUV(float arr[2]) const
GR_CommonDispOption & common()
bool hasLightSamplingLimit() const
void setSelectMask(unsigned mask)
void setUniformFogFalloff(fpreal f)
fpreal getVolumeFogFalloff() const
fpreal getVolumeFogHeight() const
void setFogNode(const char *node)
void showSelected(bool onoff)
GLint limit
Definition: glew.h:13230
void drawSpecular(bool onoff)
bool showGuides() const
void showTemplates(bool onoff)
fpreal getVolumeFogDensity() const
void setBloomEnable(bool e)
#define GUI_API
Definition: GUI_API.h:10
fpreal getBloomScale() const
GLint GLuint mask
Definition: glcorearb.h:124
const GR_CommonDispOption & common() const
void setBloomThreshold(fpreal th)
void drawXZPlane(bool onoff)
bool mssEnable() const
const GLdouble * v
Definition: glcorearb.h:837
fpreal getShadowMapGenTime() const
void setDOFBokehAspect(fpreal a)
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
void setCameraCropMask(bool crop)
bool drawFieldGuide() const
void setUniformFogClipDistance(fpreal d)
void setUniformFogHeight(fpreal h)
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
Definition: UT_Vector3.h:1040
void mssPerPrim(bool mpp)
fpreal getImageResFraction() const
void setHQLightLimit(int nlights)
bool drawXZPlane() const
void autoPlaceImage(GUI_RotoView view, bool onoff)
void setDOFEnable(bool dof)
void showGuides(bool onoff)
void setVolumeFogColor(const UT_Vector3F &c)
fpreal getUniformFogClipDistance() const
bool mssPacked() const
void drawBackgrounds(bool onoff)
bool drawBadges() const
const UT_StringRef & getFogNode() const
bool drawBackgrounds() const
bool getUniformFogUseSun() const
void setUniformFogHeightMode(int m)
const int GUI_NUM_ROTO_VIEWS
fpreal getDefaultMaterialSpecRoughness() const
bool isStereoLeftRender() const
bool autoPlaceImage(GUI_RotoView view) const
int objectMaterialLimit() const
void showCurrentOutput(bool onoff)
UT_Vector3F getVolumeFogColor() const
void drawXYPlane(bool onoff)
fpreal getBloomIntensity() const
void setUniformFogColor(const UT_Vector3F &c)
static void setHandleScale(float v)
void setUseViewportRes(bool use_vp)
const int GUI_NUM_DISPLAY_SCENE_SETS
void setFixedImageRes(int w, int h)
GLuint res
Definition: glew.h:11549
bool autoDetectAttribType2D() const
fpreal getUniformFogFalloff() const
void setDOFBokehBoost(fpreal b)
void drawFieldGuide(bool onoff)
int getVolumeFogQuality() const
gui_MatAssignMode materialAssignMode() const
void setVolumeFogLightScatter(fpreal para, fpreal perp)
bool showMaterials() const
void materialUpdate(bool update)
bool drawEnvironmentMaps() const
void setForegroundDepthPlane(const UT_StringRef &plane)
void setHeadlightHighQuality(bool hq)
void setVolumeFogHeight(fpreal h)
bool drawMultiTexture() const
GLenum mode
Definition: glcorearb.h:99
GR_DisplayOption & operator[](GUI_DisplaySetType type)
void setBrightness(GUI_RotoView view, float brightness)
gui_StereoPass
For the OpenGL ROP only: Allows a single stereo camera to be rendered.
fpreal getUniformFogIntensity() const
void drawOrigin(bool onoff)
fpreal getUniformFogEnd() const
void setUniformFogIntensity(fpreal f)
void setForegroundDepthStyle(FGDepthStyle style)
void xrayQuality(bool q)
void setBloomScale(fpreal sc)
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
#define ANY_FLAG_ACTIVE_IN_SETS(METHOD)
void materialAssignMode(gui_MatAssignMode mode)
bool isDefaultMaterialDirty() const
bool drawStickyOrigin() const
bool showCurrentOutput() const
fpreal getUniformFogDensity() const
void setUniformFogSunBloom(fpreal f)
void setUniformFogStart(fpreal s)
GUI_RotoView
Viewport type for Rotoscope settings.
bool showTemplates() const
DOFBokeh getDOFBokeh() const
fpreal getDefaultMatCapIntensity() const
bool hasHQLightLimit() const
UT_Vector2i getCurrentImageRes() const
void setImageScale(GUI_RotoView view, float arr[2])
bool drawVertexAttrib2D() const
bool showObjectNames() const
fpreal getDOFBokehBoost() const
fpreal64 fpreal
Definition: SYS_Types.h:277
void originGnomonSize(fpreal size)
UT_Vector3F getUniformFogColor() const
bool getForegroundImageDepth() const
void setVolumeFogEnd(fpreal e)
const UT_StringRef & getDOFTexture() const
bool showDisplay() const
bool drawWalls() const
GUI_DisplaySetType getDisplaySetRemap(GUI_DisplaySetType t) const
UT_Color getDefaultMaterialDiffuse() const
const int GUI_NUM_DISPLAY_SETS
void drawEnvironmentMaps(bool onoff)
fpreal getUniformFogStart() const
bool isDefaultMatCapDirty() const
bool showSelected() const
int getUniformFogHeightMode() const
void applySelectMask(bool onoff)
OPUI_RotoscopeData * myRotoscopeData
const GLdouble * m
Definition: glew.h:9166
bool showFootprints() const
GLfloat f
Definition: glcorearb.h:1926
void drawVertexAttrib2D(bool onoff)
void setVolumeFogIntensity(fpreal f)
void setDisplaySetRemap(GUI_DisplaySetType follower, GUI_DisplaySetType reference)
Remap the display option set to another set.
bool drawSafeArea() const
Definition: core.h:982
fpreal getVolumeFogIntensity() const
void setSeparateStereoRender(gui_StereoPass pass)
bool envMapImage(GUI_RotoView view) const
fpreal getUVMapScale() const
const UT_StringRef & getForegroundImage()
void drawBadges(bool onoff)
void showFootprints(bool onoff)
void drawSafeArea(bool onoff)
bool useMaterialOverrides() const
fpreal getDOFBokehAspect() const
bool isUniformFogEnabled() const
void moveModeOn(bool onoff)
void setDOFBokeh(DOFBokeh b)
int handleHighlightSize() const
bool applySelectMask() const
ImageBuf OIIO_API crop(const ImageBuf &src, ROI roi={}, int nthreads=0)
type
Definition: core.h:1059
fpreal originGnomonSize() const
GLboolean r
Definition: glcorearb.h:1222
bool moveModeOn() const
void setShadowMapMemMB(int mem)
void showNonSelected(bool onoff)
void setUniformFogEnd(fpreal e)
bool isVolumeFogEnabled() const
void setImageMaxUV(float arr[2])
void getVolumeFogLightScatter(fpreal &para, fpreal &perp) const
unsigned getSelectMask() const
GLdouble s
Definition: glew.h:1395
void autoDetectAttribType2D(bool onoff)
void useMaterialOverrides(bool ovr)
void getImageScale(GUI_RotoView view, float arr[2]) const
void setImageResFraction(fpreal fraction)
void setBloomIntensity(fpreal i)
void setUniformFogDensity(fpreal d)
void mssPacked(bool mp)
UT_Vector2T< int32 > UT_Vector2i
bool isBloomEnabled() const
bool drawXRay() const
void setUniformFogEnable(bool fog)
void objectMaterialLimit(int m)
GR_DisplayOption & getDisplaySet(GUI_DisplaySetType type)
Direct cccess to the display set, without any mapping.
UT_Vector2i getFixedImageRes() const