HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  SWIGOUT(%newobject addSection;)
79  SWIGOUT(%kwargs addSection;)
80  virtual HOM_HDASection *addSection(
81  const char *name, const std::string &contents = "",
82  HOM_EnumValue &compression_type=HOM_compressionType::NoCompression) = 0;
83  virtual void removeSection(const char *name) = 0;
84 
85  virtual std::string description() = 0;
86  virtual void setDescription(const char *label) = 0;
87  virtual std::string icon() = 0;
88  virtual void setIcon(const char *icon) = 0;
89  virtual int minNumInputs() = 0;
90  virtual void setMinNumInputs(int min_num_inputs) = 0;
91  virtual int maxNumInputs() = 0;
92  virtual void setMaxNumInputs(int max_num_inputs) = 0;
93 
94  virtual std::string extraInfo() = 0;
95  virtual void setExtraInfo(const char *extra_info) = 0;
96 
97  virtual std::string userInfo() = 0;
98  virtual void setUserInfo(const char *extra_info) = 0;
99 
100  virtual bool hideDefaultParameters() = 0;
101  virtual std::string representativeNodePath() = 0;
102 
103  virtual std::string comment() = 0;
104  virtual void setComment(const char *comment) = 0;
105 
106  virtual std::string version() = 0;
107  virtual void setVersion(const char *version) = 0;
108 
109  virtual int modificationTime() = 0;
110  virtual void setModificationTime(int time=-1) = 0;
111 
112  SWIGOUT(%newobject options;)
113  virtual HOM_HDAOptions *options() = 0;
114  virtual void setOptions(HOM_HDAOptions &options) = 0;
115 
116  virtual void updateFromNode(HOM_Node &node) = 0;
117 
118  SWIGOUT(%kwargs save;)
119  virtual void save(
120  const std::string &file_name,
121  HOM_Node *template_node = NULL,
122  HOM_HDAOptions *options = NULL,
123  bool compile_contents = false,
124  bool black_box = false,
125  bool create_backup = true) = 0;
126 
127  SWIGOUT(%kwargs copyToHDAFile;)
128  virtual void copyToHDAFile(
129  const std::string &file_name,
130  const char *new_name = NULL,
131  const char *new_menu_name = NULL) = 0;
132 
133  virtual void destroy() = 0;
134 
135  SWIGOUT(%newobject parmTemplateGroup;)
136  virtual HOM_ParmTemplateGroup *parmTemplateGroup() = 0;
137 
138  SWIGOUT(%kwargs setParmTemplateGroup;)
139  virtual void setParmTemplateGroup(
140  HOM_ParmTemplateGroup &parm_template_group,
141  bool rename_conflicting_parms=false,
142  bool create_backup=true) = 0;
143 
144  virtual void setExtraFileOption(const char *name, HOM_UTOptionAny value,
145  HOM_EnumValue &type_hint
146  = HOM_fieldType::NoSuchField) = 0;
147  virtual void removeExtraFileOption(const char *name) = 0;
148 
149  // compileCodeSection() deprecated. Compiled VEX assembly is no longer
150  // stored in HDAs or OTLs. This function does nothing.
151  virtual void compileCodeSection(const char *source_section,
152  const char *destination_section) = 0;
153 
154  // This is the function that does the real work of fetching the contents of
155  // the ExtraFileOptions section as a UT_Options object. This function is
156  // never called directly from Python, and is instead invoked using from
157  // extraFileOptions().
158  SWIGOUT(%ignore getRawExtraFileOptions;)
159  virtual void getRawExtraFileOptions(UT_Options &options) = 0;
160 
161 #ifdef SWIG
162 #ifdef SWIGPYTHON
163 %extend
164 {
165  InterpreterObject extraFileOptions()
166  {
167  UT_Options options;
168  self->getRawExtraFileOptions(options);
169  return HOMoptionsToInterpreterObject(options);
170  }
171 }
172 #endif
173 #endif
174 };
175 
176 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:983
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
virtual std::string __repr__()=0
hboost::any HOM_UTOptionAny
Definition: HOM_Defines.h:37
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
void setPreferred(bool preferred)
png_infop png_charpp int * compression_type
Definition: png.h:2467
#define HOM_API
Definition: HOM_API.h:13
virtual ~HOM_HDADefinition()
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:982
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:610
GLuint const GLchar * name
Definition: glcorearb.h:785
GLsizei const GLfloat * value
Definition: glcorearb.h:823
A map of string to various well defined value types.
Definition: UT_Options.h:42
virtual int __hash__()=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:596