Mudbox/interface.h Source File

interface.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 #ifndef __MUDBOXSDK_INTERFACE_H__
16 #define __MUDBOXSDK_INTERFACE_H__
17 #pragma once
18 
19 
20 namespace mudbox
21 {
23  {
25 
27  enum Type
28  {
29  ePressed,
30  eReleased
31  } m_eType;
33  int m_iKey;
37  int m_iModifiers;
38  };
39 
43  class MBDLL_DECL Interface : public Node
44  {
45  public:
46  Interface( void );
47 
49  {
51  ltPaintUI
52  };
54  {
58  msgError
59  };
61  {
62  buttonNone = 0x00000000,
63  buttonOk = 0x00000400,
64  buttonCancel = 0x00400000,
65  buttonClose = 0x00200000,
66  buttonYes = 0x00004000,
67  buttonYesToAll = 0x00008000,
68  buttonNo = 0x00010000,
69  buttonNoToAll = 0x00020000,
70  buttonAbort = 0x00040000,
71  buttonRetry = 0x00080000,
72  buttonIgnore = 0x00100000,
73  buttonHelp = 0x01000000
74  };
76  {
78  HUDmsgFade
79  };
80 
82  {
85  stError
86  };
87 
89  {
90  HotkeySetMudbox = 0,
91  HotkeySetMaya = 1,
92  HotkeySet3dsMax = 2,
93  HotkeySetSoftimage = 3
94  };
95 
96  enum MenuType
97  {
111  ddmMarking
112  };
113 
115  {
116  public:
118  {
127  mmlocOverflow
128  };
129 
131  {
134  csNoCheckbox
135  };
136  protected:
138  MenuManipulator( void );
140 
141  public:
143  virtual MenuType Type( void ) const;
147  virtual QMenu *Menu( void ) const;
149  virtual Node *Object( void ) const;
151  virtual QString MarkingMenuID( void ) const;
153  virtual QAction *AddMenuItem(
154  const QString &sName,
155  void (*pCallback)( void ),
156  int iIndex = -1,
157  bool bDisabled = false
158  );
160  virtual void AddClassMenuItem(
161  const QString &sName,
162  const ClassDesc *pClass,
163  const QString &sCreatorText,
164  const int &index = -1,
165  bool bDisable = false,
166  int version = 0
167  );
169  virtual void AddHotboxItem(
170  const QString &sName,
171  const QString &sMarkingID,
172  const QImage &cIcon,
173  int iRadius = 40,
174  int bRing = 1
175  );
177  virtual void AddMarkingMenuItem(
178  const QString &sName,
179  MarkingMenuItemLocation eLocation,
180  void (*pCallback)(void),
181  CheckState eCheckState = csNoCheckbox,
182  const QString &sParent = ""
183  );
184 
186  virtual void ClearMarkingMenu( const QString &sNewMarkingMenuID );
187  };
188 
189  QMenu *DropDownMenu( MenuType eType ) const;
190 
203 
204 
206  QWidget *MainWindow( void ) const;
207 
208  void ShowNewPaintLayerDialog( void );
209 
211  void ShowBrushRing( bool bShow );
212 
214  bool RestorePreviousBrush( void );
215 
217  void SetSelectedBrush( const QString &sBrushName );
218 
221  aptr<BrushOperation> SelectedBrush;
222 
224  void ActivateLayerSystem(
225  LayerUIType eType
226  );
227 
233  void Load(
234  QString filename,
235  Scene::LoadData& cData
236  );
237 
239  void ShowProperties(
240  Node *pNode,
241  bool bFloating
242  ) const;
243 
245  void ClearProperties();
246 
248  int MessageBox(
249  MessageBoxType iType,
250  const QString &sTitle,
251  const QString &sText,
252  int iButtons = buttonNone,
253  int iDefaultButton = buttonNone
254  );
255 
259  int OneTimeMessageBox (
260  MessageBoxType iType,
261  const QString &sTitle,
262  const QString &sText,
263  int buttons = 0
264  );
265 
272  void HUDMessageShow(
273  const QString &sMessage,
274  HUDMessageType iType = HUDmsgFade
275  );
276 
281  void HUDMessageHide();
282 
284  void SetStatus(
285  StatusType iType,
286  const QString& sMsg
287  );
288 
304  void AddClassMenuItem(
305  const QString &sMenu,
306  const QString &sSubmenu,
307  const ClassDesc *pClass,
308  const QString &sCreatorText,
309  const int &index = -1,
310  const int &subindex = -1,
311  const bool addSeparator = false,
312  int version = 0
313  );
314 
321  void AddCallbackMenuItem(
322  const QString &sMenu,
323  const QString &sSubmenu,
324  const QString &sItemName,
325  void (*pCallback)(),
326  const QString &sID = "",
327  const int &index = -1,
328  const int &subindex = -1,
329  const bool addSeparator = false,
330  int version = 0
331  );
332 
339  void AddWelcomeWindowButton(
340  const QString &sItemName,
341  void (*pCallback)(),
342  const QString &icon = "",
343  const QString &styleSheet = ""
344  );
345 
347  void RemoveWelcomeWindowButton(
348  const QString &sItemName
349  );
350 
352  void SelectHotkeySet(
353  HotkeySetName newKeySet,
354  bool forceSetHotkey = false
355  );
356 
358  HotkeySetName CurrentHotkeySet() const;
359 
361  void AddToCreateMeshMenu(QFileInfo fileInfo);
362 
364  void AddObjectListContextMenuItem(
365  const ClassDesc *pObjectType,
366  const QString &sItemName,
367  void (*pCallback)(),
368  int index = -1,
369  bool addSeparator = false,
370  int version = 0
371  );
372 
374  void AddLayerCallbackMenuItem(
376  const QString &sItemName,
377  void (*pCallback)(),
378  int version = 0
379  );
380 
382  QAction* CreateHighlightableMenuItem(
383  const QString &text,
384  QObject *parent,
385  int version = 0
386  );
387 
389  void ProgressStart(
390  const QString &sDescription,
391  unsigned int iMaxValue,
392  float fWeight = 1.0f,
393  int iDelayTime = 0
395  );
396 
399  void ProgressStartGroup(
400  const QString &sDescription,
401  float fTotalWeight,
402  int iDelayTime = 0
403  );
404 
406  bool ProgressSet(
407  unsigned int iValue
408  );
409 
411  bool ProgressAdd( void );
412 
414  void ProgressEnd( void );
415 
421  bool ProgressIsCancelRequested( void );
422 
424  void ProgressRequestCancel( void );
425 
429  QString LoadFileDialog(
430  const QString &sTitle,
431  const QString &sPath,
432  const QString &sFilter,
433  QString* sSelectedFilter = 0
434  ) const;
435 
439  QString SaveFileDialog(
440  const QString &sTitle,
441  const QString &sPath,
442  const QString &sFilter,
443  bool bAskForOverwrite = true,
444  QString* sSelectedFilter = 0
445  ) const;
446 
450  QString GetDirectoryDialog(
451  const QString &sTitle,
452  const QString &sPath
453  ) const;
454 
458  QStringList LoadFilesDialog(
459  const QString &sTitle,
460  const QString &sPath,
461  const QString &sFilter
462  ) const;
463 
465  void WaitCursorStart( void );
466 
468  void WaitCursorEnd( void );
469 
471  void RefreshUI( void ) const;
472 
474  void AddView(QString className, QString windowTitle, const bool select = false) const;
475 
476 
478  float currentTabletPressure() const;
479 
480 
487  mutable aptr<KeyboardEventNotifier> KeyboardEvent;
488 
493 
495  float LastPatchXPosition( void );
497  float LastPatchYPosition( void );
498 
507  aptr<MenuManipulator> CurrentMenu;
508 
510  bool IsInStroke() const;
511 
513  bool IsInTumble() const;
517  void SetInTumble( bool b );
518 
520  bool IsInDoubleClick() const;
521 
529  bool IsInCameraNavigation() const;
531  void SetInCameraNavigation( bool bInCameraNavigation = false );
532  };
533 
539  class MBDLL_DECL Action : public Node
540  {
542 
543  enum Hotkeys
544  {
545  keyAlt = 0x00010000,
546  keyShift = 0x00020000,
547  keyCtrl = 0x00040000,
548  keyMeta = 0x00080000,
549  keyLMB = 0x00000100,
550  keyMMB = 0x00000200,
551  keyRMB = 0x00000400,
552  keyWheel = 0x00000800,
553  keyLeft = 0x01000012,
554  keyUp = 0x01000013,
555  keyRight = 0x01000014,
556  keyDown = 0x01000015
557  };
558 
559  public:
560  Action( void );
561  ~Action( void );
562 
565  virtual int DefaultHotkey( void ) const;
567  virtual bool IsSticky( void ) const;
569  virtual bool IsHidden( void ) const;
570 
572  virtual bool IsEnabled( void ) const;
573 
575  virtual void SetEnabled( bool bEnabled );
576 
578  virtual void OnActivate(
579  bool bRepeat
580  );
582  virtual void OnDeactivate( void );
584  virtual void OnCursorMove(
585  float fXPosition,
586  float fYPosition,
587  float fXChange,
588  float fYChange
589  );
591  virtual void OnOptions( void );
592  };
593 };
594 
595 #endif
596 
This class represents an action which can be triggered by the user.
Definition: interface.h:539
For rendering related functions.
Definition: interface.h:106
keep the HUD message up until specifically cancelled
Definition: interface.h:77
static QString menuCreate
Definition: interface.h:193
aptr< BrushOperation > SelectedBrush
This pointer contains the address of the currently selected brush.
Definition: interface.h:221
Sculpt Layer UI.
Definition: interface.h:50
static QString menuEdit
Definition: interface.h:192
For mesh functions.
Definition: interface.h:102
For curve related functions.
Definition: interface.h:103
For I/O related functions.
Definition: interface.h:99
This is the base class for most classes in the Mudbox SDK.
Definition: node.h:740
static QString menuRender
Definition: interface.h:199
static QString menuPlugins
Definition: interface.h:197
static QString menuHelp
Definition: interface.h:196
aevent PostUIInitializationEvent
This event is triggered after the Mudbox main UI window is created.
Definition: interface.h:492
Definition: qimage.h:87
This structure represents and describes a class.
Definition: node.h:22
Definition: qmenu.h:72
For help related functions.
Definition: interface.h:108
static QString menuMesh
Definition: interface.h:198
This class represents an event receiver/triggerer point.
Definition: node.h:999
For the object context menu, which the user activates by right clicking on an object in the object li...
Definition: interface.h:110
aptr< MenuManipulator > CurrentMenu
This attribute contains the address of the current menu creator object.
Definition: interface.h:507
static QString menuMaps
Definition: interface.h:201
GLubyte GLubyte b
Definition: GLee.h:5404
For functions related to windows.
Definition: interface.h:107
static QString menuFile
Definition: interface.h:191
static QString menuCurves
Definition: interface.h:194
static QString menuScripts
Definition: interface.h:200
Class: ConvolutionKernel.
Definition: array.h:15
For functions related to the 3d viewport.
Definition: interface.h:104
For editing related functions.
Definition: interface.h:100
Data structure to hold file import/load options, and diagnostic data.
Definition: scene.h:71
#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
aptr< KeyboardEventNotifier > KeyboardEvent
This is a pointer to the latest keyboard event.
Definition: interface.h:487
The Interface class provides access to user interface related functions and events.
Definition: interface.h:43
static QString menuDisplay
Definition: interface.h:195
For the layer context menu, which the user activates by right clicking on a layer in the layer list...
Definition: interface.h:109
For functions which create new objects in the scene.
Definition: interface.h:101
GLclampf f
Definition: GLee.h:9303
#define MBDLL_DECL
Definition: dllinterface.h:35
static QString menuWindows
Definition: interface.h:202
GLuint index
Definition: GLee.h:1704
For functions related to textures.
Definition: interface.h:105