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=
SYSclamp(q,0.0,10.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; }
646 {
return myInstancingLimitAction; }
655 { myVisibleObjects.harden(mask); }
657 { myPrimMask =
mask; }
659 void setNormalScale(
float s);
660 void setVectorScale(
float s);
679 void discSize(
float size);
681 { myShadowOffsetVariable = (f>=0.0f) ? f : 0.0f;}
683 { myShadowOffsetConstant = (f>=0.0f) ? f : 0.0f;}
688 myUpdates.shadowSize =
true; }
690 void setColorAttrib(
const char *
a);
691 void setColorType(
int t);
695 myUpdates.sceneAA =
true; }
699 void setViewGamma(
float gamma);
704 { myOCIOColorspace.harden(cs); }
706 { myOCIOLooks.harden(looks); }
708 { myOCIODisplay = display; myOCIOView = view; }
714 { myAmbOcclusionLevel =
SYSclamp(lvl, 1, 4); }
716 { myAmbOcclusionIntensity =
SYSmax(0.0, i); }
718 { myAmbOcclusionScale =
SYSmax(0.001, sc); }
720 { myAmbOcclusionSpread =
SYSclamp(sc, 0.0, 1.0); }
725 myInstancingFraction =
s; }
727 { limit =
SYSmax(0, limit);
730 myInstancingLimit = limit;
733 { myInstancingLimitAction =
SYSclamp(action, 0,2); }
736 { myMinHomeZoom =
SYSmax(val, 0.001); }
742 if(limit != mySubdPolyLimit)
744 mySubdPolyLimit = limit;
749 if(myUVAttrib != attrib)
759 {
return mySaveFlags.onionSkinEnable; }
761 {
return myOnionSkinFrameInc; }
763 {
return myOnionSkinPreFrameCount; }
765 {
return myOnionSkinPostFrameCount; }
767 {
return myOnionSkinPreFrameColor; }
769 {
return myOnionSkinPostFrameColor; }
773 { mySaveFlags.onionSkinEnable = enable; }
775 void setOnionSkinParms(
int frame_inc,
798 mySerialView2 = num_2d;
828 static bool isYUp() {
return theYUp; }
836 { myAllowPartialRender = allowed; }
838 {
return myAllowPartialRender; }
840 { myPartialPercentDone = p; }
843 return myIsPartialRender ? myPartialPercentDone
849 { myLightList = list;}
853 { myExtraMaterials = materials; }
857 void loadDefaultColors();
858 void getColorsByName();
873 float myHLOffsetVariable;
874 float myHLOffsetConstant;
882 int myParticleTextureWidth;
883 int myParticleTextureHeight;
884 float myShadowOffsetVariable;
885 float myShadowOffsetConstant;
887 bool myUseLightShadowSize;
889 int myReflectMapSize;
891 int mySelectionListInst;
892 int mySceneAntialias;
893 int myTextureAnisotropy;
894 int myAmbOcclusionLevel;
895 float myAmbOcclusionIntensity;
896 float myAmbOcclusionScale;
897 float myAmbOcclusionSpread;
910 int myViewComponents;
911 int myTransparentQuality;
912 fpreal myDisplacementQuality;
914 fpreal myVolumeAmbientShadows;
915 int myVolumeBSplines;
918 int myClosureSelection;
921 int myVertNormalLimit;
922 gr_TangentMethod myTangentMethod;
925 float myTextureScale;
926 float myDynamicScale;
927 int myMaxTextureWidth;
928 int myMaxTextureHeight;
929 int myHDRTextureFormat;
933 float myTexture3DScale;
934 float myDynamic3DScale;
935 int myMaxTexture3DWidth;
936 int myMaxTexture3DHeight;
937 int myMaxTexture3DDepth;
938 int myHDRTexture3DFormat;
939 int myDynamic3DFormat;
941 int myTextureMemLimitMB;
943 fpreal myInstancingFraction;
944 int myInstancingLimit;
945 int myInstancingLimitAction;
962 int myAgentMinPoints;
965 int myAgentBoneDeform;
968 int myOnionSkinPreFrameCount;
969 int myOnionSkinPostFrameCount;
970 int myOnionSkinFrameInc;
975 gr_BBoxMode myBBoxMode;
987 unsigned drawTexture :1,
990 drawTexturedSpots :1,
991 highQualityLighting:1,
994 limitTexture3DSize :1,
998 drawTransparentMaps:1,
1012 showObjectSelection:1,
1016 overrideColorAttrib:1,
1018 dynamicTexControl :1,
1028 polygonConvexQuality:1,
1030 volumeWireAsPoints :1,
1034 agentBlendShapes :1,
1038 enableReflectionMaps:1,
1039 hdrReflectionMaps :1,
1041 interactiveEnable :1,
1043 outlineSelection :1,
1044 offsetVertexDecor :1,
1047 grSaveFlags mySaveFlags;
1049 struct grNoSaveFlags
1051 unsigned snapToSelected :1,
1052 showComponentSelections :1,
1053 showTempSelections :1,
1060 shadingOpenCurves :1,
1061 drawMultiTexture :1,
1062 dynamicMipSetting :1,
1065 applyVisualizers :1;
1071 struct gr_UpdatedOptions
1086 grNoSaveFlags myNoSaveFlags;
1096 int *myGammaPassPtr;
1101 bool myAllowPartialRender;
1102 bool myIsPartialRender;
1103 fpreal myPartialPercentDone;
1105 int myParentViewportID = -1;
1111 float lod = (l>0.0) ? l : 0.001;
1122 if(myColorAttrib != a)
1132 if(myColorType != t)
1145 myColorDomain[0] =
s;
1146 myColorDomain[1] = e;
1152 #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
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
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)
GA_API const UT_StringHolder up
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 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
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)