12 #ifndef __GR_CommonDispOption_h__
13 #define __GR_CommonDispOption_h__
30 class GR_SchemeColors;
34 #define FLAG_ACCESSORS(FLAGS, METHOD, FLAG) \
35 bool METHOD() const { return FLAGS.FLAG; } \
36 void METHOD(bool onoff) { FLAGS.FLAG = onoff; }
38 #define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG) \
39 bool METHOD() const { return FLAGS.FLAG; } \
40 void METHOD(bool onoff) { if(FLAGS.FLAG != onoff) mySerialNum++; \
51 bool save(std::ostream &,
int indent=0)
const;
59 void setColorScheme(
const char *scheme_name);
61 static void reloadAllColorSchemes();
70 {
return myColors[
c][myGammaPassPtr?*myGammaPassPtr:0]; }
79 bool gamma =
false)
const
80 {
return myColors[color_name][gamma?1:0]; }
87 #define GET_COL(func, val) \
88 const UT_Color &func() const \
89 { return myColors[val][myGammaPassPtr?*myGammaPassPtr:0]; }
212 {
return myCurrentWireColor[myGammaPassPtr?*myGammaPassPtr:0]; }
214 {
return myColors[myCrtAuxColor][myGammaPassPtr?*myGammaPassPtr:0]; }
221 void componentLocateColor(
int component_type,
229 {
return myAlphas[alpha_name]; }
231 #define GET_ALPHA(func, val) fpreal func() const { return myAlphas[val]; }
267 {
return myMarkerSize; }
269 { myMarkerSize =
SYSmax(size, 0.1); }
279 FLAG_ACCESSORS(mySaveFlags, drawTransparentMaps, drawTransparentMaps)
280 FLAG_ACCESSORS(mySaveFlags, highQualityLighting, highQualityLighting)
291 polygonConvexQuality)
309 FLAG_ACCESSORS(mySaveFlags, dynamicReduceBitDepth, reduceBitDepth )
312 overrideColorAttrib);
319 FLAG_ACCESSORS(myNoSaveFlags, showComponentSelections, showComponentSelections)
324 FLAG_ACCESSORS(myNoSaveFlags, showTempSelections, showTempSelections)
330 FLAG_ACCESSORS(myNoSaveFlags, shadingOpenCurves, shadingOpenCurves)
344 bool cuspNormals()
const
345 {
return mySaveFlags.cuspNormals; }
348 if(c != mySaveFlags.cuspNormals)
351 mySaveFlags.cuspNormals =
c;
355 {
return myNormalCuspAngle; }
362 myNormalCuspAngle =
a;
366 {
return myVertNormalLimit; }
369 poly_limit =
SYSmax(0, poly_limit);
370 if(poly_limit != myVertNormalLimit)
373 myVertNormalLimit = poly_limit;
385 if(myTangentMethod != method)
388 myTangentMethod = method;
395 myUpdates.texSize =
true; }
399 myUpdates.tex3DSize =
true; }
403 { myTextureMemLimitMB =
SYSmax(32, max_size);
404 myUpdates.textureMem =
true; }
409 int textureAnisotropy()
const;
410 void textureAnisotropy(
int ta);
415 int getHDRTextureFormat()
const;
416 void setHDRTextureFormat(
int hdrformat);
417 void setDynamicFormat(
int format);
422 int getHDRTexture3DFormat()
const;
423 void setHDRTexture3DFormat(
int hdrformat);
424 void setDynamic3DFormat(
int format);
428 void setTextureScale(
float sc);
429 float getTextureScale()
const;
430 float getUserTextureScale()
const;
431 void setDynamicScale(
float sc);
432 float getDynamicScale()
const;
434 void setTexture3DScale(
float sc);
435 float getTexture3DScale()
const;
436 float getUserTexture3DScale()
const;
437 void setDynamic3DScale(
float sc);
438 float getDynamic3DScale()
const;
441 void setParticleTextureSize(
int max_w,
int max_h);
442 void getParticleTextureSize(
int &max_w,
int &max_h)
const;
448 void setMaxTextureSize(
bool limit,
int max_w=0,
int max_h=0);
452 void setMaxTexture3DSize(
bool limit,
int max_w=0,
int max_h=0,
int max_d=0);
457 bool mipMapTextures()
const;
458 void mipMapTextures(
bool onoff);
459 void setDynamicMipMap(
bool onoff);
462 void resetDynamicParms();
477 { myDisplacementQuality =
SYSmax(q, 0.0); }
502 void autoDPIScale(
bool dpi);
507 {
return mySaveFlags.enableReflectionMaps; }
509 { mySaveFlags.enableReflectionMaps = e; }
511 {
return mySaveFlags.hdrReflectionMaps; }
513 { myUpdates.hdrReflect =
true;
514 mySaveFlags.hdrReflectionMaps = e; }
517 { myUpdates.reflectSize =
true;
518 myReflectMapSize =
SYSclamp(wh, 16, 16384); }
521 { myReflectMinLevel =
SYSclamp(lvl, 0.0, 1.0); }
542 if(lvl != myAgentBaseLOD)
555 if(mode != myAgentWireMode)
558 myAgentWireMode =
mode;
566 void optimizePackedGeometry(
bool opt){ mySaveFlags.optPackedGeo = opt; }
570 { mySaveFlags.offsetVertexDecor = use_offset; }
572 {
return mySaveFlags.offsetVertexDecor; }
593 float LOD()
const {
return myLOD; }
597 myWireWidth*myDPIScale); }
600 : wireWidth() * 2.0; }
605 float pointSize()
const {
return myPointSize*myDPIScale; }
618 { s = myColorDomain[0];
619 e = myColorDomain[1]; }
639 {
return myAmbOcclusionIntensity; }
641 {
return myAmbOcclusionSpread; }
648 {
return myInstancingLimitAction; }
657 { myVisibleObjects.harden(mask); }
659 { myPrimMask =
mask; }
661 void setNormalScale(
float s);
662 void setVectorScale(
float s);
681 void discSize(
float size);
683 { myShadowOffsetVariable = (f>=0.0f) ? f : 0.0f;}
685 { myShadowOffsetConstant = (f>=0.0f) ? f : 0.0f;}
690 myUpdates.shadowSize =
true; }
692 void setColorAttrib(
const char *
a);
693 void setColorType(
int t);
697 myUpdates.sceneAA =
true; }
701 void setViewGamma(
float gamma);
706 { myOCIOColorspace.harden(cs); }
708 { myOCIOLooks.harden(looks); }
710 { myOCIODisplay = display; myOCIOView = view; }
717 { myAmbOcclusionLevel =
SYSclamp(lvl, 1, 4); }
719 { myAmbOcclusionIntensity =
SYSmax(0.0, i); }
721 { myAmbOcclusionScale =
SYSmax(0.001, sc); }
723 { myAmbOcclusionSpread =
SYSclamp(sc, 0.0, 1.0); }
725 { myUseRayTrace = enable; }
727 { myUseDenoise = enable; }
732 myInstancingFraction =
s; }
734 { limit =
SYSmax(0, limit);
737 myInstancingLimit = limit;
740 { myInstancingLimitAction =
SYSclamp(action, 0,2); }
743 { myMinHomeZoom =
SYSmax(val, 0.001); }
749 if(limit != mySubdPolyLimit)
751 mySubdPolyLimit = limit;
756 if(myUVAttrib != attrib)
766 {
return mySaveFlags.onionSkinEnable; }
768 {
return myOnionSkinFrameInc; }
770 {
return myOnionSkinPreFrameCount; }
772 {
return myOnionSkinPostFrameCount; }
774 {
return myOnionSkinPreFrameColor; }
776 {
return myOnionSkinPostFrameColor; }
780 { mySaveFlags.onionSkinEnable = enable; }
782 void setOnionSkinParms(
int frame_inc,
805 mySerialView2 = num_2d;
835 static bool isYUp() {
return theYUp; }
843 { myAllowPartialRender = allowed; }
845 {
return myAllowPartialRender; }
847 { myPartialPercentDone = p; }
850 return myIsPartialRender ? myPartialPercentDone
856 { myLightList = list;}
860 { myExtraMaterials = materials; }
864 void loadDefaultColors();
865 void getColorsByName();
880 float myHLOffsetVariable;
881 float myHLOffsetConstant;
889 int myParticleTextureWidth;
890 int myParticleTextureHeight;
891 float myShadowOffsetVariable;
892 float myShadowOffsetConstant;
894 bool myUseLightShadowSize;
896 int myReflectMapSize;
898 int mySelectionListInst;
899 int mySceneAntialias;
900 int myTextureAnisotropy;
901 int myAmbOcclusionLevel;
902 float myAmbOcclusionIntensity;
903 float myAmbOcclusionScale;
904 float myAmbOcclusionSpread;
905 bool myUseRayTrace =
false;
906 bool myUseDenoise = false ;
919 int myViewComponents;
920 int myTransparentQuality;
921 fpreal myDisplacementQuality;
923 fpreal myVolumeAmbientShadows;
924 int myVolumeBSplines;
927 int myClosureSelection;
930 int myVertNormalLimit;
931 gr_TangentMethod myTangentMethod;
934 float myTextureScale;
935 float myDynamicScale;
936 int myMaxTextureWidth;
937 int myMaxTextureHeight;
938 int myHDRTextureFormat;
942 float myTexture3DScale;
943 float myDynamic3DScale;
944 int myMaxTexture3DWidth;
945 int myMaxTexture3DHeight;
946 int myMaxTexture3DDepth;
947 int myHDRTexture3DFormat;
948 int myDynamic3DFormat;
950 int myTextureMemLimitMB;
952 fpreal myInstancingFraction;
953 int myInstancingLimit;
954 int myInstancingLimitAction;
971 int myAgentMinPoints;
974 int myAgentBoneDeform;
977 int myOnionSkinPreFrameCount;
978 int myOnionSkinPostFrameCount;
979 int myOnionSkinFrameInc;
984 gr_BBoxMode myBBoxMode;
996 unsigned drawTexture :1,
999 drawTexturedSpots :1,
1000 highQualityLighting:1,
1001 ambientOcclusion :1,
1002 limitTextureSize :1,
1003 limitTexture3DSize :1,
1007 drawTransparentMaps:1,
1021 showObjectSelection:1,
1025 overrideColorAttrib:1,
1027 dynamicTexControl :1,
1037 polygonConvexQuality:1,
1039 volumeWireAsPoints :1,
1043 agentBlendShapes :1,
1047 enableReflectionMaps:1,
1048 hdrReflectionMaps :1,
1050 interactiveEnable :1,
1052 outlineSelection :1,
1053 offsetVertexDecor :1,
1056 grSaveFlags mySaveFlags;
1058 struct grNoSaveFlags
1060 unsigned snapToSelected :1,
1061 showComponentSelections :1,
1062 showTempSelections :1,
1069 shadingOpenCurves :1,
1070 drawMultiTexture :1,
1071 dynamicMipSetting :1,
1074 applyVisualizers :1;
1080 struct gr_UpdatedOptions
1095 grNoSaveFlags myNoSaveFlags;
1105 int *myGammaPassPtr;
1110 bool myAllowPartialRender;
1111 bool myIsPartialRender;
1112 fpreal myPartialPercentDone;
1114 int myParentViewportID = -1;
1120 float lod = (l>0.0) ? l : 0.001;
1131 if(myColorAttrib != a)
1141 if(myColorType != t)
1154 myColorDomain[0] =
s;
1155 myColorDomain[1] = e;
1161 #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)
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
void setAgentMinPoints(int minp)
bool isOnionSkinEnabled() const
int getAgentWireMode() const
void closureSelection(int s)
fpreal getAlpha(GR_DisplayColorAlpha alpha_name) const
bool getUseRayTrace() const
int getDynamicFormat() 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 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 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
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
bool optimizePackedGeometry() const
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 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)
void setTransparentQuality(int q)
const UT_Color & getOnionSkinPreFrameColor() const
void setAmbOcclusionSpread(float sc)
void setColorDomain(fpreal s, fpreal e)
void setLightSampling(int s)
void setAgentBaseLODLevel(int lvl)
gr_BBoxMode shadedBoundingBoxes() const
int parentViewportID() 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)
bool limitTexture3DSize() const
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
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)