HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BM_ResourceManager.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: BM_ResourceManager.h ( Direct Manipulation Library, C++)
7  *
8  * COMMENTS:
9  * This class maintains a table of all states, handles, op-handle links,
10  * and input selectors. All state, handle, and op-handle link objects
11  * are created and deleted through a BM_ResourceManager. The active one
12  * is obtained via the global function BMgetResourceManager().
13  */
14 
15 #ifndef __BM_ResourceManager_H__
16 #define __BM_ResourceManager_H__
17 
18 #include "BM_API.h"
19 #include <UT/UT_Array.h>
20 #include <UT/UT_String.h>
21 #include <UT/UT_SymbolTable.h>
22 #include <PI/PI_ResourceManager.h>
23 
24 class UT_HUDInfoArgs;
25 class BM_View;
26 class BM_State;
27 class BM_Handle;
28 class BM_OpHandleLink;
29 class BM_SceneManager;
30 class BM_InputSelector;
31 
32 typedef BM_State *(*BM_StateConstructor)(BM_View &, PI_StateTemplate &,
33  BM_SceneManager *);
34 typedef BM_Handle *(*BM_HandleConstructor)(BM_SceneManager &,
36 typedef BM_OpHandleLink *(*BM_PIConstructor)(BM_SceneManager &,
37  PI_PITemplate &);
38 typedef BM_InputSelector*(*BM_SelectorConstructor)(BM_View &,
40 
42 {
43 public:
44  BM_State *newState(BM_View &view,
45  PI_StateTemplate &templ,
46  BM_SceneManager *scene = 0) const;
47  virtual
48  BM_State *newState(BM_View &view,
49  const char *name, const char *type,
50  BM_SceneManager *scene = 0) const;
51  BM_State *newState(BM_View &view,
52  PI_NetworkType nettype, int state_idx,
53  BM_SceneManager *scene = 0) const;
54 
55  BM_Handle *newHandle(BM_SceneManager &sm,
56  const char *name) const;
57  virtual
58  BM_OpHandleLink *newOpHandleLink(BM_SceneManager &sm,
59  const char *name,
60  const char *description) const;
61  BM_InputSelector *newSelector(BM_View &view,
62  const char *name) const;
63 
64  void deleteState(BM_State *state);
65  void deleteHandle(BM_Handle *handle);
66  virtual
67  void deleteOpHandleLink(BM_OpHandleLink *link);
68  void deleteSelector(BM_InputSelector *selector);
69 
70  void findVolatileKeys(const char *volatile_hotkey_name,
71  UT_Array<int> &volatile_keys,
72  UT_Array<int> &keys_modifiers)
73  const override;
74  void updateViewports(int id, const char *opname,
75  bool open_only = false) const override;
76  void removePISettingsFromTables(OP_Operator &op_type) override;
77 
78  static void startParmsCache();
79  static void stopParmsCache();
80 
81  static void lookupVolatileKeys(const char *volatile_hotkey_name,
82  UT_Array<int> &volatile_keys,
83  UT_Array<int> &keys_modifiers);
84 
85  // Called when a PI description has changed.
86  virtual void onPIDescriptionChange(BM_OpHandleLink const&, const char* old_description);
87 
88  // Called when a PI persistent state has changed.
89  virtual void onPIPersistentChange(BM_OpHandleLink const&, bool old_state);
90 
91  // Add this PI proxy index to the resource manager cache.
92  virtual void addPIProxyIndex(BM_OpHandleLink const&);
93 
94  // Returns the proxy index for a given PI name and scene_manager.
95  // scene_manager: The scene manager to get the PI from.
96  // pi_name: The name of the PI to query.
97  // pi_persistent: Indicate whether the persistent PI (true) or the
98  // non-persistent PI (false) should be returned if a name collision
99  // occurs with pi_name.
100  virtual int queryPIProxyIndex(BM_SceneManager const& scene_manager, char const* pi_name,
101  bool pi_persistent = true);
102 
103  // This should be called whenever HUD updates are requested while a new
104  // state is being constructed (i.e. UTisstring(stateToCreate()) == true).
105  void stashHUDUpdateForNewState(const UT_HUDInfoArgs &args);
106 
107 protected:
109  ~BM_ResourceManager() override;
110 
111 private:
112  class NewStateHUDQueue;
113  mutable UT_Array<NewStateHUDQueue *> myNewStateHUDQueues;
114 };
115 
117 
118 extern "C" {
124 };
125 
126 #endif
#define SYS_VISIBILITY_EXPORT
static void stopParmsCache()
PI_NetworkType
virtual void removePISettingsFromTables(OP_Operator &op_type)
static void startParmsCache()
SYS_VISIBILITY_EXPORT void newOpHandleLink(BM_ResourceManager *m)
virtual void updateViewports(int id, const char *opname, bool open_only=false) const
GLuint const GLchar * name
Definition: glcorearb.h:786
BM_API BM_ResourceManager * BMgetResourceManager()
#define BM_API
Definition: BM_API.h:10
SYS_VISIBILITY_EXPORT void newSelector(BM_ResourceManager *m)
virtual void findVolatileKeys(const char *volatile_hotkey_name, UT_Array< int > &volatile_keys, UT_Array< int > &keys_modifiers) const
SYS_VISIBILITY_EXPORT void newModelState(BM_ResourceManager *m)
SYS_VISIBILITY_EXPORT void newOpHandleBinding(BM_ResourceManager *m)
**If you just want to fire and args
Definition: thread.h:609
Definition: core.h:982
SYS_VISIBILITY_EXPORT void newHandle(BM_ResourceManager *m)
type
Definition: core.h:1059