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(void) 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(snapshotColor, GR_SNAPSHOT_COLOR)
126  GET_COL(selLabelColor, GR_SELECTED_LABEL_COLOR)
127  GET_COL(selPillTextColor, GR_SELECTED_PILL_TEXT_COLOR)
128  GET_COL(selPillBGColor, GR_SELECTED_PILL_BG_COLOR)
129  GET_COL(selPillOutlineColor, GR_SELECTED_PILL_OUTLINE_COLOR)
130  GET_COL(overlayLabelColor, GR_OVERLAY_LABEL_COLOR)
131  GET_COL(auxOverlayLabelColor, GR_AUX_OVERLAY_LABEL_COLOR)
132  GET_COL(handlePivotColor, GR_HANDLE_PIVOT_COLOR)
133  GET_COL(handleAxisColor, GR_HANDLE_AXIS_COLOR)
134  GET_COL(handlePlaneAxisColor, GR_HANDLE_PLANE_AXIS_COLOR)
135  GET_COL(handleTumbleSphereColor, GR_HANDLE_TUMBLE_SPHERE_COLOR)
136  GET_COL(handleTracerColor, GR_HANDLE_TRACER_COLOR)
137  GET_COL(handleDeltaTextColor, GR_HANDLE_DELTA_TEXT_COLOR)
138  GET_COL(handleDeltaTextShadowColor, GR_HANDLE_DELTA_TEXT_SHADOW_COLOR)
139  GET_COL(handleBendColor, GR_HANDLE_BEND_COLOR)
140  GET_COL(handleTwistColor, GR_HANDLE_TWIST_COLOR)
141  GET_COL(cplaneHandleXlateColor, GR_CPLANE_HANDLE_XLATE_COLOR)
142  GET_COL(cplaneHandleRotateColor, GR_CPLANE_HANDLE_ROTATE_COLOR)
143  GET_COL(cplaneHandleBorderColor, GR_CPLANE_HANDLE_BORDER_COLOR)
144  GET_COL(orthoGridColor, GR_ORTHO_GRID_COLOR)
145  GET_COL(orthoGridOriginColor, GR_ORTHO_GRID_ORIGIN_COLOR)
146  GET_COL(uvGridColor, GR_UV_GRID_COLOR)
147  GET_COL(uvGridOriginColor, GR_UV_GRID_ORIGIN_COLOR)
148  GET_COL(uvGridBoundaryColor, GR_UV_GRID_BOUNDARY_COLOR)
149  GET_COL(objSelectColor, GR_OBJECT_SELECT_COLOR)
150  GET_COL(objCurrentColor, GR_OBJECT_CURRENT_COLOR)
151  GET_COL(objSelectHintColor, GR_OBJECT_SELECT_HINT_COLOR)
152  GET_COL(objGhostColor, GR_OBJECT_GHOST_COLOR)
153  GET_COL(uvBackFaceFillColor, GR_UV_BACKFACE_FILL_COLOR)
154  GET_COL(uvOverlapFillColor, GR_UV_OVERLAP_FILL_COLOR)
155  GET_COL(uvSelBackFaceFillColor, GR_SELECTED_UV_BACKFACE_FILL_COLOR)
156  GET_COL(ikCriticalZoneColor, GR_IK_CRITICAL_ZONE_COLOR)
157  GET_COL(viewMaskOverlayColor, GR_VIEW_MASK_OVERLAY_COLOR)
158  GET_COL(cameraMaskColor, GR_CAMERA_MASK_COLOR)
159  GET_COL(cameraOverlayColor, GR_CAMERA_OVERLAY_COLOR)
160  GET_COL(textColor, GR_TEXT_COLOR)
161  GET_COL(textShadowColor, GR_TEXT_SHADOW_COLOR)
162  GET_COL(geoWarningColor, GR_GEO_WARNING_COLOR)
163  GET_COL(selectBoxOuterLineColor, GR_SELECTBOX_OUTER_LINE_COLOR)
164  GET_COL(selectBoxInnerLineColor, GR_SELECTBOX_INNER_LINE_COLOR)
165  GET_COL(selectBoxFillColor, GR_SELECTBOX_FILL_COLOR)
166  GET_COL(handleLocateColor, GR_HANDLE_LOCATE_COLOR)
167  GET_COL(handleLocatePassiveColor, GR_HANDLE_LOCATE_PASSIVE_COLOR)
168  GET_COL(objectNameColor, GR_OBJECT_NAME_COLOR)
169  GET_COL(pointTrailColor, GR_POINT_TRAIL_COLOR)
170  GET_COL(selPointTrailColor, GR_POINT_TRAIL_SELECTED_COLOR)
171  GET_COL(renderBorderColor, GR_RENDER_BORDER_COLOR)
172  GET_COL(renderInactiveBorderColor, GR_RENDER_INACTIVE_BORDER_COLOR)
173  GET_COL(renderTextColor, GR_RENDER_TEXT_COLOR)
174  GET_COL(renderLocateColor, GR_RENDER_LOCATE_COLOR)
175  GET_COL(renderBarColor, GR_RENDER_BAR_COLOR)
176  GET_COL(flattenPinColor, GR_FLATTEN_PIN_COLOR)
177  GET_COL(flattenPinSelColor, GR_FLATTEN_PIN_SELECTED_COLOR)
178  GET_COL(flattenInitialPinColor, GR_FLATTEN_INITIAL_PIN_COLOR)
179  GET_COL(messageColor, GR_MESSAGE_COLOR)
180  GET_COL(promptColor, GR_PROMPT_COLOR)
181  GET_COL(warningColor, GR_WARNING_COLOR)
182  GET_COL(errorColor, GR_ERROR_COLOR)
183  GET_COL(successColor, GR_SUCCESS_COLOR)
184  GET_COL(overlayBackgroundColor, GR_OVERLAY_BACKGROUND_COLOR)
185  GET_COL(boundaryColor, GR_BOUNDARY_COLOR)
186  GET_COL(edgeTipColor, GR_EDGE_TIP_COLOR)
187  GET_COL(viewPivotFGColor, GR_VIEW_PIVOT_FG_COLOR)
188  GET_COL(viewPivotBGColor, GR_VIEW_PIVOT_BG_COLOR)
189  GET_COL(bboxOutlineColor, GR_BBOX_OUTLINE_COLOR)
190  GET_COL(bboxSolidColor, GR_BBOX_SOLID_COLOR)
191  GET_COL(backfaceTint, GR_BACKFACE_TINT_COLOR)
192  GET_COL(overviewViewRegionColor, GR_OVERVIEW_VIEW_REGION_COLOR)
193  GET_COL(overviewWinRegionColor, GR_OVERVIEW_WIN_REGION_COLOR)
194  GET_COL(overviewNominalWinRegionColor, GR_OVERVIEW_NOMINAL_WIN_REGION_COLOR)
195 
196  const UT_Color &wireColor() const
197  { return myCurrentWireColor[myGammaPassPtr?*myGammaPassPtr:0]; }
198  const UT_Color &crtAuxColor() const
199  { return myColors[myCrtAuxColor][myGammaPassPtr?*myGammaPassPtr:0]; }
200 
202  {
203  alpha = myAlphas[GR_LOCATE_ALPHA];
204  return myColors[GR_LOCATE_COLOR][myGammaPassPtr?*myGammaPassPtr:0];
205  }
206  void componentLocateColor(int component_type,
207  GU_SelectionRule sel_rule,
208  UT_Color &clr, fpreal &alpha) const;
209  void componentLocateNearColor(UT_Color &clr, fpreal &alpha) const;
210 
211 #undef GET_COL
212 
214  { return myAlphas[alpha_name]; }
215  bool getAlphaByName(const char *name, fpreal &alpha);
216 #define GET_ALPHA(func, val) fpreal func() const { return myAlphas[val]; }
217  GET_ALPHA(objGhostAlpha, GR_OBJECT_GHOST_ALPHA)
218  GET_ALPHA(selectBoxFillAlpha, GR_SELECTBOX_ALPHA)
219  GET_ALPHA(cplaneAlpha, GR_CPLANE_ALPHA)
220  GET_ALPHA(cplaneLineAlpha, GR_CPLANE_LINE_ALPHA)
221  GET_ALPHA(cplaneLineFadedAlpha, GR_CPLANE_LINE_FADED_ALPHA)
222  GET_ALPHA(gridLineAlpha, GR_GRID_LINE_ALPHA)
223  GET_ALPHA(gridLineFadedAlpha, GR_GRID_LINE_FADED_ALPHA)
224  GET_ALPHA(handleLocateAlpha, GR_HANDLE_LOCATE_ALPHA)
225  GET_ALPHA(handleAxisLocateAlpha, GR_HANDLE_AXIS_LOCATE_ALPHA)
226  GET_ALPHA(handleTumbleSphereAlpha, GR_HANDLE_TUMBLE_SPHERE_ALPHA)
227  GET_ALPHA(handleTracerFillAlpha, GR_HANDLE_TRACER_FILL_ALPHA);
228  GET_ALPHA(fillSelectionAlpha, GR_FILL_SELECTION_ALPHA)
229  GET_ALPHA(fillSelectionWireOverAlpha, GR_FILL_SELECTION_WIRE_OVER_ALPHA)
230  GET_ALPHA(uvFillAlpha, GR_UV_FILL_ALPHA)
231  GET_ALPHA(uvOverlapFillAlpha, GR_UV_OVERLAP_FILL_ALPHA)
232  GET_ALPHA(overlayBackgroundAlpha, GR_OVERLAY_BACKGROUND_ALPHA)
233  GET_ALPHA(pillMenuBGAlpha, GR_PILL_MENU_BG_ALPHA)
234  GET_ALPHA(selPillMenuBGAlpha, GR_SELECTED_PILL_MENU_BG_ALPHA)
235  GET_ALPHA(bboxOutlineAlpha, GR_BBOX_OUTLINE_ALPHA)
236  GET_ALPHA(bboxSolidAlpha, GR_BBOX_SOLID_ALPHA)
237  GET_ALPHA(backfaceTintBlend, GR_BACKFACE_TINT_ALPHA)
238 #undef GET_ALPHA
239 
240  const GR_HandleParts &handleParts() const { return myHandleParts; }
241  GR_HandleParts &handleParts() { return myHandleParts; }
242 
243  GR_DecorFontSize getDecorFontSize() const { return myDecorFontSize; }
244  void setDecorFontSize(GR_DecorFontSize s){myDecorFontSize=s;}
245 
246  fpreal markerSize() const { return myMarkerSize*myDPIScale; }
248  { return myMarkerSize; }
250  { myMarkerSize = SYSmax(size, 0.1); }
251 
252  // Methods for accessing (setting/getting) the various flags.
253  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawTexture, drawTexture)
254  FLAG_ACCESSORS_BUMP_OPTS(myNoSaveFlags, drawMultiTexture, drawMultiTexture)
255  FLAG_ACCESSORS(mySaveFlags, drawTransparent, drawTransparent)
256  FLAG_ACCESSORS(mySaveFlags, drawDisplacement, drawDisplacement)
257  FLAG_ACCESSORS(mySaveFlags, drawTexturedSpots, drawTexturedSpots)
258  FLAG_ACCESSORS(mySaveFlags, drawShadows, drawShadows)
259  FLAG_ACCESSORS(mySaveFlags, drawTransparentMaps, drawTransparentMaps)
260  FLAG_ACCESSORS(mySaveFlags, highQualityLighting, highQualityLighting)
261  FLAG_ACCESSORS(mySaveFlags, drawDiffuse, drawDiffuse)
262  FLAG_ACCESSORS(mySaveFlags, drawAmbient, drawAmbient)
263  FLAG_ACCESSORS(mySaveFlags, drawEmission, drawEmission)
264  FLAG_ACCESSORS(mySaveFlags, useLighting, useLighting)
265  FLAG_ACCESSORS(mySaveFlags, ambientOcclusion, ambientOcclusion)
266  FLAG_ACCESSORS(mySaveFlags, removeBackface, removeBackface)
267  FLAG_ACCESSORS(mySaveFlags, fillSelection, fillSelection)
268  FLAG_ACCESSORS(mySaveFlags, solidOnly, solidOnly)
269  FLAG_ACCESSORS(mySaveFlags, correctBG, correctBG)
270  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, polygonConvexQuality,
271  polygonConvexQuality)
272  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawPartSprite, drawPartSprite)
273  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, orientDiscs, orientDiscs)
274 
275  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, shadeOpenCurves, shadeOpenCurves)
276  FLAG_ACCESSORS(mySaveFlags, displayAsSubdiv, displayAsSubdiv)
277 
278  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawHullsOnly, drawHullsOnly)
279  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, drawPartOrigin, drawPartOrigin)
280  FLAG_ACCESSORS(mySaveFlags, drawHandles, drawHandles)
281  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, showObjectSelection,
282  showObjectSelection)
283 
284  FLAG_ACCESSORS(mySaveFlags, use2DLimitsFor3D, use2DTexLimits)
285  FLAG_ACCESSORS(mySaveFlags, dynamicTexControl, dynamicTexControl)
286  FLAG_ACCESSORS(mySaveFlags, dynamicReduceTex2D, reduceTex2D )
287  FLAG_ACCESSORS(mySaveFlags, dynamicReduceTex3D, reduceTex3D )
288  FLAG_ACCESSORS(mySaveFlags, dynamicReduceMipMap, reduceMipMap )
289  FLAG_ACCESSORS(mySaveFlags, dynamicReduceBitDepth, reduceBitDepth )
290 
291  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, overrideColorAttrib,
292  overrideColorAttrib);
293  FLAG_ACCESSORS(mySaveFlags, pickWireAsSolid, pickWireAsSolid)
294  FLAG_ACCESSORS(mySaveFlags, wireOverPacked, wireOverPacked)
295  FLAG_ACCESSORS(mySaveFlags, showGeoColor, showGeoColor )
296 
297  FLAG_ACCESSORS(myNoSaveFlags, applyVisualizers, applyVisualizers)
298  FLAG_ACCESSORS(myNoSaveFlags, snapToSelected, snapToSelected)
299  FLAG_ACCESSORS(myNoSaveFlags, showComponentSelections, showComponentSelections)
300 
301  // NB: This flag is somewhat overloaded. At SOPs it determines whether
302  // we're showing the temporary or cook selections. At DOPs it also
303  // indicates whether we're drawing temporary DETAIL selections.
304  FLAG_ACCESSORS(myNoSaveFlags, showTempSelections, showTempSelections)
305 
306  FLAG_ACCESSORS(myNoSaveFlags, pickFrontFaces, pickFrontFaces)
307  FLAG_ACCESSORS(myNoSaveFlags, pickBackFaces, pickBackFaces)
308  FLAG_ACCESSORS_BUMP_OPTS(myNoSaveFlags, drawAuxColors, drawAuxColors)
309  FLAG_ACCESSORS_BUMP_OPTS(myNoSaveFlags, forceWireColor, forceWireColor)
310  FLAG_ACCESSORS(myNoSaveFlags, shadingOpenCurves, shadingOpenCurves)
311 
312  // This returns true if the interactive mode display option is on
313  FLAG_ACCESSORS(mySaveFlags, interactiveEnable, interactiveEnable)
314 
315  // This returns true if the user is interactively moving a handle or
316  // tumbling, independent of the interative enable flag.
317  FLAG_ACCESSORS(myNoSaveFlags, interactiveMove, interactive)
318 
319  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, pointInstancing, pointInstancing)
320 
321  FLAG_ACCESSORS(mySaveFlags, cuspNormals, cuspNormals)
322  fpreal getNormalCuspAngle() const
323  { return myNormalCuspAngle; }
325  { myNormalCuspAngle = SYSclamp(a, 0.0, 180.0); }
327  { return myVertNormalLimit; }
328  void setVertexNormalLimit(int poly_limit)
329  { myVertNormalLimit = SYSmax(0, poly_limit); }
330 
331 
332  bool limitTextureSize() const { return mySaveFlags.limitTextureSize; }
333  void limitTextureSize(bool ls){ mySaveFlags.limitTextureSize = ls;
334  myUpdates.texSize = true; }
335 
336  bool limitTexture3DSize() const { return mySaveFlags.limitTexture3DSize; }
337  void limitTexture3DSize(bool ls){ mySaveFlags.limitTexture3DSize = ls;
338  myUpdates.tex3DSize = true; }
339 
340  int textureMemLimitMB() const { return myTextureMemLimitMB; }
341  void textureMemLimitMB(int max_size)
342  { myTextureMemLimitMB = SYSmax(32, max_size);
343  myUpdates.textureMem = true; }
344 
345  // Specifies the anisotropic sampling for textures. getTextureAnisotropy()
346  // must be called when rendering, to check for the GL extension.
347  int getTextureAnisotropy(RE_Render *r) const;
348  int textureAnisotropy() const;
349  void textureAnisotropy(int ta);
350 
351  // Always use the version of getHDRTextureFormat() with RE_Render * when
352  // rendering, to ensure hardware compatibility with the format.
353  RE_TextureCompress getHDRTextureFormat(RE_Render *r) const;
354  int getHDRTextureFormat() const;
355  void setHDRTextureFormat(int hdrformat); // 2 = full HDR, 1=16b HDR, 0=8b
356  void setDynamicFormat(int format); // -1 = compressed 8b
357  int getDynamicFormat() const { return myDynamicFormat; }
358 
359 
360  RE_TextureCompress getHDRTexture3DFormat(RE_Render *r) const;
361  int getHDRTexture3DFormat() const;
362  void setHDRTexture3DFormat(int hdrformat); // 2 = full HDR, 1=16b HDR, 0=8b
363  void setDynamic3DFormat(int format);
364  int getDynamic3DFormat() const { return myDynamic3DFormat; }
365 
366  // Scale all textures down
367  void setTextureScale(float sc); // 0.0 (min size) to 1.0 (full size)
368  float getTextureScale() const; // texture scale is applied before limit
369  float getUserTextureScale() const; // texture scale w/o dynamics applied
370  void setDynamicScale(float sc); // For dynamic cache control
371  float getDynamicScale() const;
372 
373  void setTexture3DScale(float sc); // 0.0 (min size) to 1.0 (full size)
374  float getTexture3DScale() const; // texture scale is applied before limit
375  float getUserTexture3DScale() const;// texture scale w/o dynamics applied
376  void setDynamic3DScale(float sc); // For dynamic cache control
377  float getDynamic3DScale() const;
378 
379  // Maximum particle array texture size
380  void setParticleTextureSize(int max_w, int max_h);
381  void getParticleTextureSize(int &max_w, int &max_h) const;
382 
383  void setParticleDisplayType(GR_ParticleType t);
384  GR_ParticleType particleDisplayType() const;
385 
386  // Limit texture resolution
387  void setMaxTextureSize(bool limit, int max_w=0, int max_h=0);
388  void getMaxTextureSize(int &max_w, int &max_h) const;
389  void getMaxTextureSize(RE_Render *r, int &max_w, int &max_h) const;
390 
391  void setMaxTexture3DSize(bool limit, int max_w=0, int max_h=0, int max_d=0);
392  void getMaxTexture3DSize(int &max_w, int &max_h, int &max_d) const;
393  void getMaxTexture3DSize(RE_Render *r, int &max_w, int &max_h,
394  int &max_d) const;
395 
396  bool mipMapTextures() const;
397  void mipMapTextures(bool onoff);
398  void setDynamicMipMap(bool onoff);
399  bool getDynamicMipMap() const { return myNoSaveFlags.dynamicMipSetting; }
400 
401  void resetDynamicParms();
402 
403  bool getHighQualityLighting(RE_Render *r) const;
404 
405  void alphaPass(GR_AlphaPass pass) { myAlphaPass = pass; }
406  GR_AlphaPass alphaPass() const { return myAlphaPass; }
407 
408  int getTransparentQuality() const { return myTransparentQuality; }
409  void setTransparentQuality(int q) { myTransparentQuality=SYSclamp(q,-1,2); }
410 
411  fpreal getDisplacementQuality() const { return myDisplacementQuality; }
413  { myDisplacementQuality=SYSclamp(q,0.0,10.0); }
414 
415  int getLightSampling() const { return myLightSamples; }
416  void setLightSampling(int s) { myLightSamples = SYSclamp(s,1,100); }
417 
418  int getVolumeQuality() const { return myVolumeQuality; }
419  void setVolumeQuality(int q) { myVolumeQuality = SYSclamp(q,0,3); }
420 
421  bool volumeWireAsPoints() const { return false; }
422  void volumeWireAsPoints(bool vw){ }
423 
424  // DPI support.
425  void DPIScale(fpreal f) { myDPIScale = f; }
426  fpreal DPIScale() const { return myDPIScale; }
427 
428  void autoDPIScale(bool dpi);
429  bool autoDPIScale() const { return mySaveFlags.autoDPIScale; }
430 
431  // Reflection cube maps
432  bool useReflectionMaps() const
433  { return mySaveFlags.enableReflectionMaps; }
434  void useReflectionMaps(bool e)
435  { mySaveFlags.enableReflectionMaps = e; }
436  bool hdrReflectionMaps() const
437  { return mySaveFlags.hdrReflectionMaps; }
438  void hdrReflectionMaps(bool e)
439  { myUpdates.hdrReflect = true;
440  mySaveFlags.hdrReflectionMaps = e; }
441  int reflectionMapSize() const { return myReflectMapSize; }
442  void reflectionMapSize(int wh)
443  { myUpdates.reflectSize = true;
444  myReflectMapSize = SYSclamp(wh, 16, 16384); }
445  fpreal reflectionMinLevel() const { return myReflectMinLevel; }
447  { myReflectMinLevel = SYSclamp(lvl, 0.0, 1.0); }
448 
449  // Agents
450  FLAG_ACCESSORS_BUMP_OPTS(mySaveFlags, agentLODEnable, agentLODEnable)
451 
452  void setAgentLODBias(fpreal b)
453  {
454  if(!SYSisEqual(b, myAgentLODBias))
455  mySerialNum++;
456  myAgentLODBias = b;
457  }
458  fpreal getAgentLODBias() const { return myAgentLODBias; }
459 
460  void setAgentMinPoints(int minp) { myAgentMinPoints = SYSmax(1, minp); }
461  int getAgentMinPoints() const { return myAgentMinPoints; }
462 
463  void setAgentNumLODLevels(int lvls) { myAgentMaxLOD=SYSclamp(lvls,1,16);}
464  int getAgentNumLODLevels() const { return myAgentMaxLOD; }
465 
466  void setAgentBaseLODLevel(int lvl)
467  {
468  if(lvl != myAgentBaseLOD)
469  mySerialNum++;
470  myAgentBaseLOD=SYSclamp(lvl,0,16);
471  }
472  int getAgentBaseLODLevel() const { return myAgentBaseLOD; }
473 
474  void setAgentBoneDeform(int d) { myAgentBoneDeform = SYSclamp(d,0,2); }
475  int getAgentBoneDeform() const { return myAgentBoneDeform; }
476 
477  int getAgentWireMode() const { return myAgentWireMode; }
479  {
480  mode = SYSclamp(mode,0,1);
481  if(mode != myAgentWireMode)
482  {
483  mySerialNum++;
484  myAgentWireMode = mode;
485  }
486  }
487 
488  void optimizePackedGeometry(bool opt){ mySaveFlags.optPackedGeo = opt; }
489  bool optimizePackedGeometry() const { return mySaveFlags.optPackedGeo; }
490 
491  void offsetVertexDecor(bool use_offset)
492  { mySaveFlags.offsetVertexDecor = use_offset; }
493  bool offsetVertexDecor() const
494  { return mySaveFlags.offsetVertexDecor; }
495 
497  {
501  CURRENT_SHADING_BBOX // follow the current shading mode
502  };
503  void shadedBoundingBoxes(gr_BBoxMode m) { myBBoxMode = m; }
504  gr_BBoxMode shadedBoundingBoxes() const { return myBBoxMode; }
505 
506  // "Get" methods:
507  const UT_String &
508  visibleObjects() const { return myVisibleObjects; }
509  GA_PrimCompat::TypeMask primMask() const { return myPrimMask; }
510  unsigned pickMask() const { return myPickMask; }
511  float normalScale() const { return myNormalScale; }
512  float getNormalScale() const { return myNormalScale; }
513  fpreal vectorScale() const { return myVectorScale; }
514  fpreal getVectorScale() const { return myVectorScale; }
515  float LOD() const { return myLOD; }
516  float hlOffsetVariable() const { return myHLOffsetVariable; }
517  float hlOffsetConstant() const { return myHLOffsetConstant; }
518  float wireWidth() const { return SYSmax(0.1,
519  myWireWidth*myDPIScale); }
520  float selectionWireWidth()const { return (wireWidth() > 1.0)
521  ? wireWidth() + 1.0
522  : wireWidth() * 2.0; }
523  float getWireWidth() const { return myWireWidth; }
524  float wireBlend() const { return SYSclamp(myWireBlend,
525  0.0, 1.0); }
526  float interiorWireAlpha() const { return myInteriorWireAlpha; }
527  float pointSize() const { return myPointSize*myDPIScale; }
528  float getPointSize() const { return myPointSize; }
529  float discSize() const { return myDiscSize; }
530  float shadowOffsetVariable() const { return myShadowOffsetVariable; }
531  float shadowOffsetConstant() const { return myShadowOffsetConstant; }
532  int shadowAA() const { return myShadowAA; }
533  bool useLightShadowSize() const { return myUseLightShadowSize; }
534  int getShadowMapSize() const { return myShadowMapSize; }
535  int selectionListInst() const { return mySelectionListInst; }
536 
537  const char *colorAttrib() const { return myColorAttrib; }
538  int colorType() const { return myColorType; }
539  void getColorDomain(fpreal &s, fpreal &e) const
540  { s = myColorDomain[0];
541  e = myColorDomain[1]; }
542 
543  int getSceneAntialias() const { return mySceneAntialias; }
544  bool getHDRRendering() const { return mySaveFlags.hdrRender; }
545  float getViewGamma() const { return myViewGamma; }
546  bool useViewLUT() const { return myUseLUT; }
547  const char *getViewLUT() const { return myViewLUT; }
548  bool useOCIO() const { return myUseOCIO; }
549  const char *getOCIOColorspace() const { return myOCIOColorspace; }
550  const char *getOCIOLooks() const { return myOCIOLooks; }
551  float getViewBlack() const { return myViewBlack; }
552  float getViewWhite() const { return myViewWhite; }
553  int getViewComponents() const { return myViewComponents; }
554 
555  int getAmbOcclusionLevel() const { return myAmbOcclusionLevel; }
556 
557  fpreal getInstancingFraction() const { return myInstancingFraction; }
558  int getInstancingLimit() const { return myInstancingLimit; }
560  { return myInstancingLimitAction; }
561 
562  fpreal getMinHomeZoom() const { return myMinHomeZoom; }
563 
564  // In millions of polygons (eg, 10 for 10M).
565  int getSubdivisionPolyLimit() const { return mySubdPolyLimit; }
566 
567  // "Set" methods:
568  void visibleObjects(const char *mask)
569  { myVisibleObjects.harden(mask); }
571  { myPrimMask = mask; }
572  void pickMask(unsigned mask) { myPickMask = mask; }
573  void setNormalScale(float s);
574  void setVectorScale(float s);
575 
576  void useRegularAuxColor() { myCrtAuxColor=GR_AUX_GEO_COLOR; }
578 
579  void setCurrentWireColor(const UT_Color &color);
580  void setCurrentWireColor(GR_DisplayColor color);
581  const UT_Color &getCurrentWireColor() const { return myCurrentWireColor[0]; }
582 
583  void LOD(float l);
584  void hlOffsetVariable(float f) { myHLOffsetVariable = (f>=0.0f)
585  ? f :0.0f;}
586  void hlOffsetConstant(float f) { myHLOffsetConstant = (f>=0.0f)
587  ? f :0.0f;}
588  void setWireWidth(float width) { myWireWidth = width;}
589  void wireBlend(float blend) { myWireBlend = blend;}
590  void interiorWireAlpha(float a) { myInteriorWireAlpha
591  = SYSclamp(a, 0.0f, 1.0f); }
592  void setPointSize(float size) { myPointSize = size; }
593  void discSize(float size) { myDiscSize = size; }
595  { myShadowOffsetVariable = (f>=0.0f) ? f : 0.0f;}
597  { myShadowOffsetConstant = (f>=0.0f) ? f : 0.0f;}
598  void shadowAA(int aa) { myShadowAA = SYSclamp(aa, 1,4); }
599  void selectionListInst(int inst) { mySelectionListInst = inst; }
600  void setUseLightShadowSize(bool e) { myUseLightShadowSize = e; }
601  void setShadowMapSize(int s) { myShadowMapSize = s;
602  myUpdates.shadowSize = true; }
603 
604  void setColorAttrib(const char *a);
605  void setColorType(int t);
606  void setColorDomain(fpreal s, fpreal e);
607 
608  void setSceneAntialias(int a) { mySceneAntialias = SYSmax(a,2);
609  myUpdates.sceneAA = true; }
610 
611  void setHDRRendering(bool hdr) { mySaveFlags.hdrRender = hdr; }
612 
613  void setViewGamma(float gamma);
614  void setUseViewLUT(bool b) { myUseLUT = b; }
615  void setViewLUT(const char *lut) { myViewLUT.harden(lut); }
616  void useOCIO(bool use) { myUseOCIO = use; }
617  void setOCIOColorspace(const char *cs)
618  { myOCIOColorspace.harden(cs); }
619  void setOCIOLooks(const char *looks)
620  { myOCIOLooks.harden(looks); }
621  void setViewBlack(float b) { myViewBlack = b; }
622  void setViewWhite(float w) { myViewWhite = w; }
623  void setViewComponents(int c) { myViewComponents = c; }
624  void setAmbOcclusionLevel(int lvl)
625  { myAmbOcclusionLevel = SYSclamp(lvl, 1, 4); }
626 
628  { if(!SYSisEqual(s, myInstancingFraction))
629  mySerialNum++;
630  myInstancingFraction = s; }
632  { limit = SYSmax(0, limit);
633  if(!SYSisEqual(limit, myInstancingLimit))
634  mySerialNum++;
635  myInstancingLimit = limit;
636  }
637  void setInstancingLimitAction(int action)
638  { myInstancingLimitAction = SYSclamp(action, 0,2); }
639 
641  { myMinHomeZoom = SYSmax(val, 0.001); }
642 
643  // In millions of polygons (eg, 10 for 10M).
645  {
646  limit = SYSmax(0, limit);
647  if(limit != mySubdPolyLimit)
648  mySerialNum++;
649  mySubdPolyLimit = limit;
650  }
651 
653  {
654  if(myUVAttrib != attrib)
655  {
656  mySerialNum++;
657  myUVAttrib = attrib;
658  }
659  }
660  const UT_StringHolder &getUVDisplayAttrib() const { return myUVAttrib; }
661 
662  // Onion skinning
663  bool isOnionSkinEnabled() const
664  { return mySaveFlags.onionSkinEnable; }
666  { return myOnionSkinFrameInc; }
668  { return myOnionSkinPreFrameCount; }
670  { return myOnionSkinPostFrameCount; }
672  { return myOnionSkinPreFrameColor; }
674  { return myOnionSkinPostFrameColor; }
675  fpreal getOnionSkinAlpha() const { return myOnionSkinAlpha; }
676 
678  { mySaveFlags.onionSkinEnable = enable; }
679 
680  void setOnionSkinParms(int frame_inc,
681  int pre_count,
682  int post_count,
683  UT_Color pre_color,
684  UT_Color post_color,
685  fpreal alpha);
686 
687  // These are used to determine if geometry-related parms have changed on a
688  // very coarse level.
689  int getUniqueID() const { return myUniqueID; }
690  int getSerialNum() const { return mySerialNum; }
691 
692  // changes when the view is changed. ID changes if the rendered viewport
693  // is different.
694  int getViewSerialNum() const { return mySerialView; }
695  int getViewSerialID() const { return mySerialID; }
696  void setViewSerialNum(int s, int id)
697  {
698  mySerialView = s;
699  mySerialID = id;
700  }
701 
702  bool isLopsView() const { return myLopsView; }
703 
704  bool defaultTextureSize() const { return !myUpdates.texSize; }
705  bool default3DTextureSize() const{ return !myUpdates.tex3DSize; }
706  bool defaultShadowSize() const { return !myUpdates.shadowSize; }
707  bool defaultReflectSize() const { return !myUpdates.reflectSize; }
708  bool defaultHDRTexture() const { return !myUpdates.hdrTexture; }
709  bool defaultHDRReflect() const { return !myUpdates.hdrReflect; }
710  bool defaultSmoothLines() const { return !myUpdates.smoothLines; }
711  bool defaultSceneAA() const { return !myUpdates.sceneAA; }
712  bool defaultTextureMem() const { return !myUpdates.textureMem; }
713  bool defaultGuideFont() const { return !myUpdates.guideFont; }
714  bool defaultDPIScale() const { return !myUpdates.dpiScale; }
715 
716  // Turns on the closure selection on hull-based or all geometry
717  int closureSelection() const { return myClosureSelection; }
718  void closureSelection(int s) { myClosureSelection=SYSclamp(s,0,2); }
719 
720  int getVisContext() const { return myVisContext; }
721  void setVisContext(int ctxt) { myVisContext = ctxt; }
722 
723  // dummy callbacks for obsolete options.
724  bool obsoleteOption() const { return false; }
725  void obsoleteOption(bool onoff) {}
726 
727  static void setYUp(bool up) { theYUp = up; }
728  static bool isYUp() { return theYUp; }
729 
730  // Some looks can render progressively. This reports if this is a) allowed
731  // and b) whether the viewport is currently only partially rendered.
732  bool isPartialRender() const { return myIsPartialRender; }
733  void clearPartialRender() { myIsPartialRender = false; }
734  void setPartialRender() { myIsPartialRender = true; }
735  void allowPartialRender(bool allowed)
736  { myAllowPartialRender = allowed; }
737  bool allowsPartialRender() const
738  { return myAllowPartialRender; }
740  { myPartialPercentDone = p; }
742  {
743  return myIsPartialRender ? myPartialPercentDone
744  : 100.0;
745  }
746  void setLightList(const RE_LightList *list) {myLights=list;}
747  const RE_LightList *getLightList() const { return myLights; }
748 
749 private:
750  void loadDefaultColors();
751  void getColorsByName();
752 
753  // data
754  UT_Color myColors[GR_NUM_DISPLAY_COLORS][2];
755  fpreal myAlphas[GR_NUM_DISPLAY_ALPHAS];
756  UT_Color myCurrentWireColor[2];
757 
758  UT_String myVisibleObjects; // Visibility mask
759  GA_PrimCompat::TypeMask myPrimMask; // What types of prims to draw
760  unsigned myPickMask; // What geo entities to pick
761 
762  fpreal myMarkerSize; // point,vertex,breakpoint marker diam
763  float myNormalScale; // A size to scale the normal by
764  fpreal myVectorScale; // Scale custom vectors
765  float myLOD; // level of detail
766  float myHLOffsetVariable; // hidden line constant offset
767  float myHLOffsetConstant; // hidden line variable offset
768  float myWireWidth;
769  fpreal32 myWireBlend;
770  fpreal32 myInteriorWireAlpha;
771  GR_ParticleType myParticleDisplayType;
772  fpreal myDPIScale; // DPI scale factor
773  float myPointSize; // point size in pixels
774  float myDiscSize; // disc size
775  int myParticleTextureWidth; // in pixels
776  int myParticleTextureHeight; // in pixels
777  float myShadowOffsetVariable;// shadow constant offset
778  float myShadowOffsetConstant;// sadow line variable offset
779  int myShadowAA; // Antialiasing of shadow edges.
780  bool myUseLightShadowSize; // Shadowmap size source from light
781  int myShadowMapSize; // Shadowmap size or max size
782  int myReflectMapSize; // Reflect map resolution
783  fpreal myReflectMinLevel; // No reflect map below min level
784  int mySelectionListInst; // which selection instance to draw
785  int mySceneAntialias; // scene antialiasing (2^a samples).
786  int myTextureAnisotropy; // Texture anisotropic sampling
787  int myAmbOcclusionLevel; // 1-4, for more occlusion
788  int myLightSamples; // 1-64, for area/env light sampling
789  float myViewGamma;
790  bool myUseLUT;
791  UT_String myViewLUT;
792  bool myUseOCIO;
793  UT_String myOCIOColorspace;
794  UT_String myOCIOLooks;
795  float myViewBlack;
796  float myViewWhite;
797  int myViewComponents;
798  int myTransparentQuality; // Transparent object layering quality
799  fpreal myDisplacementQuality; // Bias displacement auto-LOD
800  int myVolumeQuality; // Volume slice quality
801  int myClosureSelection; // 0=hide, 1=hull geo only, 2=show
802 
803  fpreal myNormalCuspAngle;
804  int myVertNormalLimit;
805 
806  // 2D Textures
807  float myTextureScale; // 0.0-1.0
808  float myDynamicScale; // when dynamic cache adjust is on
809  int myMaxTextureWidth; // in pixels
810  int myMaxTextureHeight; // in pixels
811  int myHDRTextureFormat; // 2=full,1=16FP,0=8b,-1=compressed
812  int myDynamicFormat;
813 
814  // 3D Textures. If mySaveFlags.use2DTextureLimits is true, these are ignored
815  float myTexture3DScale; // 0.0-1.0
816  float myDynamic3DScale; // when dynamic cache adjust is on
817  int myMaxTexture3DWidth; // in pixels
818  int myMaxTexture3DHeight; // in pixels
819  int myMaxTexture3DDepth; // in pixels
820  int myHDRTexture3DFormat; // 2=full,1=16FP,0=8b,-1=compressed
821  int myDynamic3DFormat;
822 
823  int myTextureMemLimitMB; // max single texture size, in MB
824 
825  fpreal myInstancingFraction; // portion of instances to draw, 0..1
826  int myInstancingLimit; // #tris
827  int myInstancingLimitAction; // How to handle over-limit instances
828 
829  fpreal myMinHomeZoom; // minimum area to zoom to when homing
830 
831  GR_DisplayColor myCrtAuxColor; // current auxiliary color
832 
833  char myGotDefaults;
834  UT_String myColorScheme;
835 
836  UT_String myColorAttrib; // Color override parameters
837  int myColorType;
838  fpreal myColorDomain[2];
839 
840  GR_AlphaPass myAlphaPass; // Type of alpha pass
841  GR_DecorFontSize myDecorFontSize;
842 
843  fpreal myAgentLODBias;
844  int myAgentMinPoints;
845  int myAgentBaseLOD;
846  int myAgentMaxLOD;
847  int myAgentBoneDeform;
848  int myAgentWireMode;
849 
850  int myOnionSkinPreFrameCount;
851  int myOnionSkinPostFrameCount;
852  int myOnionSkinFrameInc;
853  UT_Color myOnionSkinPreFrameColor;
854  UT_Color myOnionSkinPostFrameColor;
855  fpreal myOnionSkinAlpha;
856 
857  gr_BBoxMode myBBoxMode;
858  int mySubdPolyLimit;
859 
860  UT_StringHolder myUVAttrib;
861 
862  static UT_SymbolMap<GR_SchemeColors *> *ourSchemeDefaults;
863  static UT_Array<GR_CommonDispOption *> ourInstancesArray;
864 
865  GR_HandleParts myHandleParts;
866 
867  struct grSaveFlags
868  {
869  unsigned drawTexture :1,
870  drawTransparent :1,
871  drawDisplacement :1,
872  drawTexturedSpots :1,
873  highQualityLighting:1,
874  ambientOcclusion :1,
875  limitTextureSize :1,
876  limitTexture3DSize :1,
877  mipMapTextures :1,
878  hdrRender :1,
879  drawShadows :1,
880  drawTransparentMaps:1,
881  removeBackface :1,
882  correctBG :1,
883  frameTime :1,
884  fillSelection :1,
885  solidOnly :1, // Only draw solid geometry.
886  // Don't bother with shading
887  // information (normals, etc).
888  drawPartSprite :1, // draw particles as sprites
889  orientDiscs :1, // draw particles as sprites
890 
891  drawPartOrigin :1, // draw particle origin
892  drawHandles :1, // draw handles
893  drawHullsOnly :1,
894  showObjectSelection:1, // object selection highlight
895 
896  shadeOpenCurves :1, // shade open curve in shaded
897  displayAsSubdiv :1, // display as subdiv
898  overrideColorAttrib:1, // override Cd attribute
899  use2DTexLimits :1, // 3D tex use 2D tex settings
900  dynamicTexControl :1, // dynamic texture cache
901  reduceTex2D :1, // controls - auto reduction of
902  reduceTex3D :1, // quality when resources are
903  reduceMipMap :1, // low.
904  reduceBitDepth :1, //
905  drawDiffuse :1,
906  drawAmbient :1,
907  drawEmission :1,
908  useLighting :1,
909  pointInstancing :1,
910  polygonConvexQuality:1,
911  autoDPIScale :1, // auto-set DPI scale
912  volumeWireAsPoints :1,
913  pickWireAsSolid :1, // pick wire prims as solid
914  wireOverPacked :1, // draw wire-over for packed geo
915  agentLODEnable :1,
916  onionSkinEnable :1, // global onion skinning flag
917  cuspNormals :1,
918  enableReflectionMaps:1, // cubemap gen for refl obj
919  hdrReflectionMaps :1, // 8b or fp16 refl cubmaps
920  showGeoColor :1, // show or ignore Cd on geometry
921  interactiveEnable :1, // interactive mode is on
922  optPackedGeo :1, // optimize packed geo for GL
923  offsetVertexDecor :1;
924  };
925  grSaveFlags mySaveFlags; // flags that get saved
926 
927  struct grNoSaveFlags
928  {
929  unsigned snapToSelected :1, // snap to selection
930  showComponentSelections :1, // draw geometry component
931  showTempSelections :1, // draw temporary or cooked
932  // selections?
933  pickFrontFaces :1, // pick front-facing polygons
934  pickBackFaces :1, // pick back-facing polygons
935  drawAuxColors :1, // draw auxilary colors for
936  // things like prim axes
937  forceWireColor :1, // use wire color for wire
938  shadingOpenCurves :1, // shade open curves
939  drawMultiTexture :1, // mat layers in GUI_DispOpts
940  dynamicMipSetting :1,
941  interactive :1, // interactively moving
942  applyVisualizers :1; // master visualization toggle
943  };
944 
945  // These option can be auto-set by Houdini, so it is important to keep
946  // track of whether they have been manually set or loaded from defaults/hip
947  // so that they are not overwritten by the auto-set.
948  struct gr_UpdatedOptions
949  {
950  bool texSize;
951  bool tex3DSize;
952  bool shadowSize;
953  bool reflectSize;
954  bool hdrTexture;
955  bool hdrReflect;
956  bool smoothLines;
957  bool sceneAA;
958  bool textureMem;
959  bool guideFont;
960  bool dpiScale;
961  } myUpdates;
962 
963  grNoSaveFlags myNoSaveFlags; // flags that don't get saved
964 
965  int myVisContext; // vis context (viewport index)
966  // assigned by vis manager.
967  bool myLopsView;
968  int myUniqueID;
969  int mySerialNum;
970  int mySerialView;
971  int mySerialID;
972  int *myGammaPassPtr; // ptr to gamma pass flag which
973  // can be changed during render
974  const RE_LightList *myLights;
975  static bool theYUp;
976 
977  bool myAllowPartialRender;
978  bool myIsPartialRender;
979  fpreal myPartialPercentDone;
980 };
981 
982 inline void
984 {
985  float lod = (l>0.0) ? l : 0.001;
986  if(myLOD != lod)
987  {
988  myLOD = lod;
989  mySerialNum++;
990  }
991 }
992 
993 inline void
995 {
996  if(myColorAttrib != a)
997  {
998  myColorAttrib.harden(a);
999  mySerialNum++;
1000  }
1001 }
1002 
1003 inline void
1005 {
1006  if(myColorType != t)
1007  {
1008  myColorType = t;
1009  mySerialNum ++;
1010  }
1011 }
1012 
1013 inline void
1015 {
1016  if(!SYSisEqual(myColorDomain[0], s) ||
1017  !SYSisEqual(myColorDomain[1], e))
1018  {
1019  myColorDomain[0] = s;
1020  myColorDomain[1] = e;
1021  mySerialNum ++;
1022  }
1023 }
1024 
1025 
1026 #undef FLAG_ACCESSORS
1027 
1028 #endif
void setPointSize(float size)
GLdouble s
Definition: glew.h:1390
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:1447
void shadowOffsetConstant(float f)
int getOnionSkinPostFrameCount() const
bool defaultGuideFont() const
fpreal DPIScale() const
GLuint id
Definition: glew.h:1679
void offsetVertexDecor(bool use_offset)
void setMinHomeZoom(fpreal val)
GLsizeiptr size
Definition: glew.h:1681
fpreal reflectionMinLevel() const
fpreal getPartialPercentDone() const
void setHDRRendering(bool hdr)
GLuint const GLchar * name
Definition: glew.h:1814
const char * getViewLUT() const
fpreal getMarkerSize() const
GLclampf GLclampf GLclampf alpha
Definition: glew.h:1520
int getSubdivisionPolyLimit() const
#define GET_ALPHA(func, val)
void interiorWireAlpha(float a)
float getPointSize() const
const UT_StringHolder & getUVDisplayAttrib() const
GLenum mode
Definition: glew.h:2163
void setAgentMinPoints(int minp)
GLint GLint GLint GLint GLint GLint GLsizei width
Definition: glew.h:1252
bool isOnionSkinEnabled() const
fpreal getAlpha(GR_DisplayColorAlpha alpha_name) const
GR_ParticleType
Definition: GR_Defines.h:133
const UT_Color & getCurrentWireColor() const
void limitTexture3DSize(bool ls)
GLuint const GLfloat * val
Definition: glew.h:2794
int getInstancingLimit() const
bool defaultDPIScale() const
float shadowOffsetVariable() const
float interiorWireAlpha() const
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
float getViewGamma() const
GR_DisplayColor
void setMarkerSize(fpreal size)
void reflectionMinLevel(fpreal lvl)
bool defaultHDRTexture() const
bool offsetVertexDecor() const
void obsoleteOption(bool onoff)
bool hdrReflectionMaps() const
static void setYUp(bool up)
int getTransparentQuality() const
GLint limit
Definition: glew.h:12988
bool obsoleteOption() const
float hlOffsetConstant() const
bool allowsPartialRender() const
void getColorDomain(fpreal &s, fpreal &e) const
const GLdouble * m
Definition: glew.h:9124
GLdouble l
Definition: glew.h:9122
GLenum GLint GLuint mask
Definition: glew.h:1845
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:109
void wireBlend(float blend)
void setInstancingLimitAction(int action)
int getVertexNormalLimit() const
void shadedBoundingBoxes(gr_BBoxMode m)
const UT_Color & getOnionSkinPostFrameColor() const
void reflectionMapSize(int wh)
bool defaultShadowSize() const
GLdouble GLdouble GLdouble GLdouble q
Definition: glew.h:1414
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4648
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 setViewSerialNum(int s, int id)
void setGammaPassPtr(int *p)
void setSubdivisionPolyLimit(int limit)
fpreal markerSize() const
int getAmbOcclusionLevel() const
GLclampf f
Definition: glew.h:3499
#define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG)
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)
const GR_HandleParts & handleParts() const
void volumeWireAsPoints(bool vw)
GLubyte GLubyte GLubyte GLubyte w
Definition: glew.h:1890
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:820
bool defaultSceneAA() const
void
Definition: png.h:1083
const UT_Color & getColor(GR_DisplayColor color_name, bool gamma=false) const
const GLfloat * c
Definition: glew.h:16296
int getAgentBaseLODLevel() const
void harden()
Take shallow copy and make it deep.
Definition: UT_String.h:213
float getViewWhite() const
GR_DecorFontSize
Definition: GR_Defines.h:179
#define GR_API
Definition: GR_API.h:10
bool limitTextureSize() const
bool volumeWireAsPoints() const
void alphaPass(GR_AlphaPass pass)
void hlOffsetConstant(float f)
bool defaultTextureSize() const
int getAgentBoneDeform() const
void setNormalCuspAngle(fpreal a)
bool defaultHDRReflect() const
unsigned pickMask() const
GLuint color
Definition: glew.h:7902
bool optimizePackedGeometry() const
float getWireWidth() const
bool isPartialRender() const
void setUVDisplayAttrib(const UT_StringHolder &attrib)
void setOnionSkinEnable(bool enable)
void setAmbOcclusionLevel(int lvl)
const UT_Color & crtAuxColor() const
GA_PrimCompat::TypeMask primMask() const
void setDisplacementQuality(fpreal q)
int getDynamic3DFormat() const
void setInstancingLimit(int limit)
void setInstancingFraction(fpreal s)
int getAgentNumLODLevels() const
int selectionListInst() const
bool getDynamicMipMap() const
void setOCIOLooks(const char *looks)
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
Contains transitional objects to provide some backward compatibility for code that references old GEO...
GLfloat GLfloat p
Definition: glew.h:16321
void discSize(float size)
const UT_String & visibleObjects() const
bool default3DTextureSize() const
double fpreal
Definition: SYS_Types.h:276
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)
GLint lod
Definition: glew.h:1385
void useReflectionMaps(bool e)
float normalScale() const
int getInstancingLimitAction() const
void setAgentWireMode(int mode)
GR_DisplayColorAlpha
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1254
const UT_Color & locateColor(fpreal &alpha) const
int getSceneAntialias() const
void primMask(GA_PrimCompat::TypeMask mask)
bool useLightShadowSize() const
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
void pickMask(unsigned mask)
float getNormalScale() const
fpreal getMinHomeZoom() const
void limitTextureSize(bool ls)
const UT_String & getColorScheme(void) const
void setTransparentQuality(int q)
const UT_Color & getOnionSkinPreFrameColor() const
void setColorDomain(fpreal s, fpreal e)
void setAgentBaseLODLevel(int lvl)
gr_BBoxMode shadedBoundingBoxes() const
void optimizePackedGeometry(bool opt)
#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_Color & color(GR_DisplayColor c) const
RE_TextureCompress
void visibleObjects(const char *mask)
bool limitTexture3DSize() const
GR_DecorFontSize getDecorFontSize() const
float fpreal32
Definition: SYS_Types.h:195
GLboolean enable
Definition: glew.h:2745
GLdouble GLdouble t
Definition: glew.h:1398
bool defaultTextureMem() const
fpreal getVectorScale() const
void setAgentNumLODLevels(int lvls)