12 #ifndef __GR_CommonDispOption_h__
13 #define __GR_CommonDispOption_h__
31 class GR_SchemeColors;
35 #define FLAG_ACCESSORS(FLAGS, METHOD, FLAG) \
36 bool METHOD() const { return FLAGS.FLAG; } \
37 void METHOD(bool onoff) { FLAGS.FLAG = onoff; }
39 #define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG) \
40 bool METHOD() const { return FLAGS.FLAG; } \
41 void METHOD(bool onoff) { if(FLAGS.FLAG != onoff) mySerialNum++; \
52 bool save(std::ostream &,
int indent=0)
const;
60 void setColorScheme(
const char *scheme_name);
62 static void reloadAllColorSchemes();
71 {
return myColors[
c][myGammaPassPtr?*myGammaPassPtr:0]; }
80 bool gamma =
false)
const
81 {
return myColors[color_name][gamma?1:0]; }
88 #define GET_COL(func, val) \
89 const UT_Color &func() const \
90 { return myColors[val][myGammaPassPtr?*myGammaPassPtr:0]; }
217 {
return myCurrentWireColor[myGammaPassPtr?*myGammaPassPtr:0]; }
219 {
return myColors[myCrtAuxColor][myGammaPassPtr?*myGammaPassPtr:0]; }
226 void componentLocateColor(
int component_type,
234 {
return myAlphas[alpha_name]; }
236 #define GET_ALPHA(func, val) fpreal func() const { return myAlphas[val]; }
272 {
return myMarkerSize; }
274 { myMarkerSize =
SYSmax(size, 0.1); }
284 FLAG_ACCESSORS(mySaveFlags, drawTransparentMaps, drawTransparentMaps)
285 FLAG_ACCESSORS(mySaveFlags, highQualityLighting, highQualityLighting)
296 polygonConvexQuality)
314 FLAG_ACCESSORS(mySaveFlags, dynamicReduceBitDepth, reduceBitDepth )
317 overrideColorAttrib);
324 FLAG_ACCESSORS(myNoSaveFlags, showComponentSelections, showComponentSelections)
329 FLAG_ACCESSORS(myNoSaveFlags, showTempSelections, showTempSelections)
335 FLAG_ACCESSORS(myNoSaveFlags, shadingOpenCurves, shadingOpenCurves)
349 bool cuspNormals()
const
350 {
return mySaveFlags.cuspNormals; }
353 if(c != mySaveFlags.cuspNormals)
356 mySaveFlags.cuspNormals =
c;
360 {
return myNormalCuspAngle; }
367 myNormalCuspAngle =
a;
371 {
return myVertNormalLimit; }
374 poly_limit =
SYSmax(0, poly_limit);
375 if(poly_limit != myVertNormalLimit)
378 myVertNormalLimit = poly_limit;
390 if(myTangentMethod != method)
393 myTangentMethod = method;
400 myUpdates.texSize =
true; }
404 myUpdates.tex3DSize =
true; }
408 { myTextureMemLimitMB =
SYSmax(32, max_size);
409 myUpdates.textureMem =
true; }
414 int textureAnisotropy()
const;
415 void textureAnisotropy(
int ta);
420 int getHDRTextureFormat()
const;
421 void setHDRTextureFormat(
int hdrformat);
422 void setDynamicFormat(
int format);
427 int getHDRTexture3DFormat()
const;
428 void setHDRTexture3DFormat(
int hdrformat);
429 void setDynamic3DFormat(
int format);
433 void setTextureScale(
float sc);
434 float getTextureScale()
const;
435 float getUserTextureScale()
const;
436 void setDynamicScale(
float sc);
437 float getDynamicScale()
const;
439 void setTexture3DScale(
float sc);
440 float getTexture3DScale()
const;
441 float getUserTexture3DScale()
const;
442 void setDynamic3DScale(
float sc);
443 float getDynamic3DScale()
const;
450 void setParticleTextureSize(
int max_w,
int max_h);
451 void getParticleTextureSize(
int &max_w,
int &max_h)
const;
457 void setMaxTextureSize(
bool limit,
int max_w=0,
int max_h=0);
461 void setMaxTexture3DSize(
bool limit,
int max_w=0,
int max_h=0,
int max_d=0);
466 bool mipMapTextures()
const;
467 void mipMapTextures(
bool onoff);
468 void setDynamicMipMap(
bool onoff);
471 void resetDynamicParms();
489 { myGSplatsAlphaCulling =
SYSclamp(c, 0.0, 1.0); }
493 { myDisplacementQuality =
SYSmax(q, 0.0); }
511 stride =
SYSmax(1, stride);
512 if (stride != myHeightFieldWireStride)
515 myHeightFieldWireStride =
stride;
528 void autoDPIScale(
bool dpi);
533 {
return mySaveFlags.enableReflectionMaps; }
535 { mySaveFlags.enableReflectionMaps = e; }
537 {
return mySaveFlags.hdrReflectionMaps; }
539 { myUpdates.hdrReflect =
true;
540 mySaveFlags.hdrReflectionMaps = e; }
543 { myUpdates.reflectSize =
true;
544 myReflectMapSize =
SYSclamp(wh, 16, 16384); }
547 { myReflectMinLevel =
SYSclamp(lvl, 0.0, 1.0); }
568 if(lvl != myAgentBaseLOD)
581 if(mode != myAgentWireMode)
584 myAgentWireMode =
mode;
595 void optimizePackedGeometry(
bool opt){ mySaveFlags.optPackedGeo = opt; }
599 { mySaveFlags.offsetVertexDecor = use_offset; }
601 {
return mySaveFlags.offsetVertexDecor; }
622 float LOD()
const {
return myLOD; }
626 myWireWidth*myDPIScale); }
629 : wireWidth() * 2.0; }
634 float pointSize()
const {
return myPointSize*myDPIScale; }
647 { s = myColorDomain[0];
648 e = myColorDomain[1]; }
668 {
return myAmbOcclusionIntensity; }
670 {
return myAmbOcclusionSpread; }
677 {
return myInstancingLimitAction; }
686 { myVisibleObjects.harden(mask); }
688 { myPrimMask =
mask; }
690 void setNormalScale(
float s);
691 void setVectorScale(
float s);
710 void discSize(
float size);
712 { myShadowOffsetVariable = (f>=0.0f) ? f : 0.0f;}
714 { myShadowOffsetConstant = (f>=0.0f) ? f : 0.0f;}
719 myUpdates.shadowSize =
true; }
721 void setColorAttrib(
const char *
a);
722 void setColorType(
int t);
726 myUpdates.sceneAA =
true; }
730 void setViewGamma(
float gamma);
735 { myOCIOColorspace.harden(cs); }
737 { myOCIOLooks.harden(looks); }
739 { myOCIODisplay = display; myOCIOView = view; }
746 { myAmbOcclusionLevel =
SYSclamp(lvl, 1, 4); }
748 { myAmbOcclusionIntensity =
SYSmax(0.0, i); }
750 { myAmbOcclusionScale =
SYSmax(0.001, sc); }
752 { myAmbOcclusionSpread =
SYSclamp(sc, 0.0, 1.0); }
754 { myUseRayTrace = enable; }
756 { myUseDenoise = enable; }
761 myInstancingFraction =
s; }
763 { limit =
SYSmax(0, limit);
766 myInstancingLimit = limit;
769 { myInstancingLimitAction =
SYSclamp(action, 0,2); }
772 { myMinHomeZoom =
SYSmax(val, 0.001); }
778 if(limit != mySubdPolyLimit)
780 mySubdPolyLimit = limit;
785 if(myUVAttrib != attrib)
795 {
return mySaveFlags.onionSkinEnable; }
797 {
return myOnionSkinOptions.myFrameIncrement; }
799 {
return myOnionSkinOptions.myPreFrameCount; }
801 {
return myOnionSkinOptions.myPostFrameCount; }
803 {
return myOnionSkinOptions.myPreFrameColor; }
805 {
return myOnionSkinOptions.myPostFrameColor; }
809 {
return myOnionSkinOptions; }
812 { mySaveFlags.onionSkinEnable = enable; }
814 void setOnionSkinParms(
int frame_inc,
828 myUnusedOnionSkinGroup).exchangeAdd(1);
833 { myUnusedOnionSkinGroup.store(start); }
851 mySerialView2 = num_2d;
881 static bool isYUp() {
return theYUp; }
889 { myAllowPartialRender = allowed; }
891 {
return myAllowPartialRender; }
893 { myPartialPercentDone = p; }
896 return myIsPartialRender ? myPartialPercentDone
902 { myLightList = list;}
906 { myExtraMaterials = materials; }
910 void loadDefaultColors();
911 void getColorsByName();
926 float myHLOffsetVariable;
927 float myHLOffsetConstant;
935 int myParticleTextureWidth;
936 int myParticleTextureHeight;
937 float myShadowOffsetVariable;
938 float myShadowOffsetConstant;
940 bool myUseLightShadowSize;
942 int myReflectMapSize;
944 int mySelectionListInst;
945 int mySceneAntialias;
946 int myTextureAnisotropy;
947 int myAmbOcclusionLevel;
948 float myAmbOcclusionIntensity;
949 float myAmbOcclusionScale;
950 float myAmbOcclusionSpread;
951 bool myUseRayTrace =
false;
952 bool myUseDenoise = false ;
965 int myViewComponents;
966 int myTransparentQuality;
967 fpreal myTransparencyCutoff=0.5;
968 fpreal myGSplatsAlphaCulling=0.01;
969 fpreal myDisplacementQuality;
971 fpreal myVolumeAmbientShadows;
972 int myVolumeBSplines;
974 int myHeightFieldWireStride;
976 int myClosureSelection;
979 int myVertNormalLimit;
980 gr_TangentMethod myTangentMethod;
983 float myTextureScale;
984 float myDynamicScale;
985 int myMaxTextureWidth;
986 int myMaxTextureHeight;
987 int myHDRTextureFormat;
991 float myTexture3DScale;
992 float myDynamic3DScale;
993 int myMaxTexture3DWidth;
994 int myMaxTexture3DHeight;
995 int myMaxTexture3DDepth;
996 int myHDRTexture3DFormat;
997 int myDynamic3DFormat;
999 int myTextureMemLimitMB;
1001 fpreal myInstancingFraction;
1002 int myInstancingLimit;
1003 int myInstancingLimitAction;
1020 int myAgentMinPoints;
1023 int myAgentBoneDeform;
1024 int myAgentWireMode;
1025 int myAgentMaxBlendShapeLOD;
1030 gr_BBoxMode myBBoxMode;
1031 int mySubdPolyLimit;
1042 unsigned drawTexture :1,
1044 drawDisplacement :1,
1045 drawTexturedSpots :1,
1046 highQualityLighting:1,
1047 ambientOcclusion :1,
1048 limitTextureSize :1,
1049 limitTexture3DSize :1,
1053 drawTransparentMaps:1,
1067 showObjectSelection:1,
1071 overrideColorAttrib:1,
1073 dynamicTexControl :1,
1083 polygonConvexQuality:1,
1085 volumeWireAsPoints :1,
1089 agentBlendShapes :1,
1093 enableReflectionMaps:1,
1094 hdrReflectionMaps :1,
1096 interactiveEnable :1,
1098 outlineSelection :1,
1099 offsetVertexDecor :1,
1101 interpolateLayers :1;
1103 grSaveFlags mySaveFlags;
1105 struct grNoSaveFlags
1107 unsigned snapToSelected :1,
1108 showComponentSelections :1,
1109 showTempSelections :1,
1116 shadingOpenCurves :1,
1117 drawMultiTexture :1,
1118 dynamicMipSetting :1,
1121 applyVisualizers :1;
1127 struct gr_UpdatedOptions
1142 grNoSaveFlags myNoSaveFlags;
1152 int *myGammaPassPtr;
1157 bool myAllowPartialRender;
1158 bool myIsPartialRender;
1159 fpreal myPartialPercentDone;
1161 int myParentViewportID = -1;
1167 float lod = (l>0.0) ? l : 0.001;
1178 if(myColorAttrib != a)
1188 if(myColorType != t)
1201 myColorDomain[0] =
s;
1202 myColorDomain[1] = e;
1208 #undef FLAG_ACCESSORS
void setPointSize(float size)
void allowPartialRender(bool allowed)
fpreal getAgentLODBias() const
void shadowOffsetVariable(float f)
int textureMemLimitMB() const
void setVisContext(int ctxt)
void setLightList(const GR_LightList *list)
void shadowOffsetConstant(float f)
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol)
Componentwise equality.
int getOnionSkinPostFrameCount() const
bool defaultGuideFont() const
fpreal getVolumeAmbientShadows() const
void offsetVertexDecor(bool use_offset)
void setMinHomeZoom(fpreal val)
fpreal reflectionMinLevel() const
fpreal getPartialPercentDone() const
void setHDRRendering(bool hdr)
const char * getViewLUT() const
GR_API int getMaxTexture3DSize(RE_RenderContext rc)
fpreal getMarkerSize() const
int getSubdivisionPolyLimit() const
#define GET_ALPHA(func, val)
void interiorWireAlpha(float a)
float getPointSize() const
void setUseViewLUT(bool b)
const UT_StringHolder & getUVDisplayAttrib() const
bool interpolateLayers() const
void setAgentMinPoints(int minp)
void setAgentMaxBlendShapeLODLevel(int lvl)
bool isOnionSkinEnabled() const
int getAgentWireMode() const
const GU_CommonOnionSkinOptions & getOnionSkinParms() const
void closureSelection(int s)
fpreal getAlpha(GR_DisplayColorAlpha alpha_name) const
bool getUseRayTrace() const
int getDynamicFormat() const
int getHeightFieldWireStride() const
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
void setMarkerSize(fpreal size)
void reflectionMinLevel(fpreal lvl)
bool defaultHDRTexture() const
bool offsetVertexDecor() const
void obsoleteOption(bool onoff)
void setViewSerialNum(int num, int num_2d, int id)
bool hdrReflectionMaps() const
GLboolean GLboolean GLboolean GLboolean a
static void setYUp(bool up)
int getTransparentQuality() const
bool autoDPIScale() const
bool obsoleteOption() const
float hlOffsetConstant() const
bool allowsPartialRender() const
void getColorDomain(fpreal &s, fpreal &e) const
void setUseRayTrace(bool enable)
const GR_LightList * getLightList() const
int getViewComponents() const
fpreal getDisplacementQuality() const
const char * getOCIOLooks() const
bool useReflectionMaps() const
GLdouble GLdouble GLdouble q
bool defaultSmoothLines() const
float hlOffsetVariable() const
fpreal getInstancingFraction() const
void useSelectedAuxColor()
void wireBlend(float blend)
GR_MaterialAtlas * extraMaterials() const
Temporary container for either a RV_Render and an RE_Render.
void setAgentBoneDeform(int d)
int getView3DSerialNum() const
void setInstancingLimitAction(int action)
int getVertexNormalLimit() const
void shadedBoundingBoxes(gr_BBoxMode m)
const UT_Color & getOnionSkinPostFrameColor() const
void interpolateLayers(bool do_interp)
void clearPartialRender()
void reflectionMapSize(int wh)
bool defaultShadowSize() const
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
GR_AlphaPass alphaPass() const
void textureMemLimitMB(int max_size)
float shadowOffsetConstant() const
void hlOffsetVariable(float f)
void setColorAttrib(const char *a)
fpreal vectorScale() const
void setGammaPassPtr(int *p)
int getVolumeQuality() const
void setSubdivisionPolyLimit(int limit)
fpreal markerSize() const
int getAmbOcclusionLevel() const
#define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG)
float getAmbOcclusionIntensity() const
int getAgentMinPoints() const
GR_HandleParts & handleParts()
float getAmbOcclusionSpread() const
void setDecorFontSize(GR_DecorFontSize s)
void setOCIOSerial(exint serial)
int getOnionSkinPreFrameCount() const
float getViewBlack() const
#define FLAG_ACCESSORS(FLAGS, METHOD, FLAG)
void setGSplatsAlphaCulling(fpreal c)
void setWireWidth(float width)
const GR_HandleParts & handleParts() const
void setViewWhite(float w)
void volumeWireAsPoints(bool vw)
void setVolumeQuality(int q)
int getViewSerialNum() const
gr_TangentMethod generateTangents() const
void setParentViewportID(int id)
const char * getOCIOColorspace() const
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
GLint GLint GLsizei GLint GLenum format
bool defaultSceneAA() const
GLint GLenum GLboolean GLsizei stride
const UT_Color & getColor(GR_DisplayColor color_name, bool gamma=false) const
fpreal getNormalCuspAngle() const
void useRegularAuxColor()
int getAgentBaseLODLevel() const
void harden()
Take shallow copy and make it deep.
float getViewWhite() const
void setExtraMaterials(GR_MaterialAtlas *materials)
bool limitTextureSize() const
bool volumeWireAsPoints() const
void alphaPass(GR_AlphaPass pass)
void hlOffsetConstant(float f)
bool defaultTextureSize() const
GLfloat GLfloat GLfloat alpha
void setSceneAntialias(int a)
void setViewBlack(float b)
int getAgentBoneDeform() const
void setNormalCuspAngle(fpreal a)
bool defaultHDRReflect() const
GLuint const GLchar * name
void setViewComponents(int c)
unsigned pickMask() const
fpreal getTransparencyCutoff() const
bool optimizePackedGeometry() const
void setTransparencyCutoff(fpreal c)
float getWireWidth() const
bool isPartialRender() const
void setVolumeBSplines(int bs)
GLboolean GLboolean GLboolean b
void setUVDisplayAttrib(const UT_StringHolder &attrib)
void setOnionSkinEnable(bool enable)
int getLightSampling() const
void setAmbOcclusionLevel(int lvl)
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate active
const UT_Color & crtAuxColor() const
GA_PrimCompat::TypeMask primMask() const
const char * getOCIODisplay() const
GR_API int getMaxTextureSize(RE_RenderContext rc)
void setDisplacementQuality(fpreal q)
int getDynamic3DFormat() const
float getAmbOcclusionScale() const
void generateTangents(gr_TangentMethod method)
void setInstancingLimit(int limit)
void setInstancingFraction(fpreal s)
int getAgentNumLODLevels() const
int selectionListInst() const
bool getDynamicMipMap() const
void setOCIOLooks(const char *looks)
Contains transitional objects to provide some backward compatibility for code that references old GEO...
void setAmbOcclusionIntensity(float i)
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)
void setHeightFieldWireStride(int stride)
void selectionListInst(int inst)
void setVertexNormalLimit(int poly_limit)
void setActiveRender(bool active)
void useReflectionMaps(bool e)
void setAmbOcclusionScale(float sc)
bool getActiveRender() const
float normalScale() const
LeafData & operator=(const LeafData &)=delete
int getInstancingLimitAction() const
void setAgentWireMode(int mode)
int getShadowMapSize() const
int closureSelection() const
const UT_Color & locateColor(fpreal &alpha) const
int getSceneAntialias() const
void primMask(GA_PrimCompat::TypeMask mask)
bool useLightShadowSize() const
void setUseDenoise(bool enable)
void pickMask(unsigned mask)
float getNormalScale() const
fpreal getMinHomeZoom() const
void limitTextureSize(bool ls)
int getAgentMaxBlendShapeLODLevel() const
void setTransparentQuality(int q)
const UT_Color & getOnionSkinPreFrameColor() const
void setAmbOcclusionSpread(float sc)
void setColorDomain(fpreal s, fpreal e)
fpreal getGSplatsAlphaCulling() const
void setLightSampling(int s)
void setAgentBaseLODLevel(int lvl)
gr_BBoxMode shadedBoundingBoxes() const
int parentViewportID() const
int getUniqueOnionSkinGroup() const
void setOCIODisplayView(const char *display, const char *view)
GLubyte GLubyte GLubyte GLubyte w
bool getUseDenoise() const
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
void visibleObjects(const char *mask)
void resetUniqueOnionSkinGroup(int start)
bool limitTexture3DSize() const
int getVisContext() const
GR_DecorFontSize getDecorFontSize() const
exint getOCIOSerial() const
bool defaultTextureMem() const
const char * getOCIOView() const
void setShadowMapSize(int s)
int getViewSerialID() const
fpreal getVectorScale() const
void setVolumeAmbientShadows(fpreal q)
void setAgentNumLODLevels(int lvls)