Mudbox/preferences.h Source File

preferences.h
Go to the documentation of this file.
1 
2 //**************************************************************************/
3 // Copyright (c) 2008 Autodesk, Inc.
4 // All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Autodesk license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 //
10 //**************************************************************************/
11 // DESCRIPTION:
12 // CREATED: October 2008
13 //**************************************************************************/
14 
15 #include <QtCore/QDir>
16 #include <QtCore/QCoreApplication>
17 
18 namespace mudbox {
19 
20 // Remove Linux's system header clashing defines.
21 #if defined(Bool)
22 #undef Bool
23 #endif
24 
26 {
30 };
31 
33 {
38 };
39 
41 {
42  ePaint = 0,
45 };
46 
48 {
52 };
53 
55 {
57 
58 public:
59  AttributeLocale( Node *pOwner, const QString &sID);
60  AttributeLocale( Node *pOwner, const QString &sID, const QString& cValue );
61  virtual ~AttributeLocale();
62 
63 public:
64  virtual AttributeWidget* CreateEditorWidget( QWidget *pParent, int iWidth );
65 };
66 
70 class MBDLL_DECL Preferences : public Node
71 {
74 public:
75  Preferences( void );
76  ~Preferences( void );
77  void Serialize( Stream & );
78  void ProcessLine( QString &sSrc, QString &sName, QString &sValue );
79  void SavePaths( void );
80  bool LoadPaths( void );
81  QString FindSettings( QString &sDir );
82  QString DefaultDataPath() const;
83 
84  Attribute *RegisterVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, Attribute::AttributeType eType, const QString &sDefaultValue );
85  inline afloatr *RegisterFloatVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, float fDefaultValue ) { return (afloatr *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeFloat, QString("%1").arg(fDefaultValue) ); };
86  inline abool *RegisterBoolVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, bool bDefaultValue ) { return (abool *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeBool, bDefaultValue ? "true" : "false" ); };
87  inline astring *RegisterStringVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, const QString &sDefaultValue ) { return (astring *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeString, sDefaultValue ); };
88  inline acolor *RegisterColorVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, const mudbox::Color &cDefaultValue ) { return (acolor *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeColor, QString("%1 %2 %3 %4").arg(cDefaultValue.r).arg(cDefaultValue.g).arg(cDefaultValue.b).arg(cDefaultValue.a) ); };
89  inline aint *RegisterIntegerVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, int iDefaultValue ) { return (aint *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeInt, QString("%1").arg(iDefaultValue) ); };
90  inline avector *RegisterVectorVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, const mudbox::Vector &vDefaultValue ) { return (avector *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeVector, QString("%f %f %f").arg(vDefaultValue.x).arg(vDefaultValue.y).arg(vDefaultValue.z ) ); };
91  inline aenum *RegisterEnumVariable( const QString &sName, const QString &sCategory, const QString& sNameTr, const QString &sCategoryTr, int iDefaultValue ) { return (aenum *)RegisterVariable( sName, sCategory, sNameTr, sCategoryTr, Attribute::typeEnum, QString("%1").arg(iDefaultValue) ); };
92 
93  void OnNodeEvent( const Attribute &, NodeEventType );
94 
95  const ClassDesc *SelectedMeshRenderer() { return m_pSelectedMeshRenderer; }
96 
97  abool m_bCheckFrustum, m_bMultiThreadRender, m_bHighlightBrushArea;
99  abool m_bFocusWhenEmpty, m_bFocusWhenNotEmpty, m_bZoomWhileFocus;
102 
103  abool m_bRemoveLevels, m_bRemoveOctree;
104  abool m_bSmoothPos, m_bCreateUVs, m_bSmoothUV, m_bPreserveBorders, m_bPreserveUVBorders;
105  abool m_bEnableCreasing, m_bPreserveHardEdges, m_bCreaseHardEdges;
107 
112 
113  aint m_fMinPenPressure, m_fMaxPenPressure;
114  aint m_iGridSize, m_iGridSteps;
125 
129 
132  abool m_bUseDraftRender, m_bShowFrozenVertices;
135  abool m_bHUDProjectedSubdiv, m_bHUDSelected, m_bHUDVisible, m_bHUDFPS, m_bHUDRendered;
137  aint m_iMinutesToAlarm, m_iBuildUpRate;
144 
145  abool m_bSaveIndicator, m_bSelectPicked, m_bLocalFocus;
146 
151 
154  acolor m_cViewportCenter, m_cViewportTop, m_cViewportBottom, m_cViewportFlat, m_cGrid, m_cGridAxis, m_cLocked;
155  acolor m_cSelection, m_cMask, m_cActiveLayer, m_cInactiveLayer, m_cLayerMask, m_cMirrorGrid;
156  acolor m_cSceneInfoBg, m_cFalloffCurve, m_cFalloffHull, m_cFalloffFill;
159  aenum m_eFaceSelectionMode, m_eObjectSelectionMode;
160  float m_aLinearUnitRates[4];
161  astring m_sDefaultObjDir, m_sDefaultMudDir, m_sDefaultStampDir, m_sDefaultStencilDir, m_sDefaultIconDir,
162  m_sDefaultImagePlaneDir, m_sDefaultTextureLayerDir, m_sDefaultPSDDir, m_sDefaultSaveScreenDir;
163  astring m_sLogPath, m_sTempPath, m_sSettingsPath, m_sDataPath;
166 #ifdef WantSendToMax
167 #ifdef WIN32
168  astring m_sMaxInstallPath;
169 #endif
170 #endif
172  abool m_bExpertHidesWest, m_bExpertHidesNorth, m_bExpertHidesSouth, m_bExpertHidesEast, m_bExpertHidesMenu, m_bExpertHidesStatus;
189  abool m_bMUDContainsView, m_bMUDContainsBrush;
190  abool m_bCull, m_bCreateBackup;
192 
194  // map extraction
195  //struct MapExtraction
196  //{
223  //} m_cMapExtraction;
224 
226  //struct DisplacementPreferences
227  //{
230  aint m_iFirstTileIndex, m_iDispUDim;
231  aint m_iMaskChannel, m_iNegativeDisplacementChannel, m_iPositiveDisplacementChannel;
236 // } m_cDisplacement;
237 
240 
242 
246 
248 
250 
254  // Edge bleed overlap can be calculated by two different methods:
255  // Image method: slower than the geometry method, but more accurate.
256  // Geometry method: faster than the Image method, and less accurate.
258  eNone = 0,
259  eImage = 1,
260  eGeometry = 2
261  };
268 
270 
278 
282 
287 
292 
296 
297  // Interaction Mode Preferences
299 
300  // Controls use of two channel textures. Two channel textures (GL_LUMINANCE_ALPHA) save on GPU
301  // memory. Typically we'd always want to use two channel textures, however we're having regressions
302  // on some AMD video cards. Until we have those regressions addressed we'll default to four channel
303  // for now. This attribute is not retroactive, any textures that are already four channel will not
304  // be turned into two channels.
305  //
306  // The number of channels used is internal only. The user only sees four channel textures.
308 
310 
312 
314 
324 
335  {
336  public:
337  Integer(
338  const QString &sName,
339  const QString &sCategory,
340  const QString &sNameTr,
341  const QString &sCategoryTr,
342  unsigned int iDefaultValue,
343  bool bVisible = true
344  );
345  operator unsigned int( void ) const;
347  };
350  {
351  public:
352  Bool( const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, bool bDefaultValue, bool bVisible = true );
353  operator bool( void ) const;
355  };
358  {
359  public:
360  Float( const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, float fDefaultValue, float fMinimum = 0.0f, float fMaximum = 1.0f, bool bVisible = true );
361  operator float( void ) const;
363  };
366  {
367  public:
368  String( const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, const QString &sDefaultValue, bool bVisible = true );
369  operator QString( void ) const;
371  };
374  {
375  public:
376  Color( const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, const mudbox::Color &cDefaultValue, bool bVisible = true );
377  operator mudbox::Color( void ) const;
379  };
382  {
383  public:
384  Vector( const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, const mudbox::Vector &vDefaultValue, bool bVisible = true );
385  operator mudbox::Vector( void ) const;
387  };
390  {
391  public:
392  Enum( const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, int iDefaultValue, bool bVisible = true );
393  operator int( void ) const;
395  };
396 
397  private:
398  QDir m_PreferencesPath;
399  ClassDesc *m_pSelectedMeshRenderer;
400 };
401 
402 }; // end of namespace mudbox
float z
Definition: math.h:340
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
Definition: GLee.h:10762
avector * RegisterVectorVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, const mudbox::Vector &vDefaultValue)
Definition: preferences.h:90
acolor * RegisterColorVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, const mudbox::Color &cDefaultValue)
Definition: preferences.h:88
InactiveLevelDisplay
Definition: preferences.h:47
AttributeLocale m_langhelp
Definition: preferences.h:285
abool m_bExtractDisplacement
Definition: preferences.h:201
Represents a 3D vector or point with S23E8 floating point elements.
Definition: math.h:35
This attribute represents a float value which has a minimum and a maximum value.
Definition: node.h:1020
TiffCompression
Definition: preferences.h:25
astring m_sMayaInstallPath
Definition: preferences.h:165
afloatr m_fCameraDollySensitivity
Definition: preferences.h:126
abool m_bInitialized3DConnexion
3DConnexion
Definition: preferences.h:316
Standard enum attribute, 4 bytes.
Definition: node.h:203
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
astring m_sNormalFileName
Definition: preferences.h:212
Definition: qdir.h:58
aenum m_eInteractionModeSelected
Definition: preferences.h:298
acolor m_cWhatsNewHighlightColor
Definition: preferences.h:179
astring m_sPaintLayerFormat
Paint layer dialog preferences.
Definition: preferences.h:280
abool m_bUseTwoChannelTextures
Definition: preferences.h:307
AttributeLocale m_langui
i18n
Definition: preferences.h:284
Store< mudbox::Vector > m_aMirrorPlanePositions
Definition: preferences.h:149
const ClassDesc * SelectedMeshRenderer()
Definition: preferences.h:95
String attribute, can store any UNICODE text.
Definition: node.h:195
Standard float, 4 bytes.
Definition: node.h:191
This is the base class for most classes in the Mudbox SDK.
Definition: node.h:740
This class represents a float value, appears as an editbox and a slider. See Preferences::Integer for...
Definition: preferences.h:357
NodeEventType
Possible event types when Node::OnNodeEvent is called.
Definition: node.h:148
afloatr m_fPaintBrushOffset
Definition: preferences.h:264
Color attribute, 4xfloat, See Color.
Definition: node.h:199
aint m_iHUDProjectedXSubdivisionLevel
Definition: preferences.h:136
astring m_sHighObjectName
Definition: preferences.h:219
astring m_sDisplacementFileMask
Definition: preferences.h:234
afloatr m_fPressureTreshold
Definition: preferences.h:138
This class is a simple boolean preference, appears as a checkbox. See Preferences::Integer for detail...
Definition: preferences.h:349
Represents a color with four components: red, green, blue, alpha.
Definition: math.h:674
This class holds a simple integer preference.
Definition: preferences.h:334
float y
Definition: math.h:340
This class represents a 3d vector item. See Preferences::Integer for mode details.
Definition: preferences.h:381
float b
Definition: math.h:783
abool m_bUse16bitinternalformat
Definition: preferences.h:267
astring m_sDisplacementFileName
Definition: preferences.h:213
Store< mudbox::Vector > m_aMirrorPlaneNormals
Definition: preferences.h:148
astring * RegisterStringVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, const QString &sDefaultValue)
Definition: preferences.h:87
This structure represents and describes a class.
Definition: node.h:22
Standard bool, 1 bytes.
Definition: node.h:193
afloatr m_fPaintBleedDistance
Specifies a distance how far the edge bleeding should go over UV edges during painting.
Definition: preferences.h:252
float g
Definition: math.h:783
astring m_sSelectedBrushName
Definition: preferences.h:311
aenum m_bRenderSelectedPerFace
Definition: preferences.h:193
Standard integer, 4 bytes.
Definition: node.h:189
afloatr * RegisterFloatVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, float fDefaultValue)
Definition: preferences.h:85
aenum * RegisterEnumVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, int iDefaultValue)
Definition: preferences.h:91
afloatr m_fPaintBufferMemoryBudget
Definition: preferences.h:290
astring m_sDefaultTextureLayerDir
Definition: preferences.h:161
typedef Bool(APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC)(Display *dpy
abool m_bDisplayCreaseNormals
Definition: preferences.h:124
Store< Attribute * > m_aPluginAttributes
Definition: preferences.h:247
afloatr m_fCameraTrackSensitivity
Definition: preferences.h:127
astring m_sLowObjectName
Definition: preferences.h:218
abool m_bUseGigatexelEngine
Gigatexel engine.
Definition: preferences.h:289
afloatr m_fStencilRotateSensitivity
Definition: preferences.h:139
Used to insert expanded category item.
Definition: node.h:379
This class represents a string preference value. See Preferences::Integer for mode details...
Definition: preferences.h:365
aint m_iDraftRenderMinFaceCount
Definition: preferences.h:134
afloatr m_fCameraRotateSensitivity
Definition: preferences.h:128
abool m_bWhatsNewBoxOnStartup
Definition: preferences.h:178
Class: ConvolutionKernel.
Definition: array.h:15
This is an abstract base structure for all attributes.
Definition: node.h:181
astring m_sUILayoutPath
UI layout preferences.
Definition: preferences.h:294
AttributeLocale m_locale
Definition: preferences.h:286
abool m_bMultiThreadRender
Definition: preferences.h:97
AttributeType
Type of the attribute.
Definition: node.h:184
aint m_movieWidth
movie-recording preferences
Definition: preferences.h:272
Vector, 3xfloat, see Vector.
Definition: node.h:201
aenum m_eSoloLayerVisibility
Definition: preferences.h:111
SelectionMode
Definition: preferences.h:40
Holds Mudbox application preferences.
Definition: preferences.h:70
Streams are used to read information from a file, or to write it to a file.
Definition: stream.h:39
#define DECLARE_CLASS
This macro should be used in declaration of classes which are inherited from the Node class (or any d...
Definition: node.h:91
This attribute is very similar to the aint type but on the user interface it will be displayed as a c...
Definition: node.h:1071
aenum m_eHighlightEdgeBleedOverlap
Definition: preferences.h:262
abool m_bCenterPivotOnSelection
Definition: preferences.h:321
float a
Definition: math.h:783
abool m_bUseLocalYForCameraRotation
Definition: preferences.h:141
aenum m_eObjectSelectionMode
Definition: preferences.h:159
aint * RegisterIntegerVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, int iDefaultValue)
Definition: preferences.h:89
float x
Definition: math.h:340
float r
Definition: math.h:783
GLclampf f
Definition: GLee.h:9303
aint m_iPositiveDisplacementChannel
Definition: preferences.h:231
#define Q_DECLARE_TR_FUNCTIONS(context)
abool * RegisterBoolVariable(const QString &sName, const QString &sCategory, const QString &sNameTr, const QString &sCategoryTr, bool bDefaultValue)
Definition: preferences.h:86
This class represents a color item in the preferences. See Preferences::Integer for mode details...
Definition: preferences.h:373
#define MBDLL_DECL
Definition: dllinterface.h:35
This class represents a enum item, appears as a combo box. See Preferences::Enum for mode details...
Definition: preferences.h:389