HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_hda.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  * COMMENTS:
7  */
8 
9 #ifndef __HOM_hda_h__
10 #define __HOM_hda_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_ElemPtr.h"
16 #include "HOM_EnumModules.h"
17 #include <UT/UT_Experimental.h>
18 #include <vector>
19 
20 class HOM_Node;
21 class HOM_EnumValue;
22 class HOM_HDADefinition;
23 
24 SWIGOUT(%rename(hda) HOM_hda;)
25 
27 {
28 public:
29  virtual ~HOM_hda()
30  {}
31 
32  virtual std::string __repr__() = 0;
33 
34  SWIGOUT(%kwargs installFile;)
35  virtual void installFile(
36  const char *file_path,
37  const char *oplibraries_file = NULL,
38  bool change_oplibraries_file = true,
39  bool force_use_assets = false) = 0;
40 
41  SWIGOUT(%kwargs uninstallFile;)
42  virtual void uninstallFile(const char *file_path,
43  const char *oplibraries_file = NULL,
44  bool change_oplibraries_file = true) = 0;
45 
46  SWIGOUT(%kwargs installFiles;)
47  virtual void installFiles(
48  const std::vector<std::string> &file_paths,
49  const char *oplibraries_file = NULL,
50  bool change_oplibraries_file = true,
51  bool force_use_assets = false) = 0;
52 
53  SWIGOUT(%kwargs uninstallFiles;)
54  virtual void uninstallFiles(
55  const std::vector<std::string> &file_paths,
56  const char *oplibraries_file = NULL,
57  bool change_oplibraries_file = true) = 0;
58 
59  virtual void reloadFiles(const std::vector<std::string> &file_paths) = 0;
60 
61  virtual void reloadFile(const char *file_path) = 0;
62  virtual void reloadAllFiles(bool rescan = true) = 0;
63 
64  virtual void reloadNamespaceOrder() = 0;
65 
66  virtual void expandToDirectory(const char *file_path,
67  const char *directory_path) = 0;
68 
69  virtual void collapseFromDirectory(const char *file_path,
70  const char *directory_path) = 0;
71 
72  virtual std::vector<std::string> loadedFiles() = 0;
73 
74  virtual void renameSource(const char *oplibraries_file,
75  const char *source_name = NULL) = 0;
76 
77  virtual std::vector<HOM_ElemPtr<HOM_HDADefinition> >
78  definitionsInFile(const char *file_path) = 0;
79 
80  virtual std::vector<std::string> componentsFromFullNodeTypeName(
81  const char *node_type_name) = 0;
82  virtual std::string fullNodeTypeNameFromComponents(
83  const char *scope_node_type,
84  const char *name_space,
85  const char *name,
86  const char *version) = 0;
87 
88  virtual void changeCurrentStoreUser(const char *new_user) = 0;
89 
90  virtual bool safeguardHDAs() = 0;
91  virtual void setSafeguardHDAs(bool on) = 0;
92 
93  SWIGOUT(%ignore addOpaqueEventCallback;)
94  virtual void addOpaqueEventCallback(
95  const std::vector<HOM_EnumValue *> &event_types, void *py_callback) = 0;
96  SWIGOUT(%ignore removeOpaqueEventCallback;)
97  virtual void removeOpaqueEventCallback(
98  const std::vector<HOM_EnumValue *> &event_types, void *py_callback) = 0;
99  virtual void removeAllEventCallbacks() = 0;
100  SWIGOUT(%ignore opaqueEventCallbacks;)
101  virtual std::vector<std::pair<std::vector<HOM_EnumValue *>, void *> >
102  opaqueEventCallbacks() = 0;
103 
104  virtual std::string defaultFileExtension() = 0;
105 
106 #ifdef SWIG
107 %extend
108 {
109  void addEventCallback(
110  const std::vector<HOM_EnumValue *> &event_types,
111  InterpreterObject callback)
112  { self->addOpaqueEventCallback(event_types, callback); }
113 
114  void removeEventCallback(
115  const std::vector<HOM_EnumValue *> &event_types,
116  InterpreterObject callback)
117  { self->removeOpaqueEventCallback(event_types, callback); }
118 
119  std::vector<std::pair<std::vector<HOM_EnumValue *>, InterpreterObject> >
120  eventCallbacks()
121  {
122  std::vector<std::pair<std::vector<HOM_EnumValue *>, void *> >
123  opaque_callbacks(self->opaqueEventCallbacks());
124 
125  std::vector<std::pair<std::vector<HOM_EnumValue *>, InterpreterObject> >
126  callbacks;
127  for (int i=0; i< opaque_callbacks.size(); ++i)
128  callbacks.push_back(std::make_pair(
129  opaque_callbacks[i].first,
130  (InterpreterObject)opaque_callbacks[i].second));
131  return callbacks;
132  }
133 }
134 #endif
135 
136 #ifdef ENABLE_LICENSED_ASSETS
137  SWIGOUT(%kwargs encryptAsset;)
138  virtual void encryptAsset(
139  HOM_Node &node,
140  const char *file_path,
141  const char *email,
142  const char *password,
143  const std::vector<std::string> &license_names,
144  bool compile_basic = true,
145  bool compile_vopnets = true,
146  bool compile_channels = true,
147  bool compile_nodenames = true) = 0;
148 
149  SWIGOUT(%kwargs createEntitlement;)
150  virtual void createEntitlement(
151  const char *email,
152  const char *password,
153  const char *license_name,
154  const char *entitled_email,
155  HOM_EnumValue &license_type = HOM_hdaLicenseType::Execute,
156  double expiry = 0.0f) = 0;
157 
158  SWIGOUT(%kwargs availableEntitlements;)
159  virtual std::vector<std::string> availableEntitlements(
160  const char *email,
161  const char *password) = 0;
162 
163  SWIGOUT(%kwargs redeemEntitlements;)
164  virtual void redeemEntitlements(
165  const char *email,
166  const char *password,
167  const char *license_file = NULL,
168  const std::vector<std::string> &entitlements =
169  std::vector<std::string>()) = 0;
170 #endif // ENABLE_LICENSED_ASSETS
171 };
172 
173 #endif
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:312
virtual ~HOM_hda()
Definition: HOM_hda.h:29
GLfloat f
Definition: glcorearb.h:1926
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
GLuint const GLchar * name
Definition: glcorearb.h:786
GT_API const UT_StringHolder version
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)