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 
27 SWIGOUT(%rename(HDADefinition) HOM_HDADefinition;)
28 
30 {
31 public:
33  { HOM_CONSTRUCT_OBJECT(this) }
35  { HOM_CONSTRUCT_OBJECT(this) }
37  { HOM_DESTRUCT_OBJECT(this) }
38 
39  virtual bool operator==(HOM_PtrOrNull<HOM_HDADefinition> hda_definition) = 0;
40  virtual bool operator!=(HOM_PtrOrNull<HOM_HDADefinition> hda_definition) = 0;
41 
42  virtual int __hash__() = 0;
43  virtual std::string __repr__() = 0;
44 
45  SWIGOUT(%newobject nodeType;)
46  virtual HOM_NodeType *nodeType() = 0;
47 
48  virtual HOM_NodeTypeCategory &nodeTypeCategory() = 0;
49  virtual std::string nodeTypeName() = 0;
50 
51  virtual std::string libraryFilePath() = 0;
52 
53  virtual std::string embeddedHelp() = 0;
54 
55  // installed() is deprecated in favour of isInstalled().
56  virtual bool isInstalled() = 0;
57  bool installed()
58  { return isInstalled(); }
59 
60  // current() is deprecated in favour of isCurrent().
61  virtual bool isCurrent() = 0;
62  bool current()
63  { return isCurrent(); }
64 
65  // preferred() is deprecated in favour of isPreferred().
66  virtual bool isPreferred() = 0;
67  bool preferred()
68  { return isPreferred(); }
69 
70  // setPreferred() is deprecated in favour of setIsPreferred().
71  virtual void setIsPreferred(bool preferred) = 0;
72  void setPreferred(bool preferred)
73  { setIsPreferred(preferred); }
74 
75  virtual std::map<std::string, HOM_ElemPtr<HOM_HDASection> > sections() = 0;
76 
77  virtual bool hasSection(const char *name) = 0;
78 #if defined(USE_PYTHON3)
79  SWIGOUT(%newobject addSection;)
80  SWIGOUT(%kwargs addSection;)
81  virtual HOM_HDASection *addSection(
82  const char *name, const std::string &contents = "",
83  HOM_EnumValue &compression_type=HOM_compressionType::NoCompression)
84  = 0;
85  virtual HOM_HDASection *addSection(
86  const char *name, const HOM_BinaryString &contents = "",
87  HOM_EnumValue &compression_type=HOM_compressionType::NoCompression)
88  = 0;
89 #else
90  SWIGOUT(%newobject addSection;)
91  SWIGOUT(%kwargs addSection;)
92  virtual HOM_HDASection *addSection(
93  const char *name, const HOM_BinaryString &contents = "",
94  HOM_EnumValue &compression_type=HOM_compressionType::NoCompression)
95  = 0;
96 #endif
97  virtual void removeSection(const char *name) = 0;
98 
99  virtual std::string description() = 0;
100  virtual void setDescription(const char *label) = 0;
101  virtual std::string icon() = 0;
102  virtual void setIcon(const char *icon) = 0;
103  virtual int minNumInputs() = 0;
104  virtual void setMinNumInputs(int min_num_inputs) = 0;
105  virtual int maxNumInputs() = 0;
106  virtual void setMaxNumInputs(int max_num_inputs) = 0;
107  virtual int maxNumOutputs() = 0;
108  virtual void setMaxNumOutputs(int max_num_outputs) = 0;
109 
110  virtual std::string extraInfo() = 0;
111  virtual void setExtraInfo(const char *extra_info) = 0;
112 
113  virtual std::string userInfo() = 0;
114  virtual void setUserInfo(const char *extra_info) = 0;
115 
116  virtual bool hideDefaultParameters() = 0;
117  virtual std::string representativeNodePath() = 0;
118 
119  virtual std::string comment() = 0;
120  virtual void setComment(const char *comment) = 0;
121 
122  virtual std::string version() = 0;
123  virtual void setVersion(const char *version) = 0;
124 
125  virtual int modificationTime() = 0;
126  virtual void setModificationTime(int time=-1) = 0;
127 
128  SWIGOUT(%newobject options;)
129  virtual HOM_HDAOptions *options() = 0;
130  virtual void setOptions(HOM_HDAOptions &options) = 0;
131 
132  virtual void updateFromNode(HOM_Node &node) = 0;
133 
134  SWIGOUT(%kwargs save;)
135  virtual void save(
136  const std::string &file_name,
137  HOM_Node *template_node = NULL,
138  HOM_HDAOptions *options = NULL,
139  bool compile_contents = false,
140  bool black_box = false,
141  bool create_backup = true) = 0;
142 
143  SWIGOUT(%kwargs copyToHDAFile;)
144  virtual void copyToHDAFile(
145  const std::string &file_name,
146  const char *new_name = NULL,
147  const char *new_menu_name = NULL) = 0;
148 
149  virtual void destroy() = 0;
150 
151  SWIGOUT(%newobject parmTemplateGroup;)
152  virtual HOM_ParmTemplateGroup *parmTemplateGroup() = 0;
153 
154  SWIGOUT(%kwargs setParmTemplateGroup;)
155  virtual void setParmTemplateGroup(
156  HOM_ParmTemplateGroup &parm_template_group,
157  bool rename_conflicting_parms=false,
158  bool create_backup=true) = 0;
159 
160  virtual void setExtraFileOption(const char *name, HOM_UTOptionAny value,
161  HOM_EnumValue &type_hint
162  = HOM_fieldType::NoSuchField) = 0;
163  virtual void removeExtraFileOption(const char *name) = 0;
164 
165  // compileCodeSection() deprecated. Compiled VEX assembly is no longer
166  // stored in HDAs or OTLs. This function does nothing.
167  virtual void compileCodeSection(const char *source_section,
168  const char *destination_section) = 0;
169 
170  // This is the function that does the real work of fetching the contents of
171  // the ExtraFileOptions section as a UT_Options object. This function is
172  // never called directly from Python, and is instead invoked using from
173  // extraFileOptions().
174  SWIGOUT(%ignore getRawExtraFileOptions;)
175  virtual void getRawExtraFileOptions(UT_Options &options) = 0;
176 
177 #ifdef SWIG
178 #ifdef SWIGPYTHON
179 %extend
180 {
181  InterpreterObject extraFileOptions()
182  {
183  UT_Options options;
184  self->getRawExtraFileOptions(options);
185  return HOMoptionsToInterpreterObject(options);
186  }
187 }
188 #endif
189 #endif
190 };
191 
192 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1211
GLuint const GLchar * name
Definition: glew.h:1814
GT_API const UT_StringHolder time
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#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
virtual ~HOM_HDADefinition()
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
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:563
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:8986
GT_API const UT_StringHolder version
GLsizei const GLchar *const * string
Definition: glew.h:1844
A map of string to various well defined value types.
Definition: UT_Options.h:84
virtual int __hash__()=0
HOM_HDADefinition(const HOM_HDADefinition &)
GLsizei const GLfloat * value
Definition: glew.h:1849
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:549