HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_HDADefinition.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_HDADefinition_h__
10 #define __HOM_HDADefinition_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Module.h"
16 #include "HOM_PtrOrNull.h"
17 #include "HOM_EnumModules.h"
18 #include <UT/UT_Options.h>
19 #include <string>
20 #include <vector>
21 class HOM_NodeType;
22 class HOM_HDASection;
24 class HOM_HDAOptions;
25 class HOM_ParmTemplate;
26 class HOM_Tool;
27 
28 SWIGOUT(%rename(HDADefinition) HOM_HDADefinition;)
29 
31 {
32 public:
34  { HOM_CONSTRUCT_OBJECT(this) }
36  { HOM_CONSTRUCT_OBJECT(this) }
38  { HOM_DESTRUCT_OBJECT(this) }
39 
40  virtual bool operator==(HOM_PtrOrNull<HOM_HDADefinition> hda_definition) = 0;
41  virtual bool operator!=(HOM_PtrOrNull<HOM_HDADefinition> hda_definition) = 0;
42 
43  virtual int __hash__() = 0;
44  virtual std::string __repr__() = 0;
45 
46  SWIGOUT(%newobject nodeType;)
47  virtual HOM_NodeType *nodeType() = 0;
48 
49  virtual HOM_NodeTypeCategory &nodeTypeCategory() = 0;
50  virtual std::string nodeTypeName() = 0;
51 
52  virtual std::string libraryFilePath() = 0;
53 
54  virtual std::string embeddedHelp() = 0;
55 
56  // installed() is deprecated in favour of isInstalled().
57  virtual bool isInstalled() = 0;
58  bool installed()
59  { return isInstalled(); }
60 
61  // current() is deprecated in favour of isCurrent().
62  virtual bool isCurrent() = 0;
63  bool current()
64  { return isCurrent(); }
65 
66  // preferred() is deprecated in favour of isPreferred().
67  virtual bool isPreferred() = 0;
68  bool preferred()
69  { return isPreferred(); }
70 
71  // setPreferred() is deprecated in favour of setIsPreferred().
72  virtual void setIsPreferred(bool preferred) = 0;
73  void setPreferred(bool preferred)
74  { setIsPreferred(preferred); }
75 
76  virtual void enableCreateBackups(bool create_backups) = 0;
77  virtual bool isCreateBackupsEnabled() = 0;
78 
79  virtual std::map<std::string, HOM_ElemPtr<HOM_HDASection> > sections() = 0;
80 
81  virtual bool hasSection(const char *name) = 0;
82 
83  // Swig does not allow keyword arguments for overloaded functions, so
84  // addSection is wrapped in houpythonportion.py to enable keyword
85  // arguments. If you want to change the signature of addSection, you must
86  // also edit houpythonportion.py.
87  SWIGOUT(%newobject addSection;)
88  virtual HOM_HDASection *addSection(const char *name) = 0;
89  virtual HOM_HDASection *addSection(
90  const char *name, const std::string &contents,
91  HOM_EnumValue &compression_type=HOM_compressionType::NoCompression)
92  = 0;
93  virtual HOM_HDASection *addSection(
94  const char *name, const HOM_BinaryString &contents,
95  HOM_EnumValue &compression_type=HOM_compressionType::NoCompression)
96  = 0;
97 
98  virtual void removeSection(const char *name) = 0;
99 
100  virtual std::string description() = 0;
101  virtual void setDescription(const char *label) = 0;
102  virtual std::string icon() = 0;
103  virtual void setIcon(const char *icon) = 0;
104  virtual int minNumInputs() = 0;
105  virtual void setMinNumInputs(int min_num_inputs) = 0;
106  virtual int maxNumInputs() = 0;
107  virtual void setMaxNumInputs(int max_num_inputs) = 0;
108  virtual int maxNumOutputs() = 0;
109  virtual void setMaxNumOutputs(int max_num_outputs) = 0;
110 
111  virtual std::string extraInfo() = 0;
112  virtual void setExtraInfo(const char *extra_info) = 0;
113 
114  virtual std::string extraInfoValue(const char *key) = 0;
115 
116  virtual std::string userInfo() = 0;
117  virtual void setUserInfo(const char *extra_info) = 0;
118 
119  virtual bool hideDefaultParameters() = 0;
120  virtual std::string representativeNodePath() = 0;
121 
122  virtual std::string comment() = 0;
123  virtual void setComment(const char *comment) = 0;
124 
125  virtual std::string version() = 0;
126  virtual void setVersion(const char *version) = 0;
127 
128  virtual int modificationTime() = 0;
129  virtual void setModificationTime(int time=-1) = 0;
130 
131  SWIGOUT(%newobject options;)
132  virtual HOM_HDAOptions *options() = 0;
133  virtual void setOptions(HOM_HDAOptions &options) = 0;
134 
135  virtual void updateFromNode(HOM_Node &node) = 0;
136 
137  SWIGOUT(%kwargs save;)
138  virtual void save(
139  const std::string &file_name,
140  HOM_Node *template_node = NULL,
141  HOM_HDAOptions *options = NULL,
142  bool black_box = false,
143  bool create_backup = true) = 0;
144 
145  SWIGOUT(%kwargs copyToHDAFile;)
146  virtual void copyToHDAFile(
147  const std::string &file_name,
148  const char *new_name = NULL,
149  const char *new_menu_name = NULL) = 0;
150 
151  virtual void destroy() = 0;
152 
153  SWIGOUT(%newobject parmTemplateGroup;)
154  virtual HOM_ParmTemplateGroup *parmTemplateGroup() = 0;
155 
156  SWIGOUT(%kwargs setParmTemplateGroup;)
157  virtual void setParmTemplateGroup(
158  HOM_ParmTemplateGroup &parm_template_group,
159  bool rename_conflicting_parms=false,
160  bool create_backup=true) = 0;
161 
162  virtual void setExtraFileOption(const char *name, HOM_UTOptionAny value,
163  HOM_EnumValue &type_hint
164  = HOM_fieldType::NoSuchField) = 0;
165  virtual void removeExtraFileOption(const char *name) = 0;
166 
167  // compileCodeSection() deprecated. Compiled VEX assembly is no longer
168  // stored in HDAs or OTLs. This function does nothing.
169  virtual void compileCodeSection(const char *source_section,
170  const char *destination_section) = 0;
171 
172  // This is the function that does the real work of fetching the contents of
173  // the ExtraFileOptions section as a UT_Options object. This function is
174  // never called directly from Python, and is instead invoked using from
175  // extraFileOptions().
176  SWIGOUT(%ignore getRawExtraFileOptions;)
177  virtual void getRawExtraFileOptions(UT_Options &options) = 0;
178 
179  // Returns tools defined in a HDA section of this definition.
180  virtual std::map<std::string, HOM_ElemPtr<HOM_Tool> > tools() = 0;
181 
182 #ifdef SWIG
183 #ifdef SWIGPYTHON
184 %extend
185 {
186  InterpreterObject extraFileOptions()
187  {
188  UT_Options options;
189  self->getRawExtraFileOptions(options);
190  return HOMoptionsToInterpreterObject(options);
191  }
192 }
193 #endif
194 #endif
195 };
196 
197 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
GT_API const UT_StringHolder time
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
void setPreferred(bool preferred)
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
virtual ~HOM_HDADefinition()
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
OPENVDB_API void setVersion(std::ios_base &, const VersionId &libraryVersion, uint32_t fileVersion)
Associate specific file format and library version numbers with the given stream. ...
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
GLuint const GLchar * name
Definition: glcorearb.h:786
GT_API const UT_StringHolder version
A map of string to various well defined value types.
Definition: UT_Options.h:84
virtual int __hash__()=0
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
virtual void setIcon(const char *icon)=0
virtual std::string icon()=0
Definition: core.h:1131
virtual void destroy()=0
HOM_HDADefinition(const HOM_HDADefinition &)
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542