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