12 #ifndef __GR_CommonDispOption_h__
13 #define __GR_CommonDispOption_h__
29 class GR_SchemeColors;
32 #define FLAG_ACCESSORS(FLAGS, METHOD, FLAG) \
33 bool METHOD() const { return FLAGS.FLAG; } \
34 void METHOD(bool onoff) { FLAGS.FLAG = onoff; }
36 #define FLAG_ACCESSORS_BUMP_OPTS(FLAGS, METHOD, FLAG) \
37 bool METHOD() const { return FLAGS.FLAG; } \
38 void METHOD(bool onoff) { if(FLAGS.FLAG != onoff) mySerialNum++; \
49 bool save(std::ostream &,
int indent=0)
const;
57 void setColorScheme(
const char *scheme_name);
59 static void reloadAllColorSchemes();
68 {
return myColors[c][myGammaPassPtr?*myGammaPassPtr:0]; }
77 bool gamma =
false)
const
78 {
return myColors[color_name][gamma?1:0]; }
82 #define GET_COL(func, val) \
83 const UT_Color &func() const \
84 { return myColors[val][myGammaPassPtr?*myGammaPassPtr:0]; }
207 {
return myCurrentWireColor[myGammaPassPtr?*myGammaPassPtr:0]; }
209 {
return myColors[myCrtAuxColor][myGammaPassPtr?*myGammaPassPtr:0]; }
216 void componentLocateColor(
int component_type,
224 {
return myAlphas[alpha_name]; }
226 #define GET_ALPHA(func, val) fpreal func() const { return myAlphas[val]; }
262 {
return myMarkerSize; }
264 { myMarkerSize =
SYSmax(size, 0.1); }
274 FLAG_ACCESSORS(mySaveFlags, drawTransparentMaps, drawTransparentMaps)
275 FLAG_ACCESSORS(mySaveFlags, highQualityLighting, highQualityLighting)
286 polygonConvexQuality)
304 FLAG_ACCESSORS(mySaveFlags, dynamicReduceBitDepth, reduceBitDepth )
307 overrideColorAttrib);
314 FLAG_ACCESSORS(myNoSaveFlags, showComponentSelections, showComponentSelections)
319 FLAG_ACCESSORS(myNoSaveFlags, showTempSelections, showTempSelections)
325 FLAG_ACCESSORS(myNoSaveFlags, shadingOpenCurves, shadingOpenCurves)
339 bool cuspNormals()
const
340 {
return mySaveFlags.cuspNormals; }
343 if(c != mySaveFlags.cuspNormals)
346 mySaveFlags.cuspNormals = c;
350 {
return myNormalCuspAngle; }
357 myNormalCuspAngle =
a;
361 {
return myVertNormalLimit; }
364 poly_limit =
SYSmax(0, poly_limit);
365 if(poly_limit != myVertNormalLimit)
368 myVertNormalLimit = poly_limit;
380 if(myTangentMethod != method)
383 myTangentMethod = method;
390 myUpdates.texSize =
true; }
394 myUpdates.tex3DSize =
true; }
398 { myTextureMemLimitMB =
SYSmax(32, max_size);
399 myUpdates.textureMem =
true; }
404 int textureAnisotropy()
const;
405 void textureAnisotropy(
int ta);
410 int getHDRTextureFormat()
const;
411 void setHDRTextureFormat(
int hdrformat);
412 void setDynamicFormat(
int format);
417 int getHDRTexture3DFormat()
const;
418 void setHDRTexture3DFormat(
int hdrformat);
419 void setDynamic3DFormat(
int format);
423 void setTextureScale(
float sc);
424 float getTextureScale()
const;
425 float getUserTextureScale()
const;
426 void setDynamicScale(
float sc);
427 float getDynamicScale()
const;
429 void setTexture3DScale(
float sc);
430 float getTexture3DScale()
const;
431 float getUserTexture3DScale()
const;
432 void setDynamic3DScale(
float sc);
433 float getDynamic3DScale()
const;
436 void setParticleTextureSize(
int max_w,
int max_h);
437 void getParticleTextureSize(
int &max_w,
int &max_h)
const;
443 void setMaxTextureSize(
bool limit,
int max_w=0,
int max_h=0);
444 void getMaxTextureSize(
int &max_w,
int &max_h)
const;
445 void getMaxTextureSize(
RE_Render *
r,
int &max_w,
int &max_h)
const;
447 void setMaxTexture3DSize(
bool limit,
int max_w=0,
int max_h=0,
int max_d=0);
448 void getMaxTexture3DSize(
int &max_w,
int &max_h,
int &max_d)
const;
449 void getMaxTexture3DSize(
RE_Render *
r,
int &max_w,
int &max_h,
452 bool mipMapTextures()
const;
453 void mipMapTextures(
bool onoff);
454 void setDynamicMipMap(
bool onoff);
457 void resetDynamicParms();
462 bool getHighQualityLighting(
RE_Render *
r)
const;
472 { myDisplacementQuality=
SYSclamp(q,0.0,10.0); }
497 void autoDPIScale(
bool dpi);
502 {
return mySaveFlags.enableReflectionMaps; }
504 { mySaveFlags.enableReflectionMaps = e; }
506 {
return mySaveFlags.hdrReflectionMaps; }
508 { myUpdates.hdrReflect =
true;
509 mySaveFlags.hdrReflectionMaps = e; }
512 { myUpdates.reflectSize =
true;
513 myReflectMapSize =
SYSclamp(wh, 16, 16384); }
516 { myReflectMinLevel =
SYSclamp(lvl, 0.0, 1.0); }
537 if(lvl != myAgentBaseLOD)
550 if(mode != myAgentWireMode)
553 myAgentWireMode =
mode;
561 void optimizePackedGeometry(
bool opt){ mySaveFlags.optPackedGeo = opt; }
565 { mySaveFlags.offsetVertexDecor = use_offset; }
567 {
return mySaveFlags.offsetVertexDecor; }
588 float LOD()
const {
return myLOD; }
592 myWireWidth*myDPIScale); }
595 : wireWidth() * 2.0; }
600 float pointSize()
const {
return myPointSize*myDPIScale; }
613 { s = myColorDomain[0];
614 e = myColorDomain[1]; }
636 {
return myInstancingLimitAction; }
645 { myVisibleObjects.harden(mask); }
647 { myPrimMask =
mask; }
649 void setNormalScale(
float s);
650 void setVectorScale(
float s);
669 void discSize(
float size);
671 { myShadowOffsetVariable = (f>=0.0f) ? f : 0.0f;}
673 { myShadowOffsetConstant = (f>=0.0f) ? f : 0.0f;}
678 myUpdates.shadowSize =
true; }
680 void setColorAttrib(
const char *
a);
681 void setColorType(
int t);
685 myUpdates.sceneAA =
true; }
689 void setViewGamma(
float gamma);
694 { myOCIOColorspace.harden(cs); }
696 { myOCIOLooks.harden(looks); }
698 { myOCIODisplay = display; myOCIOView = view; }
704 { myAmbOcclusionLevel =
SYSclamp(lvl, 1, 4); }
709 myInstancingFraction =
s; }
711 { limit =
SYSmax(0, limit);
714 myInstancingLimit = limit;
717 { myInstancingLimitAction =
SYSclamp(action, 0,2); }
720 { myMinHomeZoom =
SYSmax(val, 0.001); }
726 if(limit != mySubdPolyLimit)
728 mySubdPolyLimit = limit;
733 if(myUVAttrib != attrib)
743 {
return mySaveFlags.onionSkinEnable; }
745 {
return myOnionSkinFrameInc; }
747 {
return myOnionSkinPreFrameCount; }
749 {
return myOnionSkinPostFrameCount; }
751 {
return myOnionSkinPreFrameColor; }
753 {
return myOnionSkinPostFrameColor; }
757 { mySaveFlags.onionSkinEnable = enable; }
759 void setOnionSkinParms(
int frame_inc,
782 mySerialView2 = num_2d;
812 static bool isYUp() {
return theYUp; }
820 { myAllowPartialRender = allowed; }
822 {
return myAllowPartialRender; }
824 { myPartialPercentDone = p; }
827 return myIsPartialRender ? myPartialPercentDone
833 { myLightList = list;}
837 void loadDefaultColors();
838 void getColorsByName();
853 float myHLOffsetVariable;
854 float myHLOffsetConstant;
862 int myParticleTextureWidth;
863 int myParticleTextureHeight;
864 float myShadowOffsetVariable;
865 float myShadowOffsetConstant;
867 bool myUseLightShadowSize;
869 int myReflectMapSize;
871 int mySelectionListInst;
872 int mySceneAntialias;
873 int myTextureAnisotropy;
874 int myAmbOcclusionLevel;
887 int myViewComponents;
888 int myTransparentQuality;
889 fpreal myDisplacementQuality;
891 fpreal myVolumeAmbientShadows;
892 int myVolumeBSplines;
895 int myClosureSelection;
898 int myVertNormalLimit;
899 gr_TangentMethod myTangentMethod;
902 float myTextureScale;
903 float myDynamicScale;
904 int myMaxTextureWidth;
905 int myMaxTextureHeight;
906 int myHDRTextureFormat;
910 float myTexture3DScale;
911 float myDynamic3DScale;
912 int myMaxTexture3DWidth;
913 int myMaxTexture3DHeight;
914 int myMaxTexture3DDepth;
915 int myHDRTexture3DFormat;
916 int myDynamic3DFormat;
918 int myTextureMemLimitMB;
920 fpreal myInstancingFraction;
921 int myInstancingLimit;
922 int myInstancingLimitAction;
939 int myAgentMinPoints;
942 int myAgentBoneDeform;
945 int myOnionSkinPreFrameCount;
946 int myOnionSkinPostFrameCount;
947 int myOnionSkinFrameInc;
952 gr_BBoxMode myBBoxMode;
964 unsigned drawTexture :1,
967 drawTexturedSpots :1,
968 highQualityLighting:1,
971 limitTexture3DSize :1,
975 drawTransparentMaps:1,
989 showObjectSelection:1,
993 overrideColorAttrib:1,
995 dynamicTexControl :1,
1005 polygonConvexQuality:1,
1007 volumeWireAsPoints :1,
1011 agentBlendShapes :1,
1015 enableReflectionMaps:1,
1016 hdrReflectionMaps :1,
1018 interactiveEnable :1,
1020 outlineSelection :1,
1021 offsetVertexDecor :1,
1024 grSaveFlags mySaveFlags;
1026 struct grNoSaveFlags
1028 unsigned snapToSelected :1,
1029 showComponentSelections :1,
1030 showTempSelections :1,
1037 shadingOpenCurves :1,
1038 drawMultiTexture :1,
1039 dynamicMipSetting :1,
1042 applyVisualizers :1;
1048 struct gr_UpdatedOptions
1063 grNoSaveFlags myNoSaveFlags;
1073 int *myGammaPassPtr;
1078 bool myAllowPartialRender;
1079 bool myIsPartialRender;
1080 fpreal myPartialPercentDone;
1086 float lod = (l>0.0) ? l : 0.001;
1097 if(myColorAttrib != a)
1107 if(myColorType != t)
1120 myColorDomain[0] =
s;
1121 myColorDomain[1] = e;
1127 #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
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)
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)
int getAgentMinPoints() const
GR_HandleParts & handleParts()
void setDecorFontSize(GR_DecorFontSize s)
void setOCIOSerial(exint serial)
int getOnionSkinPreFrameCount() const
float getViewBlack() const
#define FLAG_ACCESSORS(FLAGS, METHOD, FLAG)
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
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
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)
const UT_Color & crtAuxColor() const
GA_PrimCompat::TypeMask primMask() const
const char * getOCIODisplay() const
void setDisplacementQuality(fpreal q)
int getDynamic3DFormat() 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...
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)
bool getActiveRender() const
float normalScale() const
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 setColorDomain(fpreal s, fpreal e)
void setLightSampling(int s)
void setAgentBaseLODLevel(int lvl)
gr_BBoxMode shadedBoundingBoxes() 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)