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