HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GR_CommonDispOption.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: GR_CommonDispOption.h
7  *
8  * COMMENTS: The display options that are common regardless of the geometry
9  * type (display, template, etc.).
10  */
11 
12 #ifndef __GR_CommonDispOption_h__
13 #define __GR_CommonDispOption_h__
14 
15 #include "GR_API.h"
16 #include <SYS/SYS_Math.h>
17 #include <UT/UT_Array.h>
18 #include <UT/UT_Color.h>
19 #include <UT/UT_String.h>
20 #include <RE/RE_TextureTypes.h>
21 #include <RE/RE_RenderContext.h>
22 #include <GEO/GEO_PrimTypeCompat.h>
23 #include <GU/GU_SelectType.h>
24 #include "GR_HandleParts.h"
25 #include "GR_DisplayColors.h"
26 #include "GR_Defines.h"
27 
28 class RE_Render;
29 class RE_LightList;
30 class GR_SchemeColors;
31 class GR_LightList;
32 class GR_MaterialAtlas;
33 
34 #define FLAG_ACCESSORS(FLAGS, METHOD, FLAG) \
35  bool METHOD() const { return FLAGS.FLAG; } \
36  void METHOD(bool onoff) { FLAGS.FLAG = onoff; }
37 
38 #define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG) \
39  bool METHOD() const { return FLAGS.FLAG; } \
40  void METHOD(bool onoff) { if(FLAGS.FLAG != onoff) mySerialNum++; \
41  FLAGS.FLAG = onoff; }
42 
44 {
45 public:
46  GR_CommonDispOption(bool for_lops);
49 
50  // Return true if the load/save was successful, and false otherwise.
51  bool save(std::ostream &, int indent=0) const;
52  bool load(UT_IStream &);
53 
55 
56  // The color scheme names are simply the suffixes applied to the
57  // default color scheme file 3DSceneColors. The dot '.' should
58  // not be included in the scheme name.
59  void setColorScheme(const char *scheme_name);
60  const UT_String &getColorScheme() const { return myColorScheme; }
61  static void reloadAllColorSchemes();
62 
63  // Grab the colors and the color scheme from opt:
64  void setColors(const GR_CommonDispOption &opt);
65 
66  bool compatibleWith(const GR_CommonDispOption &opt) const;
67 
68  // Grab the color from the current pass
70  { return myColors[c][myGammaPassPtr?*myGammaPassPtr:0]; }
71 
72  void setGammaPassPtr(int *p) { myGammaPassPtr = p; }
73 
74  void setColor(GR_DisplayColor color_name,
75  const UT_Color &c);
76  void setColor(GR_DisplayColor target_color,
77  GR_DisplayColor source_color);
78  const UT_Color &getColor(GR_DisplayColor color_name,
79  bool gamma = false) const
80  { return myColors[color_name][gamma?1:0]; }
81  bool getColorByName(const char *name, UT_Color &color);
82 
83  void setParentViewportID(int id) { myParentViewportID = id; }
84  int parentViewportID() const { return myParentViewportID; }
85 
86  // Color methods (soon to be deprecated; use color(GR_..._COLOR)
87 #define GET_COL(func, val) \
88  const UT_Color &func() const \
89  { return myColors[val][myGammaPassPtr?*myGammaPassPtr:0]; }
90 
91  GET_COL(backgndColor, GR_BACKGROUND_COLOR)
92  GET_COL(backgndBottomColor, GR_BACKGROUND_BOTTOM_COLOR)
93  GET_COL(defaultWireColor, GR_WIREFRAME_COLOR)
94  GET_COL(wireOverColor, GR_WIRE_OVER_COLOR)
95  GET_COL(ghostFillColor, GR_GHOST_FILL_COLOR)
96  GET_COL(selPrimColor, GR_SELECTED_PRIM_COLOR)
97  GET_COL(auxSelPrimColor1, GR_AUX_SELECTED_PRIM1_COLOR)
98  GET_COL(auxSelPrimColor2, GR_AUX_SELECTED_PRIM2_COLOR)
99  GET_COL(cookSelectionColor, GR_COOK_SELECTION_COLOR)
100  GET_COL(primClosureColor, GR_PRIM_CLOSURE_COLOR)
101  GET_COL(regAuxColor, GR_AUX_GEO_COLOR)
102  GET_COL(selAuxColor, GR_SELECTED_AUX_GEO_COLOR)
103  GET_COL(profileColor, GR_PROFILE_WIRE_COLOR)
104  GET_COL(axesColor, GR_AXES_COLOR)
105  GET_COL(xAxisColor, GR_X_AXIS_COLOR)
106  GET_COL(yAxisColor, GR_Y_AXIS_COLOR)
107  GET_COL(zAxisColor, GR_Z_AXIS_COLOR)
108  GET_COL(selAxesColor, GR_SELECTED_AXES_COLOR)
109  GET_COL(primInfoColor, GR_PRIM_INFO_COLOR)
110  GET_COL(selPrimInfoColor, GR_SELECTED_PRIM_INFO_COLOR)
111  GET_COL(pointColor, GR_POINT_COLOR)
112  GET_COL(selPointColor, GR_SELECTED_POINT_COLOR)
113  GET_COL(guide1Color, GR_GUIDE1_COLOR)
114  GET_COL(guide2Color, GR_GUIDE2_COLOR)
115  GET_COL(guideSelColor, GR_OBJECT_SELECT_COLOR)
116  GET_COL(cplaneColor, GR_CPLANE_COLOR)
117  GET_COL(activeCplaneColor, GR_ACTIVE_CPLANE_COLOR)
118  GET_COL(selCplaneColor, GR_SELECTED_CPLANE_COLOR)
119  GET_COL(gridColor, GR_GRID_COLOR)
120  GET_COL(heightVectorColor, GR_HEIGHT_VECTOR_COLOR)
121  GET_COL(gridXRulerColor, GR_GRID_X_RULER_COLOR)
122  GET_COL(gridYRulerColor, GR_GRID_Y_RULER_COLOR)
123  GET_COL(gridZRulerColor, GR_GRID_Z_RULER_COLOR)
124  GET_COL(handleColor, GR_HANDLE_COLOR)
125  GET_COL(pickedHandleColor, GR_PICKED_HANDLE_COLOR)
126  GET_COL(selHandleColor, GR_SELECTED_HANDLE_COLOR)
127  GET_COL(peanutColor, GR_PEANUT_COLOR)
128  GET_COL(labelColor, GR_LABEL_COLOR)
129  GET_COL(pillTextColor, GR_PILL_TEXT_COLOR)
130  GET_COL(pillBGColor, GR_PILL_BG_COLOR)
131  GET_COL(pillOutlineColor, GR_PILL_OUTLINE_COLOR)
132  GET_COL(pillCamLockTextColor, GR_PILL_CAM_LOCK_TEXT_COLOR)
133  GET_COL(pillCamLockBGColor, GR_PILL_CAM_LOCK_BG_COLOR)
134  GET_COL(pillCamLockOutlineColor, GR_PILL_CAM_LOCK_OUTLINE_COLOR)
135  GET_COL(snapshotColor, GR_SNAPSHOT_COLOR)
136  GET_COL(selLabelColor, GR_SELECTED_LABEL_COLOR)
137  GET_COL(selPillTextColor, GR_SELECTED_PILL_TEXT_COLOR)
138  GET_COL(selPillBGColor, GR_SELECTED_PILL_BG_COLOR)
139  GET_COL(selPillOutlineColor, GR_SELECTED_PILL_OUTLINE_COLOR)
140  GET_COL(overlayLabelColor, GR_OVERLAY_LABEL_COLOR)
141  GET_COL(auxOverlayLabelColor, GR_AUX_OVERLAY_LABEL_COLOR)
142  GET_COL(handlePivotColor, GR_HANDLE_PIVOT_COLOR)
143  GET_COL(handleAxisColor, GR_HANDLE_AXIS_COLOR)
144  GET_COL(handleXAxisColor, GR_HANDLE_X_AXIS_COLOR)
145  GET_COL(handleYAxisColor, GR_HANDLE_Y_AXIS_COLOR)
146  GET_COL(handleZAxisColor, GR_HANDLE_Z_AXIS_COLOR)
147  GET_COL(handlePlaneAxisColor, GR_HANDLE_PLANE_AXIS_COLOR)
148  GET_COL(handleTumbleSphereColor, GR_HANDLE_TUMBLE_SPHERE_COLOR)
149  GET_COL(handleTracerColor, GR_HANDLE_TRACER_COLOR)
150  GET_COL(handleDeltaTextColor, GR_HANDLE_DELTA_TEXT_COLOR)
151  GET_COL(handleDeltaTextShadowColor, GR_HANDLE_DELTA_TEXT_SHADOW_COLOR)
152  GET_COL(handleBendColor, GR_HANDLE_BEND_COLOR)
153  GET_COL(handleTwistColor, GR_HANDLE_TWIST_COLOR)
154  GET_COL(cplaneHandleXlateColor, GR_CPLANE_HANDLE_XLATE_COLOR)
155  GET_COL(cplaneHandleRotateColor, GR_CPLANE_HANDLE_ROTATE_COLOR)
156  GET_COL(cplaneHandleBorderColor, GR_CPLANE_HANDLE_BORDER_COLOR)
157  GET_COL(orthoGridColor, GR_ORTHO_GRID_COLOR)
158  GET_COL(orthoGridOriginColor, GR_ORTHO_GRID_ORIGIN_COLOR)
159  GET_COL(uvGridColor, GR_UV_GRID_COLOR)
160  GET_COL(uvGridOriginColor, GR_UV_GRID_ORIGIN_COLOR)
161  GET_COL(uvGridBoundaryColor, GR_UV_GRID_BOUNDARY_COLOR)
162  GET_COL(objSelectColor, GR_OBJECT_SELECT_COLOR)
163  GET_COL(objCurrentColor, GR_OBJECT_CURRENT_COLOR)
164  GET_COL(objSelectHintColor, GR_OBJECT_SELECT_HINT_COLOR)
165  GET_COL(objGhostColor, GR_OBJECT_GHOST_COLOR)
166  GET_COL(uvBackFaceFillColor, GR_UV_BACKFACE_FILL_COLOR)
167  GET_COL(uvOverlapFillColor, GR_UV_OVERLAP_FILL_COLOR)
168  GET_COL(uvSelBackFaceFillColor, GR_SELECTED_UV_BACKFACE_FILL_COLOR)
169  GET_COL(ikCriticalZoneColor, GR_IK_CRITICAL_ZONE_COLOR)
170  GET_COL(viewMaskOverlayColor, GR_VIEW_MASK_OVERLAY_COLOR)
171  GET_COL(cameraMaskColor, GR_CAMERA_MASK_COLOR)
172  GET_COL(lockedCameraMaskColor, GR_LOCKED_CAMERA_MASK_COLOR)
173  GET_COL(cameraOverlayColor, GR_CAMERA_OVERLAY_COLOR)
174  GET_COL(textColor, GR_TEXT_COLOR)
175  GET_COL(textShadowColor, GR_TEXT_SHADOW_COLOR)
176  GET_COL(geoWarningColor, GR_GEO_WARNING_COLOR)
177  GET_COL(selectBoxOuterLineColor, GR_SELECTBOX_OUTER_LINE_COLOR)
178  GET_COL(selectBoxInnerLineColor, GR_SELECTBOX_INNER_LINE_COLOR)
179  GET_COL(selectBoxFillColor, GR_SELECTBOX_FILL_COLOR)
180  GET_COL(handleLocateColor, GR_HANDLE_LOCATE_COLOR)
181  GET_COL(handleLocatePassiveColor, GR_HANDLE_LOCATE_PASSIVE_COLOR)
182  GET_COL(objectNameColor, GR_OBJECT_NAME_COLOR)
183  GET_COL(pointTrailColor, GR_POINT_TRAIL_COLOR)
184  GET_COL(selPointTrailColor, GR_POINT_TRAIL_SELECTED_COLOR)
185  GET_COL(renderBorderColor, GR_RENDER_BORDER_COLOR)
186  GET_COL(renderInactiveBorderColor, GR_RENDER_INACTIVE_BORDER_COLOR)
187  GET_COL(renderTextColor, GR_RENDER_TEXT_COLOR)
188  GET_COL(renderLocateColor, GR_RENDER_LOCATE_COLOR)
189  GET_COL(renderBarColor, GR_RENDER_BAR_COLOR)
190  GET_COL(flattenPinColor, GR_FLATTEN_PIN_COLOR)
191  GET_COL(flattenPinSelColor, GR_FLATTEN_PIN_SELECTED_COLOR)
192  GET_COL(flattenInitialPinColor, GR_FLATTEN_INITIAL_PIN_COLOR)
193  GET_COL(messageColor, GR_MESSAGE_COLOR)
194  GET_COL(promptColor, GR_PROMPT_COLOR)
195  GET_COL(warningColor, GR_WARNING_COLOR)
196  GET_COL(errorColor, GR_ERROR_COLOR)
197  GET_COL(successColor, GR_SUCCESS_COLOR)
198  GET_COL(overlayBackgroundColor, GR_OVERLAY_BACKGROUND_COLOR)
199  GET_COL(boundaryColor, GR_BOUNDARY_COLOR)
200  GET_COL(edgeTipColor, GR_EDGE_TIP_COLOR)
201  GET_COL(viewPivotFGColor, GR_VIEW_PIVOT_FG_COLOR)
202  GET_COL(viewPivotBGColor, GR_VIEW_PIVOT_BG_COLOR)
203  GET_COL(bboxOutlineColor, GR_BBOX_OUTLINE_COLOR)
204  GET_COL(bboxSolidColor, GR_BBOX_SOLID_COLOR)
205  GET_COL(backfaceTint, GR_BACKFACE_TINT_COLOR)
206  GET_COL(overviewViewRegionColor, GR_OVERVIEW_VIEW_REGION_COLOR)
207  GET_COL(overviewWinRegionColor, GR_OVERVIEW_WIN_REGION_COLOR)
208  GET_COL(overviewNominalWinRegionColor, GR_OVERVIEW_NOMINAL_WIN_REGION_COLOR)
209  GET_COL(usdModifiedPrimitiveColor, GR_USD_MODIFIED_PRIMITIVE_COLOR)
210 
211  const UT_Color &wireColor() const
212  { return myCurrentWireColor[myGammaPassPtr?*myGammaPassPtr:0]; }
213  const UT_Color &crtAuxColor() const
214  { return myColors[myCrtAuxColor][myGammaPassPtr?*myGammaPassPtr:0]; }
215 
217  {
218  alpha = myAlphas[GR_LOCATE_ALPHA];
219  return myColors[GR_LOCATE_COLOR][myGammaPassPtr?*myGammaPassPtr:0];
220  }
221  void componentLocateColor(int component_type,
222  GU_SelectionRule sel_rule,
223  UT_Color &clr, fpreal &alpha) const;
224  void componentLocateNearColor(UT_Color &clr, fpreal &alpha) const;
225 
226 #undef GET_COL
227 
229  { return myAlphas[alpha_name]; }
230  bool getAlphaByName(const char *name, fpreal &alpha);
231 #define GET_ALPHA(func, val) fpreal func() const { return myAlphas[val]; }
232  GET_ALPHA(objGhostAlpha, GR_OBJECT_GHOST_ALPHA)
233  GET_ALPHA(selectBoxFillAlpha, GR_SELECTBOX_ALPHA)
234  GET_ALPHA(cplaneAlpha, GR_CPLANE_ALPHA)
235  GET_ALPHA(cplaneLineAlpha, GR_CPLANE_LINE_ALPHA)
236  GET_ALPHA(cplaneLineFadedAlpha, GR_CPLANE_LINE_FADED_ALPHA)
237  GET_ALPHA(gridLineAlpha, GR_GRID_LINE_ALPHA)
238  GET_ALPHA(gridLineFadedAlpha, GR_GRID_LINE_FADED_ALPHA)
239  GET_ALPHA(gridRulerAlpha, GR_GRID_RULER_ALPHA)
240  GET_ALPHA(gridRulerFadedAlpha, GR_GRID_RULER_FADED_ALPHA)
241  GET_ALPHA(handleLocateAlpha, GR_HANDLE_LOCATE_ALPHA)
242  GET_ALPHA(handleAxisLocateAlpha, GR_HANDLE_AXIS_LOCATE_ALPHA)
243  GET_ALPHA(handleTumbleSphereAlpha, GR_HANDLE_TUMBLE_SPHERE_ALPHA)
244  GET_ALPHA(handleTracerFillAlpha, GR_HANDLE_TRACER_FILL_ALPHA);
245  GET_ALPHA(fillSelectionAlpha, GR_FILL_SELECTION_ALPHA)
246  GET_ALPHA(fillSelectionWireOverAlpha, GR_FILL_SELECTION_WIRE_OVER_ALPHA)
247  GET_ALPHA(uvFillAlpha, GR_UV_FILL_ALPHA)
248  GET_ALPHA(uvOverlapFillAlpha, GR_UV_OVERLAP_FILL_ALPHA)
249  GET_ALPHA(overlayBackgroundAlpha, GR_OVERLAY_BACKGROUND_ALPHA)
250  GET_ALPHA(pillMenuBGAlpha, GR_PILL_MENU_BG_ALPHA)
251  GET_ALPHA(selPillMenuBGAlpha, GR_SELECTED_PILL_MENU_BG_ALPHA)
252  GET_ALPHA(bboxOutlineAlpha, GR_BBOX_OUTLINE_ALPHA)
253  GET_ALPHA(bboxSolidAlpha, GR_BBOX_SOLID_ALPHA)
254  GET_ALPHA(backfaceTintBlend, GR_BACKFACE_TINT_ALPHA)
255  GET_ALPHA(usdSelectedPrimitiveBlend, GR_USD_SELECTED_PRIMITIVE_ALPHA)
256  GET_ALPHA(usdModifiedPrimitiveBlend, GR_USD_MODIFIED_PRIMITIVE_ALPHA)
257 #undef GET_ALPHA
258 
259  const GR_HandleParts &handleParts() const { return myHandleParts; }
260  GR_HandleParts &handleParts() { return myHandleParts; }
261 
262  GR_DecorFontSize getDecorFontSize() const { return myDecorFontSize; }
263  void setDecorFontSize(GR_DecorFontSize s){myDecorFontSize=s;}
264 
265  fpreal markerSize() const { return myMarkerSize*myDPIScale; }
267  { return myMarkerSize; }
269  { myMarkerSize = SYSmax(size, 0.1); }
270 
271  // Methods for accessing (setting/getting) the various flags.
272  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawTexture, drawTexture)
273  FLAG_ACCESSORS_BUMP_OPTS(myNoSaveFlags, drawMultiTexture, drawMultiTexture)
274  FLAG_ACCESSORS(mySaveFlags, drawTransparent, drawTransparent)
275  FLAG_ACCESSORS(mySaveFlags, showMaterials, showMaterials)
276  FLAG_ACCESSORS(mySaveFlags, drawDisplacement, drawDisplacement)
277  FLAG_ACCESSORS(mySaveFlags, drawTexturedSpots, drawTexturedSpots)
278  FLAG_ACCESSORS(mySaveFlags, drawShadows, drawShadows)
279  FLAG_ACCESSORS(mySaveFlags, drawTransparentMaps, drawTransparentMaps)
280  FLAG_ACCESSORS(mySaveFlags, highQualityLighting, highQualityLighting)
281  FLAG_ACCESSORS(mySaveFlags, drawDiffuse, drawDiffuse)
282  FLAG_ACCESSORS(mySaveFlags, drawAmbient, drawAmbient)
283  FLAG_ACCESSORS(mySaveFlags, drawEmission, drawEmission)
284  FLAG_ACCESSORS(mySaveFlags, useLighting, useLighting)
285  FLAG_ACCESSORS(mySaveFlags, ambientOcclusion, ambientOcclusion)
286  FLAG_ACCESSORS(mySaveFlags, removeBackface, removeBackface)
287  FLAG_ACCESSORS(mySaveFlags, fillSelection, fillSelection)
288  FLAG_ACCESSORS(mySaveFlags, solidOnly, solidOnly)
289  FLAG_ACCESSORS(mySaveFlags, correctBG, correctBG)
290  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, polygonConvexQuality,
291  polygonConvexQuality)
292  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawPartSprite, drawPartSprite)
293  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, orientDiscs, orientDiscs)
294 
295  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, shadeOpenCurves, shadeOpenCurves)
296  FLAG_ACCESSORS(mySaveFlags, displayAsSubdiv, displayAsSubdiv)
297 
298  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawHullsOnly, drawHullsOnly)
299  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawPartOrigin, drawPartOrigin)
300  FLAG_ACCESSORS(mySaveFlags, drawHandles, drawHandles)
301  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, showObjectSelection,
302  showObjectSelection)
303 
304  FLAG_ACCESSORS(mySaveFlags, use2DLimitsFor3D, use2DTexLimits)
305  FLAG_ACCESSORS(mySaveFlags, dynamicTexControl, dynamicTexControl)
306  FLAG_ACCESSORS(mySaveFlags, dynamicReduceTex2D, reduceTex2D )
307  FLAG_ACCESSORS(mySaveFlags, dynamicReduceTex3D, reduceTex3D )
308  FLAG_ACCESSORS(mySaveFlags, dynamicReduceMipMap, reduceMipMap )
309  FLAG_ACCESSORS(mySaveFlags, dynamicReduceBitDepth, reduceBitDepth )
310 
311  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, overrideColorAttrib,
312  overrideColorAttrib);
313  FLAG_ACCESSORS(mySaveFlags, pickWireAsSolid, pickWireAsSolid)
314  FLAG_ACCESSORS(mySaveFlags, wireOverPacked, wireOverPacked)
315  FLAG_ACCESSORS(mySaveFlags, showGeoColor, showGeoColor )
316 
317  FLAG_ACCESSORS(myNoSaveFlags, applyVisualizers, applyVisualizers)
318  FLAG_ACCESSORS(myNoSaveFlags, snapToSelected, snapToSelected)
319  FLAG_ACCESSORS(myNoSaveFlags, showComponentSelections, showComponentSelections)
320 
321  // NB: This flag is somewhat overloaded. At SOPs it determines whether
322  // we're showing the temporary or cook selections. At DOPs it also
323  // indicates whether we're drawing temporary DETAIL selections.
324  FLAG_ACCESSORS(myNoSaveFlags, showTempSelections, showTempSelections)
325 
326  FLAG_ACCESSORS(myNoSaveFlags, pickFrontFaces, pickFrontFaces)
327  FLAG_ACCESSORS(myNoSaveFlags, pickBackFaces, pickBackFaces)
328  FLAG_ACCESSORS_BUMP_OPTS(myNoSaveFlags, drawAuxColors, drawAuxColors)
329  FLAG_ACCESSORS_BUMP_OPTS(myNoSaveFlags, forceWireColor, forceWireColor)
330  FLAG_ACCESSORS(myNoSaveFlags, shadingOpenCurves, shadingOpenCurves)
331 
332  // This returns true if the interactive mode display option is on
333  FLAG_ACCESSORS(mySaveFlags, interactiveEnable, interactiveEnable)
334 
335 
336  FLAG_ACCESSORS(mySaveFlags, outlineSelection, outlineSelection)
337 
338  // This returns true if the user is interactively moving a handle or
339  // tumbling, independent of the interative enable flag.
340  FLAG_ACCESSORS(myNoSaveFlags, interactiveMove, interactive)
341 
342  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, pointInstancing, pointInstancing)
343 
344  bool cuspNormals() const
345  { return mySaveFlags.cuspNormals; }
346  void cuspNormals(bool c)
347  {
348  if(c != mySaveFlags.cuspNormals)
349  {
350  mySerialNum++;
351  mySaveFlags.cuspNormals = c;
352  }
353  }
355  { return myNormalCuspAngle; }
357  {
358  a = SYSclamp(a, 0.0, 180.0);
359  if(!SYSisEqual(a, myNormalCuspAngle))
360  {
361  mySerialNum++;
362  myNormalCuspAngle = a;
363  }
364  }
366  { return myVertNormalLimit; }
367  void setVertexNormalLimit(int poly_limit)
368  {
369  poly_limit = SYSmax(0, poly_limit);
370  if(poly_limit != myVertNormalLimit)
371  {
372  mySerialNum++;
373  myVertNormalLimit = poly_limit;
374  }
375  }
376 
378  {
381  TANGENT_DISABLE
382  };
384  {
385  if(myTangentMethod != method)
386  {
387  mySerialNum++;
388  myTangentMethod = method;
389  }
390  }
391  gr_TangentMethod generateTangents() const { return myTangentMethod; }
392 
393  bool limitTextureSize() const { return mySaveFlags.limitTextureSize; }
394  void limitTextureSize(bool ls){ mySaveFlags.limitTextureSize = ls;
395  myUpdates.texSize = true; }
396 
397  bool limitTexture3DSize() const { return mySaveFlags.limitTexture3DSize; }
398  void limitTexture3DSize(bool ls){ mySaveFlags.limitTexture3DSize = ls;
399  myUpdates.tex3DSize = true; }
400 
401  int textureMemLimitMB() const { return myTextureMemLimitMB; }
402  void textureMemLimitMB(int max_size)
403  { myTextureMemLimitMB = SYSmax(32, max_size);
404  myUpdates.textureMem = true; }
405 
406  // Specifies the anisotropic sampling for textures. getTextureAnisotropy()
407  // must be called when rendering, to check for the GL extension.
408  int getTextureAnisotropy(RE_RenderContext r) const;
409  int textureAnisotropy() const;
410  void textureAnisotropy(int ta);
411 
412  // Always use the version of getHDRTextureFormat() with RE_Render * when
413  // rendering, to ensure hardware compatibility with the format.
414  RE_TextureCompress getHDRTextureFormat(RE_RenderContext r) const;
415  int getHDRTextureFormat() const;
416  void setHDRTextureFormat(int hdrformat); // 2 = full HDR, 1=16b HDR, 0=8b
417  void setDynamicFormat(int format); // -1 = compressed 8b
418  int getDynamicFormat() const { return myDynamicFormat; }
419 
420 
421  RE_TextureCompress getHDRTexture3DFormat(RE_RenderContext r) const;
422  int getHDRTexture3DFormat() const;
423  void setHDRTexture3DFormat(int hdrformat); // 2 = full HDR, 1=16b HDR, 0=8b
424  void setDynamic3DFormat(int format);
425  int getDynamic3DFormat() const { return myDynamic3DFormat; }
426 
427  // Scale all textures down
428  void setTextureScale(float sc); // 0.0 (min size) to 1.0 (full size)
429  float getTextureScale() const; // texture scale is applied before limit
430  float getUserTextureScale() const; // texture scale w/o dynamics applied
431  void setDynamicScale(float sc); // For dynamic cache control
432  float getDynamicScale() const;
433 
434  void setTexture3DScale(float sc); // 0.0 (min size) to 1.0 (full size)
435  float getTexture3DScale() const; // texture scale is applied before limit
436  float getUserTexture3DScale() const;// texture scale w/o dynamics applied
437  void setDynamic3DScale(float sc); // For dynamic cache control
438  float getDynamic3DScale() const;
439 
440  // Maximum particle array texture size
441  void setParticleTextureSize(int max_w, int max_h);
442  void getParticleTextureSize(int &max_w, int &max_h) const;
443 
444  void setParticleDisplayType(GR_ParticleType t);
445  GR_ParticleType particleDisplayType() const;
446 
447  // Limit texture resolution
448  void setMaxTextureSize(bool limit, int max_w=0, int max_h=0);
449  void getMaxTextureSize(int &max_w, int &max_h) const;
450  void getMaxTextureSize(RE_RenderContext r, int &max_w, int &max_h) const;
451 
452  void setMaxTexture3DSize(bool limit, int max_w=0, int max_h=0, int max_d=0);
453  void getMaxTexture3DSize(int &max_w, int &max_h, int &max_d) const;
454  void getMaxTexture3DSize(RE_RenderContext r, int &max_w, int &max_h,
455  int &max_d) const;
456 
457  bool mipMapTextures() const;
458  void mipMapTextures(bool onoff);
459  void setDynamicMipMap(bool onoff);
460  bool getDynamicMipMap() const { return myNoSaveFlags.dynamicMipSetting; }
461 
462  void resetDynamicParms();
463 
464  void allowDeferredTextureLoad(bool a) { myNoSaveFlags.deferTexLoad = a; }
465  bool allowDeferredTextureLoad() const { return myNoSaveFlags.deferTexLoad; }
466 
467  bool getHighQualityLighting(RE_RenderContext r) const;
468 
469  void alphaPass(GR_AlphaPass pass) { myAlphaPass = pass; }
470  GR_AlphaPass alphaPass() const { return myAlphaPass; }
471 
472  int getTransparentQuality() const { return myTransparentQuality; }
473  void setTransparentQuality(int q) { myTransparentQuality=SYSclamp(q,-1,2); }
474 
475  fpreal getDisplacementQuality() const { return myDisplacementQuality; }
477  { myDisplacementQuality = SYSmax(q, 0.0); }
478 
479  int getLightSampling() const { return myLightSamples; }
480  void setLightSampling(int s) { myLightSamples = SYSclamp(s,1,100); }
481 
482  int getVolumeQuality() const { return myVolumeQuality; }
483  void setVolumeQuality(int q) { myVolumeQuality = SYSclamp(q,0,3); }
484 
485  fpreal getVolumeAmbientShadows() const { return myVolumeAmbientShadows; }
487  { myVolumeAmbientShadows = SYSmax((fpreal) 0, q); }
488 
489  int getVolumeBSplines() const { return myVolumeBSplines; }
490  void setVolumeBSplines(int bs) { myVolumeBSplines = bs; }
491 
492  bool getActiveRender() const { return myActiveRender; }
493  void setActiveRender(bool active) { myActiveRender = active; }
494 
495  bool volumeWireAsPoints() const { return false; }
496  void volumeWireAsPoints(bool vw){ }
497 
498  // DPI support.
499  void DPIScale(fpreal f) { myDPIScale = f; }
500  fpreal DPIScale() const { return myDPIScale; }
501 
502  void autoDPIScale(bool dpi);
503  bool autoDPIScale() const { return mySaveFlags.autoDPIScale; }
504 
505  // Reflection cube maps
506  bool useReflectionMaps() const
507  { return mySaveFlags.enableReflectionMaps; }
508  void useReflectionMaps(bool e)
509  { mySaveFlags.enableReflectionMaps = e; }
510  bool hdrReflectionMaps() const
511  { return mySaveFlags.hdrReflectionMaps; }
512  void hdrReflectionMaps(bool e)
513  { myUpdates.hdrReflect = true;
514  mySaveFlags.hdrReflectionMaps = e; }
515  int reflectionMapSize() const { return myReflectMapSize; }
516  void reflectionMapSize(int wh)
517  { myUpdates.reflectSize = true;
518  myReflectMapSize = SYSclamp(wh, 16, 16384); }
519  fpreal reflectionMinLevel() const { return myReflectMinLevel; }
521  { myReflectMinLevel = SYSclamp(lvl, 0.0, 1.0); }
522 
523  // Agents
524  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, agentLODEnable, agentLODEnable)
525 
526  void setAgentLODBias(fpreal b)
527  {
528  if(!SYSisEqual(b, myAgentLODBias))
529  mySerialNum++;
530  myAgentLODBias = b;
531  }
532  fpreal getAgentLODBias() const { return myAgentLODBias; }
533 
534  void setAgentMinPoints(int minp) { myAgentMinPoints = SYSmax(1, minp); }
535  int getAgentMinPoints() const { return myAgentMinPoints; }
536 
537  void setAgentNumLODLevels(int lvls) { myAgentMaxLOD=SYSclamp(lvls,1,16);}
538  int getAgentNumLODLevels() const { return myAgentMaxLOD; }
539 
540  void setAgentBaseLODLevel(int lvl)
541  {
542  if(lvl != myAgentBaseLOD)
543  mySerialNum++;
544  myAgentBaseLOD=SYSclamp(lvl,0,16);
545  }
546  int getAgentBaseLODLevel() const { return myAgentBaseLOD; }
547 
548  void setAgentBoneDeform(int d) { myAgentBoneDeform = SYSclamp(d,0,2); }
549  int getAgentBoneDeform() const { return myAgentBoneDeform; }
550 
551  int getAgentWireMode() const { return myAgentWireMode; }
553  {
554  mode = SYSclamp(mode,0,1);
555  if(mode != myAgentWireMode)
556  {
557  mySerialNum++;
558  myAgentWireMode = mode;
559  }
560  }
561 
562  FLAG_ACCESSORS(mySaveFlags, agentBlendShapes, agentBlendShapes)
563 
564  FLAG_ACCESSORS(mySaveFlags, characterDeform, characterDeform)
565 
566  void optimizePackedGeometry(bool opt){ mySaveFlags.optPackedGeo = opt; }
567  bool optimizePackedGeometry() const { return mySaveFlags.optPackedGeo; }
568 
569  void offsetVertexDecor(bool use_offset)
570  { mySaveFlags.offsetVertexDecor = use_offset; }
571  bool offsetVertexDecor() const
572  { return mySaveFlags.offsetVertexDecor; }
573 
575  {
579  CURRENT_SHADING_BBOX // follow the current shading mode
580  };
581  void shadedBoundingBoxes(gr_BBoxMode m) { myBBoxMode = m; }
582  gr_BBoxMode shadedBoundingBoxes() const { return myBBoxMode; }
583 
584  // "Get" methods:
585  const UT_String &
586  visibleObjects() const { return myVisibleObjects; }
587  GA_PrimCompat::TypeMask primMask() const { return myPrimMask; }
588  unsigned pickMask() const { return myPickMask; }
589  float normalScale() const { return myNormalScale; }
590  float getNormalScale() const { return myNormalScale; }
591  fpreal vectorScale() const { return myVectorScale; }
592  fpreal getVectorScale() const { return myVectorScale; }
593  float LOD() const { return myLOD; }
594  float hlOffsetVariable() const { return myHLOffsetVariable; }
595  float hlOffsetConstant() const { return myHLOffsetConstant; }
596  float wireWidth() const { return SYSmax(0.1,
597  myWireWidth*myDPIScale); }
598  float selectionWireWidth()const { return (wireWidth() > 1.0)
599  ? wireWidth() + 1.0
600  : wireWidth() * 2.0; }
601  float getWireWidth() const { return myWireWidth; }
602  float wireBlend() const { return SYSclamp(myWireBlend,
603  0.0, 1.0); }
604  float interiorWireAlpha() const { return myInteriorWireAlpha; }
605  float pointSize() const { return myPointSize*myDPIScale; }
606  float getPointSize() const { return myPointSize; }
607  float discSize() const { return myDiscSize; }
608  float shadowOffsetVariable() const { return myShadowOffsetVariable; }
609  float shadowOffsetConstant() const { return myShadowOffsetConstant; }
610  int shadowAA() const { return myShadowAA; }
611  bool useLightShadowSize() const { return myUseLightShadowSize; }
612  int getShadowMapSize() const { return myShadowMapSize; }
613  int selectionListInst() const { return mySelectionListInst; }
614 
615  const char *colorAttrib() const { return myColorAttrib; }
616  int colorType() const { return myColorType; }
617  void getColorDomain(fpreal &s, fpreal &e) const
618  { s = myColorDomain[0];
619  e = myColorDomain[1]; }
620 
621  int getSceneAntialias() const { return mySceneAntialias; }
622  bool getHDRRendering() const { return mySaveFlags.hdrRender; }
623  float getViewGamma() const { return myViewGamma; }
624  bool useViewLUT() const { return myUseLUT; }
625  const char *getViewLUT() const { return myViewLUT; }
626  bool useOCIO() const { return myUseOCIO; }
627  const char *getOCIOColorspace() const { return myOCIOColorspace; }
628  const char *getOCIOLooks() const { return myOCIOLooks; }
629  const char *getOCIODisplay() const { return myOCIODisplay; }
630  const char *getOCIOView() const { return myOCIOView; }
631  exint getOCIOSerial() const { return myOCIOSerial; }
632  float getViewBlack() const { return myViewBlack; }
633  float getViewWhite() const { return myViewWhite; }
634  int getViewComponents() const { return myViewComponents; }
635 
636  int getAmbOcclusionLevel() const { return myAmbOcclusionLevel; }
637  float getAmbOcclusionScale() const { return myAmbOcclusionScale; }
639  { return myAmbOcclusionIntensity; }
640  float getAmbOcclusionSpread() const
641  { return myAmbOcclusionSpread; }
642  bool getUseRayTrace() const { return myUseRayTrace; }
643  bool getUseDenoise() const { return myUseDenoise; }
644 
645  fpreal getInstancingFraction() const { return myInstancingFraction; }
646  int getInstancingLimit() const { return myInstancingLimit; }
648  { return myInstancingLimitAction; }
649 
650  fpreal getMinHomeZoom() const { return myMinHomeZoom; }
651 
652  // In millions of polygons (eg, 10 for 10M).
653  int getSubdivisionPolyLimit() const { return mySubdPolyLimit; }
654 
655  // "Set" methods:
656  void visibleObjects(const char *mask)
657  { myVisibleObjects.harden(mask); }
659  { myPrimMask = mask; }
660  void pickMask(unsigned mask) { myPickMask = mask; }
661  void setNormalScale(float s);
662  void setVectorScale(float s);
663 
664  void useRegularAuxColor() { myCrtAuxColor=GR_AUX_GEO_COLOR; }
666 
667  void setCurrentWireColor(const UT_Color &color);
668  void setCurrentWireColor(GR_DisplayColor color);
669  const UT_Color &getCurrentWireColor() const { return myCurrentWireColor[0]; }
670 
671  void LOD(float l);
672  void hlOffsetVariable(float f) { myHLOffsetVariable = (f>=0.0f)
673  ? f :0.0f;}
674  void hlOffsetConstant(float f) { myHLOffsetConstant = (f>=0.0f)
675  ? f :0.0f;}
676  void setWireWidth(float width) { myWireWidth = width;}
677  void wireBlend(float blend) { myWireBlend = blend;}
678  void interiorWireAlpha(float a) { myInteriorWireAlpha
679  = SYSclamp(a, 0.0f, 1.0f); }
680  void setPointSize(float size) { myPointSize = size; }
681  void discSize(float size);
683  { myShadowOffsetVariable = (f>=0.0f) ? f : 0.0f;}
685  { myShadowOffsetConstant = (f>=0.0f) ? f : 0.0f;}
686  void shadowAA(int aa) { myShadowAA = SYSclamp(aa, 1,4); }
687  void selectionListInst(int inst) { mySelectionListInst = inst; }
688  void setUseLightShadowSize(bool e) { myUseLightShadowSize = e; }
689  void setShadowMapSize(int s) { myShadowMapSize = s;
690  myUpdates.shadowSize = true; }
691 
692  void setColorAttrib(const char *a);
693  void setColorType(int t);
694  void setColorDomain(fpreal s, fpreal e);
695 
696  void setSceneAntialias(int a) { mySceneAntialias = a;
697  myUpdates.sceneAA = true; }
698 
699  void setHDRRendering(bool hdr) { mySaveFlags.hdrRender = hdr; }
700 
701  void setViewGamma(float gamma);
702  void setUseViewLUT(bool b) { myUseLUT = b; }
703  void setViewLUT(const char *lut) { myViewLUT.harden(lut); }
704  void useOCIO(bool use) { myUseOCIO = use; }
705  void setOCIOColorspace(const char *cs)
706  { myOCIOColorspace.harden(cs); }
707  void setOCIOLooks(const char *looks)
708  { myOCIOLooks.harden(looks); }
709  void setOCIODisplayView(const char *display, const char *view)
710  { myOCIODisplay = display; myOCIOView = view; }
711  void setOCIOSerial(exint serial) { myOCIOSerial = serial; }
712  void setViewBlack(float b) { myViewBlack = b; }
713  void setViewWhite(float w) { myViewWhite = w; }
714  void setViewComponents(int c) { myViewComponents = c; }
715  void copyColorCorrect(const GR_CommonDispOption &src);
716  void setAmbOcclusionLevel(int lvl)
717  { myAmbOcclusionLevel = SYSclamp(lvl, 1, 4); }
719  { myAmbOcclusionIntensity = SYSmax(0.0, i); }
720  void setAmbOcclusionScale(float sc)
721  { myAmbOcclusionScale = SYSmax(0.001, sc); }
722  void setAmbOcclusionSpread(float sc)
723  { myAmbOcclusionSpread = SYSclamp(sc, 0.0, 1.0); }
724  void setUseRayTrace(bool enable)
725  { myUseRayTrace = enable; }
726  void setUseDenoise(bool enable)
727  { myUseDenoise = enable; }
728 
730  { if(!SYSisEqual(s, myInstancingFraction))
731  mySerialNum++;
732  myInstancingFraction = s; }
733  void setInstancingLimit(int limit)
734  { limit = SYSmax(0, limit);
735  if(!SYSisEqual(limit, myInstancingLimit))
736  mySerialNum++;
737  myInstancingLimit = limit;
738  }
739  void setInstancingLimitAction(int action)
740  { myInstancingLimitAction = SYSclamp(action, 0,2); }
741 
743  { myMinHomeZoom = SYSmax(val, 0.001); }
744 
745  // In millions of polygons (eg, 10 for 10M).
746  void setSubdivisionPolyLimit(int limit)
747  {
748  limit = SYSmax(0, limit);
749  if(limit != mySubdPolyLimit)
750  mySerialNum++;
751  mySubdPolyLimit = limit;
752  }
753 
755  {
756  if(myUVAttrib != attrib)
757  {
758  mySerialNum++;
759  myUVAttrib = attrib;
760  }
761  }
762  const UT_StringHolder &getUVDisplayAttrib() const { return myUVAttrib; }
763 
764  // Onion skinning
765  bool isOnionSkinEnabled() const
766  { return mySaveFlags.onionSkinEnable; }
768  { return myOnionSkinFrameInc; }
770  { return myOnionSkinPreFrameCount; }
772  { return myOnionSkinPostFrameCount; }
774  { return myOnionSkinPreFrameColor; }
776  { return myOnionSkinPostFrameColor; }
777  fpreal getOnionSkinAlpha() const { return myOnionSkinAlpha; }
778 
779  void setOnionSkinEnable(bool enable)
780  { mySaveFlags.onionSkinEnable = enable; }
781 
782  void setOnionSkinParms(int frame_inc,
783  int pre_count,
784  int post_count,
785  UT_Color pre_color,
786  UT_Color post_color,
787  fpreal alpha);
788 
789  // These are used to determine if geometry-related parms have changed on a
790  // very coarse level.
791  int getUniqueID() const { return myUniqueID; }
792  int getSerialNum() const { return mySerialNum; }
793  void bumpSerialNum() { mySerialNum++; }
794 
795  // changes when the view is changed. ID changes if the rendered viewport
796  // is different. 3D is for 3D view changes, 2D is for screen pan/zoom.
797  // getViewSerialID() is bumped for either.
798  int getViewSerialNum() const { return mySerialView +mySerialView2; }
799  int getView3DSerialNum() const { return mySerialView; }
800  int getView2DSerialNum() const { return mySerialView2; }
801  int getViewSerialID() const { return mySerialID; }
802  void setViewSerialNum(int num, int num_2d, int id)
803  {
804  mySerialView = num;
805  mySerialView2 = num_2d;
806  mySerialID = id;
807  }
808 
809  bool isLopsView() const { return myLopsView; }
810 
811  bool defaultTextureSize() const { return !myUpdates.texSize; }
812  bool default3DTextureSize() const{ return !myUpdates.tex3DSize; }
813  bool defaultShadowSize() const { return !myUpdates.shadowSize; }
814  bool defaultReflectSize() const { return !myUpdates.reflectSize; }
815  bool defaultHDRTexture() const { return !myUpdates.hdrTexture; }
816  bool defaultHDRReflect() const { return !myUpdates.hdrReflect; }
817  bool defaultSmoothLines() const { return !myUpdates.smoothLines; }
818  bool defaultSceneAA() const { return !myUpdates.sceneAA; }
819  bool defaultTextureMem() const { return !myUpdates.textureMem; }
820  bool defaultGuideFont() const { return !myUpdates.guideFont; }
821  bool defaultDPIScale() const { return !myUpdates.dpiScale; }
822 
823  // Turns on the closure selection on hull-based or all geometry
824  int closureSelection() const { return myClosureSelection; }
825  void closureSelection(int s) { myClosureSelection=SYSclamp(s,0,2); }
826 
827  int getVisContext() const { return myVisContext; }
828  void setVisContext(int ctxt) { myVisContext = ctxt; }
829 
830  // dummy callbacks for obsolete options.
831  bool obsoleteOption() const { return false; }
832  void obsoleteOption(bool onoff) {}
833 
834  static void setYUp(bool up) { theYUp = up; }
835  static bool isYUp() { return theYUp; }
836 
837  // Some looks can render progressively. This reports if this is a) allowed
838  // and b) whether the viewport is currently only partially rendered.
839  bool isPartialRender() const { return myIsPartialRender; }
840  void clearPartialRender() { myIsPartialRender = false; }
841  void setPartialRender() { myIsPartialRender = true; }
842  void allowPartialRender(bool allowed)
843  { myAllowPartialRender = allowed; }
844  bool allowsPartialRender() const
845  { return myAllowPartialRender; }
847  { myPartialPercentDone = p; }
849  {
850  return myIsPartialRender ? myPartialPercentDone
851  : 100.0;
852  }
853 
854  // Lights currently used for rendering
855  void setLightList(const GR_LightList *list)
856  { myLightList = list;}
857  const GR_LightList *getLightList() const { return myLightList; }
858 
860  { myExtraMaterials = materials; }
861  GR_MaterialAtlas *extraMaterials() const { return myExtraMaterials; }
862 
863 private:
864  void loadDefaultColors();
865  void getColorsByName();
866 
867  // data
868  UT_Color myColors[GR_NUM_DISPLAY_COLORS][2];
869  fpreal myAlphas[GR_NUM_DISPLAY_ALPHAS];
870  UT_Color myCurrentWireColor[2];
871 
872  UT_String myVisibleObjects; // Visibility mask
873  GA_PrimCompat::TypeMask myPrimMask; // What types of prims to draw
874  unsigned myPickMask; // What geo entities to pick
875 
876  fpreal myMarkerSize; // point,vertex,breakpoint marker diam
877  float myNormalScale; // A size to scale the normal by
878  fpreal myVectorScale; // Scale custom vectors
879  float myLOD; // level of detail
880  float myHLOffsetVariable; // hidden line constant offset
881  float myHLOffsetConstant; // hidden line variable offset
882  float myWireWidth;
883  fpreal32 myWireBlend;
884  fpreal32 myInteriorWireAlpha;
885  GR_ParticleType myParticleDisplayType;
886  fpreal myDPIScale; // DPI scale factor
887  float myPointSize; // point size in pixels
888  float myDiscSize; // disc size
889  int myParticleTextureWidth; // in pixels
890  int myParticleTextureHeight; // in pixels
891  float myShadowOffsetVariable;// shadow constant offset
892  float myShadowOffsetConstant;// sadow line variable offset
893  int myShadowAA; // Antialiasing of shadow edges.
894  bool myUseLightShadowSize; // Shadowmap size source from light
895  int myShadowMapSize; // Shadowmap size or max size
896  int myReflectMapSize; // Reflect map resolution
897  fpreal myReflectMinLevel; // No reflect map below min level
898  int mySelectionListInst; // which selection instance to draw
899  int mySceneAntialias; // scene antialiasing (2^a samples).
900  int myTextureAnisotropy; // Texture anisotropic sampling
901  int myAmbOcclusionLevel; // 1-4, for more occlusion
902  float myAmbOcclusionIntensity; // Vulkan only
903  float myAmbOcclusionScale; // Vulkan only
904  float myAmbOcclusionSpread; // Vulkan only
905  bool myUseRayTrace = false; // Vulkan only
906  bool myUseDenoise = false ; // Vulkan only
907  int myLightSamples; // 1-64, for area/env light sampling
908  float myViewGamma;
909  bool myUseLUT;
910  UT_String myViewLUT;
911  bool myUseOCIO;
912  UT_StringHolder myOCIOColorspace;
913  UT_StringHolder myOCIOLooks;
914  UT_StringHolder myOCIODisplay;
915  UT_StringHolder myOCIOView;
916  exint myOCIOSerial;
917  float myViewBlack;
918  float myViewWhite;
919  int myViewComponents;
920  int myTransparentQuality; // Transparent object layering quality
921  fpreal myDisplacementQuality; // Bias displacement auto-LOD
922  int myVolumeQuality; // Volume slice quality
923  fpreal myVolumeAmbientShadows;// Default intensity of volume ambient shadows
924  int myVolumeBSplines; // Use b-splines for volume interpolation
925  // (-1: never, 0: non-interactive, 1: always)
926  bool myActiveRender; // Is the viewport currently being interacted with?
927  int myClosureSelection; // 0=hide, 1=hull geo only, 2=show
928 
929  fpreal myNormalCuspAngle;
930  int myVertNormalLimit;
931  gr_TangentMethod myTangentMethod;
932 
933  // 2D Textures
934  float myTextureScale; // 0.0-1.0
935  float myDynamicScale; // when dynamic cache adjust is on
936  int myMaxTextureWidth; // in pixels
937  int myMaxTextureHeight; // in pixels
938  int myHDRTextureFormat; // 2=full,1=16FP,0=8b,-1=compressed
939  int myDynamicFormat;
940 
941  // 3D Textures. If mySaveFlags.use2DTextureLimits is true, these are ignored
942  float myTexture3DScale; // 0.0-1.0
943  float myDynamic3DScale; // when dynamic cache adjust is on
944  int myMaxTexture3DWidth; // in pixels
945  int myMaxTexture3DHeight; // in pixels
946  int myMaxTexture3DDepth; // in pixels
947  int myHDRTexture3DFormat; // 2=full,1=16FP,0=8b,-1=compressed
948  int myDynamic3DFormat;
949 
950  int myTextureMemLimitMB; // max single texture size, in MB
951 
952  fpreal myInstancingFraction; // portion of instances to draw, 0..1
953  int myInstancingLimit; // #tris
954  int myInstancingLimitAction; // How to handle over-limit instances
955 
956  fpreal myMinHomeZoom; // minimum area to zoom to when homing
957 
958  GR_DisplayColor myCrtAuxColor; // current auxiliary color
959 
960  char myGotDefaults;
961  UT_String myColorScheme;
962 
963  UT_String myColorAttrib; // Color override parameters
964  int myColorType;
965  fpreal myColorDomain[2];
966 
967  GR_AlphaPass myAlphaPass; // Type of alpha pass
968  GR_DecorFontSize myDecorFontSize;
969 
970  fpreal myAgentLODBias;
971  int myAgentMinPoints;
972  int myAgentBaseLOD;
973  int myAgentMaxLOD;
974  int myAgentBoneDeform;
975  int myAgentWireMode;
976 
977  int myOnionSkinPreFrameCount;
978  int myOnionSkinPostFrameCount;
979  int myOnionSkinFrameInc;
980  UT_Color myOnionSkinPreFrameColor;
981  UT_Color myOnionSkinPostFrameColor;
982  fpreal myOnionSkinAlpha;
983 
984  gr_BBoxMode myBBoxMode;
985  int mySubdPolyLimit;
986 
987  UT_StringHolder myUVAttrib;
988 
989  static UT_SymbolMap<GR_SchemeColors *> *ourSchemeDefaults;
990  static UT_Array<GR_CommonDispOption *> ourInstancesArray;
991 
992  GR_HandleParts myHandleParts;
993 
994  struct grSaveFlags
995  {
996  unsigned drawTexture :1,
997  drawTransparent :1,
998  drawDisplacement :1,
999  drawTexturedSpots :1,
1000  highQualityLighting:1,
1001  ambientOcclusion :1,
1002  limitTextureSize :1,
1003  limitTexture3DSize :1,
1004  mipMapTextures :1,
1005  hdrRender :1,
1006  drawShadows :1,
1007  drawTransparentMaps:1,
1008  removeBackface :1,
1009  correctBG :1,
1010  frameTime :1,
1011  fillSelection :1,
1012  solidOnly :1, // Only draw solid geometry.
1013  // Don't bother with shading
1014  // information (normals, etc).
1015  drawPartSprite :1, // draw particles as sprites
1016  orientDiscs :1, // draw particles as sprites
1017 
1018  drawPartOrigin :1, // draw particle origin
1019  drawHandles :1, // draw handles
1020  drawHullsOnly :1,
1021  showObjectSelection:1, // object selection highlight
1022 
1023  shadeOpenCurves :1, // shade open curve in shaded
1024  displayAsSubdiv :1, // display as subdiv
1025  overrideColorAttrib:1, // override Cd attribute
1026  use2DTexLimits :1, // 3D tex use 2D tex settings
1027  dynamicTexControl :1, // dynamic texture cache
1028  reduceTex2D :1, // controls - auto reduction of
1029  reduceTex3D :1, // quality when resources are
1030  reduceMipMap :1, // low.
1031  reduceBitDepth :1, //
1032  drawDiffuse :1,
1033  drawAmbient :1,
1034  drawEmission :1,
1035  useLighting :1,
1036  pointInstancing :1,
1037  polygonConvexQuality:1,
1038  autoDPIScale :1, // auto-set DPI scale
1039  volumeWireAsPoints :1,
1040  pickWireAsSolid :1, // pick wire prims as solid
1041  wireOverPacked :1, // draw wire-over for packed geo
1042  agentLODEnable :1,
1043  agentBlendShapes :1,
1044  characterDeform :1, // deform APEX characters
1045  onionSkinEnable :1, // global onion skinning flag
1046  cuspNormals :1,
1047  enableReflectionMaps:1, // cubemap gen for refl obj
1048  hdrReflectionMaps :1, // 8b or fp16 refl cubmaps
1049  showGeoColor :1, // show or ignore Cd on geometry
1050  interactiveEnable :1, // interactive mode is on
1051  optPackedGeo :1, // optimize packed geo for GL
1052  outlineSelection :1, // Outline obj/lop selections
1053  offsetVertexDecor :1,
1054  showMaterials:1; // If materials are shown
1055  };
1056  grSaveFlags mySaveFlags; // flags that get saved
1057 
1058  struct grNoSaveFlags
1059  {
1060  unsigned snapToSelected :1, // snap to selection
1061  showComponentSelections :1, // draw geometry component
1062  showTempSelections :1, // draw temporary or cooked
1063  // selections?
1064  pickFrontFaces :1, // pick front-facing polygons
1065  pickBackFaces :1, // pick back-facing polygons
1066  drawAuxColors :1, // draw auxilary colors for
1067  // things like prim axes
1068  forceWireColor :1, // use wire color for wire
1069  shadingOpenCurves :1, // shade open curves
1070  drawMultiTexture :1, // mat layers in GUI_DispOpts
1071  dynamicMipSetting :1,
1072  interactive :1, // interactively moving
1073  deferTexLoad :1, // allow deferred texture loads
1074  applyVisualizers :1; // master visualization toggle
1075  };
1076 
1077  // These option can be auto-set by Houdini, so it is important to keep
1078  // track of whether they have been manually set or loaded from defaults/hip
1079  // so that they are not overwritten by the auto-set.
1080  struct gr_UpdatedOptions
1081  {
1082  bool texSize;
1083  bool tex3DSize;
1084  bool shadowSize;
1085  bool reflectSize;
1086  bool hdrTexture;
1087  bool hdrReflect;
1088  bool smoothLines;
1089  bool sceneAA;
1090  bool textureMem;
1091  bool guideFont;
1092  bool dpiScale;
1093  } myUpdates;
1094 
1095  grNoSaveFlags myNoSaveFlags; // flags that don't get saved
1096 
1097  int myVisContext; // vis context (viewport index)
1098  // assigned by vis manager.
1099  bool myLopsView;
1100  int myUniqueID;
1101  int mySerialNum;
1102  int mySerialView;
1103  int mySerialView2;
1104  int mySerialID;
1105  int *myGammaPassPtr; // ptr to gamma pass flag which
1106  // can be changed during render
1107  const GR_LightList *myLightList;
1108  static bool theYUp;
1109 
1110  bool myAllowPartialRender;
1111  bool myIsPartialRender;
1112  fpreal myPartialPercentDone;
1113  GR_MaterialAtlas *myExtraMaterials = nullptr;
1114  int myParentViewportID = -1;
1115 };
1116 
1117 inline void
1119 {
1120  float lod = (l>0.0) ? l : 0.001;
1121  if(myLOD != lod)
1122  {
1123  myLOD = lod;
1124  mySerialNum++;
1125  }
1126 }
1127 
1128 inline void
1130 {
1131  if(myColorAttrib != a)
1132  {
1133  myColorAttrib.harden(a);
1134  mySerialNum++;
1135  }
1136 }
1137 
1138 inline void
1140 {
1141  if(myColorType != t)
1142  {
1143  myColorType = t;
1144  mySerialNum ++;
1145  }
1146 }
1147 
1148 inline void
1150 {
1151  if(!SYSisEqual(myColorDomain[0], s) ||
1152  !SYSisEqual(myColorDomain[1], e))
1153  {
1154  myColorDomain[0] = s;
1155  myColorDomain[1] = e;
1156  mySerialNum ++;
1157  }
1158 }
1159 
1160 
1161 #undef FLAG_ACCESSORS
1162 
1163 #endif
void setPointSize(float size)
void allowPartialRender(bool allowed)
fpreal getAgentLODBias() const
void shadowOffsetVariable(float f)
int textureMemLimitMB() const
void setVisContext(int ctxt)
#define SYSmax(a, b)
Definition: SYS_Math.h:1582
void setLightList(const GR_LightList *list)
void shadowOffsetConstant(float f)
int getOnionSkinPostFrameCount() const
bool defaultGuideFont() const
fpreal DPIScale() const
fpreal getVolumeAmbientShadows() const
void offsetVertexDecor(bool use_offset)
void setMinHomeZoom(fpreal val)
fpreal reflectionMinLevel() const
fpreal getPartialPercentDone() const
void setHDRRendering(bool hdr)
const char * getViewLUT() const
GR_API int getMaxTexture3DSize(RE_RenderContext rc)
fpreal getMarkerSize() const
int getSubdivisionPolyLimit() const
#define GET_ALPHA(func, val)
void interiorWireAlpha(float a)
float getPointSize() const
const UT_StringHolder & getUVDisplayAttrib() const
void
Definition: png.h:1083
void setAgentMinPoints(int minp)
bool isOnionSkinEnabled() const
fpreal getAlpha(GR_DisplayColorAlpha alpha_name) const
bool getUseRayTrace() const
GR_ParticleType
Definition: GR_Defines.h:155
const UT_Color & getCurrentWireColor() const
int getVolumeBSplines() const
void limitTexture3DSize(bool ls)
int getInstancingLimit() const
bool allowDeferredTextureLoad() const
bool defaultDPIScale() const
float shadowOffsetVariable() const
float interiorWireAlpha() const
float getViewGamma() const
GR_DisplayColor
void setMarkerSize(fpreal size)
void reflectionMinLevel(fpreal lvl)
bool defaultHDRTexture() const
bool offsetVertexDecor() const
void obsoleteOption(bool onoff)
int64 exint
Definition: SYS_Types.h:125
void setViewSerialNum(int num, int num_2d, int id)
bool hdrReflectionMaps() const
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
static void setYUp(bool up)
GLdouble s
Definition: glad.h:3009
int getTransparentQuality() const
bool obsoleteOption() const
float hlOffsetConstant() const
bool allowsPartialRender() const
void getColorDomain(fpreal &s, fpreal &e) const
void setUseRayTrace(bool enable)
const GR_LightList * getLightList() const
int getViewComponents() const
fpreal getDisplacementQuality() const
const char * getOCIOLooks() const
bool useReflectionMaps() const
GLdouble GLdouble GLdouble q
Definition: glad.h:2445
bool defaultSmoothLines() const
float hlOffsetVariable() const
fpreal getInstancingFraction() const
GR_AlphaPass
Definition: GR_Defines.h:123
float fpreal32
Definition: SYS_Types.h:200
void wireBlend(float blend)
GR_MaterialAtlas * extraMaterials() const
Temporary container for either a RV_Render and an RE_Render.
int getView3DSerialNum() const
void setInstancingLimitAction(int action)
int getVertexNormalLimit() const
void shadedBoundingBoxes(gr_BBoxMode m)
const UT_Color & getOnionSkinPostFrameColor() const
void reflectionMapSize(int wh)
bool defaultShadowSize() const
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4949
GR_AlphaPass alphaPass() const
void textureMemLimitMB(int max_size)
float shadowOffsetConstant() const
void hlOffsetVariable(float f)
void setColorAttrib(const char *a)
fpreal vectorScale() const
GLfloat f
Definition: glcorearb.h:1926
void setGammaPassPtr(int *p)
void setSubdivisionPolyLimit(int limit)
fpreal markerSize() const
int getAmbOcclusionLevel() const
#define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG)
float getAmbOcclusionIntensity() const
int getAgentMinPoints() const
GR_HandleParts & handleParts()
float getAmbOcclusionSpread() const
void setDecorFontSize(GR_DecorFontSize s)
void setOCIOSerial(exint serial)
int getOnionSkinPreFrameCount() const
float getViewBlack() const
#define FLAG_ACCESSORS(FLAGS, METHOD, FLAG)
GU_SelectionRule
Definition: GU_SelectType.h:40
void setWireWidth(float width)
const GR_HandleParts & handleParts() const
void volumeWireAsPoints(bool vw)
gr_TangentMethod generateTangents() const
void setParentViewportID(int id)
const char * getOCIOColorspace() const
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
Definition: UT_Vector3.h:1057
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
bool defaultSceneAA() const
GLint GLuint mask
Definition: glcorearb.h:124
const UT_Color & getColor(GR_DisplayColor color_name, bool gamma=false) const
fpreal getNormalCuspAngle() const
int getAgentBaseLODLevel() const
void harden()
Take shallow copy and make it deep.
Definition: UT_String.h:222
float getViewWhite() const
void setExtraMaterials(GR_MaterialAtlas *materials)
GR_DecorFontSize
Definition: GR_Defines.h:202
#define GR_API
Definition: GR_API.h:10
bool limitTextureSize() const
bool volumeWireAsPoints() const
void alphaPass(GR_AlphaPass pass)
void hlOffsetConstant(float f)
GLuint id
Definition: glcorearb.h:655
bool defaultTextureSize() const
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:112
int getAgentBoneDeform() const
void setNormalCuspAngle(fpreal a)
bool defaultHDRReflect() const
GLuint const GLchar * name
Definition: glcorearb.h:786
unsigned pickMask() const
bool optimizePackedGeometry() const
float getWireWidth() const
bool isPartialRender() const
void setVolumeBSplines(int bs)
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
void setUVDisplayAttrib(const UT_StringHolder &attrib)
void setOnionSkinEnable(bool enable)
void setAmbOcclusionLevel(int lvl)
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate active
const UT_Color & crtAuxColor() const
GLdouble t
Definition: glad.h:2397
GA_PrimCompat::TypeMask primMask() const
const char * getOCIODisplay() const
GR_API int getMaxTextureSize(RE_RenderContext rc)
void setDisplacementQuality(fpreal q)
int getDynamic3DFormat() const
GLenum mode
Definition: glcorearb.h:99
float getAmbOcclusionScale() const
void generateTangents(gr_TangentMethod method)
void setInstancingLimit(int limit)
void setInstancingFraction(fpreal s)
int getAgentNumLODLevels() const
int selectionListInst() const
bool getDynamicMipMap() const
void setOCIOLooks(const char *looks)
Contains transitional objects to provide some backward compatibility for code that references old GEO...
void setAmbOcclusionIntensity(float i)
GLsizeiptr size
Definition: glcorearb.h:664
const UT_String & visibleObjects() const
bool default3DTextureSize() const
void allowDeferredTextureLoad(bool a)
void hdrReflectionMaps(bool e)
void setUseLightShadowSize(bool e)
bool getHDRRendering() const
const char * colorAttrib() const
int getOnionSkinFrameIncrement() const
float selectionWireWidth() const
#define GET_COL(func, val)
void setOCIOColorspace(const char *cs)
GLuint color
Definition: glcorearb.h:1261
void selectionListInst(int inst)
void setVertexNormalLimit(int poly_limit)
fpreal64 fpreal
Definition: SYS_Types.h:278
void setActiveRender(bool active)
void useReflectionMaps(bool e)
void setAmbOcclusionScale(float sc)
bool getActiveRender() const
float normalScale() const
LeafData & operator=(const LeafData &)=delete
int getInstancingLimitAction() const
void setAgentWireMode(int mode)
GR_DisplayColorAlpha
const UT_Color & locateColor(fpreal &alpha) const
int getSceneAntialias() const
void primMask(GA_PrimCompat::TypeMask mask)
bool useLightShadowSize() const
void setUseDenoise(bool enable)
void pickMask(unsigned mask)
GLuint GLfloat * val
Definition: glcorearb.h:1608
float getNormalScale() const
fpreal getMinHomeZoom() const
void limitTextureSize(bool ls)
void setTransparentQuality(int q)
const UT_Color & getOnionSkinPreFrameColor() const
void setAmbOcclusionSpread(float sc)
void setColorDomain(fpreal s, fpreal e)
GLint GLsizei width
Definition: glcorearb.h:103
void setAgentBaseLODLevel(int lvl)
gr_BBoxMode shadedBoundingBoxes() const
int parentViewportID() const
void setOCIODisplayView(const char *display, const char *view)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
GLboolean r
Definition: glcorearb.h:1222
void setViewLUT(const char *lut)
fpreal getOnionSkinAlpha() const
int reflectionMapSize() const
void setPartialPercentDone(fpreal p)
bool defaultReflectSize() const
const UT_String & getColorScheme() const
int getView2DSerialNum() const
const UT_Color & color(GR_DisplayColor c) const
RE_TextureCompress
void visibleObjects(const char *mask)
bool limitTexture3DSize() const
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
Definition: UT_Vector2.h:674
GR_DecorFontSize getDecorFontSize() const
exint getOCIOSerial() const
GLint lod
Definition: glcorearb.h:2765
bool defaultTextureMem() const
const char * getOCIOView() const
fpreal getVectorScale() const
void setVolumeAmbientShadows(fpreal q)
void setAgentNumLODLevels(int lvls)
GLenum src
Definition: glcorearb.h:1793